[wp-hackers] Plugin Management and Autoupdate System

Computer Guru computerguru at neosmart.net
Sat Jul 29 18:22:06 GMT 2006


I'm done with a framework that checks for the updates.
Basically I'm going with an RDF RSS file that looks something like this:


<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>CompleteRSS Download Bulletin</title>
        <link>http://neosmart.net/dl.php?id=2</link>
        <description>CompleteRSS is the best WP plugin ever!</description>
        <lastBuildDate>20 Jul 2006 12:34:56 GMT</lastBuildDate>
        <item>
	        <title>Alpha 2</title>
	
<link>http://neosmart.net/mint/pepper/orderedlist/downloads/download.php?fil
e=http%3A//neosmart.net/downloads/software/WordPress/Plugins/CompleteRSS/Com
pleteRSS_0.2.phps</link>
	        <guid isPermaLink="false">0.3</guid>
	        <pubDate>20 Jul 2006 12:34:56 GMT</pubDate>
	        <description>Upgrade immediately to win a cool
million!</description>
        </item>       
        <item>
	        <title>Alpha 1</title>
	
<link>http://neosmart.net/mint/pepper/orderedlist/downloads/download.php?fil
e=http%3A//neosmart.net/downloads/software/WordPress/Plugins/CompleteRSS/Com
pleteRSS_0.1.phps</link>
	        <guid isPermaLink="false">0.1</guid>
	        <pubDate>03 Jul 2006 13:14:15 GMT</pubDate>
	        <description>This version is the first
release!</description>
        </item>
    </channel>
</rss>


It is saved as a plaintext (.xml or .rdf preferable) file on any server
anywhere. In the plugin itself:
/* 
Plugin Name: CompleteRSS 
Plugin URI: http://neosmart.net/dl.php?id=2 
Update URI: http://neosmart.ath.cx/CompleteRSS.xml 
Description: CompleteRSS makes sure your RSS Feeds contain full article text
and are fully valid - because your readers deserve it! 
Version: 0.2 
Author: Computer Guru 
Author URI: http://neosmart.net/blog/
*/

Notice the line of added meta data: "Update URI"

On the server-side I've finished a script that cycle through all installed
plugins, search for "Update URI" metadata, and if found, query the XML/RDF
file, check if a new version is available, and return the result.

Before I take this any further:
Is this OK or not? I don't want to put weeks into it and find out there is
no interest.

I can prolly really soon get a working version of this that has _very_ basic
auto-update and auto-install and auto-remove features included. It'll simply
grab a remote plain-text file, save it as a PHP file on the local server in
the plugins DIR.
On update it will delete the old file and save the new.
On uninstall it will delete the old file.

I don't have anything in my head yet as to the best way of creating an
(un)install routine for anything more complex than this; such as
(un)installing database tables or multiple file plugins.

Source code available on demand, ask and you shall receive. And no, it's not
a plugin, it's a wp-core file.

Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/




More information about the wp-hackers mailing list