[wp-trac] [WordPress Trac] #51827: When a plugin makes use of the 'automatic_updater_disabled' filter, it causes a PHP Warning to be thrown.

WordPress Trac noreply at wordpress.org
Thu Nov 19 16:59:23 UTC 2020


#51827: When a plugin makes use of the 'automatic_updater_disabled' filter, it
causes a PHP Warning to be thrown.
-----------------------------------------+-----------------------
 Reporter:  jamesros161                  |       Owner:  audrasjb
     Type:  defect (bug)                 |      Status:  accepted
 Priority:  normal                       |   Milestone:  5.6
Component:  Upgrade/Install              |     Version:  5.6
 Severity:  normal                       |  Resolution:
 Keywords:  needs-patch has-screenshots  |     Focuses:
-----------------------------------------+-----------------------
Changes (by audrasjb):

 * keywords:   => needs-patch has-screenshots
 * owner:  (none) => audrasjb
 * status:  new => accepted


Comment:

 Hi, welcome to WordPress Trac and thank you for reporting this,

 I am able to reproduce the issue using the steps provided by @jamesros161.

 But at a glance, I think the following logic should be enough:
 {{{
 if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) && true ===
 AUTOMATIC_UPDATER_DISABLED || has_filter( 'automatic_updater_disabled' )
 && true === apply_filters( 'automatic_updater_disabled', false ) ) {
     $upgrade_dev   = false;
     $upgrade_minor = false;
     $upgrade_major = false;

     // The UI is overridden using a constant or a filter.
     $can_set_update_option = false;
 }
 }}}

 I should be able to test it deeper later today.

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


More information about the wp-trac mailing list