[wp-trac] [WordPress Trac] #14915: Fix activation hook inconsistency
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 23 02:13:46 UTC 2010
#14915: Fix activation hook inconsistency
--------------------------+-------------------------------------------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.1
Component: Plugins | Version: 2.9
Severity: normal | Keywords: needs-patch
--------------------------+-------------------------------------------------
Comment(by joelhardi):
OK, to use my test plugin, untar it and you'll see there's a patch to
apply to the tree. Basically, the patch just inserts one line of code into
two different files to call a function that injects data into the http
response WordPress gets when it does the remote query for available plugin
versions.
(NB that one of the files it's patching is {{{class-wp-upgrader.php}}} so
if you wind up doing something with my code be sure not to commit this
line!)
Then, to use my permanently out of date plugin, open it in your editor and
change the $zipfile line to whatever URL or filesystem location you're
going to put the .zip in. Then save, zip the folder and move the zip file
into place.
Now activate the plugin. You'll see it adds an admin page under the
Settings menu where it dumps its log to screen.
Then, to use it, just go to the plugin page, there should be the yellow
"new version available" strip, so you can click the "upgrade
automatically" link.
So, if you run it without my patch, you'll see it pretty obviously run the
deactivation hook and then the reactivation in the iframe. You can check
the log dump page and see that deactivate() and activate() were called.
With the patch, no activation/reactivation!
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14915#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list