Commit Graph

240 Commits

Author SHA1 Message Date
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
47ed56f38f 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.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
Sergey Biryukov
037a736757 Docs: Improve comments in some wp-admin files per the documentation standards.
Follow-up to [47084].

Props passoniate, apedog.
Fixes #49223, #49227.
Built from https://develop.svn.wordpress.org/trunk@47119


git-svn-id: http://core.svn.wordpress.org/trunk@46919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:35:08 +00:00
Sergey Biryukov
2900bb8ea7 Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47088


git-svn-id: http://core.svn.wordpress.org/trunk@46888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-20 03:14:06 +00:00
Sergey Biryukov
f501814eac Upgrade/Install: When creating the .htaccess file in insert_with_markers(), make sure it has 0644 as a minimum set of permissions.
Props rcutmore, dd32, i3anaan.
Fixes #40572.
Built from https://develop.svn.wordpress.org/trunk@47005


git-svn-id: http://core.svn.wordpress.org/trunk@46805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-22 02:45:03 +00:00
John Blackbourn
eda6a9e111 Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.
See #48303

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


git-svn-id: http://core.svn.wordpress.org/trunk@46462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-05 21:30:03 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa 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.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Sergey Biryukov
b1e34ccc1f Docs: Add missing description for $wp_rewrite global.
See #45604, #47110.
Built from https://develop.svn.wordpress.org/trunk@45735


git-svn-id: http://core.svn.wordpress.org/trunk@45546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 01:19:56 +00:00
Sergey Biryukov
c9942bb3d8 Coding Standards: Fix WPCS violations in [45694].
See #47466.
Built from https://develop.svn.wordpress.org/trunk@45696


git-svn-id: http://core.svn.wordpress.org/trunk@45507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-28 16:52:56 +00:00
Sergey Biryukov
e7abdc7040 Docs: Improve the DocBlocks for got_mod_rewrite(), extract_from_markers(), insert_with_markers().
See #47110.
Built from https://develop.svn.wordpress.org/trunk@45695


git-svn-id: http://core.svn.wordpress.org/trunk@45506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-28 16:35:56 +00:00
Sergey Biryukov
67e5038470 Rewrite Rules: Add a comment to # BEGIN/END .htaccess markers to clarify that the directives are dynamically generated, and should only be modified via WordPress filters.
Introduce `insert_with_markers_inline_instructions` filter to modify the default instructions text.

Props bradleyt, SergeyBiryukov.
Fixes #47466.
Built from https://develop.svn.wordpress.org/trunk@45694


git-svn-id: http://core.svn.wordpress.org/trunk@45505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-28 16:31:57 +00:00
Gary Pendergast
a02b5cc2a8 Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-05 01:45:56 +00:00
Gary Pendergast
cf3fa9f7c8 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 12:52:01 +00:00
Gary Pendergast
55af0f0d0a Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632


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


git-svn-id: http://core.svn.wordpress.org/trunk@45391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 08:01:57 +00:00
Andrew Ozz
87acdab81d Privacy tools: Organize privacy functions into logical files and classes.
Props xkon, birgire, desrosj, garrett-eclipse, azaozz.
See #43895.
Built from https://develop.svn.wordpress.org/trunk@45448


git-svn-id: http://core.svn.wordpress.org/trunk@45259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 20:50:53 +00:00
John Blackbourn
d4d1267847 I18N: Improvements to and additions of translator comments for various email subject strings.
Props ramiy

Fixes #46920

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


git-svn-id: http://core.svn.wordpress.org/trunk@45013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-15 22:39:50 +00:00
aduth
41022dc6f2 Privacy: Remove unnecessary translation from help notice action label.
As static markup, the Privacy Policy editor help notice link no longer needs to be translateable with the revisions included in [45174].

Props garrett-eclipse.
Fixes #46098. See [45174].

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


git-svn-id: http://core.svn.wordpress.org/trunk@44989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-12 20:44:52 +00:00
aduth
7f456cab7d Privacy: Display help notice on block editor screen.
Use the Notices data module when viewing the block editor screen for the assigned Privacy Policy page to display a help notice.

Props garrett-eclipse, joen, xkon.
Fixes #46098.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-12 18:19:51 +00:00
Sergey Biryukov
8ea4da0826 Privacy: Update default privacy policy text to match the current behavior of setting a temporary cookie on visiting the login page.
Props mechter, subrataemfluence, garrett-eclipse.
Fixes #44175.
Built from https://develop.svn.wordpress.org/trunk@44987


git-svn-id: http://core.svn.wordpress.org/trunk@44818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-23 10:54:53 +00:00
aduth
9cf4ee65a7 Scripts: Assign api-fetch nonce with corrected rest_nonce.
As of `@wordpress/api-fetch@3.0.0` (introduced in 44812), the `apiFetch` nonce middleware must have its nonce value assigned explicitly, and will no longer listen for heartbeat ticks automatically. This changeset adds an inline script for the default registration of the `api-fetch` script handle to assign the nonce value in response to the heartbeat action. In doing so, it removes the now-unused, misnamed `rest-nonce` property from the heartbeat response, whose original introduction served as temporary compatibility with earlier versions of `@wordpress/api-fetch`.

