[wp-hackers] Plugin Updates not on WP.org
DD32
wordpress at dd32.id.au
Mon Dec 15 01:59:08 GMT 2008
If a plugin wants a non-wordpress.org update check, Then theres nothing to
stop it from doing so whilst its activated through filters, I'm undecided on
support for a plugin header though, I can think of things to both sides..
personally leaning towards a "No" myself (But i'll leave my reasoning for
later).
If a plugin is activated, and wants to check somewhere else, something like
this could be used:
add_filter('pre_update_option-update_plugnis', 'func_update');
function func_update($current) {
if ( ! is_array($current->response) ) return;
$file = plugin_basename(__FILE__);
$body = wp_remote_post('my-url', array('plugin' => $file ) );
$res = @unserialize($body['body']);
if ( false !== $res ) {
$current->response[ $file ] = $res;
}
return $current;
}
Just as long as $res was the same format as what the .org api returns, It
should be transparent to the end user, and to WordPress.
2008/12/15 Alex Hempton-Smith <hempsworth at googlemail.com>
> Hey all,
> It was discussed a while ago about plugins being hosted on private websites
> (non-WP.org), and still having the update functionality of WP.org hosted
> plugins. For 2.8, would it be possible to perhaps have this functionality
> added?
>
> I was looking through 'update.php' and noticed that the WordPress update
> script just checks against a URL, in this case on wordpress.org, but
> couldn't we introduce an element into the main plugin header, where author
> etc information is kept, with an alternative URL? That would mean the
> plugin
> author could just upload a txt file perhaps which had the current stable
> plugin version, which WP can check against instead of api.wordpress.org?
>
> Any thoughts?
>
> -- Alex
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list