Commit Graph

106 Commits

Author SHA1 Message Date
Sergey Biryukov
68dfbf51d9 Script Loader: Add backward compatibility for JavaScript i18n globals and properties deprecated in WordPress 5.5.
The recommended approach for any plugins using these globals or properties is to switch to the newer `wp.i18n` functions.

In the meantime, this ensures that accessing any of these globals does not break the rest of the code on the page, and an appropriate warning message is logged to the JavaScript console.

Follow-up to: https://core.trac.wordpress.org/query?summary=~wp.i18n&milestone=5.5

Props omarreiss, peterwilsoncc, kbjohnson90, johnbillion, TimothyBlynJacobs, joostdevalk, ocean90, desrosj, SergeyBiryukov.
Fixes #51123.
Built from https://develop.svn.wordpress.org/trunk@48923


git-svn-id: http://core.svn.wordpress.org/trunk@48685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 20:30:03 +00:00
Sergey Biryukov
3f04e3bf5c I18N: Further adjust some update/install strings for consistency.
Follow-up to [48568], [48569].

See #50708, #50714.
Built from https://develop.svn.wordpress.org/trunk@48589


git-svn-id: http://core.svn.wordpress.org/trunk@48351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 21:08:01 +00:00
whyisjake
dd642e7b00 i18n: Merge similar translation strings to "Update failed".
Fixes #50714.
Props ramiy, ocean90.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-22 22:10:02 +00:00
whyisjake
921ddab889 I18N: Merge similar "Installation failed" strings
Fixes #50708.

Props ramiy, ocean90, audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-22 21:59:05 +00:00
whyisjake
d1517a1ad4 I18N: Update some strings to have periods.
Fixes #50707.
Props ramiy, afercia, audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-22 21:55:06 +00:00
Andrea Fercia
9e8d1b1a68 Accessibility: Security: Improves the accessible audible messages for Plugins & Themes Auto-Updates.
- changes the politeness level of the two error messages introduced in [47835] to `assertive`
- remove unnecessary `polite` parameters as that's the default value

See #50512, #50052.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-14 15:46:02 +00:00
Sergey Biryukov
9848b6b3e9 Plugins: Make delete plugin message less scary.
This adds a check if the plugin actually has an uninstall routine before saying that its data will be deleted too.

Props samful, joostdevalk, joyously, Chouby, SergeyBiryukov.
Fixes #50346.
Built from https://develop.svn.wordpress.org/trunk@48451


