Commit Graph

117 Commits

Author SHA1 Message Date
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov 6bdc961d5f Docs: Improve comments in some `wp-admin` files per the documentation standards.
Follow-up to [47084].

Props passoniate, apedog.
Fixes #49223, #49227.

git-svn-id: https://develop.svn.wordpress.org/trunk@47119 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:33:45 +00:00
Sergey Biryukov e21792cb37 Docs: Add `requires_php` to the list of fields returned by `plugins_api()`.
Props ediamin.
Fixes #48291.

git-svn-id: https://develop.svn.wordpress.org/trunk@46463 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-12 02:33:13 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Sergey Biryukov a7513ac8e0 I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 17:12:43 +00:00
Gary Pendergast 9a1549767e Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-admin`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 12:50:14 +00:00
Andrea Fercia 725c77a13d Plugins: Fix the plugin details modal layout after [45520].
Props mukesh27, marybaum, audrasjb.
Fixes #47561.


git-svn-id: https://develop.svn.wordpress.org/trunk@45563 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 14:10:29 +00:00
Sergey Biryukov a6fa4b5491 General: Update support forum links.
There are a lot of places in Core that link to https://wordpress.org/support/ for the support forums, but that's now the URL for HelpHub. The new forums link is https://wordpress.org/support/forums/.

This is a follow-up to [45140], which changed the links in help tabs.

Props dilipbheda.
Fixes #47239. See #46790.

git-svn-id: https://develop.svn.wordpress.org/trunk@45412 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-25 14:23:27 +00:00
Sergey Biryukov 78e868e4c7 Plugins: Introduce `is_wp_version_compatible()` and `is_php_version_compatible()` for checking compatibility with the current WordPress or PHP version.
Props afragen.
Fixes #46599.

git-svn-id: https://develop.svn.wordpress.org/trunk@45185 602fd350-edb4-49c9-b593-d223f7449a82
2019-04-12 23:55:19 +00:00
Jonathan Desrosiers 97bb59d939 Plugins: Block plugin updates if required PHP version is not supported.
When a plugin states it requires a specific minimum PHP version (as defined in the `requires_php` field included in the plugin update API response), a user should not be allowed to update that plugin when the server does not satisfy the minimum PHP version.

When this scenario is encountered, the update buttons and links are disabled and links to educational resources about PHP are displayed to the user with a notice.

Props afragen, schlessera, desrosj.
Fixes #43987. 

git-svn-id: https://develop.svn.wordpress.org/trunk@44937 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-20 01:43:05 +00:00
Felix Arntz f518dea0bc Upgrade/Install: Make `version_compare()` calls for plugin required version checks more robust.
Props afragen.
Fixes #46024. See #43986.


git-svn-id: https://develop.svn.wordpress.org/trunk@44656 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-20 12:02:02 +00:00
Felix Arntz 17e5f4ad0b Plugins: Use centralized API to display information about updating PHP when a plugin requires a higher version.
This changeset uses the API functions introduced in [44476] to link to the resource about updating PHP when highlighting a plugin's required PHP version is not met. It furthermore expands them, introducing a new `wp_update_php_annotation()` function that prints the markup to indicate that the default URL has been altered by the web host, allowing it to be reused universally.

Furthermore, this changeset adds missing `update_php` capability checks before displaying the information about updating PHP.

Props afragen.
Fixes #45986. See #43986, #45686.


git-svn-id: https://develop.svn.wordpress.org/trunk@44627 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-16 17:05:37 +00:00
Gary Pendergast 992184cf73 Coding Standards: Upgrade WPCS to 1.2.1.
This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.



git-svn-id: https://develop.svn.wordpress.org/trunk@44574 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 06:40:16 +00:00
Sergey Biryukov 6d8e3c5864 Plugins: Use newer "Updating PHP" page URL in the notice displayed when a plugin requires a higher PHP version.
Props afragen.
Fixes #43986. See #45686.

git-svn-id: https://develop.svn.wordpress.org/trunk@44420 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-07 15:34:34 +00:00
Jonathan Desrosiers 7cda2404b5 PHP 7.3 Compatibility: Fix compact related notices.
In PHP 7.3, the `compact()` function has been changed to issue an `E_NOTICE` level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. This fixes a few more instances of unset variables in the WordPress admin.

The full RFC can be viewed here: https://wiki.php.net/rfc/compact.

See #44416.

Merges [44185] into trunk.

Fixes #45483.

git-svn-id: https://develop.svn.wordpress.org/trunk@44297 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-18 21:59:00 +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
Gary Pendergast cb3d1777b1 Coding Standards: Prepare for upgrading WPCS to 1.0.0.
In order to get the best result when running `phpcbf` across the codebase, there are some manual tweaks we need to make.

These fall into three categories:
- Fixing incorrectly indented code which has flow-on effects when auto-fixing.
- Tweaking the layout of inline PHP inside HTML tags.
- Moving more complex inline PHP inside HTML tags, to execute earlier.

See #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43569 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-15 06:22:00 +00:00
Sergey Biryukov 7569772234 Plugins: Disable "Install Now" button for plugins that require a higher version of PHP or WordPress.
Display a notice with an explanation and the steps required to resolve the issue.

Props afragen, schlessera, flixos90, nerrad, melchoyce, boemedia, hedgefield, joyously, johnalarcon, lakenh, afercia, acirujano, ibantxillo, SergeyBiryukov.
Fixes #43986.

git-svn-id: https://develop.svn.wordpress.org/trunk@43436 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-09 13:44:53 +00:00
John Blackbourn a131758bf5 Plugins: Correct another instance of incorrect parameter ordering when displaying plugins with more than one million active installations.
See #43193


git-svn-id: https://develop.svn.wordpress.org/trunk@43179 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-07 21:42:47 +00:00
Sergey Biryukov 6d2bcaa9b3 Administration: Change all the occurrences of "(opens in a new window)" to "(opens in a new tab)".
Props chetan200891, ianbelanger, afercia.
Fixes #43803.

git-svn-id: https://develop.svn.wordpress.org/trunk@43174 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-05 09:44:21 +00:00
Felix Arntz f3150c77c5 Plugins: Show the required PHP version in the plugin details view, if specified.
Props xkon.
Fixes #43650.


git-svn-id: https://develop.svn.wordpress.org/trunk@42998 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-24 11:40:25 +00:00
Dion Hulse 36d237cc13 Plugins: Add support for plugins having an `active_installs` value larger than 1 million.
WordPress.org currently supports up to 5 million, and with the growth of WordPress, it's expected that that upper bound will increase in the future.

Fixes #43193.


git-svn-id: https://develop.svn.wordpress.org/trunk@42829 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-12 01:56:20 +00:00
Sergey Biryukov 88d00c0fac Plugins: Use correct variable name in `install_plugin_information()`.
Props afragen.
Fixes #43282. See #43192, #29274.

git-svn-id: https://develop.svn.wordpress.org/trunk@42686 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-10 22:07:40 +00:00
Dion Hulse e0d5a8ac54 Plugins: Use `api.wordpress.org/plugins/info/1.2/` for querying plugins & plugin information.
See #43192.
Fixes #29274.


git-svn-id: https://develop.svn.wordpress.org/trunk@42631 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 05:16:15 +00:00
Sergey Biryukov 842b3a2378 Plugins: Update review filter links in Details modal.
Props darko-a7, afercia.
Fixes #43016. See #meta3379.

git-svn-id: https://develop.svn.wordpress.org/trunk@42459 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 00:14:48 +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
Dion Hulse 2ff224a044 Standardise on performing api.WordPress.org requests over SSL when possible, falling back to non-SSL when appropriate.
This also standardises the `User-Agent` used when communicating with WordPress.org, allowing for more consistent version detection.

Fixes #42004.


git-svn-id: https://develop.svn.wordpress.org/trunk@41605 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 07:59:14 +00:00
John Blackbourn 8df2151660 General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
Dominik Schilling (ocean90) 2dbc6ea67b Plugins: Don't strip line breaks and blockquote elements in the plugin information modal.
Fixes #40679.

git-svn-id: https://develop.svn.wordpress.org/trunk@40633 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:15:30 +00:00
Sergey Biryukov 7faf699c69 I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.
Props ramiy, SergeyBiryukov.
Fixes #38880.

git-svn-id: https://develop.svn.wordpress.org/trunk@39325 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:51:39 +00:00
Sergey Biryukov 4f033e5487 I18N: Allow for WordPress Plugin Directory URL in plugin details modal to be localized.
Props Soean.
Fixes #38495. See #37501.

git-svn-id: https://develop.svn.wordpress.org/trunk@38953 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-26 12:16:14 +00:00
Pascal Birchler 9639758d1c Docs: Improve documentation for `install_plugin_install_status()`.
Props clarionwpdeveloper, sudar.
Fixes #36912.

git-svn-id: https://develop.svn.wordpress.org/trunk@38805 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-17 08:29:30 +00:00
Andrea Fercia 7ce67a141d Administration: Better consistency for the Media, Add Plugins, and Add Themes toolbars.
Fixes the Add Themes toolbar padding. Standardizes the placeholders to no title
case and three trailing dots. Expands the Media search placeholder in
"Search media items..." for consistency with the Plugins and Themes toolbars.

Props mikeviele, jamesacero, mattking5000, koenschipper, dungengronovius.

Fixes #38010.


git-svn-id: https://develop.svn.wordpress.org/trunk@38795 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-14 21:32:08 +00:00
Dion Hulse 1bd6d19f80 Plugins: Display 'Less Than 10' active installs of a plugin rather than '0+' active installs.
Props ovann86.
Fixes #37509.


git-svn-id: https://develop.svn.wordpress.org/trunk@38729 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-05 03:32:41 +00:00
Pascal Birchler f231e7233d I18N: Introduce a user-specific language setting.
By enabling the user to select their preferred locale when editing the profile, we allow for greater personalization of the WordPress admin and therefore a better user experience.

The back end will be displayed in the user's individual locale while the locale used on the front end equals the one set for the whole site. If the user didn't specify a locale, the site's locale will be used as a fallback. The new `locale` property of the `WP_User` class can be used to retrieve the user's locale setting.

Props ocean90, ipm-frommen, swissspidy.
Fixes #29783.

git-svn-id: https://develop.svn.wordpress.org/trunk@38705 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 07:03:41 +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
Scott Taylor 1825eff382 General: use `get_bloginfo( 'version' )` instead of `global $wp_version` in several locations - excluding those locations which reload `version.php` mid-flight.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38459 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 05:48:49 +00:00
Sergey Biryukov afd7e3b16d I18N: Allow for WordPress Plugin/Theme Directory URLs to be localized.
Props ramiy.
Fixes #37501.

git-svn-id: https://develop.svn.wordpress.org/trunk@38325 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 01:18:53 +00:00
Dominik Schilling 44676ab38f Plugins: Improve Ajax search of new plugins.
Fixes a few accessibility issues, restores the "Search Results" tab and the search type selector, and improves compatibility with older browsers.

Props rahulsprajapati, swissspidy, adamsilverstein, ocean90
See #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38119 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:31:50 +00:00
Dominik Schilling 408ac29bfb Docs: Fix a typo in the DocBlock for `themes_api()`, `themes_api`, `plugins_api()`, and `plugins_api`.
See #32246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38025 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-09 14:38:33 +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 e4b26366e4 Plugin Install: show the upload form in place rather than sending users to the devoted upload plugin page.
Props Ipstenu, ericlewis, michaelarestad.

Fixes #35429.

git-svn-id: https://develop.svn.wordpress.org/trunk@37221 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-16 16:42:48 +00:00
Dominik Schilling (ocean90) 7ef7a98dd1 Plugins: Use correct placeholder for the number of reviews.
`number_format_i18n()` returns a string, not an integer.

See #35111.
Fixes #36395.

git-svn-id: https://develop.svn.wordpress.org/trunk@37156 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-02 11:16:32 +00:00
Dominik Schilling (ocean90) 6bf0509046 I18N: Clarify translator comment for an a11y label added in [36618].
Props TacoVerdo.
See #35111.
Fixes #36396.

git-svn-id: https://develop.svn.wordpress.org/trunk@37155 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-02 11:11:52 +00:00
Aaron Jorbin bd0c3bf0c7 Add Nonce to updating wporg_favorites user meta field
git-svn-id: https://develop.svn.wordpress.org/trunk@37145 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-30 18:35:37 +00:00
Andrea Fercia bf528d321d Accessibility: Remove title attributes from the Plugin details modal.
Also, improves accessibility of the star rating reviews links.

Fixes #35111.

git-svn-id: https://develop.svn.wordpress.org/trunk@36618 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-22 23:17:21 +00:00
Pascal Birchler d2b96ce6b9 Plugins: Make sure the 'Beta testing' tab is first in the plugin installer.
This makes feature plugins more discoverable for people running development builds.

Fixes #29631.

git-svn-id: https://develop.svn.wordpress.org/trunk@36297 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 09:06:12 +00:00
Konstantin Obenland e4b8679d17 Plugins: Use plugin file rather than slug as identifier
The plugin file is unique while there can be more than one plugin with the
same slug. This also allows us to simplify the way updates from the plugin
detail iframe are executed.

See [36205].
Fixes #35350.



git-svn-id: https://develop.svn.wordpress.org/trunk@36221 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-08 17:47:18 +00:00