Giter VIP home page Giter VIP logo

bradparks / wp-safe-updates__test-wordpress-plugin-updates-safely-before-applying-them-on-the-live-site.- Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anttiviljami/wp-safe-updates

0.0 3.0 0.0 627 KB

Test WordPress plugin updates safely before applying them on the live site.

Home Page: https://wordpress.org/plugins/wp-safe-updates/

License: GNU General Public License v3.0

PHP 100.00%

wp-safe-updates__test-wordpress-plugin-updates-safely-before-applying-them-on-the-live-site.-'s Introduction

WP Safe Updates.

Latest Stable Version Total Downloads Latest Unstable Version License

Test WordPress plugin updates safely before applying them on the live site.

Core trac ticket discussion: #37301

Disclaimer

Please make sure to always have backups of all your WordPress files and database before updating plugins or themes. We are not responsible for any misuse, deletions, white screens, fatal errors, or any other issue arising from using this plugin.

How does it work?

This plugin adds a "test update" button when plugin updates are available. Clicking it triggers the creation of a sandbox where the user can safely test updating plugins without affecting the live site. Once the user is finished testing the plugin, they can go back to the live site and do updates if they like.

The sandbox works similarly to how WordPress multisite works. We tell WordPress to temporarily use a different database prefix and a different plugins directory while in the alternative heap (sandbox). This is done by sending WordPress a special _alt_heap cookie.

Screenshots

The 'test update' button when an update is available for a plugin

Test update link

Updating the plugin safely in an alternative heap

Updating a plugin

Testing the updated plugin

Testing the update

Installation

The Composer Way (preferred)

Install the plugin via Composer

composer require anttiviljami/wp-safe-updates

Activate the plugin

wp plugin activate wp-safe-updates

The Old Fashioned Way

This plugin is available on the official WordPress.org plugin directory.

You can also install the plugin by directly uploading the zip file as instructed below:

  1. Download the plugin
  2. Upload to the plugin to /wp-content/plugins/ via the WordPress plugin uploader or your preferred method
  3. Activate the plugin

Configuration

First copy the db.php file from this plugin to your wp-content directory.

Then just paste these lines to your wp-config.php.

/**
 * WordPress Safe Updates required configuration
 */
function currheap() {
  return isset( $_COOKIE['_alt_heap'] ) && ! empty( $_COOKIE['_alt_heap'] ) ? preg_replace('/[^a-z0-9_]/', '', strtolower( $_COOKIE['_alt_heap'] ) ) : false;
}
defined( 'WP_CONTENT_DIR' ) || define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/wp-content' );
defined( 'WP_CONTENT_URL' ) || define( 'WP_CONTENT_URL', '/wp-content' );
if ( false !== currheap() ) {
  defined( 'WP_PLUGIN_DIR' ) || define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins_tmp_' . currheap() );
  defined( 'WP_PLUGIN_URL' ) || define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins_tmp_' . currheap() );
  defined( 'PLUGINDIR' ) || define( 'PLUGINDIR', 'wp-content/plugins_tmp_' . currheap() );
}

wp-safe-updates__test-wordpress-plugin-updates-safely-before-applying-them-on-the-live-site.-'s People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.