git-svn-id: http://core.svn.wordpress.org/trunk@48220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-12 13:22:04 +00:00
whyisjake
28a390c2b2 Upgrade/Install: Use ARIA button class on plugin and theme auto-updates action links
According to the [accesability guidelines](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/#semantics-for-controls), the control should be a link when JavaScript is not available and a button the rest of the time.

In addition, handlers were added for spacebar usage, and some changes to the a11y speak verbiage.

Fixes #50516.
Props ryokuhi, audrasjb, afercia, whyisjake/



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


git-svn-id: http://core.svn.wordpress.org/trunk@48187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-10 06:18:04 +00:00
Andrew Ozz
aca919f007 Plugins and Themes Auto-Updates:
- Fix displaying of errors on the Themes screen.
- Correct the classes used for the error messages, and use `notice-alt` as notices are mostly shown on a white background.

Props afercia, azaozz.
Fixes #50405.
Built from https://develop.svn.wordpress.org/trunk@48092


git-svn-id: http://core.svn.wordpress.org/trunk@47859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 16:51:14 +00:00
Sergey Biryukov
cf597dcf7c Plugins: Make the message displayed when no plugins are installed more concise.
Props johnjamesjacoby, Presskopp.
Fixes #42336.
Built from https://develop.svn.wordpress.org/trunk@47894


git-svn-id: http://core.svn.wordpress.org/trunk@47668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-03 10:51:13 +00:00
Dominik Schilling
ba92ed7615 I18N: Use wp.i18n for translatable strings in wp-admin/js/updates.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50235.
Built from https://develop.svn.wordpress.org/trunk@47884


git-svn-id: http://core.svn.wordpress.org/trunk@47658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-01 21:41:09 +00:00
Andrew Ozz
0318a92948 Plugins and Themes Auto-Updates: update the state of the auto-update link on the themes screen after successfully saving the setting.
Props desrosj, pbiron, azaozz.
Fixes #50291.
Built from https://develop.svn.wordpress.org/trunk@47883


git-svn-id: http://core.svn.wordpress.org/trunk@47657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-01 20:53:15 +00:00
whyisjake
661b929e1e Security: Add user interface to auto-update themes and plugins.
Building on core update mechanisms, this adds the ability to enable automatic updates for themes and plugins to the WordPress admin. 

Fixes: #50052.
Props: afercia, afragen, audrasjb, azaozz, bookdude13, davidperonne, desrosj, gmays, gmays, javiercasares, karmatosed, knutsp, mapk, mukesh27, netweb, nicolaskulka, nielsdeblaauw, paaljoachim, passoniate, pbiron, pedromendonca, whodunitagency, whyisjake, wpamitkumar, and xkon.

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


git-svn-id: http://core.svn.wordpress.org/trunk@47611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-20 18:49:09 +00:00
Sergey Biryukov
49007e52bc Build/Test Tools: Add banner to RTL CSS and minified JS files.
Patches occasionally come in on generated files. We should be kind to new contributors and give them a hint that these files are auto-generated.

This is a follow-up to [41271], which added the banner to minified CSS files.

Fixes #48424. See #30666.
Built from https://develop.svn.wordpress.org/trunk@46589


git-svn-id: http://core.svn.wordpress.org/trunk@46386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-26 00:17:07 +00:00
Aaron Jorbin
0e21d32900 Build/Test: Bump devDependencies for WordPress 5.3
This upgrades a number of devDependencies.  Some of these include changes to how the tasks are configured.

Uglify: There are deprecated options from 2.x to 4.x, see: https://github.com/gruntjs/grunt-contrib-uglify#options

Autoprefixer: Browserslist now warns when passing in the browser list, so that is put into package.json

As with most changes to uglify, this changes every minified JS file.

Fixes #48203.



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


git-svn-id: http://core.svn.wordpress.org/trunk@46206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-05 19:49:10 +00:00
desrosj
8cb7c5c764 Upgrade/Install: Fix the Install Now button in the plugin overlay when running WordPress on a specific port.
Props garrett-eclipse, pierlo, afragen.
Fixes #48077.
Built from https://develop.svn.wordpress.org/trunk@46348


git-svn-id: http://core.svn.wordpress.org/trunk@46147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-30 00:05:57 +00:00
whyisjake
90d9bdc54c Update wp.a11y.speak() to sanitize HTML before display.
Props iandunn, adamsilverstein, sstoqnov, peterwilsoncc

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


git-svn-id: http://core.svn.wordpress.org/trunk@45790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 17:13:21 +00:00
Sergey Biryukov
428a738f1d Plugins: Adjust the pause before running plugin search AJAX request on "Add Plugins" screen to allow more time for using browser's autocomplete.
Props donmhico, apermo.
Fixes #46021.
Built from https://develop.svn.wordpress.org/trunk@45793


git-svn-id: http://core.svn.wordpress.org/trunk@45604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-14 02:02:56 +00:00
Sergey Biryukov
9ac8b5b4f5 Importers: Use correct l10n variable in wp.updates.installImporterError and filesystem credentials dialog.
Missed in [40034].

Props afercia, abhayvishwakarma.
Fixes #45765.
Built from https://develop.svn.wordpress.org/trunk@44417


git-svn-id: http://core.svn.wordpress.org/trunk@44247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-07 13:49:49 +00:00
Sergey Biryukov
b2411e9e3f Administration: Make sure wp.updates.addAdminNotice is displayed after the page header and does not unexpectedly push down "Add New" and other buttons.
Props shivapoudel.
Fixes #41221.
Built from https://develop.svn.wordpress.org/trunk@42700


git-svn-id: http://core.svn.wordpress.org/trunk@42528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-11 17:28:30 +00:00
Sergey Biryukov
ea6f648401 Upgrade/Install: In postMessage events handler, check for message object existence before checking its action property.
Props manikmist09.
Fixes #43005.
Built from https://develop.svn.wordpress.org/trunk@42604


git-svn-id: http://core.svn.wordpress.org/trunk@42433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-24 22:31:30 +00:00
Konstantin Obenland
b61de38e87 Customize: Spiff up theme updates
Fixes UI bugs around theme updates in the Customizer. Theme versions now get updated and users are no longer left alone after a successful update.

Props rinkuyadav999, celloexpressions for initial patch.
Fixes #42365.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 01:33:47 +00:00
Weston Ruter
d19c79fa21 Customize: Remove theme_installing notification when installation fails.
Amends [41648].
Props celloexpressions.
See #42184, #37661.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 01:14:46 +00:00
Aaron Jorbin
b8fc8cb59c Dashboard: Remove "Try Gutenberg" callout.
Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.

Reverts [41931] [41900] [41896] [41895]
See #41316


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


git-svn-id: http://core.svn.wordpress.org/trunk@41812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 20:48:47 +00:00
Gary Pendergast
3981736cd6 Dashboard: Introduce a "Try Gutenberg" callout.
To encourage more people to try Gutenberg, this new Dashboard box allows site users to easily install and try out Gutenberg.

Props pento, melchoyce, joen, karmatosed.
Fixes #41316.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 10:04:47 +00:00
Weston Ruter
76f590b99b Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.

Also includes CSS auto-prefixing added via `grunt precommit:css`.

For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 20:13:50 +00:00
Pascal Birchler
1f5c7470fb Plugins: Improve error messages on plugins screen.
This unifies the layout and wording of error messages on both the plugins screen and the themes screen.

Props tinkerbelly, juhise, Ankit K Gupta, m1tk00, swissspidy, mrahmadawais, danieltj.
Fixes #37430.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:46:45 +00:00
Sergey Biryukov
0170c40e24 Plugins: Restore "Clear List" button functionality for recently active plugins.
Props obenland.
Fixes #41080.
Built from https://develop.svn.wordpress.org/trunk@41585


git-svn-id: http://core.svn.wordpress.org/trunk@41418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 15:16:46 +00:00
Aaron Campbell
38347d7c58 Add nonce for updating file system credentials.
Built from https://develop.svn.wordpress.org/trunk@40723


git-svn-id: http://core.svn.wordpress.org/trunk@40581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 14:48:44 +00:00
Sergey Biryukov
222ee437fe Update/Install: Give context to "Deleted! string to allow for differentiation between theme and plugin translations.
Props swissspidy.
See #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40035


git-svn-id: http://core.svn.wordpress.org/trunk@39972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:59:40 +00:00
Sergey Biryukov
9264813949 Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.
Fixes #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40034


git-svn-id: http://core.svn.wordpress.org/trunk@39971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:27:41 +00:00
Pascal Birchler
b076f7e4a8 Plugins: Remove trailing pipe symbol in sub navigation after updating the last plugin.
Props sagarprajapati.
Fixes #39655.
Built from https://develop.svn.wordpress.org/trunk@40025


git-svn-id: http://core.svn.wordpress.org/trunk@39962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-28 17:01:46 +00:00
Dion Hulse
8912d6b134 Updates: Properly define $filesystemForm to handle error in modals.
Ammends [39657].
See #39057.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 07:24:43 +00:00
Dion Hulse
05f07e13d9 Updates: Show the Authentication key settings after selecting the SSH transport in both the modal, and also on the plugin/theme updates screen.
Props afercia.
Fixes #39057 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 07:44:41 +00:00
Andrea Fercia
993f895c29 Accessibility: Remove inappropriate content from the Plugins screen heading.
See #26601.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-07 18:48:40 +00:00
Helen Hou-Sandí
1281a28382 Customize: Revert theme install feature.
This is a great goal for core, and is close, but it is not in shape to be shipped for 4.7 and there is not enough time left in the development cycle to alter and polish sufficiently. There are bugs, but more than that, there are more fundamental questions around the use of existing UI, general UX, and how findable themes are (not) on the .org side.

see #37661.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-04 17:18:26 +00:00
Aaron Jorbin
32be6f7bb7 Bump grunt-contrib-uglify from 1.0.1 to 2.0.0
Sets `screwIE8` to false as it is now enabled by default

Files Changed:
build/wp-admin/js/customize-nav-menus.min.js
build/wp-admin/js/customize-widgets.min.js
build/wp-includes/js/customize-loader.min.js

Changelog:
2016-07-19   v2.0.0   Update uglify-js to v2.7.0. screwIE8 is enabled by default.
2016-07-19   v1.0.2   Update grunt to ^1.0.0. Fix beautify when passed as an object. Fix docs about report values.

See #38199.


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


git-svn-id: http://core.svn.wordpress.org/trunk@39059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:40:34 +00:00
Pascal Birchler
ceeb8ddb46 Plugins: Improve Ajax search of installed plugins.
Removes the highlight from the current filter when performing an Ajax search and adds it back when clearing the search input.

Fixes #37657.
Built from https://develop.svn.wordpress.org/trunk@39099


git-svn-id: http://core.svn.wordpress.org/trunk@39041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 22:47:30 +00:00
Pascal Birchler
e4d7dd2b8a Upgrade/Install: Refresh update counts after page load.
By enqueuing the updates script in the footer and passing the number of available updates to it after page load, the update bubbles will be more accurate.

Props ocean90, swissspidy.
Fixes #13071.
Built from https://develop.svn.wordpress.org/trunk@38827


git-svn-id: http://core.svn.wordpress.org/trunk@38770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 10:27:29 +00:00
Weston Ruter
1c3b96537f Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context.

For details, see https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Fixes #37661, #34843.
Props celloexpressions, folletto, westonruter, karmatosed, afercia.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 03:20:29 +00:00
Pascal Birchler
bd03add624 Import: Fix plugin activation link after installing an importer on multisite.
When installing the importer via Ajax, the activation link should be the same as if the page were reloaded.

Props joelcj91 for initial patch.
Fixes #37943.
Built from https://develop.svn.wordpress.org/trunk@38704


git-svn-id: http://core.svn.wordpress.org/trunk@38647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 06:42:29 +00:00
Andrea Fercia
eeefec932f Administration: Improve the usage of the button CSS classes.
Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 19:54:28 +00:00
Andrew Ozz
0d4320fcbc Update/Install error messages: do not escape from the template, escape the error message string before inserting it.
Props swissspidy, ocean90.
Fixes #37623 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38240


git-svn-id: http://core.svn.wordpress.org/trunk@38181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-10 19:03:31 +00:00
Dominik Schilling
cb131d8d5f Updates: Add visual feedback when deleting themes/plugins.
This corrects the selector for the delete link in `wp.updates.deletePlugin()` so the text can be changed to 'Deleting…'. `wp.updates.deleteTheme()` already worked on wp-admin/themes.php but not on wp-admin/network/themes.php because the network screen is similar to the plugins list table, this is now fixed too.
The `credential-modal-cancel` handler has been updated to support canceled delete jobs.

Props swissspidy.
Props jorbin for review.
Fixes #37603.
Built from https://develop.svn.wordpress.org/trunk@38227


git-svn-id: http://core.svn.wordpress.org/trunk@38168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-09 10:39:32 +00:00
Aaron Jorbin
b3b32f22a1 Updates: Improve experience for Bulk Actions when FTP is dismissed.
Before this change, when a bulk update was canceled due dismissing the FTP credentials modal, part of the actions didn't get canceled.  This meant the "There is a new version of…” notices become blank and the updates you had checked became unchecked.  Now, the notices remain and you are essentially returned to the screen you had before. Strings are also updated to improve ARIA usage.

Fixes #37563.
Props ocean90, swissspidy, obenland, afercia.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-09 01:14:28 +00:00
Aaron Jorbin
b86f7a832b Updates: Standardize JS Custom Event Names
Custom JS events are triggered on the document in order for plugins to have something to hook into.  The standard began in #31819 is dash separated and begins with `wp` to signify the namespace, followed by the subject of our action ( "theme", "plugin", etc.) followed by the action and an optional indicator of status ( "install-success", "deleting" ).

This brings some of the theme hooks in line with the standard.  As of now, all plugin actions in `src/wp-admin/js/updates.js` have an equal corresponding theme action.

Fixes #37598.
See #37512, #37216, #31819.
Props olarmarius, ocean90.



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


git-svn-id: http://core.svn.wordpress.org/trunk@38159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-08 22:49:28 +00:00
Dominik Schilling
1cef5f60f9 Update/Install: Remove the .notice-error class before adding classes for the update process.
Prevents displaying an update message with error styling.

Props obenland.
Props SergeyBiryukov for review.
Fixes #37550.
Built from https://develop.svn.wordpress.org/trunk@38209


git-svn-id: http://core.svn.wordpress.org/trunk@38150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-05 22:57:29 +00:00
Dominik Schilling
572a9cb488 Update/Install: Replace "error" and "-1" failure messages with a more meaningful one.
* "-1" is an invalid nonce error, show 'An error has occurred. Please reload the page and try again.'.
* "error" means that the connection to the server was lost, show 'Connection lost or the server is busy. Please try again later.'.
* Escape the message in `wp-updates-admin-notice` because the response may include HTML.
* Remove HTML tags in `wp.updates.isValidResponse()` to make PHP's error messages more readable.

Props azaozz for review.
Fixes #37583.
Built from https://develop.svn.wordpress.org/trunk@38205


git-svn-id: http://core.svn.wordpress.org/trunk@38146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-05 19:28:30 +00:00
Dominik Schilling
58d772a02f Upgrade/Install: Make some install/update failures more verbose.
An upgrader class is used in conjunction with an upgrader skin class. A skin class handles the logging for an upgrade and informs a user about the progress and failures.
The current Ajax install/update handlers are using the `Automatic_Upgrader_Skin` class because during an Ajax request no output is intended. The difference between Ajax updates and automatic updates is that you will see the full log (usually by email) while Ajax updates focus only on success or failure. For that `Automatic_Upgrader_Skin` has one disadvantage: It doesn't provide a way to retrieve failure messages which were passed through `WP_Upgrader_Skin::error()` by the upgrader.
To solve this issue a new skin `WP_Ajax_Upgrader_Skin` has been introduced. The skin extends `Automatic_Upgrader_Skin` and overrides the `error()` and `feedback()` methods to intercept all errors, which can be a `WP_Error` object or a string.

This updates all four Ajax handler for installing/updating themes/plugins to use the new skin. They now also check the skin for any intercepted errors and pass them on to the user.

Props flixos90, obenland, ocean90.
Props DrewAPicture, pento for review.
Fixes #37531.
Built from https://develop.svn.wordpress.org/trunk@38199


git-svn-id: http://core.svn.wordpress.org/trunk@38140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-04 22:18:30 +00:00
Dominik Schilling
c9c2377b1d Plugins: Also update aria-labels when a plugin update fails.
Previously the label was stuck at "Updating…".

Props afercia, ocean90.
Props DrewAPicture for review.
Fixes #37556.
Built from https://develop.svn.wordpress.org/trunk@38196


git-svn-id: http://core.svn.wordpress.org/trunk@38137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-04 21:06:38 +00:00