[wp-hackers] WP Plugin Update Detect

Stephen O'Connor steve at stevarino.com
Tue Aug 3 17:28:08 UTC 2004


Great idea, but two concerns: you don't specify a time-out time for 
update-checks and you don't include a method to disable individual 
plugin updates.

By a time-out period, I'm referring to this plugin only checking for 
updates every hour. By checking for updates every time plugins.php 
loads, an end-user could easily be seen as spamming  an authors site. 
Also think about page-load times...

And that brings me to my next point: disabling individual plugin 
updates... If a user has maybe 20 or more plugins there plugins.php will 
take forever to load. If a few of those plugin sites are bad or slow, 
the end-user's web browser has a danger of timing out (leaving 
plugins.php unreachable).

Again, while I think it's a great idea, there are some things to be 
worked out. Keep up the good work. :)

- Stephen

Ryan Meyers wrote:

> WP Plugin Update Detect
> ©2004 Ryan Meyers
> http://www.ryanmeyers.com
>
> Anyone want to know when their favorite plugins have been updated?  I 
> know that I do!  And even more so, I want users of my plugins to know 
> when I've fixed the hundreds of critters running around in them.
>
> With the few plugins that I've released for public use, it's been 
> amazing how many tech support e-mails that flood in each day.  While a 
> real bug-report is a great help (thanks Janice!), often it's something 
> that's already been fixed.  Users aren't checking the home pages for 
> updates, miss or don't read the posts on the hacks forum, and thus 
> have no idea that a brand new, better version of your plugin is 
> available for their consumption.  This is my attempt at making that 
> process a little bit easier.
>
> Users, please note that adding support for update won't break plugins 
> that don't support it.  Authors, please note that adding support for 
> update won't break your plugin on users that decide not to utilize 
> it.  It's an optional component on both ends, but one that's worth 
> taking advantage of, I think.
>
> Once a supported database of WordPress plugins (a la Firefox 
> extensions) is created, this feature could possibly reach new levels 
> of ease, speed, and usability.  As it is, I think that it will achieve 
> its simple purpose with a small footprint, since the files it will be 
> retrieving will be a few bytes in size.
>
> ==========================================================
>
> FOR WORDPRESS USERS:
>
> Installation requires editing one file:  wp-admin/plugins.php
>
> 1) Open wp-admin/plugins.php in your editor
>
> 2) Find:
>    if ( preg_match("|Version:(.*)|i", $plugin_data, $version) )
>            $version = $version[1];
>        else
>            $version ='';
>
> 3) After, add:
>        // BEGIN PLUGIN UPDATE ADD-ON
>        if ( preg_match("|Update:(.*)|i", $plugin_data, $update) )
>        {
>            $update = $update[1];
>            $update = trim($update);
>                if ($u = @file("$update")) {
>                    $u = implode('',$u);
>                    $u = trim($u);
>                    $v = trim($version);
>                    if($u != $v){
>                        $updatelink = '<a href="';
>                        $updatelink .= $plugin_uri[1];
>                        $updatelink .= '">';
>                        $updatelink .= '<em><strong>Update 
> Available:</strong> (';
>                        $updatelink .= $u;
>                        $updatelink .= ')</em></a>';
>                        $description[1] .= '<br />';
>                        $description[1] .= $updatelink;
>
>                                            }
>                    else
>                    {
>                    $updatelink = '';
>                    }
>                              }
>                else{
>                    $updatelink = '';
>                }
>        }
>        else
>        {    $update ='';}
>
>        //END PLUGIN UPDATE ADD-ON
>
> 4) Upload wp-admin/plugins.php
>
> 5) Update those plugins!
>
>
> ==========================================================
>
> FOR PLUGIN AUTHORS:
>
> The trick to making this the best it can be for users is a consistent 
> format.  You can alter the code on your end to a certain extent, but 
> the idea is for users to easily be able to detect updates to your 
> plugins.  Keep it simple!
>
> 1) Upload plugin-update.php to your WordPress root.
>
> 2) Add a Custom field called 'Current Version' with a value relative 
> to your plugin's development to each of your WordPress posts detailing 
> their development.
>
> 3) Add the following line to your plugin source (replace 99999 with 
> the ID for the post mentioned above:
>    Update: http://www.yoursite.com/yourwpinstall/plugin-update?p=99999
>
>
> ===========================================================
>
> A NOTE FOR AUTHORS OF PLUGINS:
>
> In an effort for mass-usability, I'm proposing that plugin authors 
> that desire their plugins to be easily updated distrubute the 
> following instructions with their plugins and/or distribute this file:
>
> /************************************
> **                                 **
> **  TO TAKE ADVANTAGE OF UPDATE    **
> **  DETECTION, PLEASE CONSIDER     **
> **  MAKING THE FOLLOWING ADDITION  **
> **  TO YOUR WORDPRESS INSTALL      **
> **                                 **
> *************************************
>
>  OPEN FOR EDITING : wp-admin/plugins.php
>
>  FIND :
>
>     if ( preg_match("|Version:(.*)|i", $plugin_data, $version) )
>              $version = $version[1];
>          else
>              $version ='';
>
>
>  ADD THE FOLLOWING CODE AFTERWARDS :
>
>    // BEGIN PLUGIN UPDATE ADD-ON
>        if ( preg_match("|Update:(.*)|i", $plugin_data, $update) )
>        {
>            $update = $update[1];
>            $update = trim($update);
>                if ($u = @file("$update")) {
>                    $u = implode('',$u);
>                    $u = trim($u);
>                    $v = trim($version);
>                    if($u != $v){
>                        $updatelink = '<a href="';
>                        $updatelink .= $plugin_uri[1];
>                        $updatelink .= '">';
>                        $updatelink .= '<em><strong>Update 
> Available:</strong> (';
>                        $updatelink .= $u;
>                        $updatelink .= ')</em></a>';
>                        $description[1] .= '<br />';
>                        $description[1] .= $updatelink;
>
>                                            }
>                    else
>                    {
>                    $updatelink = '';
>                    }
>                              }
>                else{
>                    $updatelink = '';
>                }
>        }
>        else
>        {    $update ='';}
>
>        //END PLUGIN UPDATE ADD-ON
>
>
> */
>
>
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>
>




More information about the hackers mailing list