Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:Yoast/wordpress-seo into releasing…
Browse files Browse the repository at this point in the history
…-yoastseo
  • Loading branch information
FAMarfuaty committed Oct 30, 2023
2 parents d349cc5 + e02b51b commit 69fba20
Show file tree
Hide file tree
Showing 61 changed files with 1,304 additions and 655 deletions.
1 change: 1 addition & 0 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ protected function load_renamed_scripts() {
'feature-flag' => 'feature-flag-package',
'helpers' => 'helpers-package',
'jed' => 'jed-package',
'chart.js' => 'chart.js-package',
'legacy-components' => 'components-package',
'network-admin-script' => 'network-admin',
'redux' => 'redux-package',
Expand Down
2 changes: 1 addition & 1 deletion admin/views/redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h1 id="wpseo-title"><?php echo \esc_html( \get_admin_page_title() ); ?></h1>
<div class="wpseo_content_wrapper" style="position: relative;">
<div style="position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 100; display: flex;justify-content: center;align-items: center;background: radial-gradient(#ffffffcf 20%, #ffffff00 50%);">
<a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="<?php echo \esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/4e0/' ) ); ?>" target="_blank">
<a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="<?php echo \esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/redirect-manager-upsell' ) ); ?>" target="_blank">
<?php
echo \esc_html__( 'Unlock with Premium', 'wordpress-seo' )
// phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
Expand Down
23 changes: 12 additions & 11 deletions admin/watchers/class-slug-change-watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public function detect_post_trash( $post_id ) {
$post_label = $this->get_post_type_label( get_post_type( $post_id ) );

/* translators: %1$s expands to the translated name of the post type. */
$first_sentence = sprintf( __( 'You just trashed a %1$s.', 'wordpress-seo' ), $post_label );
$message = $this->get_message( $first_sentence, 'trashed', $post_label );
$first_sentence = sprintf( __( 'You just trashed a %1$s.', 'wordpress-seo' ), $post_label );
$second_sentence = __( 'Search engines and other websites can still send traffic to your trashed content.', 'wordpress-seo' );
$message = $this->get_message( $first_sentence, $second_sentence );

$this->add_notification( $message );
}
Expand All @@ -85,8 +86,9 @@ public function detect_post_delete( $post_id ) {
$post_label = $this->get_post_type_label( get_post_type( $post_id ) );

/* translators: %1$s expands to the translated name of the post type. */
$first_sentence = sprintf( __( 'You just deleted a %1$s.', 'wordpress-seo' ), $post_label );
$message = $this->get_message( $first_sentence, 'deleted', $post_label );
$first_sentence = sprintf( __( 'You just deleted a %1$s.', 'wordpress-seo' ), $post_label );
$second_sentence = __( 'Search engines and other websites can still send traffic to your deleted content.', 'wordpress-seo' );
$message = $this->get_message( $first_sentence, $second_sentence );

$this->add_notification( $message );
}
Expand All @@ -107,8 +109,9 @@ public function detect_term_delete( $term_taxonomy_id ) {
$term_label = $this->get_taxonomy_label_for_term( $term->term_id );

/* translators: %1$s expands to the translated name of the term. */
$first_sentence = sprintf( __( 'You just deleted a %1$s.', 'wordpress-seo' ), $term_label );
$message = $this->get_message( $first_sentence, 'deleted', $term_label );
$first_sentence = sprintf( __( 'You just deleted a %1$s.', 'wordpress-seo' ), $term_label );
$second_sentence = __( 'Search engines and other websites can still send traffic to your deleted content.', 'wordpress-seo' );
$message = $this->get_message( $first_sentence, $second_sentence );

$this->add_notification( $message );
}
Expand Down Expand Up @@ -209,17 +212,15 @@ protected function check_visible_post_status( $post_status ) {
* Returns the message around changed URLs.
*
* @param string $first_sentence The first sentence of the notification.
* @param string $action The action performed, either "deleted" or "trashed".
* @param string $object_label The label of the object that was deleted or trashed.
* @param string $second_sentence The second sentence of the notification.
*
* @return string The full notification.
*/
protected function get_message( $first_sentence, $action, $object_label ) {
protected function get_message( $first_sentence, $second_sentence ) {
return '<h2>' . __( 'Make sure you don\'t miss out on traffic!', 'wordpress-seo' ) . '</h2>'
. '<p>'
. $first_sentence
/* translators: %1$s expands to either "deleted" or "trashed". %2$s expands to the name of the post or term. */
. ' ' . sprintf( __( 'Search engines and other websites can still send traffic to your %1$s %2$s.', 'wordpress-seo' ), $action, $object_label )
. ' ' . $second_sentence
. ' ' . __( 'You should create a redirect to ensure your visitors do not get a 404 error when they click on the no longer working URL.', 'wordpress-seo' )
/* translators: %s expands to Yoast SEO Premium */
. ' ' . sprintf( __( 'With %s, you can easily create such redirects.', 'wordpress-seo' ), 'Yoast SEO Premium' )
Expand Down
4 changes: 4 additions & 0 deletions config/dependency-injection/deprecated-classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
use Yoast\WP\SEO\Integrations\Schema_Blocks;
use Yoast\WP\SEO\Integrations\Third_Party\CoAuthors_Plus;
use Yoast\WP\SEO\Integrations\Third_Party\The_Events_Calendar;
use Yoast\WP\SEO\Integrations\Third_Party\Wincher;
use Yoast\WP\SEO\Integrations\Third_Party\Wordproof_Integration_Toggle;
use Yoast\WP\SEO\Routes\Indexables_Page_Route;
use Yoast\WP\SEO\Schema_Templates\Assets\Icons;

Expand All @@ -56,6 +58,8 @@
Schema_Blocks::class => '20.5',
Icons::class => '20.5',
Old_Premium_Integration::class => '20.10',
Wincher::class => '21.6',
Wordproof_Integration_Toggle::class => '21.6',
];

foreach ( $deprecated_classes as $original_class => $version ) {
Expand Down
25 changes: 0 additions & 25 deletions config/jenkins/Jenkinsfile_artifact

This file was deleted.

34 changes: 18 additions & 16 deletions config/webpack/externals.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
const { camelCaseDash } = require( "@wordpress/dependency-extraction-webpack-plugin/lib/util" );
const {
camelCaseDash,
} = require("@wordpress/dependency-extraction-webpack-plugin/lib/util");

/**
* Yoast dependencies, declared as such in the package.json.
*/
const { dependencies } = require( "../../packages/js/package" );
const legacyYoastPackages = [ "yoast-components", "yoastseo" ];
const additionalPackages = [
const { dependencies } = require("../../packages/js/package");
const legacyYoastPackages = ["yoast-components", "yoastseo"];
const additionalPackages = [
"draft-js",
"styled-components",
"jed",
"prop-types",
"redux",
"@reduxjs/toolkit",
"react-helmet",
"chart.js",
];

const YOAST_PACKAGE_NAMESPACE = "@yoast/";

// Fetch all packages from the dependencies list.
const yoastPackages = Object.keys( dependencies )
.filter(
( packageName ) =>
packageName.startsWith( YOAST_PACKAGE_NAMESPACE ) ||
legacyYoastPackages.includes( packageName ) ||
additionalPackages.includes( packageName )
);
const yoastPackages = Object.keys(dependencies).filter(
(packageName) =>
packageName.startsWith(YOAST_PACKAGE_NAMESPACE) ||
legacyYoastPackages.includes(packageName) ||
additionalPackages.includes(packageName)
);

/**
* Convert Yoast packages to externals configuration.
*/
const yoastExternals = yoastPackages.reduce( ( memo, packageName ) => {
let useablePackageName = packageName.replace( YOAST_PACKAGE_NAMESPACE, "" );
const yoastExternals = yoastPackages.reduce((memo, packageName) => {
let useablePackageName = packageName.replace(YOAST_PACKAGE_NAMESPACE, "");

switch ( useablePackageName ) {
switch (useablePackageName) {
case "components":
useablePackageName = "components-new";
break;
Expand All @@ -47,9 +49,9 @@ const yoastExternals = yoastPackages.reduce( ( memo, packageName ) => {
break;
}

memo[ packageName ] = camelCaseDash( useablePackageName );
memo[packageName] = camelCaseDash(useablePackageName);
return memo;
}, {} );
}, {});

module.exports = {
YOAST_PACKAGE_NAMESPACE,
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { yoastExternals } = require( "./externals" );
let analyzerPort = 8888;

module.exports = function( { entry, output, combinedOutputFile, cssExtractFileName } ) {
const exclude = /node_modules[/\\](?!(yoast-components|gutenberg|yoastseo|@wordpress|@yoast|parse5)[/\\]).*/;
const exclude = /node_modules[/\\](?!(yoast-components|gutenberg|yoastseo|@wordpress|@yoast|parse5|chart.js)[/\\]).*/;
// The index of the babel-loader rule.
let ruleIndex = 0;
if ( process.env.NODE_ENV !== "production" ) {
Expand Down
7 changes: 7 additions & 0 deletions css/src/introductions.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@
focus:yst-outline-none
focus:yst-ring-offset-0;
}
.yst-introduction-modal-panel {
background-image: linear-gradient(180deg, rgba(166, 30, 105, 0.25) 10%, rgba(255, 255, 255, 0.25) 50%);
}
.yst-introduction-modal-uppercase{
letter-spacing: 0.8px;
@apply yst-uppercase yst-text-slate-500;
}
}
5 changes: 5 additions & 0 deletions css/src/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

@media (min-width: 600px) {
border-radius: 8px;
max-height: calc( 100% - 48px );
}
}

Expand All @@ -80,6 +81,10 @@
margin: 0;
}

.yoast-gutenberg-modal .components-modal__content .components-modal__header {
border-bottom: 1px solid #e2e8f0 !important;
}

.yoast-gutenberg-modal .components-modal__icon-container {
display: inline-flex;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"typescript": "^4.2.4"
},
"yoast": {
"pluginVersion": "21.5-RC1"
"pluginVersion": "21.5-RC4"
},
"version": "0.0.0"
}
6 changes: 5 additions & 1 deletion packages/babel-preset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ module.exports = ( api ) => {

return {
presets: [ "@wordpress/babel-preset-default" ],
plugins: [ "@babel/plugin-proposal-optional-chaining", "@babel/plugin-transform-runtime" ],
plugins: [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-class-properties",
],
sourceType: "unambiguous",
};
};
1 change: 1 addition & 0 deletions packages/babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"private": false,
"dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.17.12",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-runtime": "^7.17.12",
"@wordpress/babel-preset-default": "^6.13.0"
},
Expand Down
19 changes: 11 additions & 8 deletions packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"@draft-js-plugins/mention": "^5.0.0",
"@headlessui/react": "^1.7.8",
"@heroicons/react": "^1.0.6",
"@wordpress/api-fetch": "^6.13.0",
"@reduxjs/toolkit": "^1.8.3",
"@wordpress/a11y": "^2.15.1",
"@wordpress/api-fetch": "^6.13.0",
"@wordpress/block-editor": "^5.3.1",
"@wordpress/blocks": "^11.1.2",
"@wordpress/components": "^13.0.3",
Expand Down Expand Up @@ -40,9 +41,13 @@
"@yoast/ui-library": "^3.2.1",
"a11y-speak": "git+https://github.com/Yoast/a11y-speak.git#master",
"babel-polyfill": "^6.26.0",
"bowser": "^2.11.0",
"chart.js": "^4.2.1",
"chartjs-adapter-moment": "^1.0.1",
"classnames": "^2.3.2",
"draft-js": "^0.11.7",
"find-with-regex": "~1.0.2",
"formik": "^2.2.9",
"interpolate-components": "^1.1.0",
"jed": "^1.1.1",
"lodash": "^4.17.21",
Expand All @@ -51,22 +56,20 @@
"moment-duration-format": "^2.2.2",
"prop-types": "^15.5.10",
"react-animate-height": "^2.0.23",
"react-aria-live": "^2.0.5",
"react-chartjs-2": "^5.2.0",
"react-helmet": "^6.1.0",
"react-hotkeys-hook": "^4.0.5",
"react-intl": "^2.4.0",
"react-redux": "^5.0.6",
"react-router-dom": "^6.3.0",
"react-select": "^3.1.0",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"styled-components": "^5.3.6",
"yoast-components": "^5.24.0",
"yoastseo": "^1.91.1",
"formik": "^2.2.9",
"@reduxjs/toolkit": "^1.8.3",
"react-router-dom": "^6.3.0",
"yup": "^0.32.11",
"bowser": "^2.11.0",
"react-hotkeys-hook": "^4.0.5",
"react-aria-live": "^2.0.5"
"yup": "^0.32.11"
},
"devDependencies": {
"@babel/core": "^7.17.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/ai-generator/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AiGeneratorUpsell = ( { fieldId } ) => {
{ __( "Use AI", "wordpress-seo" ) }
</button>
<Modal className="yst-introduction-modal" isOpen={ isModalOpen } onClose={ setIsModalOpenFalse } initialFocus={ focusElementRef }>
<Modal.Panel className="yst-max-w-lg yst-p-0 yst-bg-gradient-to-b yst-from-[#EDD2E1] yst-rounded-3xl">
<Modal.Panel className="yst-max-w-lg yst-p-0 yst-rounded-3xl yst-introduction-modal-panel">
<ModalContent onClose={ setIsModalOpenFalse } focusElementRef={ focusElementRef } />
</Modal.Panel>
</Modal>
Expand Down
21 changes: 5 additions & 16 deletions packages/js/src/components/AdvancedSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getNoIndexOptions = ( editorContext ) => {
return [
{
name: sprintf(
/* Translators: %s translates to "yes" or "no", %s translates to the Post Label in plural form */
/* translators: the first %s translates to "yes" or "no", the second %s translates to the content type label in plural form */
__( "%s (current default for %s)", "wordpress-seo" ),
noIndex,
editorContext.postTypeNamePlural
Expand All @@ -45,7 +45,7 @@ const getNoIndexOptions = ( editorContext ) => {
return [
{
name: sprintf(
/* Translators: %s translates to the "yes" or "no" ,%s translates to the Post Label in plural form */
/* translators: the first %s translates to "yes" or "no", the second %s translates to the content type label in plural form */
__( "%s (current default for %s)", "wordpress-seo" ),
noIndex,
editorContext.postTypeNamePlural
Expand Down Expand Up @@ -81,12 +81,7 @@ const MetaRobotsNoIndex = ( { noIndex, onNoIndexChange, editorContext, isPrivate
</Alert>
}
<Select
label={
sprintf(
/* Translators: %s translates to the Post Label in singular form */
__( "Allow search engines to show this %s in search results?", "wordpress-seo" ),
editorContext.postTypeNameSingular
) }
label={ __( "Allow search engines to show this content in search results?", "wordpress-seo" ) }
onChange={ onNoIndexChange }
id={ join( [ "yoast-meta-robots-noindex", location ] ) }
options={ metaRobotsNoIndexOptions }
Expand Down Expand Up @@ -116,19 +111,15 @@ MetaRobotsNoIndex.defaultProps = {
*
* @returns {JSX.Element} The Meta Robots No-Follow option.
*/
const MetaRobotsNoFollow = ( { noFollow, onNoFollowChange, postTypeName } ) => {
const MetaRobotsNoFollow = ( { noFollow, onNoFollowChange } ) => {
return <LocationConsumer>
{ location => {
const id = join( [ "yoast-meta-robots-nofollow", location ] );

return <RadioButtonGroup
id={ id }
options={ [ { value: "0", label: "Yes" }, { value: "1", label: "No" } ] }
label={ sprintf(
/* Translators: %s translates to the Post Label in singular form */
__( "Should search engines follow links on this %s", "wordpress-seo" ),
postTypeName
) }
label={ __( "Should search engines follow links on this content?", "wordpress-seo" ) }
groupName={ id }
onChange={ onNoFollowChange }
selected={ noFollow }
Expand All @@ -143,7 +134,6 @@ const MetaRobotsNoFollow = ( { noFollow, onNoFollowChange, postTypeName } ) => {
MetaRobotsNoFollow.propTypes = {
noFollow: PropTypes.string.isRequired,
onNoFollowChange: PropTypes.func.isRequired,
postTypeName: PropTypes.string.isRequired,
};

/**
Expand Down Expand Up @@ -318,7 +308,6 @@ const AdvancedSettings = ( props ) => {
const noFollowProps = {
noFollow,
onNoFollowChange,
postTypeName: editorContext.postTypeNameSingular,
};

const advancedProps = {
Expand Down
Loading

0 comments on commit 69fba20

Please sign in to comment.