Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:Yoast/wordpress-seo into td/class-…
Browse files Browse the repository at this point in the history
…syntax
  • Loading branch information
mhkuu committed May 13, 2024
2 parents 995dc7a + ffbe015 commit ca33693
Show file tree
Hide file tree
Showing 381 changed files with 2,777 additions and 14,671 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
artifact/
apps/
packages/
js/dist/
vendor/
vendor_prefixed/
22 changes: 0 additions & 22 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,6 @@ overrides:
- "packages/social-metadata-previews/**/*.js"
rules:
import/no-unresolved: [ "error", { ignore: [ "^@yoast/(components|replacement-variable-editor|social-metadata-forms|style-guide)" ] } ]
- files:
- "packages/yoast-components/**/*.js"
rules:
complexity: [ 1, 6 ]
# A wrapping label is not necessary when there already is an htmlFor attribute.
jsx-a11y/label-has-for: [ "error", { required: "id" } ]
require-jsdoc: 1
react/button-has-type: 1
react/default-props-match-prop-types: 1
react/no-unused-prop-types: 1
react/no-access-state-in-setstate: 1
react/no-unused-state: 1
react/jsx-no-bind: 1
react/jsx-no-target-blank: 1
react/require-default-props: 1
react/forbid-foreign-prop-types: 1
import/no-duplicates: 0
import/named: 0
import/no-extraneous-dependencies: 0
import/no-unresolved: [ "error", { ignore: [ "^@yoast/(analysis-report|components|helpers|replacement-variable-editor|search-metadata-previews|style-guide)" ] } ]
env:
jest: true
- files:
- "packages/**/tests/**/*Test.js"
rules:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deprecation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Deprecation check
on:
pull_request:
paths:
- packages/yoast-components/**
- packages/babel-preset/**
- packages/components/**
- packages/e2e-tests/**
Expand Down Expand Up @@ -32,7 +31,6 @@ jobs:
@${{ github.actor }} Please be aware that following packages have been abandoned and are not actively maintained anymore:
| Package name | Path |
| ------------- | ------------- |
| yoast-components | [packages/yoast-components](https://github.com/Yoast/wordpress-seo/tree/trunk/packages/yoast-components) |
| @yoast/babel-preset | [packages/babel-preset](https://github.com/Yoast/wordpress-seo/tree/trunk/packages/babel-preset) |
| @yoast/components | [packages/components](https://github.com/Yoast/wordpress-seo/tree/trunk/packages/components) |
| @yoast/e2e-tests | [packages/e2e-tests ](https://github.com/Yoast/wordpress-seo/tree/trunk/packages/e2e-tests ) |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/finish-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ jobs:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }} # Connect all builds together.
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
carryforward: "unit-php-7.2,unit-php-8.3,php-7.2-wp-6.3,php-7.2-wp-6.3-ms,php-8.3-wp-trunk,php-8.3-wp-trunk-ms,package-analysis-report,package-browserslist-config,package-components,package-feature-flag,package-helpers,package-js,package-replacement-variable-editor,package-search-metadata-previews,package-social-metadata-forms,package-social-metadata-previews,package-yoast-components,package-yoastseo"
carryforward: "unit-php-7.2,unit-php-8.3,php-7.2-wp-6.3,php-7.2-wp-6.3-ms,php-8.3-wp-trunk,php-8.3-wp-trunk-ms,package-analysis-report,package-browserslist-config,package-components,package-feature-flag,package-helpers,package-js,package-replacement-variable-editor,package-search-metadata-previews,package-social-metadata-forms,package-social-metadata-previews,package-yoastseo"
parallel-finished: true
1 change: 0 additions & 1 deletion .github/workflows/jstest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
- 'search-metadata-previews'
- 'social-metadata-forms'
- 'social-metadata-previews'
- 'yoast-components'

name: "TestJS - ${{ matrix.package }} (full)"

Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
matrix:
include:
- php_version: "7.2"
wp_version: "6.3"
wp_version: "6.4"
multisite: true
coverage: true

Expand All @@ -151,23 +151,22 @@ jobs:
coverage: false

- php_version: "8.0"
wp_version: "6.3"
wp_version: "6.4"
multisite: false
coverage: false

- php_version: "8.1"
wp_version: "latest"
- php_version: '8.1'
wp_version: '6.5'
multisite: true
coverage: false

- php_version: "8.2"
wp_version: "6.4"
- php_version: '8.2'
wp_version: '6.4'
multisite: true
coverage: false

# WP 6.4 is the earliest version which supports PHP 8.3.
- php_version: '8.3'
wp_version: 'trunk'
wp_version: 'latest'
multisite: true
coverage: true

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ test.sh
/js/dist/*
/css/dist/*
/packages/*/dist
/blocks/**
yarn-error.log
coverage
dependencies.json
Expand All @@ -108,4 +109,4 @@ dependencies.md
############
/.tmp

.cache/phpunit/cache/
.cache/phpunit/cache/
6 changes: 6 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@
<exclude-pattern>/inc/wpseo-functions-deprecated\.php$</exclude-pattern>
</rule>

<!-- Ignore unused variables in deprecated functionality. -->
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable">
<exclude-pattern>/src/deprecated/*</exclude-pattern>
<exclude-pattern>/inc/wpseo-functions-deprecated\.php$</exclude-pattern>
</rule>

<!-- Exclude deprecated code from select sniffs regarding naming conventions.
These classes are still available to prevent BC-breaks and renaming them would
create a BC-break. -->
Expand Down
11 changes: 6 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global require, process */
var timeGrunt = require( "time-grunt" );
var path = require( "path" );
var loadGruntConfig = require( "load-grunt-config" );
// eslint-disable-next-line import/no-extraneous-dependencies
const timeGrunt = require( "time-grunt" );
const path = require( "path" );
// eslint-disable-next-line import/no-extraneous-dependencies
const loadGruntConfig = require( "load-grunt-config" );
const { flattenVersionForFile } = require( "./config/webpack/paths" );
require( "dotenv" ).config();

