[wp-hackers] fwiw: informing a user that a updated plugin is avaiable

Per Søderlind per at soderlind.no
Sun Apr 13 11:25:00 GMT 2008


In February 2006 I wrote a Protoype.js version that tells a user if a plugin
is updated, here's how to do it in jQuery:

[script type="text/javascript"]
/**
* @desc ImageManager check for new version script
* @author Per Soderlind - www.soderlind.no
*/
jQuery(document).ready(function() {
    jQuery.get('http://www.soderlind.no/imagemanagerversion.txt',
function(newversion){
        if (251 < newversion) { // 251 is the vidersion number for the
installed plugin, I set number this using PHP
            jQuery('#plugins
td.name').filter(':contains(ImageManager)').append('new version
available').css('color','red');
        }
    });
});
[/script]

Note, you should put at break (i.e. a BR tag) in front of 'new version
available'

You'll find it explained at
http://www.soderlind.no/archives/2008/04/11/last-night-i-became-a-jquery-fan
/

BTW, you don't need this if you host your plugin at
http://wordpress.org/extend/plugins/about/ 

Regards,
PerS



More information about the wp-hackers mailing list