Commit Graph

90 Commits

Author SHA1 Message Date
Felix Arntz 0612ea2d38 Bootstrap/Load: Revert fatal error recovery mechanism from 5.1 to polish for 5.2.
Due to the high number of follow-up tickets and associated security concerns, it was decided to reschedule the fatal error recovery feature for WordPress 5.2, in order to address these issues properly. The feature will continue to be developed, with iterations being merged into trunk early in the 5.2 release cycle.

Fixes #46141. See #44458, #45932, #45940, #46038, #46047, #46068.


git-svn-id: https://develop.svn.wordpress.org/trunk@44717 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-30 11:00:30 +00:00
Felix Arntz 9b19f2eea4 I18n: Add missing translator comments in `wp-admin/includes/class-wp-plugins-list-table.php`.
Fixes #45898.


git-svn-id: https://develop.svn.wordpress.org/trunk@44541 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 10:45:13 +00:00
Felix Arntz ffd2a4bd16 Bootstrap/Load: Fix missing object argument for singular capability checks and support capability tests overlooked in [44524].
See #44458.


git-svn-id: https://develop.svn.wordpress.org/trunk@44525 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 20:43:57 +00:00
Felix Arntz fc37b1746e Bootstrap/Load: Introduce fatal error recovery mechanism allowing users to still log in to their admin dashboard.
This changeset introduces a `WP_Shutdown_Handler` class that detects fatal errors and which extension (plugin or theme) causes them. Such an error is then recorded, and an error message is displayed. Subsequently, in certain protected areas, for example the admin, the broken extension will be paused, ensuring that the website is still usable in the respective area. The major benefit is that this mechanism allows site owners to still log in to their website, to fix the problem by either disabling the extension or solving the bug and then resuming the extension.

Extensions are only paused in certain designated areas. The frontend for example stays unaffected, as it is impossible to know what pausing the extension would cause to be missing, so it might be preferrable to clearly see that the website is temporarily not accessible instead.

The fatal error recovery is especially important in scope of encouraging the switch to a maintained PHP version, as not necessarily every WordPress extension is compatible with all PHP versions. If problems occur now, non-technical site owners that do not have immediate access to the codebase are not locked out of their site and can at least temporarily solve the problem quickly.

Websites that have custom requirements in that regard can implement their own shutdown handler by adding a `shutdown-handler.php` drop-in that returns the handler instance to use, which must be based on a class that inherits `WP_Shutdown_Handler`. That handler will then be used in place of the default one.

Websites that would like to modify specifically the error template displayed in the frontend can add a `php-error.php` drop-in that works similarly to the existing `db-error.php` drop-in.

Props afragen, bradleyt, flixos90, ocean90, schlessera, SergeyBiryukov, spacedmonkey.
Fixes #44458.


git-svn-id: https://develop.svn.wordpress.org/trunk@44524 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 20:04:55 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
John Blackbourn f12dec95fe Docs: Document many more parameters and properties using typed array notation.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42871 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-22 20:26:06 +00:00
John Blackbourn b20dc7aaaf Docs: Standardise and correct documentation relating to parameters which accept plugin names.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42787 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 21:49:53 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
Gary Pendergast 574821573a General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 23:56:25 +00:00
Gary Pendergast 5c2609bbdb Plugins: Tweak the plugin icons added in [41695].
- Remove plugins icons from the plugin list table, as there were performance issues loading the icons when the site had lots of plugins.
- Depending on which icons the plugin has uploaded, prefer them in this order: `svg`, `128x128`, `256x256`.
- Improve the style of the fallback icon for plugins that don't have an icon defined.

Props Travel_girl, danieltj, afercia, karmatosed,hugobaeta, empireoflight, brentjett, melchoyce, pento.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41755 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 23:42:55 +00:00
Gary Pendergast 942482993d Plugins: Add plugin icons to the plugin list tables.
To mirror theme list table behaviour, the plugin icon now appears next to plugins in the plugin list tables. For plugins that don't have an icon, or non-W.org plugins, a fallback dashicon is shown.

Props melchoyce, afercia, paulwilde, pento, obenland.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41695 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:24:31 +00:00
Andrea Fercia 02588452f7 Accessibility: List Tables: use `aria-current` for the views current link.
The `aria-current` attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the 
introduction in core of the `aria-current` attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.


git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:43:02 +00:00
John Blackbourn fa4713e898 General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.
Props kawauso, Mte90 for initial patches

Fixes #13377


git-svn-id: https://develop.svn.wordpress.org/trunk@41399 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 10:10:35 +00:00
John Blackbourn 9990abec14 Plugins: Introduce singular capabilities for activating and deactivating individual plugins.
This introduces the following meta capabilities:

* `activate_plugin`
* `deactivate_plugin`
* `deactivate_plugins`

The singular `activate_plugin` and `deactivate_plugin` capabilities are used along with the corresponding plugin name when
determining whether or not a user can activate or deactivate an individual plugin.

The plural `deactivate_plugins` capability is used in place of the existing `activate_plugins` capability when determining
whether a user can deactivate plugins.