Expand All @@ -12,7 +13,7 @@ module.exports = function( grunt ) {
const pluginVersion = pkg.yoast.pluginVersion;

/* Used to switch between development and release builds.
Switches based on the grunt command (which is the third 'argv', after node and grunt, so index 2).*/
Switches based on the grunt command (which is the third 'argv', after node and grunt, so index 2).*/
const developmentBuild = ! [ "create-rc", "release", "release:js", "artifact", "deploy:trunk", "deploy:master" ].includes( process.argv[ 2 ] );

// Define project configuration.
Expand Down
25 changes: 19 additions & 6 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/**
* This class registers all the necessary styles and scripts.
*
* Also has methods for the enqueing of scripts and styles.
* It automatically adds a prefix to the handle.
*/
class WPSEO_Admin_Asset_Manager {
Expand Down Expand Up @@ -361,7 +360,7 @@ protected function scripts_to_be_registered() {
'wp-components',
'wp-element',
'wp-i18n',
self::PREFIX . 'yoast-components',
self::PREFIX . 'components-new-package',
self::PREFIX . 'externals-components',
],
'version' => $scripts['installation-success']['version'],
Expand Down Expand Up @@ -402,7 +401,7 @@ static function ( $dep ) {
self::PREFIX . 'externals-redux',
self::PREFIX . 'analysis',
self::PREFIX . 'react-select',
self::PREFIX . 'yoast-components',
self::PREFIX . 'components-new-package',
],
'version' => $scripts['workouts']['version'],
];
Expand Down Expand Up @@ -503,7 +502,6 @@ protected function load_renamed_scripts() {
'helpers' => 'helpers-package',
'jed' => 'jed-package',
'chart.js' => 'chart.js-package',
'legacy-components' => 'components-package',
'network-admin-script' => 'network-admin',
'redux' => 'redux-package',
'replacement-variable-editor' => 'replacement-variable-editor-package',
Expand Down Expand Up @@ -572,6 +570,14 @@ protected function styles_to_be_registered() {
self::PREFIX . 'admin-css',
self::PREFIX . 'tailwind',
'wp-components',
self::PREFIX . 'additional-mentions',
],
],
[
'name' => 'additional-mentions',
'src' => 'additional-mentions-' . $flat_version,
'deps' => [
self::PREFIX . 'tailwind',
],
],
[
Expand Down Expand Up @@ -628,7 +634,11 @@ protected function styles_to_be_registered() {
[
'name' => 'structured-data-blocks',
'src' => 'structured-data-blocks-' . $flat_version,
'deps' => [ 'wp-edit-blocks' ],
'deps' => [
'dashicons',
'forms',
'wp-edit-blocks',
],
],
[
'name' => 'elementor',
Expand All @@ -641,7 +651,10 @@ protected function styles_to_be_registered() {
[
'name' => 'new-settings',
'src' => 'new-settings-' . $flat_version,
'deps' => [ self::PREFIX . 'tailwind' ],
'deps' => [
self::PREFIX . 'tailwind',
self::PREFIX . 'additional-mentions',
],
],
[
'name' => 'black-friday-banner',
Expand Down
24 changes: 0 additions & 24 deletions admin/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,6 @@ public function config_page_scripts() {
$this->asset_manager->enqueue_user_language_script();
}

/**
* Retrieves some variables that are needed for replacing variables in JS.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @return array The replacement and recommended replacement variables.
*/
public function get_replace_vars_script_data() {
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
$replace_vars = new WPSEO_Replace_Vars();
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
$replace_vars_list = $replace_vars->get_replacement_variables_list();

return [
'replace_vars' => $replace_vars_list,
'recommended_replace_vars' => $recommended_replace_vars->get_recommended_replacevars(),
'editor_specific_replace_vars' => $editor_specific_replace_vars->get(),
'shared_replace_vars' => $editor_specific_replace_vars->get_generic( $replace_vars_list ),
'hidden_replace_vars' => $replace_vars->get_hidden_replace_vars(),
];
}

/**
* Enqueues and handles all the tool dependencies.
*
Expand Down
Loading

0 comments on commit ca33693

Please sign in to comment.