See https://github.com/WordPress/gutenberg/pull/13451
See #45113

Props adamsilverstein, nerrad .
Fixes #46107 .

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


git-svn-id: http://core.svn.wordpress.org/trunk@44780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-20 20:53:50 +00:00
Felix Arntz
3120fe36c9 General: Introduce wp_is_php_version_acceptable filter to make the check for triggering PHP version warnings stricter.
The filter is only run if the wordpress.org API considers the PHP version acceptable. This ensures that other plugins or hosting providers can only make this check stricter, but not loosen it.

Props j-falk, mikeschroder.
Fixes #46065.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-04 21:14:50 +00:00
Aaron Jorbin
71cf332e65 Replace usages of basename() with wp_basename() in order to support multibyte filenames
This is focused on the pieces of code that touch media files and the tests that support them. `basename` isn't multibyte compatible out of the box. See http://php.net/basename and https://bugs.php.net/bug.php?id=62119.

See #43170.
Props Viper007Bond.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-01 20:58:52 +00:00
Sergey Biryukov
e57fcaeeee Privacy: Escape Privacy Policy guide URL in in Privacy Policy edit page notice.
Props itowhid06, garrett-eclipse.
Fixes #44761.
Built from https://develop.svn.wordpress.org/trunk@44779


git-svn-id: http://core.svn.wordpress.org/trunk@44611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-28 12:08:49 +00:00
Peter Wilson
729c8e875f Admin: Improve logic of PHP version check on about page.
Props noisysocks, peterwilsoncc.
See #46161.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-08 01:53:51 +00:00
Sergey Biryukov
f93ccded3f Docs: Correct type and description for the first parameter of set-screen-option filter.
Props pbiron, burhandodhy.
Fixes #44850.
Built from https://develop.svn.wordpress.org/trunk@44667


git-svn-id: http://core.svn.wordpress.org/trunk@44498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-21 16:08:51 +00:00
desrosj
67bec96f92 Privacy: Improve the ’Copy’ button verbiage to provide more clarity.
On the Privacy Policy Guide, there is currently a ‘Copy’ button below each section of suggested text. It is unclear what copy means without more context. It could be assumed, for instance, that the suggested text is copied to a new page.

This changes the button text to read `Copy this section to clipboard` to more clearly inform the user what is copied and how.

Props JoshuaWold, garrett-eclipse, birgire, vishaldodiya.
Fixes #44677.
Built from https://develop.svn.wordpress.org/trunk@44629


git-svn-id: http://core.svn.wordpress.org/trunk@44460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 22:45:50 +00:00
Gary Pendergast
8c702e04f3 Rewrite: Remove extra arguments being passed to WP_Rewrite::iis7_url_rewrite_rules().
Props rafsuntaskin.
Fixes #44185.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:10:50 +00:00
desrosj
51155f3989 Docs: Specify missing global variables used in wp_print_theme_file_tree().
The `$relative_file` and `$stylesheet` variables are used in the `wp_print_theme_file_tree()` function but were not noted within the inline documentation.

Props mukesh27, desrosj,
Fixes #43682.
Built from https://develop.svn.wordpress.org/trunk@44477


git-svn-id: http://core.svn.wordpress.org/trunk@44308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 18:33:49 +00:00
desrosj
1f6da37438 Docs: Fix order of parameter type and variable name.
The order of the type and variable name in the `param` tags for the `wp_get_default_privacy_policy_content` filter is incorrectly reversed. This moves the two into the correct order.

Props ishitaka, mukesh27.
Fixes #45416.
Built from https://develop.svn.wordpress.org/trunk@44475


git-svn-id: http://core.svn.wordpress.org/trunk@44306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 17:03:48 +00:00
Gary Pendergast
fe837d19a7 Docs: Fix the @param type for wp_make_plugin_file_tree().
`$plugin_editable_files` is an `array`, not a `string`.

Props subrataemfluence.
Fixes #45593.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 06:02:51 +00:00
desrosj
4818f7e3f7 Administration: Update default fallback color for SVG icons.
Currently, when an SVG is used as a menu icon, the color is inconsistent with the other, default dashicons and the contrast ratio does not meet the minimum requirement for accessibility.

This updates the base color for the default `fresh` color scheme to ensure consistency and proper contrast.

Props swift, dschalk.
Fixes #44209.
Built from https://develop.svn.wordpress.org/trunk@44353


git-svn-id: http://core.svn.wordpress.org/trunk@44183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-20 19:01:48 +00:00
desrosj
38d1e7233d Block Editor: Show privacy help notice on Privacy Policy page.
When editing a page set to be the Privacy Policy page, display a help notice
containing a link to the Privacy Policy guide.

Merges [43920] to trunk.

Fixes #45057.
Built from https://develop.svn.wordpress.org/trunk@44291


git-svn-id: http://core.svn.wordpress.org/trunk@44121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 16:14:49 +00:00
desrosj
03262a191f Block Editor: Refresh nonces used by wp.apiFetch.
Adds heartbeat nonces refreshing support to `wp.apiFetch` requests.