Each of these new meta capabilities map to the existing `activate_plugins` primitive capability, which means there is no
change in existing behaviour, but plugins can now filter the capabilities required to activate and deactivate individual
plugins.

Fixes #38652 


git-svn-id: https://develop.svn.wordpress.org/trunk@41290 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:01:36 +00:00
John Blackbourn db49a16f00 Plugins: Correct and improve docblocks for the various `plugin_action_links` filters on the Plugins screen.
This also adds a changelog for the removal of the Edit links in [41160].

See #41017
Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41231 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 22:14:37 +00:00
Drew Jaynes 829139ba1a Docs: Remove `@access` notations from method DocBlocks in wp-admin/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.


git-svn-id: https://develop.svn.wordpress.org/trunk@41161 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 00:39:34 +00:00
John Blackbourn 609aaef919 Administration: Remove `Edit` links from all plugin listing screens and the remaining theme listing screens.
This simplifies these list tables, reducing user confusion, without removing functionality.

Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41160 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-26 23:27:47 +00:00
John Blackbourn 99267c4e1d Plugins: Correct the `since` docs for the various `plugin_action_links` filters.
Props tfrommen, SergeyBiryukov


git-svn-id: https://develop.svn.wordpress.org/trunk@39063 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 19:37:39 +00:00
Pascal Birchler 2a713b0b39 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@38827 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-19 10:26:31 +00:00
Andrea Fercia ee7f970ffa 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 19:53:07 +00:00
Drew Jaynes b4fca4a558 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.


git-svn-id: https://develop.svn.wordpress.org/trunk@38307 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 18:24:48 +00:00
Sergey Biryukov cc9e4262ca Plugins: Add a missing space between classes on `<td>` element for custom columns of the Plugins list table.
Props crstauf.
Fixes #37460.

git-svn-id: https://develop.svn.wordpress.org/trunk@38149 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 13:27:42 +00:00
Dominik Schilling 6f5f178e8c List Table: Improve `WP_Plugins_List_Table::search_box()` which was added in [38033].
* Update DocBlock to use third-person singular verb and to include a period at the end.
* Use `submit_button()` for the submit button.
* Escape the ID attribute.
* Apply the same to `WP_List_Table::search_box()`.

See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38146 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 10:58:23 +00:00
Dominik Schilling 0780b19984 Plugins: Make search field placeholder translatable.
See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38141 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 14:50:22 +00:00
Sergey Biryukov fd19901336 Text Changes: Change `Network deactivate %s` to upper case, for consistency with `Network Activate %s`.
See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@38081 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 17:03:24 +00:00
Sergey Biryukov 8308164a77 I18N: After [38057], consistently use a context for other instances of `Activate %s`, `Network Activate %s`, and `Delete %s` strings.
See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@38071 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-16 23:19:05 +00:00
Pascal Birchler 68cff6ac40 Plugins: Improve Ajax search of installed plugins.
Fixes a few accessibility issues, tweaks the design of the search form to match other Ajax search fields and improves compatibility with older browsers.

See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38033 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-11 21:49:30 +00:00
Pascal Birchler ce7b53fb3f Docs: Fix a typo across some function and hook docs.
s/filterss/filters.

See #32246.

git-svn-id: https://develop.svn.wordpress.org/trunk@37961 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-04 22:44:10 +00:00
Konstantin Obenland 4dd1d9bef9 Update/Install: Shiny Updates v2.
Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.

Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.



git-svn-id: https://develop.svn.wordpress.org/trunk@37714 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 16:36:07 +00:00
Drew Jaynes 1cd420af5e Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37488 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-22 18:00:23 +00:00
Andrea Fercia 2a2539402f Accessibility: Improve accessibility for the Plugin details modal.
The plugin details modal can be invoked from several screens. There's now a new
`.open-plugin-details-modal` CSS class to be used in combination with the
`.thickbox` CSS class that adds everything needed for accessibility.

- Adds an ARIA role `dialog` and an `aria-label` attribute to the modal
- Adds a `title` attribute to the iframe inside the modal
- Constrains tabbing within the modal
- Restores focus back in a proper place when closing the modal

Also, improves a bit the native Thickbox implementation: it should probably be
replaced with some more modern tool but at least keyboard focus should be moved
inside the modal.

Fixes #33305.

git-svn-id: https://develop.svn.wordpress.org/trunk@36964 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 22:36:25 +00:00
Sergey Biryukov 090e49fe74 Docs: Correct `$plugins` global type in `WP_Plugins_List_Table::prepare_items()`.
Props mt8.biz.
Fixes #36080.

git-svn-id: https://develop.svn.wordpress.org/trunk@36830 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 10:00:40 +00:00
Pascal Birchler 1178047725 Docs: Move the hook doc for the `all_plugins` filter in `WP_Plugins_List_Table::prepare_items()` to directly precede the `apply_filters()` line.
See #35986.

git-svn-id: https://develop.svn.wordpress.org/trunk@36828 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-03 09:50:57 +00:00
Dominik Schilling (ocean90) 479596acda Plugins: Remove slashes from search terms and use `urldecode()` in non-URL contexts.
Fixes #35712.

