Changeable certified plugin version using AnyVar
Nov 26th, 2009 by Hoi Lo
2.0 Changeable certified plugin version using AnyVar
2.1 Introduction
The back-end of the WordPress Plugin Check allows users to change the certified version of each plugin. This is accomplished using the AnyVar plugin. AnyVar can be accessed under “Tool” in the sidebar.
Figure 2. AnyVar Interface
The image above shows the interface of AnyVar. To use AnyVar, we must first create a desired variable, for example [java_version], and place this tag within our HTML code. Luckily, the site developer has already done this, so we do not need to worry.
2.2 Instructions
Each of the plugins are clearly listed: flash_version, java_version, etc. These variables each accompany with them a value displayed on the right textbox. This value is the certified version of the plugin. For example, flash_version has a “10.0”, this means that the certified version for the flash plugin check on the front end is “10.0”. If a user has Flash “10.0”, a check mark will appear on the front end like so:
Figure 3. Certified Version
This variable is completely changeable to any the user desires. If the user wants to change the certified flash_version to “9.8”, he/she needs only to click on the variable, and then a new page will show allowing them to enter in the new number. Similar to the image listed below:
Figure 4. Change certified version
Once changed, the front-end of the plugin check will also act accordingly, showing a check if the user has Flash 9.8 installed.
2.3 Programming Description
AnyVar is a plugin that allows the modification of user created tags. The greatest asset for this plugin is in the implementation of the plugin version. Developers can create a tag like [java_version] and insert it into the HTML page, then users can modify that variable to any number they want by using the intuitive interface provided by AnyVar.
Here is an example of the AnyVar plugin in action within the Plugin Check code:
<script type=”text/javascript”>
function flashc(){
if(PluginDetect.isMinVersion(“Flash”,[flash_version])==1) document.getElementById(“flashb1″).src =”http://oltubc.com/sandbox/images/flashcheck.bmp”; else document.getElementById(“flashb1″).src =”http://oltubc.com/sandbox/images/flashcross.bmp”;
}
</script>
As you can see within the “if” statement, we imbedded the tag [flash_version]. To explain in detail, if the flash version is not greater that the version stated in the tag [flash_version], and then the image id “flashb1” will show a cross, indicating that the version installed in your browser does not meet the minimum version required by the plugin check.
Therefore, in conclusion, the purpose of the AnyVar plugin is to allow modification of the required plugin version without the experience of any HTML or Javascript programming, that is its greatest asset, and the reason we use it.