Call For Action – Testing Rollback Feature

Hello WordPress Hosts!

The CoreCore Core is the set of software required to run WordPress. The Core Team builds WordPress. Development Team is requesting assistance with testing a new Rollback Feature in WordPress Core. As always, your testing contributions help keep the development process informed and are valuable to the WordPress Open SourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. Project! Thank you all in advance for participating in testing this feature!

This new feature offers the option to “rollback” to a previously installed version of plugins or themes that have thrown an error during a version update. Users may experience such an error as a WSOD (“white screen of death”), a visible PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. Error on the front-end or in another form during updates that can prevent a site from continuing to function without assistance from a Developer or Technical Support. This rollback feature will provide an option within WordPress Core itself for the user to set pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory or can be cost-based plugin from a third-party. and themeTheme A theme dictates the style and function of your WordPress website. Child Themes derive from the main parent theme. files back to the previously working version.

The feature uses a rename() function to copy plugin/theme files into another directory and then copy previously working files back into core directories, rather than using the less performant copy_dir() function which recursively copies files but is believed to result in timeouts on some systems.

How do I test Rollback?

Do not test on a production siteProduction Site A production site is a live site online meant to be viewed by your visitors, as opposed to a site that is staged for development or testing..

But do test on a local, staging or test environment, or spin up a cloud staging or test environment.

  1. Here are some large plugins used for testing: akismet, jetpack, mailpoet, woocommerce, wpforms-lite, wordpress-seo
    • WP-CLIWP-CLI WP CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way.wp plugin install akismet jetpack mailpoet woocommerce wpforms-lite wordpress-seo
  2. Do this from the plugin’s page on https://wordpress.org/plugins by navigating to the “Development” tab, clicking “Advanced” to the right, and downloading an older version from the dropdown at the bottom of the page. You can also install the current version then modify the version in the plugin’s main file to decrement the version number.
  3. Install the WordPress Beta Tester plugin, set to Bleeding edge and Nightlies. Go to Dashboard > Updates and click the Update to latest 6.1 nightly button.
  4. Install the Rollback feature plugin or test using the PR2225 in WordPress/wordpress-develop.
  5. Please make a note of the time required to perform plugin updates. Your phone’s stopwatch function may be the easiest method to do this.

Testing a single plugin update:

  1. Navigate to Plugins > Installed Plugins.
  2. Click “Update Now” located within the plugin row.

Testing bulk plugin updates via “Plugins”:

  1. Navigate to Plugins > Installed Plugins.
  2. Select another two plugins, select “Update” from the Bulk Actions dropdown, and click “Apply”.

Testing bulk plugin updates via “Dashboard”:

  1. Navigate to Dashboard > Updates
  2. Tick all plugins with an available update.
  3. Select “Update” from the Bulk Actions dropdown, and click “Apply”.

Testing updates via WP-CLI (if already familiar).

Validation of successful updates

This requires activating all the testing plugins on your testing site. Unsuccessful updates should show PHP Errors or PHP Fatal Errors.

  1. Activate each of the plugins that were updated.
  2. In WP Admin, navigate to each plugin’s menu pages.
  3. Navigate the frontend of your test site.
  4. Navigate to your wp-content/temp-backup/plugins folder. It should be empty.

Forcing an update failure

Use the following filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. to force an update failure. This will reinstall the previously active plugin/theme.

add_filter( 'upgrader_install_package_result', function() {
  return new WP_Error( 'simulated_error', 'Simulated Error' );
});

Testing update failures

When testing for failures on the bulk update in update-core.php you must use the PR. There is a modification in the PR that stops WP_Upgrader::unpack_package() from deleting the items in the temp-backup directory.

For More Information please see this original Call to Action from the Core Team.

The more testing that is done on a wider variety of hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. environments, the more likely WordPress and its new features are to perform on the wide range of hosting platforms available to users. As such, testing provides value to the software, users and hosts alike. Thank you again for your testing contributions!