Commit Graph

184 Commits

Author SHA1 Message Date
Andrew Nacin 8ae8e01b67 Remove the old wp_auto_updates_maybe_update cron event. Schedule the new wp_maybe_auto_update event at 7 a.m. and 7 p.m. in the site's timezone.
see #27704.

Built from https://develop.svn.wordpress.org/trunk@25825


git-svn-id: http://core.svn.wordpress.org/trunk@25825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:14 +00:00
Andrew Nacin 0976999929 Remove debug code from WP_Automatic_Updater::send_email().
props markmcwilliams for initial patch.
see #25678.

Built from https://develop.svn.wordpress.org/trunk@25891


git-svn-id: http://core.svn.wordpress.org/trunk@25803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 01:51:09 +00:00
Andrew Nacin 7b772e5c58 Introduce a send_core_update_notification_email filter to control whether to send update notifications.
Currently, this is dependent on whether the automatic updater is enabled (generally). This is likely to be decoupled in a future release.

This refocuses the auto_core_update_send_email filter to specifically be for success/fail emails for auto updates, while the new filter is more general.

see #25603.

Built from https://develop.svn.wordpress.org/trunk@25882


git-svn-id: http://core.svn.wordpress.org/trunk@25794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-23 19:47:09 +00:00
Ryan Boren b87d4b77e5 Pinking shears
Built from https://develop.svn.wordpress.org/trunk@25880


git-svn-id: http://core.svn.wordpress.org/trunk@25792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-23 14:38:10 +00:00
Andrew Nacin a387c3bef9 Make some changes to the email templates to account for the fact that an auto update offer might not be to the latest version.
For example, 3.7.2 install is served a 3.7.3 update, but the current version is 3.8.1.

This commit also allows for core update notification emails to be sent even when we are unable to run an auto update due to filesystem configuration (VCS checkout or file permissions). But, since these emails go through WP_Automatic_Updater, they will not be sent if the updater is outright disabled.

fixes #25654.

Built from https://develop.svn.wordpress.org/trunk@25873


git-svn-id: http://core.svn.wordpress.org/trunk@25785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 21:19:09 +00:00
Andrew Nacin 13dd29126a "some files" instead of "certain files". Less stuffy.
props markjaquith.
see #25652.

Built from https://develop.svn.wordpress.org/trunk@25871


git-svn-id: http://core.svn.wordpress.org/trunk@25783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 18:41:10 +00:00
Andrew Nacin fabf119cf3 New, better error message when we realize we won't be able to copy a file and continue with the update.
fixes #25652.

Built from https://develop.svn.wordpress.org/trunk@25870


git-svn-id: http://core.svn.wordpress.org/trunk@25782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 18:21:10 +00:00
Andrew Nacin 097c0fd0b6 Updates: Saner stats and rollback handling. WP.org now collects basic stats on non-auto updates as they have been hugely informative.
props dd32 for initial patch.
fixes #25657.

Built from https://develop.svn.wordpress.org/trunk@25863


git-svn-id: http://core.svn.wordpress.org/trunk@25775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 09:49:09 +00:00
Andrew Nacin 64bd5aa564 Move upgrader_process_complete for core to its proper place in Core_Upgrader.
This means it will be firing as a JS redirect is taking place if the update is from pre-3.4. Acceptable.

props dd32.
fixes #25659.

Built from https://develop.svn.wordpress.org/trunk@25861


git-svn-id: http://core.svn.wordpress.org/trunk@25773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 04:37:09 +00:00
Andrew Nacin 5a0b227316 Rename the automatic_updates_send_email filter to auto_core_update_send_email. (Final name change.)
fixes #25653. Also:
 * Fully document all new hooks, methods, and classes in the upgrader.
 * Rename 'language' to 'translation' inside the upgrader.
 * Improve the readability of the crazy do-while loop in the is_vcs_checkout() method.

Built from https://develop.svn.wordpress.org/trunk@25859


git-svn-id: http://core.svn.wordpress.org/trunk@25771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-21 22:29:09 +00:00
Andrew Nacin ee489a2e81 Commit [25823] should not have renamed AUTOMATIC_UPDATER_DISABLED to AUTOMATIC_UPDATES_DISABLED.
The proper constant is AUTOMATIC_UPDATER_DISABLED. Keep the filter in line with that too.

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25851


git-svn-id: http://core.svn.wordpress.org/trunk@25763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-18 21:24:10 +00:00
Andrew Nacin c00bba9e8b Use correct variable. fixes #10787.
Built from https://develop.svn.wordpress.org/trunk@25843


