Skip to content

Commit ddc5cb1

Browse files
author
YoastBot
committed
Merge branch 'release/21.5'
2 parents 7aa7a2d + e42f227 commit ddc5cb1

File tree

101 files changed

+996
-8271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+996
-8271
lines changed

admin/class-gutenberg-compatibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
1515
*
1616
* @var string
1717
*/
18-
const CURRENT_RELEASE = '16.8.0';
18+
const CURRENT_RELEASE = '16.8.1';
1919

2020
/**
2121
* The minimally supported version of Gutenberg by the plugin.
2222
*
2323
* @var string
2424
*/
25-
const MINIMUM_SUPPORTED = '16.8.0';
25+
const MINIMUM_SUPPORTED = '16.8.1';
2626

2727
/**
2828
* Holds the current version.

admin/tracking/class-tracking-settings-data.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
231231
'deny_search_crawling',
232232
'deny_wp_json_crawling',
233233
'deny_adsbot_crawling',
234+
'deny_ccbot_crawling',
235+
'deny_google_extended_crawling',
236+
'deny_gptbot_crawling',
234237
'last_known_no_unindexed',
235238
];
236239

apps/content-analysis/src/analysis.worker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import CollectionCornerstoneSEOAssessor from "yoastseo/src/scoring/collectionPag
2424
import CollectionRelatedKeywordAssessor from "yoastseo/src/scoring/collectionPages/relatedKeywordAssessor";
2525
import CollectionCornerstoneRelatedKeywordAssessor from "yoastseo/src/scoring/collectionPages/cornerstone/relatedKeywordAssessor";
2626

27+
import registerPremiumAssessments from "./utils/registerPremiumAssessments";
2728

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

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

40+
registerPremiumAssessments( worker, language );
41+
3942
// Set custom assessors.
4043
// Store product pages.
4144
worker.setCustomSEOAssessorClass( productSEOAssessor, "productPage", { introductionKeyphraseUrlTitle: "https://yoa.st/shopify8",
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { getLanguagesWithWordComplexity } from "yoastseo/src/helpers/getLanguagesWithWordComplexity";
2+
3+
// Configs for the supported languages.
4+
import wordComplexityConfigEnglish from "yoastseo/src/languageProcessing/languages/en/config/wordComplexity";
5+
import wordComplexityConfigGerman from "yoastseo/src/languageProcessing/languages/de/config/wordComplexity";
6+
import wordComplexityConfigSpanish from "yoastseo/src/languageProcessing/languages/es/config/wordComplexity";
7+
import wordComplexityConfigFrench from "yoastseo/src/languageProcessing/languages/fr/config/wordComplexity";
8+
9+
// Helpers for the supported languages.
10+
import wordComplexityHelperEnglish from "yoastseo/src/languageProcessing/languages/en/helpers/checkIfWordIsComplex";
11+
import wordComplexityHelperGerman from "yoastseo/src/languageProcessing/languages/de/helpers/checkIfWordIsComplex";
12+
import wordComplexityHelperSpanish from "yoastseo/src/languageProcessing/languages/es/helpers/checkIfWordIsComplex";
13+
import wordComplexityHelperFrench from "yoastseo/src/languageProcessing/languages/fr/helpers/checkIfWordIsComplex";
14+
// Research.
15+
import wordComplexity from "yoastseo/src/languageProcessing/researches/wordComplexity";
16+
import keyPhraseDistribution from "yoastseo/src/languageProcessing/researches/keyphraseDistribution";
17+
18+
// Assessment.
19+
import WordComplexityAssessment from "yoastseo/src/scoring/assessments/readability/WordComplexityAssessment";
20+
import KeyphraseDistributionAssessment from "yoastseo/src/scoring/assessments/seo/KeyphraseDistributionAssessment";
21+
22+
const helpers = {
23+
de: wordComplexityHelperGerman,
24+
en: wordComplexityHelperEnglish,
25+
es: wordComplexityHelperSpanish,
26+
fr: wordComplexityHelperFrench,
27+
};
28+
29+
const configs = {
30+
de: wordComplexityConfigGerman,
31+
en: wordComplexityConfigEnglish,
32+
es: wordComplexityConfigSpanish,
33+
fr: wordComplexityConfigFrench,
34+
};
35+
36+
const pluginName = "YoastSEOPremium";
37+
38+
export default function( worker, language ) {
39+
if ( getLanguagesWithWordComplexity().includes( language ) ) {
40+
// Get the word complexity config for the specific language.
41+
const wordComplexityConfig = configs[ language ];
42+
// Get the word complexity helper for the specific language.
43+
const wordComplexityHelper = helpers[ language ];
44+
// Initialize the assessment for regular content.
45+
const wordComplexityAssessment = new WordComplexityAssessment();
46+
// Initialize the assessment for cornerstone content.
47+
const wordComplexityAssessmentCornerstone = new WordComplexityAssessment( {
48+
scores: {
49+
acceptableAmount: 3,
50+
},
51+
} );
52+
53+
// Register the word complexity config.
54+
worker.registerResearcherConfig( "wordComplexity", wordComplexityConfig );
55+
56+
// Register the word complexity helper.
57+
worker.registerHelper( "checkIfWordIsComplex", wordComplexityHelper );
58+
59+
// Register the word complexity research.
60+
worker.registerResearch( "wordComplexity", wordComplexity );
61+
62+
// Register the word complexity assessment for regular content.
63+
worker.registerAssessment( "wordComplexity", wordComplexityAssessment, pluginName, "readability" );
64+
65+
// Register the word complexity assessment for cornerstone content.
66+
worker.registerAssessment( "wordComplexity", wordComplexityAssessmentCornerstone, pluginName, "cornerstoneReadability" );
67+
}
68+
const keyphraseDistributionAssessment = new KeyphraseDistributionAssessment();
69+
worker.registerResearch( "keyphraseDistribution", keyPhraseDistribution );
70+
worker.registerAssessment( "keyphraseDistributionAssessment", keyphraseDistributionAssessment, pluginName, "seo" );
71+
}

css/src/icons.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/src/modal.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@
5959
right: 16px;
6060
}
6161

62+
.yoast-gutenberg-modal__box.components-modal__frame {
63+
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
64+
65+
@media (min-width: 600px) {
66+
border-radius: 8px;
67+
max-height: calc( 100% - 48px );
68+
}
69+
}
70+
71+
.yoast-gutenberg-modal__no-padding .components-modal__content {
72+
padding: 0;
73+
}
74+
6275
.yoast-modal__heading h1,
6376
.yoast-gutenberg-modal .components-modal__header-heading {
6477
font-size: 20px;
@@ -68,6 +81,10 @@
6881
margin: 0;
6982
}
7083

84+
.yoast-gutenberg-modal .components-modal__content .components-modal__header {
85+
border-bottom: 1px solid #e2e8f0 !important;
86+
}
87+
7188
.yoast-gutenberg-modal .components-modal__icon-container {
7289
display: inline-flex;
7390
}

inc/options/class-wpseo-option-wpseo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ class WPSEO_Option_Wpseo extends WPSEO_Option {
127127
'deny_search_crawling' => false,
128128
'deny_wp_json_crawling' => false,
129129
'deny_adsbot_crawling' => false,
130+
'deny_ccbot_crawling' => false,
131+
'deny_google_extended_crawling' => false,
132+
'deny_gptbot_crawling' => false,
130133
'redirect_search_pretty_urls' => false,
131134
'least_readability_ignore_list' => [],
132135
'least_seo_score_ignore_list' => [],
@@ -511,6 +514,9 @@ protected function validate_option( $dirty, $clean, $old ) {
511514
* 'search_cleanup_patterns'
512515
* 'deny_wp_json_crawling'
513516
* 'deny_adsbot_crawling'
517+
* 'deny_ccbot_crawling'
518+
* 'deny_google_extended_crawling'
519+
* 'deny_gptbot_crawling'
514520
* 'redirect_search_pretty_urls'
515521
* 'should_redirect_after_install_free'
516522
* 'show_new_content_type_notification'

inc/options/class-wpseo-option.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

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

109109
/**
110-
* Array of variable option name patterns for the option - if any -.
110+
* Array of variable option name patterns for the option - if any.
111111
*
112112
* Set this when the option contains array keys which vary based on post_type
113113
* or taxonomy.
@@ -230,7 +230,7 @@ protected function __construct() {
230230
* ```
231231
* ---------------
232232
*
233-
* Concrete classes *may* contain a enrich_defaults method to add additional defaults once
233+
* Concrete classes *may* contain an enrich_defaults method to add additional defaults once
234234
* all post_types and taxonomies have been registered.
235235
*
236236
* ```
@@ -497,7 +497,7 @@ public function get_option( $options = null ) {
497497
return $filtered;
498498
}
499499

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

502502
/**
503503
* Register (whitelist) the option for the configuration pages.
@@ -523,7 +523,7 @@ public function register_setting() {
523523
}
524524

525525
/**
526-
* Validate the option
526+
* Validate the option.
527527
*
528528
* @param mixed $option_value The unvalidated new value for the option.
529529
*
@@ -645,7 +645,7 @@ public function maybe_add_option() {
645645
*
646646
* @param mixed $value The new value for the option.
647647
*
648-
* @return bool Whether the update was succesfull.
648+
* @return bool Whether the update was successful.
649649
*/
650650
public function update_site_option( $value ) {
651651
if ( $this->multisite_only === true && is_multisite() ) {
@@ -667,7 +667,7 @@ public function update_site_option( $value ) {
667667
* @uses WPSEO_Option::import()
668668
*
669669
* @param string|null $current_version Optional. Version from which to upgrade, if not set,
670-
* version specific upgrades will be disregarded.
670+
* version-specific upgrades will be disregarded.
671671
*
672672
* @return void
673673
*/
@@ -692,7 +692,7 @@ public function clean( $current_version = null ) {
692692
*
693693
* @param array $option_value Option value to be imported.
694694
* @param string|null $current_version Optional. Version from which to upgrade, if not set,
695-
* version specific upgrades will be disregarded.
695+
* version-specific upgrades will be disregarded.
696696
* @param array|null $all_old_option_values Optional. Only used when importing old options to
697697
* have access to the real old values, in contrast to
698698
* the saved ones.

inc/sitemaps/class-taxonomy-sitemap-provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public function is_valid_taxonomy( $taxonomy_name ) {
287287
return false;
288288
}
289289

290-
if ( in_array( $taxonomy_name, [ 'link_category', 'nav_menu' ], true ) ) {
290+
if ( in_array( $taxonomy_name, [ 'link_category', 'nav_menu', 'wp_pattern_category' ], true ) ) {
291291
return false;
292292
}
293293

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"typescript": "^4.2.4"
8484
},
8585
"yoast": {
86-
"pluginVersion": "21.4"
86+
"pluginVersion": "21.5"
8787
},
8888
"version": "0.0.0"
8989
}

packages/components/src/base/icons.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"scripts": {
77
"test": "jest -u",
8-
"lint": "eslint src tests --max-warnings=75"
8+
"lint": "eslint src tests --max-warnings=74"
99
},
1010
"dependencies": {
1111
"@draft-js-plugins/mention": "^5.0.0",

packages/js/src/analysis/collectAnalysisData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import getWritingDirection from "./getWritingDirection";
1010

1111
import { Paper } from "yoastseo";
1212

13+
/* eslint-disable complexity */
1314

1415
/**
1516
* Retrieves the data needed for the analyses.

0 commit comments

Comments
 (0)