git-svn-id: https://develop.svn.wordpress.org/trunk@36560 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 20:14:37 +00:00
Pascal Birchler cc6fe1179d Allow searching for `0` throughout the admin.
Fixes #31025.

git-svn-id: https://develop.svn.wordpress.org/trunk@36302 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 20:05:06 +00:00
Pascal Birchler 5209de6052 Plugins: Prevent a warning when searching in the plugins list table.
After [36182], plugin data contains compatibility info from the API, which is an array and cannot be searched.

Fixes #35461.

git-svn-id: https://develop.svn.wordpress.org/trunk@36301 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 19:59:06 +00:00
Konstantin Obenland c67abd1c66 Plugins: Avoid ID attribute collisions in plugins list table.
Removes id attributes with non-unique plugin slug and adds a data attribute
with the unique plugin file.

Props khag7.
Fixes #18974.



git-svn-id: https://develop.svn.wordpress.org/trunk@36205 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-06 22:39:23 +00:00
Helen Hou-Sandi 093707c534 Plugins: Provide a link to searching the plugin directory when no search results are found.
Many new users do not know the difference between managing installed plugins and those found in the plugin directory. This helps with discoverability. The link is not provided in multisite installs because we assume that somebody with that kind of power in a network is experienced enough not to need it. This can always be reconsidered later.

props mordauk for the initial patch.
fixes #29865.


git-svn-id: https://develop.svn.wordpress.org/trunk@35808 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-06 22:22:11 +00:00
Sergey Biryukov bb045e4e3c Replace a second instance of `<code>` in translatable string left in [35440].
Props ramiy.
See #34498.

git-svn-id: https://develop.svn.wordpress.org/trunk@35445 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-30 01:55:49 +00:00
Sergey Biryukov 9e8e68f001 Add `<code>` tag missed in [35440].
See #34498.

git-svn-id: https://develop.svn.wordpress.org/trunk@35441 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-30 01:11:53 +00:00
Sergey Biryukov 540e4b5edd Don't use `<code>` in translatable strings in `wp-admin/includes/class-wp-plugins-list-table.php`.
Add translator commments.

Props ramiy.
Fixes #34498.

git-svn-id: https://develop.svn.wordpress.org/trunk@35440 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-30 01:07:11 +00:00
Scott Taylor c6354d6bfd Plugins: after [35151], set default `$restrict_network_*` values to prevent notices.
Props johnjamesjacoby.
Fixes #20104.


git-svn-id: https://develop.svn.wordpress.org/trunk@35361 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-22 19:55:30 +00:00
Drew Jaynes 5a0fd03f95 Docs: Add missing file headers to the list table classes and adjust class DocBlocks accordingly.
See #33701.


git-svn-id: https://develop.svn.wordpress.org/trunk@35241 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 15:12:48 +00:00
John Blackbourn b5c3abcdfa Include network-active plugins and inactive network-only plugins on the Plugins listing screen for individual sites on Multisite.
These plugins are only shown to users with the `manage_network_plugins` capability, which is Super Admins by default. This new feature lowers the blood pressure of Super Admins who may browse or search the Plugins listing screen of an individual site, having forgotten that a particular plugin is network-active. Showing inactive network-only plugins here also reduces friction when searching the Plugins listing screen on individual sites.

This change introduces a `show_network_active_plugins` filter which controls whether the network-active plugins and inactive network-only plugins are shown. This can be used to enable this functionality for regular site admininstrators, or, indeed, to disable this functionality for Super Admins.

Fixes #20104


git-svn-id: https://develop.svn.wordpress.org/trunk@35151 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-13 22:11:36 +00:00
Jeremy Felt 599fb50e09 Revert [34778], continue using `_site_option()` for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34912 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 17:11:01 +00:00
John Blackbourn 780460af28 Remove the unnecessary dynamic prefix used in the `plugin_action_links` filter name, and in those of its brethren. This way, `network_admin_plugin_action_links` gets listed as a separate filter.
Fixes #34117


git-svn-id: https://develop.svn.wordpress.org/trunk@34786 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 23:43:20 +00:00
Jeremy Felt 3c177b8c6f MS: Use `*_network_option()` functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function.

This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation.

Props spacedmonkey.
See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34778 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 19:07:23 +00:00
John Blackbourn a6a00a3625 Implement 'Recently Active' functionality for network-wide plugins in the Network Admin.
Fixes #20468
Thanks to WordCamp RI attendees for testing!


git-svn-id: https://develop.svn.wordpress.org/trunk@34551 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-25 19:15:08 +00:00
Scott Taylor 2ddc438111 List Tables: when comparing string literals (non-numeric in nature) against vars, strict comparison can/should be used.
Props wonderboymusic, Viper007Bond.
Fixes #21249.


git-svn-id: https://develop.svn.wordpress.org/trunk@34383 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 06:05:39 +00:00
Scott Taylor ab7ca361dd In `WP_List_Table`, make a new `public` method, `->get_primary_column()`, and revert [34101] due to BC issues.
Fixes #33854.


git-svn-id: https://develop.svn.wordpress.org/trunk@34128 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-14 20:28:29 +00:00