git-svn-id: http://core.svn.wordpress.org/trunk@25755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-18 17:16:10 +00:00
Andrew Nacin ee20af1fad Notify administrators of successful, failed, and pending core updates.
Blocks future background updates after critical failures, but allow retries in certain situations. More in the ticket.

fixes #10787.

Built from https://develop.svn.wordpress.org/trunk@25841


git-svn-id: http://core.svn.wordpress.org/trunk@25753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-18 16:30:11 +00:00
Andrew Nacin 5f3e90a112 Introduce email templates for automatic background updates.
The four templates are:
 1. We successfully updated their site. If any of their themes or plugins are out of date, it also mentions that. ('success')
 2. We are not configured to update their site, so we notify them of the new release. ('notify')
 3. We tried but failed to update their site. The error was early in the process, so no harm, no foul. This is the same as template #2, plus one sentence. ('fail')
 4. We tried to update their site, and failed while copying files. ('critical')

With assistance from markjaquith.

see #10787.

Built from https://develop.svn.wordpress.org/trunk@25837


git-svn-id: http://core.svn.wordpress.org/trunk@25749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-18 06:33:10 +00:00
Andrew Nacin a65661abee In automatic background updates, standardize on 'update'.
New, final filter names:
 * auto_update_{$type} (plugin, theme, core, language)
 * automatic_updates_is_vcs_checkout
 * automatic_updates_disabled

New class name is WP_Automatic_Updater. Method names include update() and should_update().

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25835


git-svn-id: http://core.svn.wordpress.org/trunk@25747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 23:21:10 +00:00
Dion Hulse 1c8d882e13 For Background updates, ensure that only one update process runs at the same time by using the options table as a lock.
This prevents multiple cron spawns and/or long-running updates from causing multiple update processes to spin up.
This also fixes a case where the upgrader might kick in for ( ! is_main_network() || ! is_main_site() ) in mulisite installs.
See #22704

Built from https://develop.svn.wordpress.org/trunk@25828


git-svn-id: http://core.svn.wordpress.org/trunk@25740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 05:24:09 +00:00
Andrew Nacin 191efaef61 Make WP_Automatic_Upgrader a proper object that gets instantiated. Renames nearly all of its methods.
Also renames wp_auto_updates_maybe_update() to wp_maybe_auto_update().

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25823


git-svn-id: http://core.svn.wordpress.org/trunk@25735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 00:55:09 +00:00
Dion Hulse 640f73ecd2 Remove a duplicate semicolon that snuck in. Props JustinSainton. See #18200
Built from https://develop.svn.wordpress.org/trunk@25822


git-svn-id: http://core.svn.wordpress.org/trunk@25734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 00:12:10 +00:00
Dion Hulse 376a0a55c7 Allow the WordPress.org Language update API to disallow automated background updates for a specific language pack. See #18200
Built from https://develop.svn.wordpress.org/trunk@25818


git-svn-id: http://core.svn.wordpress.org/trunk@25730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 22:27:09 +00:00
Dion Hulse ed07bab4b4 When a plugin enables Background Plugin updates, don't deactivate the plugin during update as we require a browser to reactivate it afterwards. See #22704
Built from https://develop.svn.wordpress.org/trunk@25817


git-svn-id: http://core.svn.wordpress.org/trunk@25729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 19:48:10 +00:00
Andrew Nacin bccefbbd83 Merge the should_auto_update() and can_auto_update() methods. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25815


git-svn-id: http://core.svn.wordpress.org/trunk@25727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 19:35:09 +00:00
Dion Hulse 085f5c5fb9 Fix a issue where the translation name isn't showing up in the Background Update emails, caused by a PHP Warning/missing variable in [25806]. See #18200
Built from https://develop.svn.wordpress.org/trunk@25812


git-svn-id: http://core.svn.wordpress.org/trunk@25724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 17:07:08 +00:00
Dion Hulse 1c8e79353a Language Packs: Many many fixes such as:
- Add a "Update Translations" stand-alone button to the updates page
- Shift Language feedback to before update process completion action links & limit the verbosity of output (name + success/errors)
- Simplify/combine the language update descriptive string to only include a plugin/theme name
- Properly handle cache clearing after language updates to prevent langs being repeditively updated
- Display a "All items up to date" string when there's nothing to do
- Reduce the 'Connection Information' from a <h2> to a <h3> to remove duplicate h2's and screen icons from update screens
- Fix the Direct filesystem method not being used for Language updates because WP_LANG_DIR doesn't exist (check it's parent for writable instead)
See #18200, #22704


