[wp-trac] [WordPress Trac] #50849: Incorrect action passed to hooks when updating plugin/theme by uploading ZIP file

WordPress Trac noreply at wordpress.org
Wed Nov 4 04:14:58 UTC 2020


#50849: Incorrect action passed to hooks when updating plugin/theme by uploading
ZIP file
-------------------------------------+---------------------
 Reporter:  desrosj                  |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  5.6
Component:  Upgrade/Install          |     Version:  5.5
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------

Comment (by hellofromTonya):

 [https://github.com/WordPress/wordpress-develop/pull/684 PR 684] does the
 following:

 - Applies 50849.diff patch
 - Refactors to encapsulate the theme and plugin code into the base class,
 ie method `get_hook_extra_action`
 - Prevents the hook from running during `install` action. It now only runs
 when it's actually completed, ie update and downgrade.

 Testing Results:
 - Upload plugin with same version: hook ran 1x and 'action' = 'update-
 plugin'
 - Upload plugin with newer version: hook ran 1x and 'action' = 'update-
 plugin'
 - Upload plugin with older version: hook ran 1x and 'action' = 'downgrade-
 plugin'
 - Upload theme with same version: hook ran 1x and 'action' = 'update-
 theme'
 - Upload theme with newer version: hook ran 1x and 'action' = 'update-
 theme'
 - Upload theme with older version: hook ran 1x and 'action' = 'downgrade-
 theme'

 @desrosj can you do a code review and test it out please?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50849#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list