Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#50912 closed defect (bug) (fixed)

Site Health flags define WP_AUTO_UPDATE_CORE value as an error

Reported by: sterndata's profile sterndata Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.5.1 Priority: normal
Severity: normal Version: 5.5
Component: Site Health Keywords: commit fixed-major
Focuses: Cc:

Description (last modified by SergeyBiryukov)

See https://wordpress.org/support/topic/wp_auto_update_core-2

If this is in wp-config.php:

define('WP_AUTO_UPDATE_CORE', 'minor')

Site health reports

Error The WP_AUTO_UPDATE_CORE constant is defined and enabled.

According to the docs, 'minor' is a legit value for the constant.

Note that changeset [47841] changed it from loose to a strict comparison...

Change History (10)

This ticket was mentioned in Slack in #forums by sterndata. View the logs.


3 years ago

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Site Health
  • Description modified (diff)
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.5.1

Hi there, thanks for the ticket!

At a glance, this seemed like a duplicate of #49923. Upon a closer look, however, that ticket is about the message displayed when WP_AUTO_UPDATE_CORE is set to false, and this one is about the value set to 'minor'.

Indeed it looks like before [47841], 'minor' was recognized as a valid value, due to a loose comparison with true. With the strict comparison, it's no longer recognized.

#4 @mukesh27
3 years ago

Below both give same result in site health report.

if ( defined( $constant ) && constant( $constant ) != $value ) { and if ( defined( $constant ) && constant( $constant ) !== $value ) {

Both give same result - The WP_AUTO_UPDATE_CORE constant is defined and enabled.

#5 @avixansa
3 years ago

So for the time being , i removed this line define('WP_AUTO_UPDATE_CORE', 'minor') from the config file and the site health is not showing this issue any more !!

  1. But is it recommended ?
  2. Also After doing that ..

I see a new column and a constant checking of the update in the plugin page !!
http://prnt.sc/tyekx6

#6 @desrosj
3 years ago

@avixansa WP_AUTO_UPDATE_CORE is used to configure the types of WordPress updates that you'd like to receive automatically. In your case, you were specifying minor updates (updates to the Z number in X.Y.Z).

This is actually the default behavior of WordPress Core. So you can safely remove that constant and should not see any problems or changes in behavior.

The new column that you are seeing on the plugin page is a feature added in 5.5, so it looks like your site updated correctly.

However, sometimes it is desired to define WP_AUTO_UPDATE_CORE as minor, so the issue described here and expanded by @SergeyBiryukov above should still be fixed.

#7 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#8 @SergeyBiryukov
3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 48792:

Site Health: Recognize define( 'WP_AUTO_UPDATE_CORE', 'minor' ) as an acceptable value.

Previously, it was only incidentally recognized as valid due to a loose comparison with true.

With the strict comparison added to WP_Site_Health_Auto_Updates::test_constants(), this was no longer the case.

Follow-up to [47841].

Props sterndata, mukesh27, avixansa, desrosj, SergeyBiryukov.
Fixes #50912.

#9 @SergeyBiryukov
3 years ago

  • Keywords commit fixed-major added; needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for the 5.5 branch.

#10 @SergeyBiryukov
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 48804:

Site Health: Recognize define( 'WP_AUTO_UPDATE_CORE', 'minor' ) as an acceptable value.

Previously, it was only incidentally recognized as valid due to a loose comparison with true.

With the strict comparison added to WP_Site_Health_Auto_Updates::test_constants(), this was no longer the case.

Follow-up to [47841].

Props sterndata, mukesh27, avixansa, desrosj, SergeyBiryukov.
Merges [48792] to the 5.5 branch.
Fixes #50912.

Note: See TracTickets for help on using tickets.