Commit Graph

173 Commits

Author SHA1 Message Date
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
Dion Hulse
a54a345cff Add a missing . in the Hook documentation from r25542 See #22704
Built from https://develop.svn.wordpress.org/trunk@25543


git-svn-id: http://core.svn.wordpress.org/trunk@25463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-21 07:02:11 +00:00
Dion Hulse
2c3a35491b WordPress Core Automatic Updates: Add a filter as to whether or not to send the site administrator a summary of executed updates. Props JustinSainton. See #22704
Built from https://develop.svn.wordpress.org/trunk@25542


git-svn-id: http://core.svn.wordpress.org/trunk@25462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-21 07:00:10 +00:00
Dion Hulse
6737d0a202 Upgrader: Perform a MD5 file verification check on the files during upgrade. This ensures that both a Partial upgrade build can be used, and that all the files were copied into place correctly.
Props pento for initial patch. Fixes #18201

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


git-svn-id: http://core.svn.wordpress.org/trunk@25460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-21 06:49:11 +00:00
Dion Hulse
aa0fb26397 WordPress Core Automatic Updates: Add a post-upgrade summary email to the WordPress install's admin email address. See #22704
Built from https://develop.svn.wordpress.org/trunk@25496


git-svn-id: http://core.svn.wordpress.org/trunk@25417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-19 08:46:09 +00:00
Dion Hulse
340e129deb Upgrader: Fix the order of arguements passed to wp_parse_args() in the Upgrader, introduced with [25272]. See #22704
Built from https://develop.svn.wordpress.org/trunk@25495


git-svn-id: http://core.svn.wordpress.org/trunk@25416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-19 08:40:10 +00:00
Dion Hulse
59d5e858f7 WordPress Core Automatic Updates: Remove some debug. See #22704
Built from https://develop.svn.wordpress.org/trunk@25468


git-svn-id: http://core.svn.wordpress.org/trunk@25389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-17 04:08:09 +00:00
Dion Hulse
cc84220ab5 WordPress Core Automatic Updates: Switch from using a transient for locking the upgrade process, to using a site option. See #22704
Built from https://develop.svn.wordpress.org/trunk@25467


git-svn-id: http://core.svn.wordpress.org/trunk@25388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-17 02:28:09 +00:00
Dion Hulse
d39f430f64 WordPress Core Automatic Updates: Remove an accidental closure which isn't supported in PHP 5.2. See #22704
Built from https://develop.svn.wordpress.org/trunk@25447


git-svn-id: http://core.svn.wordpress.org/trunk@25368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-15 01:26:09 +00:00
Dion Hulse
dd8e15f612 Upgrader: Allow plugins to short-circuit the package download. Props rmccue and DrewAPicture. Fixes #22378
Built from https://develop.svn.wordpress.org/trunk@25427


git-svn-id: http://core.svn.wordpress.org/trunk@25351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-13 12:53:08 +00:00
Dion Hulse
89682d2013 WordPress Core Automatic Updates: Pass the Filesystem path as $context to request_filesystem_credentials(). See #22704
Built from https://develop.svn.wordpress.org/trunk@25422


git-svn-id: http://core.svn.wordpress.org/trunk@25347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-13 06:53:09 +00:00
Dion Hulse
4678d33216 WordPress Core Automatic Updates: Add the first slice of Automatic Upgrades, This is presently disabled, and requires a filter to enable ( 'auto_upgrade_core' ). See #22704
Built from https://develop.svn.wordpress.org/trunk@25421


git-svn-id: http://core.svn.wordpress.org/trunk@25346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-13 06:19:12 +00:00