Commit Graph

11641 Commits

Author SHA1 Message Date
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
325ccd0a14 set_current_screen() is now unnecessary in Automatic_Upgrader_Skin, which is good because it breaks things in the network admin.
fixes #25622.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 23:24:09 +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
Andrew Nacin
de21e296ce Remove redundant code. see #25603, #22704, [25833].
Built from https://develop.svn.wordpress.org/trunk@25834


git-svn-id: http://core.svn.wordpress.org/trunk@25746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 20:30:10 +00:00
Andrew Nacin
c3a27493e6 Check if background core updates are supported on about.php.
see #25603, #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 20:29:09 +00:00
Andrew Nacin
5343c74b4a Update the text for the about page, so translators can get started. Design is in flux.
props nacin, markjaquith, jorbin, jenmylo.
see #25603.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 20:17:09 +00:00
Dion Hulse
924e35d66a Silence PHP warnings from disk_free_space(). disk_free_space() will produce a warning in error conditions in addition to returning false, this includes a case where the bytes free is greater than PHP_INT_MAX (which is a error condition we don't need to check).
See #25576, #22704

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


git-svn-id: http://core.svn.wordpress.org/trunk@25743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 18:40:10 +00:00
Drew Jaynes
73f3f80a1d Inline documentation for hooks in wp-admin/options-general.php.
Props siobhyb for the initial patch.
Fixes #25454.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 06:18:10 +00:00
Drew Jaynes
21b24c1fba Inline documentation for hooks in wp-admin/options-discussion.php.
Props siobhyb, ericlewis.
Fixes #25453.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 06:00:09 +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
Drew Jaynes
1ac5a51c18 Inline documentation for hooks in wp-admin/customize.php.
Props andg, rzen.
Fixes #25444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 04:53:09 +00:00
Andrew Nacin
9432acde4e 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@25737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-17 04:02: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
Drew Jaynes
bd09d15a2c Inline documentation for hooks in wp-admin/custom-header.php.
Props gizburdt for the initial patch.
Fixes #25443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 23:26:10 +00:00
Andrew Nacin
55b0b79179 "Future security updates will be applied automatically." see #22704.
Built from https://develop.svn.wordpress.org/trunk@25820


git-svn-id: http://core.svn.wordpress.org/trunk@25732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 23:06:09 +00:00
Drew Jaynes
359a2ce779 Inline documentation for hooks in wp-admin/edit-form-advanced.php.
Props ericlewis.
Fixes #25434.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 22:59:09 +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
766b6d3842 Update the banner for update-core.php that tells users they are set up for security updates to happen in the background.
"This site is set up to install security updates of WordPress automatically. Cool!"

Checkmark is a placeholder; we'll tinker with this further today.

see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 19:41:09 +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
8c35982ae8 Avoid a few PHP Warnings when files don't exist and use a better method to locate the local filepath.
See #18201

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


git-svn-id: http://core.svn.wordpress.org/trunk@25723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 15:20:10 +00:00
Andrew Nacin
ba0ebf3736 Include translations in the update bubbles (as +1 if there are any). see #18200.
Built from https://develop.svn.wordpress.org/trunk@25810


git-svn-id: http://core.svn.wordpress.org/trunk@25722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 14:34:10 +00:00
Dion Hulse
84cec7b526 Remove the no longer used Headerless_Upgrader_Skin class, it's been replaced by Language_Pack_Upgrader_Skin.
See #18200, [25806]

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


git-svn-id: http://core.svn.wordpress.org/trunk@25719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 04:19:09 +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
9fe39c464a Avoid numerous potential PHP warnings when dealing with the pre-r25801 get_core_checksums() return value.
Warnings included current(), filestat(), and md5_file().

see #18201. see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-16 04:02: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
Andrew Nacin
9507d22243 Use correct variable. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25800


git-svn-id: http://core.svn.wordpress.org/trunk@25712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 22:07:09 +00:00
Andrew Nacin
95831a8a67 Remove accidental debug cruft in [25780]. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25799


git-svn-id: http://core.svn.wordpress.org/trunk@25711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 21:24:09 +00:00
Andrew Nacin
2100fa65fd Avoid our pre-flight writable checks if get_core_checksums() doesn't exist yet.
Thus, it will not work for 3.6 => 3.7, only 3.7+.

see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 20:35:10 +00:00
Andrew Nacin
a6188bc84a Only add error data to the files_not_writable WP_Error if the install already has [25775] and [25796] applied.
see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 20:01:09 +00:00
Andrew Nacin
82547b21b6 In show_message(), only print error data if it is a string.
see #25576, [25775].

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


git-svn-id: http://core.svn.wordpress.org/trunk@25708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 19:51:10 +00:00
Andrew Nacin
26c03ea5fb Core Updates: Verify that all files we're about to copy are actually writable, when using the direct transport.
Once we begin to copy core files, all bets are off. This allows us to fail early when we'll otherwise need to stop midway through due to permissions issues, which is a particularly bad problem when only some files have permissions issues.

see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 19:18:10 +00:00
Andrew Nacin
eeaad19a26 Use FS_CHMOD_FILE rather than an explicit 0644 in copy_dir() and _copy_dir().
This occurs when we can't copy a file. We chmod it and try again.

see #22704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 19:14: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
7b0088c938 Hide language-specific warnings/labels on update-core.php when we are dealing with a point release partial build.
see #22704, #18200.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 05:08:09 +00:00
Andrew Nacin
e503d0e2ec Hide auto updates from update-core.php directly in get_core_updates(). see #22704.
Built from https://develop.svn.wordpress.org/trunk@25783


git-svn-id: http://core.svn.wordpress.org/trunk@25696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-15 05:07:10 +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
9b56d4d11f Parse absolute paths out of error data. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25780


git-svn-id: http://core.svn.wordpress.org/trunk@25693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 22:25:08 +00:00
Dion Hulse
4dcca90887 Remove PHP4 compat code from the ZipArchive unzip handler, and pass the failure reason into the WP_Error return.
See #22704

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


git-svn-id: http://core.svn.wordpress.org/trunk@25692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 21:55:09 +00:00
Andrew Nacin
4fa3687e6a Account for the possible failure of disk_free_space() in update_core().
see #22704, #25576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 21:15: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
145dbde82f Account for possible failures by disk_free_space(), as well as the potential need to copy the unzipped files.
see #25576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 20:58:09 +00:00
Andrew Nacin
1516b990f1 In the upgrader, only print additional error data if it is a string.
As in [25576], we sometimes want to return additional data that is not necessarily meant for UI consumption.

see #25576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 20:20:10 +00:00
Andrew Nacin
d68a80217f In unzip_file(), confirm we have enough available disk space before extracting.
"enough" is calculated by adding up the uncompressed size of the files in the archive, then adding a 20% buffer.

props dd32.
fixes #25576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 20:15:09 +00:00
Andrew Nacin
2d898df04f More specific error codes in the core upgrader when copying language, plugin, and theme files. see #22704.
Built from https://develop.svn.wordpress.org/trunk@25772


git-svn-id: http://core.svn.wordpress.org/trunk@25685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 19:38:10 +00:00
Dominik Schilling
f3faba9b95 Fix typo in wp-admin.css. props wycks. fixes #25589.
Built from https://develop.svn.wordpress.org/trunk@25771


git-svn-id: http://core.svn.wordpress.org/trunk@25684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-14 16:14:13 +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