core-command icon indicating copy to clipboard operation
core-command copied to clipboard

`wp core install` forcefully upgrades WordPress version

Open takaya1992 opened this issue 5 years ago • 3 comments

I'm having trouble because wp core install forcibly upgrades the WordPress version.

Is it necessary to upgrade WordPress in the command? I want to remove the upgrade process if not need it.

For example...

Specify the version and download core. (There are cases where you want to try a past version, right?)

$ wp core download --path=/path/to/dir --version=5.4.1

Make sure you have downloaded the specified version.

$ wp core version --path=/path/to/dir
5.4.1

After setting up and creating the DB, install core.

$ wp core install --path=/path/to/dir --url=http://example.com/ --title=example --admin_user=admin --admin_password=admin --admin_email='[email protected]'
Success: WordPress installed successfully.

(Even if the command ends, the upgrade process is being executed asynchronously, so wait about 30 seconds) Check the version of core again.

$ wp core version --path=/path/to/dir
5.4.2

The version has changed.

Please remove the WordPress upgrade process in wp core install, or any other workarounds?

takaya1992 avatar Jul 02 '20 08:07 takaya1992

I can't replicate this on a Linux machine. What environment are you using?

schlessera avatar Jul 04 '20 09:07 schlessera

This could be caused by the automatic update included in WordPress. @takaya1992 Have you disabled the automatic updates? https://wordpress.org/support/article/configuring-automatic-background-updates/#constant-to-disable-all-updates

grappler avatar Sep 01 '21 08:09 grappler

Hi there,

Today, I started having problems with some of my GitHub actions: I'm using them to install and test a plugin end-to-end and I got the "Database update required" error.

After a bit of debugging, I saw that the version of WordPress being tested was not the installed version.

I was able to fix it by adding define( 'AUTOMATIC_UPDATER_DISABLED', true ); (as suggested here).

I think it would be nice to have a flag in the install command to say "disable automatic update" or something like that.

I created a repo to show the behavior. Please look at this debug action: https://github.com/julienloizelet/wp-cli-install-debug/actions/runs/6119079805

In short, here's what debugging action do:

  • Prepare the environment to use DDEV. IMO,There is no reason for this behavior to be related to a DDEV problem.
  • Download a specific version of WordPress (using the matrix value):
    • wp core download --version=${{ matrix.wp-version }}
  • Install WordPress
    • wp core install --url='some-url' --title='WordPress' --admin_user='admin' ... ...
  • Check the current version with wp core version => result is OK for all tests
  • Access the admin page and wait 20 seconds
  • Check the current version again : result is KO in some cases

Capture d’écran du 2023-09-08 17-00-27

example: the 5.6 version is automatically updated to 6.3.1

Capture d’écran du 2023-09-08 17-02-25

[EDIT]: seems to be as expected here

Starting WordPress 5.6, the default value of WP_AUTO_UPDATE_CORE for new WordPress installations is true

Thanks

julienloizelet avatar Sep 08 '23 08:09 julienloizelet