Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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…
<?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.' );
} );
}
@fatihtoprak

This comment has been minimized.

Copy link

fatihtoprak commented Oct 18, 2013

looks like great (: Thanks.

@nacin

This comment has been minimized.

Copy link
Owner Author

nacin commented Oct 27, 2013

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
You can’t perform that action at this time.