Last active
March 11, 2019 17:17
-
-
Save nacin/7047909 to your computer and use it in GitHub Desktop.
This is how @dd32 and I test automatic background updates in WordPress 3.7. Then just do example.com/?wp_maybe_auto_update. (If you use a checkout of develop.svn.wordpress.org, you can run this on the `build` directory, then simply run `grunt copy` between updates to copy over the latest code from `src`. This is how we are able to make adjustmen…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this as a mu-plugin. | |
if ( isset( $_GET['wp_maybe_auto_update'] ) ) { | |
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' ); | |
add_action( 'template_redirect', function() { | |
$time = date( 'r' ); | |
echo "Starting... $time<br />"; | |
delete_site_option( 'auto_core_update_failed' ); | |
delete_option( 'auto_upgrader.lock' ); | |
delete_site_transient( 'update_core' ); | |
wp_maybe_auto_update(); | |
die( 'Done, check your email.' ); | |
} ); | |
} |
One other thing you could do:
Open src/wp-admin/includes/class-wp-upgrader.php, and uncomment these lines at the bottom of the file, in the WP_Automatic_Updater::send_debug_email()
method:
//echo "<h1>\n$subject\n</h1>\n";
//echo "<pre>\n" . implode( "\n", $body ) . "\n</pre>";
We should probably add a hook there so this can be done in a plugin.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
looks like great (: Thanks.