Skip to content

Commit

Permalink
Merge branch 'release/21.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
YoastBot committed Oct 31, 2023
2 parents 7aa7a2d + 85327e9 commit 8f596ae
Show file tree
Hide file tree
Showing 101 changed files with 1,031 additions and 8,302 deletions.
4 changes: 2 additions & 2 deletions admin/class-gutenberg-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '16.8.0';
const CURRENT_RELEASE = '16.8.1';

/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '16.8.0';
const MINIMUM_SUPPORTED = '16.8.1';

/**
* Holds the current version.
Expand Down
3 changes: 3 additions & 0 deletions admin/tracking/class-tracking-settings-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
'deny_search_crawling',
'deny_wp_json_crawling',
'deny_adsbot_crawling',
'deny_ccbot_crawling',
'deny_google_extended_crawling',
'deny_gptbot_crawling',
'last_known_no_unindexed',
];

Expand Down
3 changes: 3 additions & 0 deletions apps/content-analysis/src/analysis.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import CollectionCornerstoneSEOAssessor from "yoastseo/src/scoring/collectionPag
import CollectionRelatedKeywordAssessor from "yoastseo/src/scoring/collectionPages/relatedKeywordAssessor";
import CollectionCornerstoneRelatedKeywordAssessor from "yoastseo/src/scoring/collectionPages/cornerstone/relatedKeywordAssessor";

import registerPremiumAssessments from "./utils/registerPremiumAssessments";

self.onmessage = ( event ) => {
const language = event.data.language;
Expand All @@ -36,6 +37,8 @@ self.onmessage = ( event ) => {

const worker = new AnalysisWebWorker( self, new Researcher() );

registerPremiumAssessments( worker, language );

// Set custom assessors.
// Store product pages.
worker.setCustomSEOAssessorClass( productSEOAssessor, "productPage", { introductionKeyphraseUrlTitle: "https://yoa.st/shopify8",
Expand Down
71 changes: 71 additions & 0 deletions apps/content-analysis/src/utils/registerPremiumAssessments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { getLanguagesWithWordComplexity } from "yoastseo/src/helpers/getLanguagesWithWordComplexity";

// Configs for the supported languages.
import wordComplexityConfigEnglish from "yoastseo/src/languageProcessing/languages/en/config/wordComplexity";
import wordComplexityConfigGerman from "yoastseo/src/languageProcessing/languages/de/config/wordComplexity";
import wordComplexityConfigSpanish from "yoastseo/src/languageProcessing/languages/es/config/wordComplexity";
import wordComplexityConfigFrench from "yoastseo/src/languageProcessing/languages/fr/config/wordComplexity";

// Helpers for the supported languages.
import wordComplexityHelperEnglish from "yoastseo/src/languageProcessing/languages/en/helpers/checkIfWordIsComplex";
import wordComplexityHelperGerman from "yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex";
import wordComplexityHelperSpanish from "yoastseo/src/languageProcessing/languages/es/helpers/checkIfWordIsComplex";
import wordComplexityHelperFrench from "yoastseo/src/languageProcessing/languages/fr/helpers/checkIfWordIsComplex";
// Research.
import wordComplexity from "yoastseo/src/languageProcessing/researches/wordComplexity";
import keyPhraseDistribution from "yoastseo/src/languageProcessing/researches/keyphraseDistribution";

// Assessment.
import WordComplexityAssessment from "yoastseo/src/scoring/assessments/readability/WordComplexityAssessment";
import KeyphraseDistributionAssessment from "yoastseo/src/scoring/assessments/seo/KeyphraseDistributionAssessment";

const helpers = {
de: wordComplexityHelperGerman,
en: wordComplexityHelperEnglish,
es: wordComplexityHelperSpanish,
fr: wordComplexityHelperFrench,
};

const configs = {
de: wordComplexityConfigGerman,
en: wordComplexityConfigEnglish,
es: wordComplexityConfigSpanish,
fr: wordComplexityConfigFrench,
};

const pluginName = "YoastSEOPremium";

export default function( worker, language ) {
if ( getLanguagesWithWordComplexity().includes( language ) ) {
// Get the word complexity config for the specific language.
const wordComplexityConfig = configs[ language ];
// Get the word complexity helper for the specific language.
const wordComplexityHelper = helpers[ language ];
// Initialize the assessment for regular content.
const wordComplexityAssessment = new WordComplexityAssessment();
// Initialize the assessment for cornerstone content.
const wordComplexityAssessmentCornerstone = new WordComplexityAssessment( {
scores: {
acceptableAmount: 3,
},
} );

// Register the word complexity config.
worker.registerResearcherConfig( "wordComplexity", wordComplexityConfig );

// Register the word complexity helper.
worker.registerHelper( "checkIfWordIsComplex", wordComplexityHelper );

// Register the word complexity research.
worker.registerResearch( "wordComplexity", wordComplexity );

// Register the word complexity assessment for regular content.
worker.registerAssessment( "wordComplexity", wordComplexityAssessment, pluginName, "readability" );

// Register the word complexity assessment for cornerstone content.
worker.registerAssessment( "wordComplexity", wordComplexityAssessmentCornerstone, pluginName, "cornerstoneReadability" );
}
const keyphraseDistributionAssessment = new KeyphraseDistributionAssessment();
worker.registerResearch( "keyphraseDistribution", keyPhraseDistribution );
worker.registerAssessment( "keyphraseDistributionAssessment", keyphraseDistributionAssessment, pluginName, "seo" );
}
2 changes: 1 addition & 1 deletion css/src/icons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions css/src/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@
right: 16px;
}

.yoast-gutenberg-modal__box.components-modal__frame {
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

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

.yoast-gutenberg-modal__no-padding .components-modal__content {
padding: 0;
}

.yoast-modal__heading h1,
.yoast-gutenberg-modal .components-modal__header-heading {
font-size: 20px;
Expand All @@ -68,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
6 changes: 6 additions & 0 deletions inc/options/class-wpseo-option-wpseo.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
'deny_search_crawling' => false,
'deny_wp_json_crawling' => false,
'deny_adsbot_crawling' => false,
'deny_ccbot_crawling' => false,
'deny_google_extended_crawling' => false,
'deny_gptbot_crawling' => false,
'redirect_search_pretty_urls' => false,
'least_readability_ignore_list' => [],
'least_seo_score_ignore_list' => [],
Expand Down Expand Up @@ -511,6 +514,9 @@ protected function validate_option( $dirty, $clean, $old ) {
* 'search_cleanup_patterns'
* 'deny_wp_json_crawling'
* 'deny_adsbot_crawling'
* 'deny_ccbot_crawling'
* 'deny_google_extended_crawling'
* 'deny_gptbot_crawling'
* 'redirect_search_pretty_urls'
* 'should_redirect_after_install_free'
* 'show_new_content_type_notification'
Expand Down
26 changes: 13 additions & 13 deletions inc/options/class-wpseo-option.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

/**
* This abstract class and it's concrete classes implement defaults and value validation for
* This abstract class and its concrete classes implement defaults and value validation for
* all WPSEO options and subkeys within options.
*
* Some guidelines:
Expand All @@ -22,9 +22,9 @@
*
* [Updating/Adding options]
* - For multisite site_options, please use the WPSEO_Options::update_site_option() method.
* - For normal options, use the normal add/update_option() functions. As long a the classes here
* - For normal options, use the normal add/update_option() functions. As long as the classes here
* are instantiated, validation for all options and their subkeys will be automatic.
* - On (succesfull) update of a couple of options, certain related actions will be run automatically.
* - On (successful) update of a couple of options, certain related actions will be run automatically.
* Some examples:
* - on change of wpseo[yoast_tracking], the cron schedule will be adjusted accordingly
* - on change of wpseo and wpseo_title, some caches will be cleared
Expand All @@ -41,7 +41,7 @@
* translate_defaults() method.
* - When you remove an array key from an option: if it's important that the option is really removed,
* add the WPSEO_Option::clean_up( $option_name ) method to the upgrade run.
* This will re-save the option and automatically remove the array key no longer in existance.
* This will re-save the option and automatically remove the array key no longer in existence.
* - When you rename a sub-option: add it to the clean_option() routine and run that in the upgrade run.
* - When you change the default for an option sub-key, make sure you verify that the validation routine will
* still work the way it should.
Expand Down Expand Up @@ -74,8 +74,8 @@ abstract class WPSEO_Option {
* Option group name for use in settings forms.
*
* Will be set automagically if not set in concrete class (i.e.
* if it confirm to the normal pattern 'yoast' . $option_name . 'options',
* only set in conrete class if it doesn't).
* if it conforms to the normal pattern 'yoast' . $option_name . 'options',
* only set in concrete class if it doesn't).
*
* @var string
*/
Expand Down Expand Up @@ -107,7 +107,7 @@ abstract class WPSEO_Option {
protected $defaults;

/**
* Array of variable option name patterns for the option - if any -.
* Array of variable option name patterns for the option - if any.
*
* Set this when the option contains array keys which vary based on post_type
* or taxonomy.
Expand Down Expand Up @@ -230,7 +230,7 @@ protected function __construct() {
* ```
* ---------------
*
* Concrete classes *may* contain a enrich_defaults method to add additional defaults once
* Concrete classes *may* contain an enrich_defaults method to add additional defaults once
* all post_types and taxonomies have been registered.
*
* ```
Expand Down Expand Up @@ -497,7 +497,7 @@ public function get_option( $options = null ) {
return $filtered;
}

/* *********** METHODS influencing add_uption(), update_option() and saving from admin pages. *********** */
/* *********** METHODS influencing add_option(), update_option() and saving from admin pages. *********** */

/**
* Register (whitelist) the option for the configuration pages.
Expand All @@ -523,7 +523,7 @@ public function register_setting() {
}

/**
* Validate the option
* Validate the option.
*
* @param mixed $option_value The unvalidated new value for the option.
*
Expand Down Expand Up @@ -645,7 +645,7 @@ public function maybe_add_option() {
*
* @param mixed $value The new value for the option.
*
* @return bool Whether the update was succesfull.
* @return bool Whether the update was successful.
*/
public function update_site_option( $value ) {
if ( $this->multisite_only === true && is_multisite() ) {
Expand All @@ -667,7 +667,7 @@ public function update_site_option( $value ) {
* @uses WPSEO_Option::import()
*
* @param string|null $current_version Optional. Version from which to upgrade, if not set,
* version specific upgrades will be disregarded.
* version-specific upgrades will be disregarded.
*
* @return void
*/
Expand All @@ -692,7 +692,7 @@ public function clean( $current_version = null ) {
*
* @param array $option_value Option value to be imported.
* @param string|null $current_version Optional. Version from which to upgrade, if not set,
* version specific upgrades will be disregarded.
* version-specific upgrades will be disregarded.
* @param array|null $all_old_option_values Optional. Only used when importing old options to
* have access to the real old values, in contrast to
* the saved ones.
Expand Down
2 changes: 1 addition & 1 deletion inc/sitemaps/class-taxonomy-sitemap-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function is_valid_taxonomy( $taxonomy_name ) {
return false;
}

if ( in_array( $taxonomy_name, [ 'link_category', 'nav_menu' ], true ) ) {
if ( in_array( $taxonomy_name, [ 'link_category', 'nav_menu', 'wp_pattern_category' ], true ) ) {
return false;
}

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.4"
"pluginVersion": "21.5"
},
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion packages/components/src/base/icons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"test": "jest -u",
"lint": "eslint src tests --max-warnings=75"
"lint": "eslint src tests --max-warnings=74"
},
"dependencies": {
"@draft-js-plugins/mention": "^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/js/src/analysis/collectAnalysisData.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import getWritingDirection from "./getWritingDirection";

import { Paper } from "yoastseo";

/* eslint-disable complexity */

/**
* Retrieves the data needed for the analyses.
Expand Down
Loading

0 comments on commit 8f596ae

Please sign in to comment.