Built from https://develop.svn.wordpress.org/trunk@25806


git-svn-id: http://core.svn.wordpress.org/trunk@25718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 04:15:09 +00:00
Andrew Nacin 4542fbb2ae Significantly simplify get_core_checksums(), as the caching and chunking was causing too much grief.
Make sure we only do our pre-flight is_writable check when the file exists.

see #18201. see #22704.

Built from https://develop.svn.wordpress.org/trunk@25801


git-svn-id: http://core.svn.wordpress.org/trunk@25713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 23:03:10 +00:00
Dion Hulse 592123951b Fix a misspelling of the filter we're checking for, s/fs_method/filesystem_method/.
My bad. See #22704, [25781].

Built from https://develop.svn.wordpress.org/trunk@25787


git-svn-id: http://core.svn.wordpress.org/trunk@25699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 14:55:09 +00:00
Andrew Nacin 957df34182 Automatic updates: An error code containing 'do_rollback' can be used to trigger a rollback.
This could enable the triggering of a rollback in update_core() in wp-admin/includes/update-core.php.

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25782


git-svn-id: http://core.svn.wordpress.org/trunk@25695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 02:59:10 +00:00
Andrew Nacin cdede88a23 Automatic updates: Include error data in the follow-up API request.
props dd32.
see #22704.

Built from https://develop.svn.wordpress.org/trunk@25781


git-svn-id: http://core.svn.wordpress.org/trunk@25694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 23:33:10 +00:00
Andrew Nacin 3e3c085db3 Auto updates: Only attempt a roll back when we've hit a critical error code.
Specifically, this means when we've failed in copying files.

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25777


git-svn-id: http://core.svn.wordpress.org/trunk@25690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 21:03:09 +00:00
Andrew Nacin 4c90c3cb31 Add explicit link to the installation being updated in debugging emails. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25770


git-svn-id: http://core.svn.wordpress.org/trunk@25683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-12 20:18:10 +00:00
Andrew Nacin de1d3c8261 Silence possible warnings from is_dir(). fixes #25572.
Built from https://develop.svn.wordpress.org/trunk@25764


git-svn-id: http://core.svn.wordpress.org/trunk@25677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-11 17:11:10 +00:00
Andrew Nacin 29f5f5b5fd Refine error codes throughout the upgrader so we can better detect at what stage updates fail.
see #22704.

Built from https://develop.svn.wordpress.org/trunk@25763


git-svn-id: http://core.svn.wordpress.org/trunk@25676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-11 16:06:11 +00:00
Andrew Nacin 2a8dcbae1f Auto updates: For follow-up API call when an update fails, send back the version attempted. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25755


git-svn-id: http://core.svn.wordpress.org/trunk@25668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-10 14:46:11 +00:00
Dion Hulse 186a5379e8 After a upgrade fails, and we successfully rollback to a previous version, Don't send the version we rolled back to to the API, just that it was successful. See [25750]. See #22704
Built from https://develop.svn.wordpress.org/trunk@25752


git-svn-id: http://core.svn.wordpress.org/trunk@25665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-10 01:57:08 +00:00
Dion Hulse 0b9f198994 In the event that an Automatic Upgrade fails, send a failure status on the next API request to indicate that it failed, and if the rollback was successful.
See #22704

Built from https://develop.svn.wordpress.org/trunk@25750


git-svn-id: http://core.svn.wordpress.org/trunk@25663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-10 01:32:09 +00:00
Andrew Nacin a8ea7828e9 Be as sure as possible that WordPress is not under version control when deciding if we should do automatic updates.
see #22704.

Built from https://develop.svn.wordpress.org/trunk@25700


git-svn-id: http://core.svn.wordpress.org/trunk@25615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-06 15:46:09 +00:00
Andrew Nacin be366723d2 Don't use a double negative.
props TobiasBg.
fixes #18201.

Built from https://develop.svn.wordpress.org/trunk@25674


git-svn-id: http://core.svn.wordpress.org/trunk@25590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 21:50:09 +00:00
Andrew Nacin 01484339b9 More string cleanups.
Built from https://develop.svn.wordpress.org/trunk@25658


git-svn-id: http://core.svn.wordpress.org/trunk@25575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 18:51:10 +00:00
Andrew Nacin bc842ab011 This error message should have a period.
Built from https://develop.svn.wordpress.org/trunk@25656


git-svn-id: http://core.svn.wordpress.org/trunk@25573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 17:45:09 +00:00
Andrew Nacin 32376e99be Rollback is not a verb.
Built from https://develop.svn.wordpress.org/trunk@25655


