Commit Graph

206 Commits

Author SHA1 Message Date
Dion Hulse
9109f107c4 Bacground Updates: Move the 'automatic_updates_complete' hook to only fire when some updates have actually been completed. Props nacin. Fixes #25841
Built from https://develop.svn.wordpress.org/trunk@26164


git-svn-id: http://core.svn.wordpress.org/trunk@26075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-14 06:29:09 +00:00
Dion Hulse
4fbc450f52 Background Updates: Add a 'automatic_updates_complete' hook that fires after any updates have run. Props pento. Fixes #25841
Built from https://develop.svn.wordpress.org/trunk@26155


git-svn-id: http://core.svn.wordpress.org/trunk@26066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-14 05:08:09 +00:00
Dion Hulse
02841470a1 Background Updates: Fix a PHP Fatal error which could be encountered on some systems when using FTP. Fixes #25817 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26148


git-svn-id: http://core.svn.wordpress.org/trunk@26059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-14 02:02:09 +00:00
Sergey Biryukov
e15b51efa3 Pass correct 'type' parameter to 'upgrader_process_complete' action in Theme_Upgrader.
props bamadesigner.
fixes #25882 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26049


git-svn-id: http://core.svn.wordpress.org/trunk@25974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-08 17:04:09 +00:00
Dion Hulse
c9683257db Core Upgrader: Include an unmodified $wp_version in Core_Upgrader::upgrade(). This protects against cases where the global $wp_version has been modified. See #25772
Built from https://develop.svn.wordpress.org/trunk@26017


git-svn-id: http://core.svn.wordpress.org/trunk@25948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-05 06:23:10 +00:00
Dion Hulse
9d011a0556 Core Upgrader success statistics: Pass the version of WordPress we're upgrading from, as well as the version being upgraded to. Props nacin. See #25772 for trunk
Built from https://develop.svn.wordpress.org/trunk@26016


git-svn-id: http://core.svn.wordpress.org/trunk@25947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-05 06:20:09 +00:00
Dion Hulse
38a69e4ccc Remove dead code from the Plugin Upgrader class. Props jdgrimes. Fixes #25470
Built from https://develop.svn.wordpress.org/trunk@26015


git-svn-id: http://core.svn.wordpress.org/trunk@25946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-05 05:48:10 +00:00
Dion Hulse
21a3164b3b Add a filter to the Background Updates debug email, matches the filter used on the non-debug post-update emails. Props pento. Fixes #25756
Built from https://develop.svn.wordpress.org/trunk@26013


git-svn-id: http://core.svn.wordpress.org/trunk@25944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-05 02:15:10 +00:00
Andrew Nacin
d0cfa40983 Add jshintrc to qunit.
props jorbin.
see #25187.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-30 14:39:10 +00:00
Andrew Nacin
70fd806759 Revert r25824:25875 from the core.svn.wordpress.org repository.
These commits were accidentally re-synced commits from develop.svn.wordpress.org due to a race condition. Thankfully, the history of this repository matters fairly little. It also happened only for trunk.


git-svn-id: http://core.svn.wordpress.org/trunk@25876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-25 02:29:52 +00:00
Andrew Nacin
ac2e70227f 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@25873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 23:00:01 +00:00
Andrew Nacin
ff711dba63 "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@25871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:59:45 +00:00
Andrew Nacin
bed7a78426 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@25870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:59:37 +00:00
Andrew Nacin
3b7e540f00 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@25863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:58:40 +00:00
Andrew Nacin
de7977d66c 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@25861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:58:23 +00:00
Andrew Nacin
b134f540e2 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@25859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:57:58 +00:00
Andrew Nacin
04bbb52c7c 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@25851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:56:54 +00:00
Andrew Nacin
aea50d4b4c Use correct variable. fixes #10787.
Built from https://develop.svn.wordpress.org/trunk@25843


git-svn-id: http://core.svn.wordpress.org/trunk@25843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:55:46 +00:00
Andrew Nacin
83b20ee7f9 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@25841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:55:30 +00:00
Andrew Nacin
fa4f4033f7 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@25837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:54:54 +00:00
Andrew Nacin
a3561e7e07 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@25835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:54:38 +00:00
Dion Hulse
66f01957a0 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@25828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:40 +00:00
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