This allows the full error message to be shown from the connection attempt instead of a generic error message.
Fixes#62382
git-svn-id: https://develop.svn.wordpress.org/trunk@59443 602fd350-edb4-49c9-b593-d223f7449a82
This is a companion to https://github.com/WordPress/gutenberg/pull/65460 that requires syncing in WordPress Core. Namely, the block-library changes require registration with their updated script module IDs so that the blocks continue to work correctly.
They key improvement is script modules registration is handled in one central place, and a combined asset file is used to improve the performance by avoiding multiple disk operations for every individual file.
Props jonsurrell, gziolo, wildworks, noisysocks.
See #60647, #59462.
git-svn-id: https://develop.svn.wordpress.org/trunk@59083 602fd350-edb4-49c9-b593-d223f7449a82
GitHub recently sunset support for Subversion, causing the `precommit:emoji` Grunt script to break. Since there’s no direct replacement for `svn ls` in Git, this has been replaced with a query through the GitHub CLI.
This also adds a step in the workflow that tests the build process to run the `precommit:emoji` script to ensure no changes to built files are missed when updating the Twemoji library in the future.
Follow up to [57626].
Props kraftbj, peterwilsoncc, swissspidy.
Fixes#60520. See #57600.
git-svn-id: https://develop.svn.wordpress.org/trunk@57758 602fd350-edb4-49c9-b593-d223f7449a82
This restores the site icon setting to its original home on the settings page where it lives with the title and tagline.
The base for this code was originally added in [32994] and then removed in [33329]. The majority of the modification to that version are to remove the no-js pieces and make the workflow completely inline rather than putting the cropping on a separate page.
Additionally, since image crops rely on the ability to upload an image, this setting is gated by the `upload_files` capability.
Follow-up to: [32994], [33329].
Props jorbin, audrasjb, mukesh27, joedolson, afercia, kebbet, swissspidy, obenland, jameskoster, kjellr, andraganescu, stacimc, mikeschroder, h71, krupajnanda, huzaifaalmesbah.
Fixes#54370.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@57602 602fd350-edb4-49c9-b593-d223f7449a82
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
git-svn-id: https://develop.svn.wordpress.org/trunk@57377 602fd350-edb4-49c9-b593-d223f7449a82
Runs `npm run grunt precommit:image` to minify/compress images in the repository.
Props desrosj.
Fixes#58996.
git-svn-id: https://develop.svn.wordpress.org/trunk@57322 602fd350-edb4-49c9-b593-d223f7449a82
As per the migration plan shared last year, this migrates all browser-based tests in WordPress core to use Playwright.
This includes end-to-end, performance, and visual regression tests.
Props swissspidy, mamaduka, kevin940726, bartkalisz, desrosj, adamsilverstein.
Fixes#59517.
git-svn-id: https://develop.svn.wordpress.org/trunk@56926 602fd350-edb4-49c9-b593-d223f7449a82
This prevents erroneously copying a file from source onto itself in source.
Props westonruter, jorbin.
Fixes#59196.
git-svn-id: https://develop.svn.wordpress.org/trunk@56461 602fd350-edb4-49c9-b593-d223f7449a82
* Remove obsolete `load` event handler in `wp-embed` since IE10+ support `DOMContentLoaded`.
* Replace obsolete use of `document.createElement('a')` in favor of the newer `URL` class (supported in all browsers but obsolete IE11).
* Remove obsolete IE10/IE11 code.
* Combine conditionals.
* Use `substring()` instead of deprecated `substr()` method.
* Eliminate the stipulation that `wp-embed.js` not include ampersands, considering this was put in place for WP<4.3 which now accounts for only 1.43% of sites. This includes the elimination of the `verify:wp-embed` grunt task.
Props westonruter, swissspidy.
Fixes#58974.
git-svn-id: https://develop.svn.wordpress.org/trunk@56383 602fd350-edb4-49c9-b593-d223f7449a82
grunt-jsvalidate was added to catch situations where minification introduced parsing errors in Internet Explorer.
IE is no longer supported by WordPress, and the grunt task itself has not been maintained for a decade.
Removing this task simplifies the build and avoids false-positive warnings where the outdated tool flags modern JS syntax incorrectly.
Props westonruter, joemcgill, jorbin, youknowriad, desrosj, swissspidy.
Fixes#58645. See #26615.
git-svn-id: https://develop.svn.wordpress.org/trunk@56247 602fd350-edb4-49c9-b593-d223f7449a82
Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.
Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes#58623.
git-svn-id: https://develop.svn.wordpress.org/trunk@56065 602fd350-edb4-49c9-b593-d223f7449a82
Add a show/hide toggle for new passwords in initial user creation and database access during install and setup process using the same model as on user profiles. Add a new password toggle script. Change setup config table to two columns, matching the install table layout.
Props xmarcos, matt, markjaquith, nazgul, akbigdog, intoxination, rob1n, MichaelH, empireoflight, rmccue, markoheijnen, r0uter, amansurov, bi0xid, DrewAPicture, Narthur, wpnook, markparnell, costdev, clorith, ryokuhi, sabernhardt, bgoewert, ironprogrammer, adeltahri, joedolson, mukesh27, audrasjb, sergeybiryukov.
Fixes#3534.
git-svn-id: https://develop.svn.wordpress.org/trunk@56008 602fd350-edb4-49c9-b593-d223f7449a82
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
Patches twemoji.js to add support for a `doNotParse()` callback. Uses that callback to always exclude emojis in HTML elements with the above class.
Props: dd32, peterwilsoncc, azaozz.
Fixes#52219.
git-svn-id: https://develop.svn.wordpress.org/trunk@55186 602fd350-edb4-49c9-b593-d223f7449a82
This updates PostCSS related dependencies for the main Core build process to versions that use the latest major version of PostCSS, 8.x.
There were no changes to any versioned CSS files as a result of this update directly. However, two occurrences of `-o-tab-size` have been removed due to the version of `caniuse-lite` used being updated in the process.
See #57554, #57555.
git-svn-id: https://develop.svn.wordpress.org/trunk@55150 602fd350-edb4-49c9-b593-d223f7449a82
Allows to revert changes applied in [54277] - temporary workaround for the failing Test NPM CI check on Windows.
Improvements included:
- generate combined asset files for both production and development
- store in the repository only the production version of the combined assets for packages, we use everything else only in development
- to make unit tests work, ensure that they ignore react fast refresh and use the production version of combined assets that are present in the source code
Props bernhard-reiter, jsnajdr, clorith, wildworks.
Fixes#56615.
git-svn-id: https://develop.svn.wordpress.org/trunk@54289 602fd350-edb4-49c9-b593-d223f7449a82
This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.
Includes:
* Adding a new Grunt task to convert `block.json` files to `block-json.php`.
* Using the new `block-json.php` file in the `register_block_type_from_metadata()` function.
Follow-up to [48141].
Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes#55005.
git-svn-id: https://develop.svn.wordpress.org/trunk@54276 602fd350-edb4-49c9-b593-d223f7449a82
Syncing stable blocks from the Gutenberg repository to wordpress-develop was a manual process, but it got automated with the script that runs together with syncing WordPress packages changed in the Gutenberg package.
Props zieladam.
Fixes#56179.
git-svn-id: https://develop.svn.wordpress.org/trunk@53688 602fd350-edb4-49c9-b593-d223f7449a82
Includes cherry-picked commit from the Gutenberg plugin that fix a bug discovere just before WordPress 6.0 RC 2.
Props hellofromtonya, zieladam, kebbet.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53378 602fd350-edb4-49c9-b593-d223f7449a82
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 3.
Props zieladam, ndiego, darerodz.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53329 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up for #51491.
Updating WordPress packages is currently a manual process that takes some reading and trial & error to figure out. This PR adds a single npm task called `sync-gutenberg-packages` that automates this entire process.
Props zieladam.
Fixes#55642.
git-svn-id: https://develop.svn.wordpress.org/trunk@53311 602fd350-edb4-49c9-b593-d223f7449a82
The NPM package for jQuery Color was updated in [50543], but a bundled version still existed within core.
This removes that bundled version, in favor of expanding the Grunt build steps to include the package from NPM instead.
Fixes#55016. See #51405.
git-svn-id: https://develop.svn.wordpress.org/trunk@52657 602fd350-edb4-49c9-b593-d223f7449a82
The task was previously used to ensure that `/*! This file is auto-generated */` comment is not included on front end as part of the inline emoji detection script.
As the `wp-emoji-loader.js` script is now included via `file_get_contents()` and `wp_print_inline_script_tag()` instead of `grunt-include` to simplify the logic, the task does not find anything to replace and is no longer necessary.
Additionally, include a line break before the `wp-emoji-loader.js` script content for better line wrapping.
Follow-up to [48096], [50651], [52132].
See #44632, #44306, #53363.
git-svn-id: https://develop.svn.wordpress.org/trunk@52325 602fd350-edb4-49c9-b593-d223f7449a82
* Prevent loading `wp-embed` script unconditionally on every page in favor of conditionally enqueueing when a post embed is detected. The `wp-embed` script is also explicitly marked as being in the footer group. Sites which currently disable post embed scripts from being enqueued via `remove_action( 'wp_head', 'wp_oembed_add_host_js' )` will continue to do so.
* Send a `ready` message from the host page to each post embed window in case the `iframe` loads before the `wp-embed` script does. When the `ready` message is received by the post embed window, it sends the same `height` message as it sends when it loads.
* Eliminate use of `grunt-include` to inject emoji script and the post embed script. Instead obtain the script contents via `file_get_contents()` (as is done elsewhere in core) and utilize `wp_print_inline_script_tag()`/`wp_get_inline_script_tag()` to construct out the script. This simplifies the logic and allows the running of src without `SCRIPT_DEBUG` enabled.
* For the embed code that users are provided to copy for embedding outside of WP, add the `secret` on the `blockquote` and `iframe`. This ensures the `blockquote` will be hidden when the `iframe` loads. The embed code in question is accessed here via `get_post_embed_html()`.
Props westonruter, swissspidy, pento, flixos90, ocean90.
Fixes#44632, #44306.
git-svn-id: https://develop.svn.wordpress.org/trunk@52132 602fd350-edb4-49c9-b593-d223f7449a82
This brings the JS packages up to date and is the first step that will allow us
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.
Props noisysocks.
See #54337.
git-svn-id: https://develop.svn.wordpress.org/trunk@52042 602fd350-edb4-49c9-b593-d223f7449a82
Move the cleaning of the `wp-includes/css/dist` folder from `clean:css` to `clean:webpack-assets` to avoid an order of operations issue in which the files were built shortly before been deleted later in the build process.
Follow up to [51689].
Props netweb, ramonopoly, peterwilsoncc.
Fixes#53719.
git-svn-id: https://develop.svn.wordpress.org/trunk@51713 602fd350-edb4-49c9-b593-d223f7449a82
Modify the `grunt clean:css` command to include the folder `wp-includes/css/dist` to ensure legacy files do not remain if the built files are removed/relocated.
Props desrosj, netweb.
Fixes#53719.
git-svn-id: https://develop.svn.wordpress.org/trunk@51689 602fd350-edb4-49c9-b593-d223f7449a82
It aligns with the changes proposed added in Gutenberg: https://github.com/WordPress/gutenberg/pull/33293.
The idea here is to split the growing webpack config into two parts: blocks and packages.
We need to add handling for JavaScript files that are going to be used with blocks on the frontend. They didn't work quite well with the current setup for entry points created for packages.
As part of the effort, it adds support for `viewScript` in `block.json` metadata file that is later translated to `$view_script` in `WP_Block_Type` class and exposed as `view_script` from the REST API endpoint for block types.
Props youknowriad, desrosj, aristath.
Fixes#53690.
git-svn-id: https://develop.svn.wordpress.org/trunk@51501 602fd350-edb4-49c9-b593-d223f7449a82
Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.
This also fixes the `grunt clean` command which erroneously deletes `script-loader-packages.php`. This file is re-populated during the build, but deleting it during the clean is undesirable.
Fixes#53606
git-svn-id: https://develop.svn.wordpress.org/trunk@51355 602fd350-edb4-49c9-b593-d223f7449a82
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.
See #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51268 602fd350-edb4-49c9-b593-d223f7449a82
This also adds support for the viewScript for blocks fixing
the PDF preview for file blocks.
Props desrosj, gziolo.
See #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51259 602fd350-edb4-49c9-b593-d223f7449a82
If a custom plugin or theme exists in the `build/wp-content` directory with a sourcemap, the build` script is currently returning a warning and failing.
This improves the `verify:source-maps` task in Grunt to ignore directories and files that do not belong to WordPress Core.
Props ryelle, afragen, johnbillion.
Fixes#52689.
git-svn-id: https://develop.svn.wordpress.org/trunk@51173 602fd350-edb4-49c9-b593-d223f7449a82
This makes it easier to run `phpunit` Grunt tasks without having to figure out how and which PHPUnit version needs to be installed.
It also more closely matches the `format:php` task.
Follow-up to [47881].
Props ocean90.
Fixes#53015.
git-svn-id: https://develop.svn.wordpress.org/trunk@51016 602fd350-edb4-49c9-b593-d223f7449a82
It contains several changes in addition to regular update to WordPress packages:
- All newly exposed blocks are now registered on the server.
- Dutone block support was added.
- Border block support was updated.
- New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work.
Props youknowriad.
See #52991.
git-svn-id: https://develop.svn.wordpress.org/trunk@50929 602fd350-edb4-49c9-b593-d223f7449a82
* Remove `travis:` tasks in Gruntfile.js.
* Remove status badge in README.md that comes from Travis CI via shields.io.
* Remove Travis CI related skipping in the `WP_UnitTestCase_Base::skipOnAutomatedBranches()` test method and related Docker environment variables.
Props johnbillion, SergeyBiryukov, ocean90.
See #52161.
Fixes#52666.
git-svn-id: https://develop.svn.wordpress.org/trunk@50697 602fd350-edb4-49c9-b593-d223f7449a82
This makes the task names more consistent with other tasks.
Follow-up to [41043], [48096], [50650].
See #52625.
git-svn-id: https://develop.svn.wordpress.org/trunk@50651 602fd350-edb4-49c9-b593-d223f7449a82
Previously, jQuery 1.12.4 was added to the WordPress SVN repo in order to backport an upstream security patch from jQuery 3.4.0.
Now that WordPress includes an unmodified version of jQuery 3.5.1 and no longer needs to maintain a fork, it can be removed from the SVN repo and installed via NPM again as part of the build.
Follow-up to [45342], [49101].
Props peterwilsoncc, SergeyBiryukov.
Fixes#52647.
git-svn-id: https://develop.svn.wordpress.org/trunk@50445 602fd350-edb4-49c9-b593-d223f7449a82
Some PHPUnit tests were concerned with the state of files in the `build` directory. In order to allow the tests to run without requiring a build to be run first, these have been moved into assertions that run after the build step (and therefore cause it to fail if they do not pass), or into QUnit tests as necessary.
Various other PHPUnit tests implictly depend on built JavaScript files being present. These files are now touched during the test setup to avoid PHP warnings if the `build` files are not present.
The `wp-tests-config-sample.php` file and the GitHub Actions configuration have also been changed so `ABSPATH` uses `src` instead of `build`, therefore allowing the PHPUnit tests to be run without a build having to be run first. This means all new local installations of WordPress will use `src` for PHPUnit testing. If you would like to switch your existing installation over then change the location of `ABSPATH` in `wp-tests-config.php` to point to `src` instead of `build`.
Props peterwilsoncc, iandunn, gziolo, desroj, johnbillion
Fixes#51734
See #45863
git-svn-id: https://develop.svn.wordpress.org/trunk@50441 602fd350-edb4-49c9-b593-d223f7449a82
Switch the Sass implementation used by Grunt to `sass` (the Dart version), since LibSass & `node-sass` have been deprecated.
Props desrosj.
Fixes#51763.
git-svn-id: https://develop.svn.wordpress.org/trunk@50126 602fd350-edb4-49c9-b593-d223f7449a82
This will help catch issues with Ajax related functionality on multisite.
A few tests have also been marked as `skipWithMultisite()` as they require network admin level capabilities when performing the same operations on a multisite install.
Props garrett-eclipse, netweb.
Fixes#46567.
git-svn-id: https://develop.svn.wordpress.org/trunk@49835 602fd350-edb4-49c9-b593-d223f7449a82
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes#42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82