In the tests for updating a plugin or theme via Ajax, `wp_installing( true )` was called to prevent `wp_update_plugins()` or `wp_update_themes()` from running.
Since the subsequent `wp_installing( false )` call was in the same `try { ... }` block, it could not be executed if an exception was thrown, affecting other tests.
In this case, after rearranging the Ajax tests in [54722], this started affecting the `get_site_option()` calls in the tests for `wp_ajax_wp_compression_test()`.
By moving both `wp_installing()` calls out of the `try`/`catch` block, we can ensure the status is correctly restored.
Follow-up to [734/tests], [37150], [38168], [38710], [54722].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54723 602fd350-edb4-49c9-b593-d223f7449a82
This updates the test classes to match the names of the functions being tested.
Includes moving the `@covers` tags from individual test methods to the class DocBlocks.
Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Writing PHP Tests: Naming and Organization].
Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489], [53561], [54704].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54722 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an `Equals sign not aligned with surrounding assignments` WPCS warning.
Follow-up to [54720].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54721 602fd350-edb4-49c9-b593-d223f7449a82
This was previously used to delete the users created during `wpSetUpBeforeClass()`, however that now happens automatically in `WP_UnitTestCase_Base::tear_down_after_class()` via `_delete_all_data()`.
Follow-up to [35311], [37404], [38398].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54720 602fd350-edb4-49c9-b593-d223f7449a82
As the tests belong to either the `ms-excluded` or the `ms-required` group, the skipping should not be necessary.
While these methods were initially intended to be used in conjunction with the respective group, the PHPUnit configuration files for single site and multisite exclude these groups as appropriate, so calling these methods explicitly is no longer required.
Follow-up to [40520], [40543], [40564], [43005], [46683], [53011].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54719 602fd350-edb4-49c9-b593-d223f7449a82
This was previously removed in [51870] and appears to be accidentally readded in [53561].
As the test belongs to the `ms-excluded` group, the skipping is unnecessary and does not affect anything in practice.
Follow-up to [46693], [49835], [51870], [53561].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54718 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency to the location of category function tests, as well as to make the tests more discoverable and easier to expand.
Follow-up to [28438], [28566], [31006], [31025], [37464], [28438], [31299], [36988], [42364], [42367], [42368], [46413], [53684].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54717 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency to the location of pluggable function tests.
Includes:
* Renaming the test class to better reflect the intention of the tests.
* Adding a `@coversNothing` tag to the class DocBlock.
Follow-up to [34126], [53478], [54702].
Props pbearne, SergeyBiryukov.
See #56793, #56782.
git-svn-id: https://develop.svn.wordpress.org/trunk@54716 602fd350-edb4-49c9-b593-d223f7449a82
Based on feedback from network storage configurations there was a noticed slowdown due to the usage of the `path_join()` function. This needs more time to find a workaround.
Follow-up to [53934].
Props mreishus, SergeyBiryukov, desrosj, mikeschroder.
Reverts [53934].
See #56924.
git-svn-id: https://develop.svn.wordpress.org/trunk@54712 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency with other database-related tests.
Includes adding a missing `@covers` tag to the class DocBlock.
Follow-up to [30345], [32108], [32770], [51798].
Props pbearne, SergeyBiryukov.
See #56793, #56782.
git-svn-id: https://develop.svn.wordpress.org/trunk@54711 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency to the location of the tests for this class.
Includes adding the missing `@covers` tags.
Follow-up to [36177], [51622], [54250].
Props pbearne, SergeyBiryukov.
See #56793, #56782.
git-svn-id: https://develop.svn.wordpress.org/trunk@54710 602fd350-edb4-49c9-b593-d223f7449a82
This change removes caching of global styles for logged in users, allowing "wp_global_styles" custom post type to be imported completely, regardless of any previously cached data. This change now relies on the lower-level native `WP_Query` cache invalidation methods for the global styles post type.
Follow-up to [52275], [54186].
Props anariel-design, bernhard-reiter, andrewserong, spacedmonkey, andraganescu, peterwilsoncc, oandregal, hellofromTonya.
Fixes#56901.
git-svn-id: https://develop.svn.wordpress.org/trunk@54706 602fd350-edb4-49c9-b593-d223f7449a82
This change ensures custom styles for all third-party blocks are rendered on the front end if assets are set to be loaded on a per-block basis. Additionally, this change includes new unit tests to help prevent a similar bug in the future.
Props scruffian, aristath, poena, wildworks, ajlende, andraganescu, ndiego, gigitux, cbravobernal, ramonopoly, andrewserong, oandregal, hellofromTonya, bernhard-reiter.
Fixes#56915.
git-svn-id: https://develop.svn.wordpress.org/trunk@54703 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency with other pluggable function tests.
Includes moving the `@covers` tag from a single test method to the class DocBlock.
Follow-up to [221/tests], [909/tests], [54529].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54702 602fd350-edb4-49c9-b593-d223f7449a82
This aims to bring some consistency with other comment function tests.
Includes moving the `@covers` tags from individual test methods to the class DocBlock.
Follow-up to [34799], [34801], [53863].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54701 602fd350-edb4-49c9-b593-d223f7449a82
This introduces a GitHub Action workflow that performs the following steps for default themes:
- Test installing npm dependencies and running the build script (for relevant themes).
- Create ZIP files for the .org Theme directory and uploads them as workflow artifacts.
The workflow will only run on limited occasions, one of those being when Twenty Nineteen, Twenty Twenty, or Twenty Twenty-One is edited. These are the themes with build scripts that need to be tested for issues.
It can also be manually run through the GitHub Actions UI for occasions when the ZIP files are needed for a release.
Props peterwilsoncc, desrosj
Fixes#56898.
git-svn-id: https://develop.svn.wordpress.org/trunk@54699 602fd350-edb4-49c9-b593-d223f7449a82
Switch to the CDN URLs for the images on the About page. Update the images used on Freedoms & Privacy to match the 6.1 design style.
Props richtabor, audrasjb, kebbet.
See #56357.
git-svn-id: https://develop.svn.wordpress.org/trunk@54690 602fd350-edb4-49c9-b593-d223f7449a82
This aims to clarify that "Site Address (URL)" is a required field that should not be left blank, whether or not the site home page is intended to be different from the WordPress installation directory.
Follow-up to [1203], [3058], [5093], [5141], [13750], [41986].
Props digical, sabernhardt.
Fixes#50629.
git-svn-id: https://develop.svn.wordpress.org/trunk@54689 602fd350-edb4-49c9-b593-d223f7449a82
In [54358], styling for Button blocks that had been removed from classic themes was reintroduced. However, it was added with a global scope, whereas editor styles are usually added with a `.editor-styles-wrapper` selector, which makes them more specific.
This change modifies the way that classic theme styles are added so that they also get wrapped in an `.editor-styles-wrapper` selector to match specificity.
Furthermore, adjust specificity for some Button block related styling in the editor for the Twenty Twelve and Twenty Twenty themes.
Merges [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] into trunk.
Follow-up to [54358].
Props scruffian, cbravobernal, sabernhardt, audrasjb.
See #56467.
git-svn-id: https://develop.svn.wordpress.org/trunk@54687 602fd350-edb4-49c9-b593-d223f7449a82
Introduce `WP_Query::generate_cache_key()` for generating the cache key used by the main database query.
This removes the need for a filter to test that cache keys do not include the WPDB placeholder causing unreachable cache keys. The tests now call `WP_Query::generate_cache_key()` directly.
The filter `wp_query_cache_key` is removed as a hard deprecation. The filter was not included in a stable release.
Follow up to [54634].
Props spacedmonkey, jorbin, azaozz, hellofromtonya, mukesh27, peterwilsoncc, desrosj, audrasjb, adamsilverstein, flixos90, davidbaumwald, joedolson, sergeybiryukov.
Fixes#56802.
git-svn-id: https://develop.svn.wordpress.org/trunk@54685 602fd350-edb4-49c9-b593-d223f7449a82
When a ruleset error is encountered during a PHPCodeSniffer scan, an XML report is not generated and `cs2pr` will exit with a `0`.
In this situation, a workflow run will be marked as passing (even though a failure has occurred) due to the presence of `continue-on-error`.
This adjusts the logic in the Coding Standards and PHP Compatibility workflows to remove the need for the `continue-on-error` option and ensures all failures are accurately reflected within the GitHub Actions UI.
Follow up to [54371].
Props jrf, TobiasBg.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@54678 602fd350-edb4-49c9-b593-d223f7449a82
This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`.
Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai.
Fixes#56855.
git-svn-id: https://develop.svn.wordpress.org/trunk@54675 602fd350-edb4-49c9-b593-d223f7449a82
This removes the dynamic aspect of the `createWorkflowDispatch()` call that dispatches a Failed Workflow run when another workflow encounters an issue.
By hardcoding `trunk` as the `ref`, the version of the workflow used will always be the latest, most up to date. This ensures older branches receive the bug fixes and improvements made in `trunk` without having to backport them.
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@54674 602fd350-edb4-49c9-b593-d223f7449a82
Based on feedback, this enhancement isn't quite ready. Reverting [54213] for now to continue the work in the next cycle.
Follow-up to [54213].
Props manfcarlo, peterwilsoncc.
git-svn-id: https://develop.svn.wordpress.org/trunk@54673 602fd350-edb4-49c9-b593-d223f7449a82
When using the `CUSTOM_TAGS` constant, these global variables should be set to arrays:
* `$allowedposttags`
* `$allowedtags`
* `$allowedentitynames`
* `$allowedxmlentitynames`
This commit aims to improve developer experience by displaying a more helpful message to explain a PHP fatal error further in the code if any of these globals are either not set or not an array.
Note Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The `wp_kses_allowed_html` filter is more powerful and supplies context.
Follow-up to [832], [834], [2896], [13358], [21796], [28845], [43016], [48072].
Props doctorlai, pento, KnowingArt_com, bosconiandynamics, TJNowell, ironprogrammer, audrasjb, mukesh27, SergeyBiryukov.
Fixes#47357.
git-svn-id: https://develop.svn.wordpress.org/trunk@54672 602fd350-edb4-49c9-b593-d223f7449a82
In `register_block_type`, continue to allow passing arrays as the `editor_script`, `script`, `view_script`, `editor_style`, and `style` arguments. Note that those fields were soft-deprecated in favor of their `_handles` counterparts in [54155], which would allow specifying multiple items. At the same time, the deprecated fields were limited to `string` or `null`.
However, this broke existing code that passed an array as one of those arguments. For backwards compatibility, this change thus restores the previous behavior. It is implemented in `WP_Block_Type` as a pair of `__get()` and `__set()` methods that wrap around the corresponding `_handles` members, which are arrays of strings.
It also affects the REST API endpoint for block types. The latter’s schema has never allowed for anything other than `string` or `null` for any of those fields. For this reason, it now returns the first element of the array stored in the corresponding `_handles` member in `WP_Block_Type`.
Follow-up [54155].
Props nendeb55, costdev, gziolo, spacedmonkey, mukesh27, sergeybiryukov, audrasjb.
Fixes#56707.
git-svn-id: https://develop.svn.wordpress.org/trunk@54670 602fd350-edb4-49c9-b593-d223f7449a82
`WP_Textdomain_Registry` was introduced in [53874] to store text domains and their language directory paths, addressing issues with just-in-time loading of textdomains when using locale switching and when using`load_*_textdomain()` functions.
Said change has inadvertently caused a performance regression exactly when using`load_*_textdomain()`, which still often is the case, where the cached information was not further used or even overridden.
This change addresses that issue by storing the default languages paths in a separate way, while at the same time making `WP_Textdomain_Registry` easier to maintain and adding new tests to catch future regressions.
Props flixos90, spacedmonkey, ocean90, SergeyBiryukov, costdev.
Fixes#39210.
git-svn-id: https://develop.svn.wordpress.org/trunk@54669 602fd350-edb4-49c9-b593-d223f7449a82
This creates separate test cases for `safecss_filter_attr()` with `margin-*` and `padding-*` logical properties for additional clarity.
Follow-up to [54102].
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54666 602fd350-edb4-49c9-b593-d223f7449a82
This changeset fixes a typo in meta boxes preferences. It also changes the related sentence from passive to active voice.
Follow-up to [49179].
Props sabernhardt.
Fixes#56884.
git-svn-id: https://develop.svn.wordpress.org/trunk@54665 602fd350-edb4-49c9-b593-d223f7449a82
When used inline, the SVG needs the `aria-hidden`, `focusable`, and `viewBox` properties for accessibility. Additionally, this optimizes the SVG by using `cirlce` elements in place of `path`, and removing `clipPath`. There is no visible change, but the file is now one-third the size.
Props sabernhardt.
See #56703, #56357.
git-svn-id: https://develop.svn.wordpress.org/trunk@54662 602fd350-edb4-49c9-b593-d223f7449a82
Fix the responsive breakpoint styles for short vertical viewports on the link popup modal. Follow up to [54216].
Props sabernhardt.
Fixes#53174.
git-svn-id: https://develop.svn.wordpress.org/trunk@54660 602fd350-edb4-49c9-b593-d223f7449a82
This updates a conditional in `do_core_upgrade()` to use strict comparison for error codes that are static strings.
Follow-up to [8595], [36349].
Props rezakhan995, kebbet, mukesh27, jrf, SergeyBiryukov.
Fixes#56866.
git-svn-id: https://develop.svn.wordpress.org/trunk@54654 602fd350-edb4-49c9-b593-d223f7449a82
Tumblr's oEmbed API correctly rejects invalid URLs, we can rely on that for the handful of cases that aren't embeddable URLs.
Props cbravobernal, bernhard-reiter.
Fixes#56733.
git-svn-id: https://develop.svn.wordpress.org/trunk@54652 602fd350-edb4-49c9-b593-d223f7449a82
This updates the third-party action used to post a welcome message to pull requests opened by first time contributors.
This release updates the action to use Node.js version 16 instead of 12, the latter of which support has been deprecated for in GitHub Action runners.
The action has also changed from `bukboo/welcome-action` to `wow-action/welcome`.
See #56793.
git-svn-id: https://develop.svn.wordpress.org/trunk@54651 602fd350-edb4-49c9-b593-d223f7449a82
The `save-state` and `set-output` commands have been deprecated in GitHub Actions. This removes all occurrences of the command within workflow steps.
This will not remove all deprecated notices from workflow summaries (some third-party actions still contain instances of these commands and need to be fixed upstream), but it will fix the notices caused by custom workflow code.
See #56820.
git-svn-id: https://develop.svn.wordpress.org/trunk@54649 602fd350-edb4-49c9-b593-d223f7449a82
This commit:
* Adds default minimum font size limits so that min font size, where provided, does not become smaller than `14px`/`0.875rem`/`0.875em`.
* For font sizes of `< 14px` that have no defined minimum sizes, uses the font size to set the floor of the `clamp()` value.
This bugfix prevents converting existing small font sizes to clamp values that will reduce their font size even further in narrow widths. It therefore improves backward compatibility and accessibility.
Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/44993#44993 Fluid typography: add font size constraints]
Follow-up to [54260], [54360], [54497], [54500].
Props ramonopoly, andrewserong, isabel_brison, Joen, bernhard-reiter.
See #56467.
git-svn-id: https://develop.svn.wordpress.org/trunk@54646 602fd350-edb4-49c9-b593-d223f7449a82
The new About header image appears to have been accidentally reverted to the older one in a previous commit.
Follow-up to [54635], [54638].
Props kebbet.
See #56703.
git-svn-id: https://develop.svn.wordpress.org/trunk@54645 602fd350-edb4-49c9-b593-d223f7449a82
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.
If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.
This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.
Follow-up to [53578], [54484].
Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
See #56057.
git-svn-id: https://develop.svn.wordpress.org/trunk@54643 602fd350-edb4-49c9-b593-d223f7449a82