3930 Commits

Author SHA1 Message Date
Sergey Biryukov
7cd0ff4812 Tests: Use an image on WordPress.org CDN in external HTTP tests.
Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.6 branch.

Props peterwilsoncc, jorbin.
See #60865.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@57995 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-15 12:27:18 +00:00
Jb Audras
fdf14d0c4a Grouped backports to the 5.6 branch.
- Media: Prevent CSRF setting attachment thumbnails.
- Embeds: Add protocol validation for WordPress Embed code.
- I18N: Introduce sanitization function for locale.
- Editor: Ensure block comments are of a valid form.

Merges [55760-55764] to the 5.6 branch.
Props dd32, isabel_brison, martinkrcho, matveb, ocean90, paulkevan, peterwilsoncc, timothyblynjacobs, xknown, youknowriad.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@55781 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-16 15:40:27 +00:00
Peter Wilson
a5f8ceb60a Built/Test tools, HTTP API: Refactor test for multiple location headers.
Remove wordpress.org as an external dependency testing `WP_HTTP::handle_redirects()`.

This refactors and reenables an existing test to call the `WP_HTTP::handle_redirects()` method directly with a mocked array of HTTP headers containing multiple location headers.

The test is moved from the external-http group to the http test group as it no longer makes an HTTP request.

Follow up to [54955].

Props SergeyBiryukov, dd32, peterwilsoncc.
Merges [54968] to the 5.6 branch.
Fixes #57306.
See #56793.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@54979 602fd350-edb4-49c9-b593-d223f7449a82
2022-12-15 04:27:04 +00:00
Jb Audras
36248b2a4f Grouped backports to the 5.6 branch.
- Editor: Bump @wordpress packages for the branch,
- Media: Refactor search by filename within the admin,
- REST API: Lockdown post parameter of the terms endpoint,
- Customize: Escape blogname option in underscores templates,
- Query: Validate relation in `WP_Date_Query`,
- Posts, Post types: Apply KSES to post-by-email content,
- General: Validate host on "Are you sure?" screen,
- Posts, Post types: Remove emails from post-by-email logs,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Mail: Reset PHPMailer properties between use,
- Comments: Apply kses when editing comments,
- Widgets: Escape RSS error messages for display.

Merges [54521-54530] to the 5.6 branch.
Props audrasjb, costdev, cu121, dd32, davidbaumwald, ehtis, johnbillion, johnjamesjacoby, martinkrcho, matveb, oztaser, paulkevan, peterwilsoncc, ravipatel, SergeyBiryukov, talldanwp, timothyblynjacobs, tykoted, voldemortensen, vortfu, xknown.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@54555 602fd350-edb4-49c9-b593-d223f7449a82
2022-10-17 17:56:34 +00:00
Peter Wilson
f6bc4ec879 Tests: Replace the timezone used in date/time tests.
The `Europe/Kiev` timezone has been deprecated in PHP 8.2 and replaced with `Europe/Kyiv`.

The tests updated in this commit are testing the WordPress date/time functionality. They are **not** testing whether WP or PHP can handle deprecated timezone names correctly.