git-svn-id: http://core.svn.wordpress.org/trunk@25572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 17:44:09 +00:00
Dion Hulse 55822259df Automatic Updates: Remove some debug from [25649] See #22704
Built from https://develop.svn.wordpress.org/trunk@25651


git-svn-id: http://core.svn.wordpress.org/trunk@25568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-30 00:30:10 +00:00
Dion Hulse 30b921d10e Automatic Updates: Disable Automatic updates for Mercurial(HG) and Bazaar(bzr) version control systems in addition to Git and SVN. Props jamescollins. See #22704
Built from https://develop.svn.wordpress.org/trunk@25650


git-svn-id: http://core.svn.wordpress.org/trunk@25567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-30 00:25:10 +00:00
Dion Hulse 75475ed773 Automatic Updates: Add a rollback functionality upon installation failure, the rollback package will be available for partial-updates for automatic updates and be similar to our existing partial builds (but in reverse).
A further iteration of this is to also detect whitescreens (fatals) after a auto update, and trigger the rollback for that too.
See #22704

Built from https://develop.svn.wordpress.org/trunk@25649


git-svn-id: http://core.svn.wordpress.org/trunk@25566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-30 00:21:09 +00:00
Dion Hulse 7ed4059230 MD5 file verification: Prevent md5_file() warnings when files don't exist, additionally, don't verify wp-content files as they can be updated separately, as well as WP_CONTENT_DIR being set elsewhere. See #22704 See #18201
Built from https://develop.svn.wordpress.org/trunk@25648


git-svn-id: http://core.svn.wordpress.org/trunk@25565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-29 23:08:09 +00:00
Dion Hulse 6e9ba8be22 Automatic Updates: Skip doing the sanity checking MD5 before deciding if we should use a partial build or not, This change means we always use a partial build for automatic updates. See #22704
Built from https://develop.svn.wordpress.org/trunk@25647


git-svn-id: http://core.svn.wordpress.org/trunk@25564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-29 23:00:09 +00:00
Andrew Nacin e3798dc013 Fix strict notice. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25635


git-svn-id: http://core.svn.wordpress.org/trunk@25552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-28 06:33:10 +00:00
Andrew Nacin 00d2c39c48 Changes to automatic background updates in preparation for Beta 1.
* Show a notice for beta testers on update-core.php explaining the status of their install. Three possibilities: auto updates are enabled, auto updates are disabled because the install doesn't support SSL HTTP requests, and auto updates are disabled because it is a VCS checkout.
 * Improve the output of the email, for maximum debugging potential. Failures are clearly labeled and the email leads testers to the support forums and Trac.
 * Try to create wp-content/languages in the upgrader if it doesn't exist. Our mkdir isn't recursive, so trying to create wp-content/languages/plugins could fail.
 * Abstract out version control checkout determination into a public method. The filter is now auto_upgrade_is_vcs_checkout, still subject to change.

see #22704.

Built from https://develop.svn.wordpress.org/trunk@25633


git-svn-id: http://core.svn.wordpress.org/trunk@25550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-27 23:21:10 +00:00
Dion Hulse 7669224311 Automatic Updates: Correct a typo of a constant, s/DISABLE_FILE_MODS/DISALLOW_FILE_MODS/. See #22704
Built from https://develop.svn.wordpress.org/trunk@25599


git-svn-id: http://core.svn.wordpress.org/trunk@25516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 07:16:09 +00:00
Dion Hulse 65caf043c0 Automatic Core Updates: Enable Core Automatic Updates for Security releases, Development nightly releases, and, Language packs. See #22704
For more information on Automatic Core Updates, See #22704 and http://wp.me/p2AvED-1Lo


Built from https://develop.svn.wordpress.org/trunk@25598


git-svn-id: http://core.svn.wordpress.org/trunk@25515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 03:36:09 +00:00
Dion Hulse c4a20fd9fe Language Packs: Integrate Language Packs into the Auto-upgrader. See #18200 See #22704
Built from https://develop.svn.wordpress.org/trunk@25568


git-svn-id: http://core.svn.wordpress.org/trunk@25486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 09:38:09 +00:00
Andrew Nacin 187c26415f Add a language pack upgrader class.
At the conclusion of any upgrade, after the transients are refreshed from the API, pending translations are downloaded and installed to wp-content/languages.

props dd32.
see #18200.

Built from https://develop.svn.wordpress.org/trunk@25566


git-svn-id: http://core.svn.wordpress.org/trunk@25484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 02:08:10 +00:00