This builds on the temporary backup system introduced in 6.3 to allow automatic updates to benefit from fatal error protection. A loopback request is performed to the home page of the site and the plugin is rolled back to its backed up version if a fatal error is observed.
For debugging and observability during beta, this change includes several calls to `error_log()` during the upgrade and rollback stages. These calls can be removed or placed behind a flag once we're ready for RC1.
Props costdev, johnbillion, mukesh27, afragen, audrasjb, justlevine, kirasong, peterwilsoncc
Fixes#58281
Built from https://develop.svn.wordpress.org/trunk@58128
git-svn-id: http://core.svn.wordpress.org/trunk@57593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Interactivity API has hooks that run on the frontend, but not in wp-admin. This means that interactivity data was not printed to the HTML and the interactivity Script Modules were not registered.
Fixes#61087.
Props jonsurrell, cbravobernal, gziolo.
Built from https://develop.svn.wordpress.org/trunk@58127
git-svn-id: http://core.svn.wordpress.org/trunk@57592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin.
Fixes#61086.
Props jonsurrell, cbravobernal, gziolo.
Built from https://develop.svn.wordpress.org/trunk@58126
git-svn-id: http://core.svn.wordpress.org/trunk@57591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This results in the prevention of an installation running on a port on localhost (for example `localhost:8889`) being converted to a subdomain Multisite installation, whereas previously it was incorrectly allowed.
Props spacedmonkey
See #21077
Built from https://develop.svn.wordpress.org/trunk@58125
git-svn-id: http://core.svn.wordpress.org/trunk@57590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes correcting a conditional in `_wp_menu_item_classes_by_context()` where `$parent_item->object`, which contains a string like `page`, was erroneously compared to the queried object's ID. The correct property to compare is `$parent_item->object_id`.
Follow-up to [14876], [14923], [14942], [15302], [16731], [16742], [22302], [47550], [47557], [47808].
Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@58124
git-svn-id: http://core.svn.wordpress.org/trunk@57589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Query caching in `WP_Query` was added in [53941]. When this functionality was added to the `WP_Query` class, a number of edge cases were missed that would result in redundant duplicate queries. It was possible to pass parameters to `WP_Query` that would be different but would result in the same database query being generated. As the cache key is generated from a mixture of query arguments and the SQL query, this resulted in different cache keys for the same database query, resulting in unnecessary duplicate queries. In this change, the logic in the `generate_cache_key` method has been improved to ensure reuse of existing caches. The following edge cases have been considered:
- Passing `post_type` as an empty string.
- Passing `post_type` as the string `any`.
- Passing `post_type` as array vs. string.
- Passing `post_type` as an array in a different order.
- Not passing `orderby`.
- Passing `post_status` as an array vs. string.
- Passing `post_status` as an array in a different order.
This change also fixes an issue where the old SQL query would not match, as the queries had different whitespaces.
Props spacedmonkey, joemcgill, pbearne, peterwilsoncc, rajinsharwar, mukesh27, thekt12, huzaifaalmesbah, rodionov201.
Fixes#59442.
Built from https://develop.svn.wordpress.org/trunk@58122
git-svn-id: http://core.svn.wordpress.org/trunk@57587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `check-latest` setting is used to ensure the latest version of Node.js is always installed in GitHub Action workflows.
This input was added and turned on in [57212] when the minimum required version of Node.js was bumped to `20.10.0`. Because GitHub Action runner image updates are deployed on a rolling basis over the course of several days, a version of Node.js that met this new requirement was not always present (especially on Windows runners). Using this input was a temporary fix to ensure stability for Core’s test workflows.
The `check-latest` input does have some side effects. Two examples are:
- An additional request is performed to check the latest version every time `setup-node` is used with this option enabled. More requests are made to download and install a newer version of Node.js when one is available.
- When new versions of Node.js are released, the Core workflows immediately switch to the new version, which could potentially have undiscovered bugs or regressions.
The latter has surfaced today due to a regression in Node.js 20.13.0 on Windows (see https://github.com/nodejs/node/issues/52884).
A bit of time has passed and a version >=20.10.0 is now reliably available on all GitHub Action runners. Running the very latest release Node.js is also not important for Core’s testing setup, so `check-version` can safely be removed to address both side effects detailed above.
Props johnbillion.
Fixes#60129.
Built from https://develop.svn.wordpress.org/trunk@58120
git-svn-id: http://core.svn.wordpress.org/trunk@57585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a `wp-admin/user/contribute.php` file to allow the "Get Involved" link to work on User Admin.
This changeset prevents an unintended 404 that occurs when a logged-in user clicks the "Get Involved" link (located in the menu-bar) from inside of the multisite-specific User Dashboard.
Related: r56220, r56309, #23348.
Props ignatiusjeroe, audrasjb, tobiasbg.
Fixes#61122.
Built from https://develop.svn.wordpress.org/trunk@58118
git-svn-id: http://core.svn.wordpress.org/trunk@57583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This prevents a fatal error in `wp_apply_custom_classname_support()`, which expects an array data type for block attributes, and makes sure the block editor can still load if there is a mistake in the attributes of a block.
Follow-up to [54498].
Props caercam.
Fixes#61151.
Built from https://develop.svn.wordpress.org/trunk@58112
git-svn-id: http://core.svn.wordpress.org/trunk@57577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds descriptions to multiple bundled themes. All patterns without the "Inserter" parameter set to "false" or "no", should use the description parameter (These patterns are hidden in the block inserter and do not use the descriptions).
Props poena, StringPiggy, oglekler, audrasjb, huzaifaalmesbah, swisspidy.
Fixes#59688.
Built from https://develop.svn.wordpress.org/trunk@58111
git-svn-id: http://core.svn.wordpress.org/trunk@57576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the docblock attributes for `wp_get_attachment_image()` to account for attribute values that are being determined by `wp_get_loading_optimization_attributes()`. Updates docs for `$attr['loading']` and adds docs for `$attr['fetchpriority']`.
Props joemcgill, dmsnell.
Fixes#59550.
Built from https://develop.svn.wordpress.org/trunk@58110
git-svn-id: http://core.svn.wordpress.org/trunk@57575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The FAQ pattern uses multiple details blocks in a row. This ends up with it behaving as an accordion and opens to issues. In ticket discussion this was decided to be removed to set a good example of how to build.
Props poena, alh0319, abditsori, richtabor, joedolson, huzaifaalmesbah, krupajnanda, luminuu, shailu25, swisspidy.
Fixes#60335.
Built from https://develop.svn.wordpress.org/trunk@58106
git-svn-id: http://core.svn.wordpress.org/trunk@57571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows a Multisite network to use an address that includes a port name, such as `example.com:1234`, and adds support for this to the local development environment too. You can now run a Multisite installation on the local development environment, for example at `localhost:8889`.
This also fixes some bugs with running a single site installation on a port, and updates the testing infrastructure so that the whole test suite runs both with and without a port number.
Props djzone, scribu, nacin, ipstenu, F J Kaiser, jeremyfelt, johnjamesjacoby, spacedmonkey, PerS, Clorith, Blackbam, enrico.sorcinelli, Jules Colle, obliviousharmony, desrosj, johnbillion
Fixes#21077, #52088
Built from https://develop.svn.wordpress.org/trunk@58097
git-svn-id: http://core.svn.wordpress.org/trunk@57562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Contributing to WordPress using `wordpress-develop` on GitHub is a useful way collaborate, test, and review suggested changes to the code base. One of the required criteria, though, is including a link to a corresponding Trac ticket. This ensures the PR and associated activity is listed on the Trac ticket, which serves as the source of truth.
It’s easy to forget this and newer contributors aren’t always aware of this requirement. This adds a GitHub Actions job that will add a comment as a reminder when no Trac ticket is included.
Is the waiting really ended? Two thousand years.
Props anamarijapapic, peterwilsoncc.
Fixes#60129.
Built from https://develop.svn.wordpress.org/trunk@58092
git-svn-id: http://core.svn.wordpress.org/trunk@57557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Plugin activation on the Plugins > Add New screen is performed using AJAX, no longer performing redirects. This means that users will not see a newly activated plugin's menu items, admin notices, or other UI elements until the user refreshes or navigates to another screen. Without adequate messaging and direction, users may be unsure of what to do next.
This shows an admin notice when a plugin is activated from its plugin card or modal, informing the user that the plugin was activated, and that some changes may not occur until they refresh the page.
Follow-up to [57545].
Props costdev, jorbin, jeherve, flixos90, joedolson, ironprogrammer, audrasjb, alanfuller, kevinwhoffman, devsahadat, afragen, adrianduffell, azaozz, jason_the_adams, JeffPaul, webdevmattcrom, DrewAPicture, justlevine, stevejonesdev, benlk, roytanck.
Fixes#60992. See #22316.
Built from https://develop.svn.wordpress.org/trunk@58081
git-svn-id: http://core.svn.wordpress.org/trunk@57546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This prevents a number of php notices that are surfaced due to the endpoint being called on load of the post editor even when there are no templates.
Props grantmkin, CookiesForDevo, britner, wildworks, jorbin.
Fixes#60909.
Built from https://develop.svn.wordpress.org/trunk@58079
git-svn-id: http://core.svn.wordpress.org/trunk@57544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Simplifies the tests setup by leveraging a test matrix, improving maintenance and making it much easier to test more scenarios. With this change, tests are now also run with an external object cache (Memcached). Additional information such as memory usage and the number of database queries is now collected as well.
Improves test setup and cleanup by disabling external HTTP requests and cron for the tests, as well as deleting expired transients and flushing the cache in-between. This should aid the test stability.
When testing the previous commit / target branch, this now leverages the already built artifact from the build process workflow. Raw test results are now also uploaded as artifacts to aid debugging.
Props swissspidy, adamsilverstein, joemcgill, mukesh27, desrosj, youknowriad, flixos90.
Fixes#59900
Built from https://develop.svn.wordpress.org/trunk@58076
git-svn-id: http://core.svn.wordpress.org/trunk@57541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The html5lib-tests suite parses tests from a number of files with a specific
data format. It uses a dataProvider in a loop that yields test information.
This relies on some variables being reset on each iteration. The context
element has not properly reset on each iteration.
The test specification describes the context element as follows:
a9f44960a9/tree-construction/README.md
> Then there *may* be a line that says "#document-fragment", which must be
> followed by a newline (LF), followed by a string of characters that indicates
> the context element, followed by a newline (LF). If the string of characters
> starts with "svg ", the context element is in the SVG namespace and the
> substring after "svg " is the local name. If the string of characters starts
> with "math ", the context element is in the MathML namespace and the
> substring after "math " is the local name. Otherwise, the context element is
> in the HTML namespace and the string is the local name. If this line is
> present the "#data" must be parsed using the HTML fragment parsing algorithm
> with the context element as context.
Without the proper reset of this value, a single context element would change
subsequent tests, breaking the test suite.
This patch adds the reset to ensure that the test suite works properly.
Developed in https://github.com/WordPress/wordpress-develop/pull/6464
Discussed in https://core.trac.wordpress.org/ticket/61102Fixes#61102.
Props costdev, dmsnell, jonsurrell.
Built from https://develop.svn.wordpress.org/trunk@58072
git-svn-id: http://core.svn.wordpress.org/trunk@57537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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 [36444].
Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58070
git-svn-id: http://core.svn.wordpress.org/trunk@57535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The way `wp_reset_vars()` sets global variables based on `$_POST` and `$_GET` values makes code hard to understand and maintain. It also makes it easy to forget to sanitize input.
This change removes the few places where `wp_reset_vars()` is used in the admin to explicitly use `$_REQUEST` and sanitize any input.
Props swissspidy, audrasjb, davideferre, killua99, weijland, voldemortensen.
Fixes#38073.
Built from https://develop.svn.wordpress.org/trunk@58069
git-svn-id: http://core.svn.wordpress.org/trunk@57534 1a063a9b-81f0-0310-95a4-ce76da25c4cd