To ensure the tests follow the original purpose, the use of `Europe/Kiev` within these tests is now replaced with the `Europe/Helsinki` timezone, which is within the same timezone as `Europe/Kyiv`. This should ensure that these tests run without issue and test what they are supposed to be testing on every supported PHP version (unless at some point in the future `Europe/Helsinki` would be renamed, but that's a bridge to cross if and when).

Note: Separate tests should/will be added to ensure that relevant date/time related functions handle a deprecated timezone correctly, but that is not something ''these'' tests are supposed to be testing.

Follow-up to [45853], [45856], [45876], [45882], [45887], [45908], [45914], [46577], [46154], [46580], [46864], [46974], [54207].

Props jrf, costdev, SergeyBiryukov.
Merges [54217] to the 5.6 branch.
See #56468.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@54516 602fd350-edb4-49c9-b593-d223f7449a82
2022-10-14 07:00:08 +00:00
Tonya Mork
2283fe0cbf Build/Test Tools: Fix test forward-compatibility layer.
In [51840], the test wrapper methods were not being called due to the names not being recognized as supported PHPUnit "hook" names for fixtures.

This commit:
- Fixes the problem by adding extra camelCase wrappers to the `WP_UnitTestCase` to call the methods in the right order.
- Adds wrappers for the `assertPreConditions()` and `assertPostConditions()` fixture methods to make the backport feature complete for the fixture wrappers.

Test wrapper methods call fix:

By adding method overloads for the PHPUnit native camelCase fixture methods and letting those call the (camelCase) parent method first and only calling the snake_case fixture methods after, the snake_case methods can be supported and the typical run order safeguarded.

As not all test classes will have declared snake_case fixture methods, the snake_case fixture methods are also declared in the `WP_UnitTestCase`. Why? This prevents having to wrap these method calls in `method_exists()` conditions checking for the existence of the snake_case methods in an unknown Test child class. And with the normal inheritance rules in combination with calling the method using `static`, the right method will be called anyway without fatal "calling undeclared method" errors.

Note: While it will be rare, there ''may'' be cases where a test class does not adhere to the normal execution order for fixtures, i.e. for the setup methods, parent first, own code second; and for the teardown methods, own code first, parent second. For example a test class which has "some code - `parent::setUp()` call - some more code" in their `setUp()` method. In those (rare) cases, the execution order of the code will now be changed, which may have side-effects. This rare case will be identified in the dev note.

Follow-up to [51840].

Props bjorsch, swissspidy, jrf, hellofromTonya.
See #53911.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51863 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-24 13:54:12 +00:00
Jonathan Desrosiers
279d36ebf3 Build/Test Tools: Introduce the PHPUnit Polyfills package for easier cross branch testing.
This backports the PHPUnit Polyfills package and related test infrastructure changes to make it easier for developers to continue testing on multiple versions WordPress while adding tests for newer versions of PHP, which require more modern PHPUnit practices.

One of the changes included is the addition of wrappers for the new snake_case fixture methods in PHPUnit. This allows the native camelCase standard in PHPUnit to be used, but allows for developers to transition to the new naming conventions.

Props hellofromTonya, jrf, SergeyBiryukov, johnbillion, netweb, schlessera, jeherve, lucatume, desrosj.
Merges [51559,51560,51810-51813,51828] to the 5.6 branch.
See #53911.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51840 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-21 19:29:38 +00:00
Jonathan Desrosiers
a9f2b0fa8f Grouped merges for 5.6.3.
* REST API: Allow authors to read their own password protected posts.
* About page update.

Merges [50717] to the 5.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50726 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 01:06:00 +00:00
Jonathan Desrosiers
8aeb41e2bc Build/Test Tools: Backport GitHub Action and build improvements to the 5.6 branch.
This backports several build and test tool improvements to the 5.6 branch. Most notably, this includes:

- The changes required to allow each workflow to be triggered by the `workflow_dispatch` event so that tests can be run on a schedule [50590].
- The ability to run PHPUnit tests from `src` instead of `build` [50441-50443].
- Splitting single site and multisite tests into parallel jobs [50379].
- Split slow tests into separate, parallel jobs for PHP 5.6 [50444].
- Better branch and path scoping for GitHub Action workflows when running on `pull_request` [50432,50479].
- Several `devDependency` updates.

Merges [50267,50299,50379,50387,50413,50416,50432,50435-50436,50441-50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50592,50598] to the 5.6 branch.
See #50401, #51734, #51801, #51802, #52548, #52608, #52612, #52623, #52624, #52625, #52645, #52653, #52658, #52660, #52667, #52786.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50602 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 17:21:35 +00:00
Jonathan Desrosiers
8aa4153d3b Build/Test Tools: Fix tests after [50186].
This removes a test assertion defending against version ranges in the `node` value in `package.json` files. This is now supported.

Props peterwilsoncc.
Merges [50192] to the 5.6 branch.
See #52341.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50193 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 03:38:58 +00:00
Sergey Biryukov
829d7880c3 Tests: Set up the plugin download in multisite plugin tests to come locally.
This brings consistency between single site and multisite in REST API plugin installation tests.

Previously, multisite tests were unnecessarily downloading the plugin from WordPress.org on each test run, causing external HTTP requests and leading to failures in case of a timeout.

Follow-up to [48242], [49491], [49913].

Merges [49951] to the 5.6 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50085 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 10:39:20 +00:00
Sergey Biryukov
2aa72a9f78 Tests: Disable update checks while running REST API plugin installation tests.
This prevents external HTTP requests that are not required for the tests in question and may interfere with the results in case of a timeout.

Follow-up to [48242], [49491].

Merges [49913] to the 5.6 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50083 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 10:36:38 +00:00
Jake Spurlock
3bf49fdece REST API: Only include the controller's own taxonomy in it's schema.
Previously, all taxonomies were incorrectly exposed as possible values.

This commit brings the changes from [49922] to the 5.6 branch.

Props johnbillion, TimothyBlynJacobs.

Fixes #51940.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50047 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:52:01 +00:00
Jake Spurlock
858410ad79 App Passwords: Only attempt auth if the username and password are set.
Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the PHP_AUTH_USER field.

This brings the changes from [49919] to the 5.6 branch.

Props MadtownLems, johnbillion, richard.tape, engahmeds3ed, TimothyBlynJacobs.

Fixes #52003.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50045 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:31:10 +00:00
Jake Spurlock
37db115fef Privacy: Ensure that exported user data reports can't be found with directory listings.
By moving from .html to .php files, we can prevent directory listings, and ensure that WordPress can load.

This brings the changes from [50037] to the 5.6 branch.

Fixes #52299.

Props lucasbustamante, xkon, freewebmentor, SergeyBiryukov, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50038 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-27 23:47:43 +00:00
Ian Dunn
b5cc4dc44a Feed: Merge multiple header values to avoid fatal error.
When SimplePie parses HTTP headers, it combines multiple values for the same header into a comma-separated string. `WP_SimplePie_File` overrides the parsing, but was leaving them as an array instead.

That lead to a fatal error in PHP 8, because other parts of the codebase ended up passing an array to a function that expected a string.

Props david.binda, litemotiv, inc2734, NicolasKulka, hellofromTonya, mbabker, skithund, SergeyBiryukov, desrosj, timothyblynjacobs.
Reviewed by SergeyBiryukov, iandunn.
Merges [49803] and [49805] to the 5.6 branch.
Fixes #51056. See #51956.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49806 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 14:24:07 +00:00
Helen Hou-Sandi
8d91f0ddea App Passwords: Prevent conflicts when Basic Auth is already used by the site.
Application Passwords uses Basic Authentication to transfer authentication details. If the site is already using Basic Auth, for instance to implement a private staging environment, then the REST API will treat this as an authentication attempt and would end up generating an error for any REST API request.

Now, Application Password authentication will only be attempted if Application Passwords is in use by a site. This is flagged by setting an option whenever an Application Password is created. An upgrade routine is added to set this option if any App Passwords already exist.

Lastly, creating an Application Password will be prevented if the site appears to already be using Basic Authentication.

Props chexwarrior, georgestephanis, adamsilverstein, helen, Clorith, marybaum, TimothyBlynJacobs.
Reviewed by TimothyBlynJacobs, helen.
Merges [49752] to the 5.6 branch.
Fixes #51939.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49754 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-04 21:46:42 +00:00
Ian Dunn
ce25d0935a Media: Return WP_Error when cropping with bad input to avoid fatal.
This avoids an error on PHP 8 caused by calling `wp_imagecreatetruecolor()` with inputs that aren't numeric, or are less than 0.

Props hellofromtonya, Boniu91, metalandcoffee, SergeyBiryukov.
Reviewed by SergeyBiryukov, iandunn.
Merges [49751] to the 5.6 branch.
Fixes #51937.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49753 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-04 21:44:27 +00:00
Ian Dunn
424eab756c Multisite: Cache absolute dirsize paths to avoid PHP 8 fatal.
r49212 greatly improved the performance of `get_dirsize()`, but also changed the structure of the data stored in the `dirsize_cache` transient. It stored relative paths instead of absolute ones, and also removed the unnecessary `size` array.

That difference in data structures led to a fatal error in the following environment:

* PHP 8
* Multisite
* A custom `WP_CONTENT_DIR` which is not a child of WP's `ABSPATH` folder (e.g., [https://roots.io/bedrock/ Bedrock])
* The `upload_space_check_disabled` option set to `0`

After upgrading to WP 5.6, the `dirsize_cache` transient still had data in the old format. When `wp-admin.php/index.php` was visited, `get_space_used()` received an `array` instead of an `int`, and tried to divide it by another `int`. PHP 7 would silently cast the arguments to match data types, but [https://wiki.php.net/rfc/arithmetic_operator_type_checks PHP 8 throws a fatal error]: 

`Uncaught TypeError: Unsupported operand types: array / int`

`recurse_dirsize()` was using `ABSPATH` to convert the absolute paths to relative ones, but some upload locations are not located under `ABSPATH`. In those cases, `$directory` and `$cache_path` were identical, and that triggered the early return of the old `array`, instead of the expected `int`. 

In order to avoid that, this commit restores the absolute paths, but without the `size` array. It also adds a type check when returning cached values. Using absolute paths without `size` has the result of overwriting the old data, so that it matches the new format. The type check and upgrade routine are additional safety measures.

Props peterwilsoncc, janthiel, helen, hellofromtonya, francina, pbiron.
Reviewed by SergeyBiryukov, iandunn.
Merges [49744] to the 5.6 branch.
Fixes #51913. See #19879.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49745 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 20:43:53 +00:00
John Blackbourn
422d767b0b REST API: Pass the previous state of the post as a parameter to the wp_after_insert_post hook.
This enables, for example, the previous post status to be used by this hook without the need to first capture it on an earlier hook.

This also fixes the value of the `$fire_after_hooks` parameter in `get_default_post_to_edit()` so the `wp_after_insert_post` action correctly fires just once on the new post screen.

This merges [45114] into the 5.6 branch

See #45114


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49732 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-01 20:55:03 +00:00
Sergey Biryukov
bafdd2072d Tests: Ignore EOL differences in WP_List_Table::get_bulk_items() test for optgroups.
This avoids a misleading failure due to Unix vs. Windows EOL style mismatches and allows the test to pass on Windows.

Follow-up to [46612], [49190].

Reviewed by desrosj, SergeyBiryukov.
Merges [49691] to the 5.6 branch.
Fixes #19278.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49730 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-01 19:40:50 +00:00
Sergey Biryukov
40a6bc1a01 Site Health, App Passwords: Ensure REST API responses are properly translated.
The REST API requests in Site Health and App Passwords now include `_locale=user` in the request URL to ensure the user's locale is used instead of the site locale. Additionally, the `apiRequest` library now sends a JSON `Accept` header which is required by `determine_locale()` to respect the `_locale` query parameter.

The Site Health REST API controllers now manually load the default admin textdomain if not `is_admin()`. This allows for the Site Health tests to be translated even though the translations are part of the administration project and the REST API is not.

Props oglekler, kebbet, Clorith, TimothyBlynJacobs, ocean90, SergeyBiryukov, adamsilverstein.
Reviewed by TimothyBlynJacobs, SergeyBiryukov.
Merges [49716] to the 5.6 branch.
Fixes #51871.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49724 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-01 18:05:52 +00:00
Robert Anderson
9b00619751 Editor: Remove render_block hooks from WP_Block
Reverts the move of pre_render_block, render_block_data, and
render_block_context to WP_Block.

This change has more implications than first thought so will be revisted later
in 5.7.

Reverts [49609,49608].
See #51612.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49694 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-25 01:13:09 +00:00
Sergey Biryukov
1a338a859b I18N: Avoid PHP notices for relative URLs in load_script_textdomain().
Props hellofromTonya, SeBsZ, archon810, nourma, justinahinon, SergeyBiryukov.
Fixes #49145.

git-svn-id: https://develop.svn.wordpress.org/trunk@49639 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 20:50:21 +00:00
Sergey Biryukov
22e4cb5266 Docs: Further remove tautology from comments in recurse_dirsize() tests.
Follow-up to [49212], [49616], [49628].

See #19879.

git-svn-id: https://develop.svn.wordpress.org/trunk@49630 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 15:48:07 +00:00
Sergey Biryukov
205c025c63 Multisite: Rename the calculate_current_dirsize filter to pre_recurse_dirsize.
Set the default value to `false`. This brings some consistency with the `pre_get_space_used` filter.

Follow-up to [49212], [49616], [49628].

See #19879.

git-svn-id: https://develop.svn.wordpress.org/trunk@49629 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 15:42:57 +00:00
Sergey Biryukov
025ad3469b Docs: Adjust comments for recurse_dirsize() and related tests per the documentation standards.
Follow-up to [49212], [49616].

See #19879.

git-svn-id: https://develop.svn.wordpress.org/trunk@49628 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 15:36:02 +00:00
Robert Anderson
ac71fffac0 Customize: Ensure multiple CSS classes are passed to nav_menu_link_attributes as an array
When multiple CSS classes are added to a menu item, the nav_menu_link_attributes
filter should be called with $item->classes set to an array of CSS class names.

When previewing in the Customizer, however, a single string was being passed to
$item->classes because WP_Customize_Nav_Menu_Item_Setting::preview() bypasses
wp_update_nav_menu_item() and instead uses filter_wp_get_nav_menu_items().

The fix is to make filter_wp_get_nav_menu_items() match what
wp_update_nav_menu_item() does and split the string into an array.

Fixes #43113.
Props dlh.


git-svn-id: https://develop.svn.wordpress.org/trunk@49624 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 04:29:02 +00:00
Peter Wilson
64ad8eb332 Permalinks: Prevent attachment pages 404ing following [49563].
This largely reverts [49563] due to attachment pages returning 404: File not found errors when they use the `inherit` status.

Permalink changes to attachment pages are retained when they are descendants of trashed or deleted posts.

Props Toro_Unit, helen, johnbillion, peterwilsoncc.
Fixes #51776.
See #5272.



git-svn-id: https://develop.svn.wordpress.org/trunk@49622 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-17 03:27:07 +00:00
Timothy Jacobs
ba8de96fc6 App Passwords: Unify availability language.
Previously App Passwords used a mix of "enabled" and "available". We've now standardized on using "available".

Additionally, we now use a 501 status code when indicating that App Passwords is not available.

Props SergeyBiryukov, ocean90, TimothyBlynJacobs.
Fixes #51513.


git-svn-id: https://develop.svn.wordpress.org/trunk@49617 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-16 22:40:11 +00:00
Helen Hou-Sandi
56ffe940b0 Multisite: More consistency for clean_dirsize_cache().
Props SergeyBiryukov.
Fixes #19879.


git-svn-id: https://develop.svn.wordpress.org/trunk@49616 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-16 22:29:42 +00:00
Robert Anderson
7a42314c8b Editor: Move pre_render_block, render_block_data, render_block_context
Move the pre_render_block, render_block_data, and render_block_context
filters from render_block() to WP_Block. This ensures that they are
called for all blocks, including nested blocks, not just top-level
blocks.

Fixes #51612.
Props gaambo, gziolo, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@49608 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-16 00:45:55 +00:00
John Blackbourn
82e44bc702 Build/Test Tools: Misc test enhancements.
See #51344


git-svn-id: https://develop.svn.wordpress.org/trunk@49606 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-15 17:17:55 +00:00
John Blackbourn
cd9ed5e3ad Built/Test Tools: Switch to a data provider for the default user role and capability tests.
This test previously performed 1,010 assertions, and a failure in any one would prevent the other assertions from running. Using a data provider means simultaneous failures will all be reported at once.

See #51344, #32394


git-svn-id: https://develop.svn.wordpress.org/trunk@49605 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-15 14:57:39 +00:00
John Blackbourn
ea852af151 Build/Test Tools: Ensure user capability assertions are performed for all default roles.
The existing assertions were erroneously placed outside the iteration of all users, and therefore were only run against the last user in the list, which is the Subscriber role.

See #51344, #32394


git-svn-id: https://develop.svn.wordpress.org/trunk@49604 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-15 14:17:31 +00:00
John Blackbourn
e8435082d6 Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes.
This brings consistency to this often-used method, and allows IDEs to provide help to developers when using its `$factory` parameter.

See #51344


git-svn-id: https://develop.svn.wordpress.org/trunk@49603 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-15 13:59:32 +00:00
John Blackbourn
5f257b4931 Build/Test Tools: Improve the reliability of the test that ensures correct dependency order when inline scripts are used.
This test already ensures `WP_Scripts->do_concat` is true, therefore it has no dependency on `SCRIPT_DEBUG` being false. This means the test can run in an environment where the `.min` suffix is not used.

This change allows for the test to pass in this situation.

See #36392, #51734, #51344


git-svn-id: https://develop.svn.wordpress.org/trunk@49601 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-14 17:20:57 +00:00
Sergey Biryukov
9befeb00cc Build/Test Tools: Only enforce PHP extension requirements when running core tests.
This allows other users of the WordPress unit test suite framework to run their own unit tests without needing the GD extension, which should only be a requirement if running core tests.

Follow-up to [49535].

Props jamescollins.
Fixes #50640.

git-svn-id: https://develop.svn.wordpress.org/trunk@49571 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-12 17:23:44 +00:00
Sergey Biryukov
f717424287 Build/Tests Tools: Restore [49491], accidentally reverted in [49566].
See #39210.

git-svn-id: https://develop.svn.wordpress.org/trunk@49570 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-12 17:13:56 +00:00
Sergey Biryukov
fd3ef484ec Build/Tests Tools: Restore [49535], accidentally reverted in [49566].
See #39210.

git-svn-id: https://develop.svn.wordpress.org/trunk@49569 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-12 17:06:48 +00:00
Dominik Schilling
4006c07417 I18N: Revert [49236] for now to investigate alternative implementations.
See #39210, #51678, #26511.

git-svn-id: https://develop.svn.wordpress.org/trunk@49566 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-12 14:41:19 +00:00
Peter Wilson
8b2aa594e3 Canonical: Prevent ID enumeration of private post slugs.
Add check to `redirect_canonical()` to ensure the destination post is not using a private post status.

Props dd32, Denis-de-Bernardy, donmhico, helen, nacin, peterwilsoncc, pishmishy, TimothyBlynJacobs, tzafrir, Viper007Bond, whyisjake.
Fixes #5272.



git-svn-id: https://develop.svn.wordpress.org/trunk@49563 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-12 04:14:44 +00:00
Helen Hou-Sandi
2a7d1e2394 Editor: Display short description from block directory in results.
Props dd32, ryelle.
Fixes #51212.


git-svn-id: https://develop.svn.wordpress.org/trunk@49559 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-10 20:24:38 +00:00
Andrew Ozz
60516115ed Tests QUnit: Remove restriction on running the TinyMCE Textpattern WP plugin tests in PhantomJS.
Props @desrosj.
Fixes #42009.

git-svn-id: https://develop.svn.wordpress.org/trunk@49556 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-10 09:16:53 +00:00
Jonathan Desrosiers
92c6723c24 Tests: Remove duplicate fields key in WP_Query test.
Introduced in [46188].

See #51344.

git-svn-id: https://develop.svn.wordpress.org/trunk@49554 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-09 23:39:25 +00:00
Jonathan Desrosiers
a85803a7ba Build/Test Tools: Remove PHP >= 5.3 check.
WordPress no longer supports PHP < 5.6.20. This check is no longer necessary.

Fixes #51737.

git-svn-id: https://develop.svn.wordpress.org/trunk@49551 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-09 19:40:41 +00:00
Sergey Biryukov
4eee0d2fb7 Tests: Use assertSame() in some newly introduced tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [48937], [48939], [48940], [48944].

See #38266.

git-svn-id: https://develop.svn.wordpress.org/trunk@49547 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-09 15:43:14 +00:00
John Blackbourn
e4f47125ab Media: Restore the ability of WP_Image_Editor_Imagick->save() to create a missing directory when needed.
Props eemitch, mikeschroder, hellofromTonya, p00ya, johnbillion

Fixes #51665


git-svn-id: https://develop.svn.wordpress.org/trunk@49542 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-09 13:16:54 +00:00
Sergey Biryukov
31831c74d9 Networks and Sites: Assign the array of site or network data returned from filters to the respective class property:
* The array of network data returned from the `networks_pre_query` filter is assigned to the `networks` property of the current `WP_Network_Query` instance.
* The array of site data returned from the `sites_pre_query` filter is assigned to the `sites` property of the current `WP_Site_Query` instance.

This avoids the performance overhead of calling `WP_Network_Query::get_networks()` or `WP_Site_Query::get_sites()` twice: first when creating the object instance, then to retrieve the filtered results.

This also makes the filters a bit more consistent with other similar filters, e.g. `posts_pre_query`, `terms_pre_query`, `comments_pre_query`, or `users_pre_query`.

Follow-up to [46086], [48990].

Props yakimun, spacedmonkey.
Fixes #51333.

git-svn-id: https://develop.svn.wordpress.org/trunk@49538 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-08 11:45:36 +00:00
Sergey Biryukov
f2302a3112 Build/Test Tools: Check if all the required PHP extensions are loaded before running the test suite.
Add the GD extension as a hard requirement.

This improves the reliability of the test suite and ensures that if the test infrastructure changes in the future and a platform requirement such as GD accidentally gets removed, the tests fail with an appropriate error message.

Follow-up to [48592].

Props ayeshrajans, jrf, johnbillion.
Fixes #50640.

git-svn-id: https://develop.svn.wordpress.org/trunk@49535 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-07 13:18:24 +00:00