Props pento, adamsilverstein, dd32, desrosj, youknowriad.

Merges [43939] into trunk.

Fixes #45113. 
Built from https://develop.svn.wordpress.org/trunk@44275


git-svn-id: http://core.svn.wordpress.org/trunk@44105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:28:51 +00:00
Gary Pendergast
4739b8147b Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:43:52 +00:00
Sergey Biryukov
f7ba175491 Docs: Correct @since value for _wp_privacy_statuses().
Fix typo in `@since` entry for `WP_Privacy_Policy_Content:add()`.

Props dimadin.
Fixes #44915.
Built from https://develop.svn.wordpress.org/trunk@43638


git-svn-id: http://core.svn.wordpress.org/trunk@43467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-09-13 10:20:24 +00:00
Sergey Biryukov
c714ad082d Docs: Correct parameter type for WP_Privacy_Policy_Content::notice().
Props burhandodhy.
Fixes #44877.
Built from https://develop.svn.wordpress.org/trunk@43609


git-svn-id: http://core.svn.wordpress.org/trunk@43438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-09-03 14:15:25 +00:00
Gary Pendergast
56c162fbc9 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Sergey Biryukov
172aa4aa3e Privacy: Enable pagination screen options for privacy requests list tables.
Props birgire, pbiron.
Fixes #44025.
Built from https://develop.svn.wordpress.org/trunk@43486


git-svn-id: http://core.svn.wordpress.org/trunk@43313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:04:24 +00:00
Sergey Biryukov
4faf05ca6a Privacy: Change @since entry for _wp_privacy_settings_filter_draft_page_titles() added in [43376] to 4.9.8.
See #44100.
Built from https://develop.svn.wordpress.org/trunk@43454


git-svn-id: http://core.svn.wordpress.org/trunk@43281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 13:48:25 +00:00
Andrew Ozz
7e9be993e6 Privacy: append (Draft) to draft page titles in the page drop-down on the Privacy Settings screen.
Props allendav, desrosj.
Fixes #44100.
Built from https://develop.svn.wordpress.org/trunk@43376


git-svn-id: http://core.svn.wordpress.org/trunk@43204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:42:29 +00:00
John Blackbourn
0aa2902436 Security: Harden the random aspect of the hash used for user profile and admin email address changes.
Props BjornW

Fixes #43771

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


git-svn-id: http://core.svn.wordpress.org/trunk@43195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:38:43 +00:00
Sergey Biryukov
593848e9dc Docs: Correct inline comment added in [43361] for consistency with other comments.
See #44142.
Built from https://develop.svn.wordpress.org/trunk@43363


git-svn-id: http://core.svn.wordpress.org/trunk@43191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:37:00 +00:00
Sergey Biryukov
d35f9813f1 Docs: Add missing @return value for save_mod_rewrite_rules() and iis7_save_url_rewrite_rules().
See #44142.
Built from https://develop.svn.wordpress.org/trunk@43362


git-svn-id: http://core.svn.wordpress.org/trunk@43190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:36:35 +00:00
Sergey Biryukov
40cfcfc222 Privacy: Make sure wp_add_privacy_policy_content() does not cause a fatal error by unintentionally flushing rewrite rules outside of the admin context.
Add a `_doing_it_wrong()` message describing the correct usage of the function.

Props kraftbj, azaozz, SergeyBiryukov, YuriV.
Fixes #44142.
Built from https://develop.svn.wordpress.org/trunk@43361


git-svn-id: http://core.svn.wordpress.org/trunk@43189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:36:09 +00:00
Sergey Biryukov
947a12f2b2 Privacy: Fix typo in default privacy policy text.
Props garetharnold, abdullahramzan.
Fixes #44166.
Built from https://develop.svn.wordpress.org/trunk@43350


git-svn-id: http://core.svn.wordpress.org/trunk@43178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:31:31 +00:00
Andrew Ozz
8c06c2c662 Privacy: only remove the "Suggested text has changed" bubble when an admin visits the Privacy Policy Guide screen.
Fixes #44063.
Built from https://develop.svn.wordpress.org/trunk@43269


git-svn-id: http://core.svn.wordpress.org/trunk@43098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-14 17:52:21 +00:00
Andrew Ozz
242e6eea46 Privacy: fix markup for the table of contents on privacy policy guide screen.
Props ocean90, azaozz.
Fixes #44056.
Built from https://develop.svn.wordpress.org/trunk@43265


git-svn-id: http://core.svn.wordpress.org/trunk@43094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-14 16:46:23 +00:00
Andrew Ozz
b5564c8646 Privacy: fix the "Privacy Policy Guide updated" message and add a link to the guide.
Props birgire, azaozz.
Fixes #44057.
Built from https://develop.svn.wordpress.org/trunk@43263


git-svn-id: http://core.svn.wordpress.org/trunk@43092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-14 16:21:21 +00:00
Dominik Schilling
2d4311e32e Privacy: Remove is-dismissible class from notice when privacy info has changed.
The notice isn't dismissible as it only gets removed once you visit the privacy guide, see #44057 and #44063.

Fixes #44065.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-14 15:55:21 +00:00