[wp-hackers] Pre-upgrade and post upgrade hooks
DD32
wordpress at dd32.id.au
Tue Jan 8 08:44:18 GMT 2008
On Tue, 08 Jan 2008 19:26:37 +1100, Ryan McCue <ryanmccue at cubegames.net> wrote:
> DD32 wrote:
>> I DO think that after an upgrade is run, plugins should be sandboxed, and sequentially activated, and de-activating those which cause an error to be thrown -- at least this would prevent the entire admin going down, And doesnt require plugin authors to do anything extra to allow this process to happen.
> I think the main issue is working out how to sandbox them. I'd
> personally be in favour of having an external PHP file, which loads the
> specified plugin and nothing else. We then run `file_get_contents` to
> get each one and check if the output is empty. If not, we deactivate it
> and add a notice to the page.
I was thinking similar to the current admin activation method.
* Set redirection or flag in session(I'm unsure if the session data gets saved if a fatal error occurs?) for failed load
* Include plugin
* Change redirection or flag to show plugin loaded correctly.
* Repeat with next plugin
It could even be done inline, via javascript using ajax calls..
Checking plugins (1/12)
Notice: There is an updated version of "Plugin Name"(abc.php) available, [link]Download 1.8 here[/link]
Checking plugins (2/12)
Checking plugins (3/12)
Error: "My Plugin"(xyz.php) has failed to load cleanly, Plugin has been deactivated.
Checking plugins (4/12)
Error: "My 2nd Plugin"(z.php) has failed to load cleanly, Plugin has been deactivated. [bold]An updated version is available, [link]Download 1.8 now[/link][/bold]"
...
(Of course, it would be nicer for the number to change and the errors/notices to be listed underneath)
Main problem i see with that method would be that idealy you need to load all of WP's files to ensure that it does load correctly(I'm not sure if the admin console currently includes all WP files atm(such as those for templating and whatnot) either), and on slower hosts it could cause slower upgrades.
Theres also the issue of those who do not use a browser to do the upgrade and instead use wget to automatically do it after the svnup
> I personally see no flaw :)
> Thanks,
> Ryan.
> _______________________________________________
> 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