Skip to content

Commit 57c6927

Browse files
committed
Merge branch 'release/19.14' of github.com:Yoast/wordpress-seo into reverts/19.14
2 parents 10ba94d + 10eb03b commit 57c6927

13 files changed

Lines changed: 87 additions & 53 deletions

File tree

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 = '14.7.1';
18+
const CURRENT_RELEASE = '14.7.3';
1919

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

2727
/**
2828
* Holds the current version.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"typescript": "^4.2.4"
8585
},
8686
"yoast": {
87-
"pluginVersion": "19.14-RC1"
87+
"pluginVersion": "19.14-RC4"
8888
},
8989
"version": "0.0.0"
9090
}

packages/js/src/components/contentAnalysis/SeoAnalysis.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ class SeoAnalysis extends Component {
3636
* Renders the keyword synonyms upsell modal.
3737
*
3838
* @param {string} location The location of the upsell component. Used to determine the shortlinks in the component.
39+
* @param {string} locationContext In which editor this component is rendered.
3940
*
4041
* @returns {wp.Element} A modalButtonContainer component with the modal for a keyword synonyms upsell.
4142
*/
42-
renderSynonymsUpsell( location ) {
43+
renderSynonymsUpsell( location, locationContext ) {
4344
const modalProps = {
4445
classes: {
4546
openButton: "wpseo-keyword-synonyms button-link",
@@ -67,6 +68,8 @@ class SeoAnalysis extends Component {
6768
link = wpseoAdminL10n[ "shortlinks.upsell.sidebar.focus_keyword_synonyms_link" ];
6869
buyLink = wpseoAdminL10n[ "shortlinks.upsell.sidebar.focus_keyword_synonyms_button" ];
6970
}
71+
link = addQueryArgs( link, { context: locationContext } );
72+
buyLink = addQueryArgs( buyLink, { context: locationContext } );
7073

7174
return (
7275
<Modal { ...modalProps }>
@@ -265,7 +268,7 @@ class SeoAnalysis extends Component {
265268
>
266269
<SynonymSlot location={ location } />
267270
{ this.props.shouldUpsell && <Fragment>
268-
{ this.renderSynonymsUpsell( location ) }
271+
{ this.renderSynonymsUpsell( location, locationContext ) }
269272
{ this.renderMultipleKeywordsUpsell( location ) }
270273
</Fragment> }
271274
{ this.props.shouldUpsellWordFormRecognition && this.renderWordFormsUpsell( location, locationContext ) }

packages/js/src/initializers/block-editor-integration.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ import { isWordProofIntegrationActive } from "../helpers/wordproof";
4343
*/
4444
function registerFormats() {
4545
if ( typeof get( window, "wp.blockEditor.__experimentalLinkControl" ) === "function" ) {
46+
const unknownSettings = select( "core/rich-text" )
47+
.getFormatType( "core/unknown" );
48+
49+
if ( typeof( unknownSettings ) !== "undefined" ) {
50+
dispatch( "core/rich-text" ).removeFormatTypes( "core/unknown" );
51+
}
52+
4653
[
4754
link,
4855
].forEach( ( { name, replaces, ...settings } ) => {
@@ -53,6 +60,10 @@ function registerFormats() {
5360
registerFormatType( name, settings );
5461
}
5562
} );
63+
64+
if ( typeof( unknownSettings ) !== "undefined" ) {
65+
registerFormatType( "core/unknown", unknownSettings );
66+
}
5667
} else {
5768
console.warn(
5869
__( "Marking links with nofollow/sponsored has been disabled for WordPress installs < 5.4.", "wordpress-seo" ) +

packages/yoastseo/spec/scoring/assessments/inclusiveLanguage/configuration/cultureAssessmentsSpec.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ describe( "A test for Culture Assessments", () => {
199199
const assessmentResult = assessor.getResult();
200200
expect( assessmentResult.getScore() ).toEqual( 3 );
201201
expect( assessmentResult.getText() ).toEqual(
202-
"Avoid using <i>first-world</i> as it is overgeneralizing. Consider using specific name for the country or region instead. " +
202+
"Avoid using <i>first-world</i> as it is overgeneralizing. Consider using the specific name for the country or region instead. " +
203203
"<a href='https://yoa.st/inclusive-language-culture' target='_blank'>Learn more.</a>"
204204
);
205205
expect( assessmentResult.hasMarks() ).toBeTruthy();
@@ -209,6 +209,28 @@ describe( "A test for Culture Assessments", () => {
209209
original: "This sentence contains first-world." } } ]
210210
);
211211
} );
212+
it( "correctly identifies 'first world countries'", () => {
213+
const mockPaper = new Paper( "Many first world countries adopted the policy." );
214+
const mockResearcher = Factory.buildMockResearcher( [ "first world countries" ] );
215+
const assessor = new InclusiveLanguageAssessment( assessments.find( obj => obj.identifier === "firstWorldCountries" ) );
216+
217+
const isApplicable = assessor.isApplicable( mockPaper, mockResearcher );
218+
219+
expect( isApplicable ).toBeTruthy();
220+
const assessmentResult = assessor.getResult();
221+
expect( assessmentResult.getScore() ).toEqual( 3 );
222+
expect( assessmentResult.getText() ).toEqual(
223+
"Avoid using <i>first world countries</i> as it is overgeneralizing. " +
224+
"Consider using the specific name for the countries or regions instead. " +
225+
"<a href='https://yoa.st/inclusive-language-culture' target='_blank'>Learn more.</a>"
226+
);
227+
expect( assessmentResult.hasMarks() ).toBeTruthy();
228+
expect( assessor.getMarks() ).toEqual( [ { _properties: {
229+
fieldsToMark: [],
230+
marked: "<yoastmark class='yoast-text-mark'>first world countries</yoastmark>",
231+
original: "first world countries" } } ]
232+
);
233+
} );
212234
it( "correctly identifies 'third-world country'", () => {
213235
const mockPaper = new Paper( "This sentence contains third-world country." );
214236
const mockResearcher = Factory.buildMockResearcher( [ "This sentence contains third-world country." ] );

packages/yoastseo/spec/scoring/assessments/inclusiveLanguage/configuration/disabilityAssessmentsSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ describe( "a test for targetting non-inclusive phrases in disability assessments
389389
expect( assessment.isApplicable( mockPaper, mockResearcher ) ).toBe( true );
390390
expect( assessment.getResult().score ).toBe( 6 );
391391
expect( assessment.getResult().text ).toBe( "Be careful when using <i>daft</i> as it is potentially harmful. " +
392-
"Consider using an alternative, such as <i>dense, uninformed, ignorant, foolish, inconsiderate, irrational, reckless</i>." +
392+
"Consider using an alternative, such as <i>uninformed, ignorant, foolish, inconsiderate, irrational, reckless</i>." +
393393
" <a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>" );
394394
} );
395395
it( "should return the appropriate score and feedback string for: 'imbecile'", () => {

packages/yoastseo/spec/scoring/assessments/inclusiveLanguage/configuration/sesAssessmentsSpec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,27 @@ describe( "A test for SES assessments", function() {
185185
original: "This sentence contains ex-offender." } } ]
186186
);
187187
} );
188+
189+
it( "gives the correct feedback for 'the undocumented'", () => {
190+
const mockPaper = new Paper( "This sentence contains the undocumented." );
191+
const mockResearcher = Factory.buildMockResearcher( [ "This sentence contains the undocumented." ] );
192+
const assessor = new InclusiveLanguageAssessment( assessments.find( obj => obj.identifier === "theUndocumented" ) );
193+
194+
const isApplicable = assessor.isApplicable( mockPaper, mockResearcher );
195+
196+
expect( isApplicable ).toBeTruthy();
197+
const assessmentResult = assessor.getResult();
198+
expect( assessmentResult.getScore() ).toEqual( 3 );
199+
expect( assessmentResult.getText() ).toEqual(
200+
"Avoid using <i>the undocumented</i> as it is potentially overgeneralizing. " +
201+
"Consider using <i>people who are undocumented, undocumented people, people without papers </i> instead. " +
202+
"<a href='https://yoa.st/inclusive-language-ses' target='_blank'>Learn more.</a>"
203+
);
204+
expect( assessmentResult.hasMarks() ).toBeTruthy();
205+
expect( assessor.getMarks() ).toEqual( [ { _properties: {
206+
fieldsToMark: [],
207+
marked: "<yoastmark class='yoast-text-mark'>This sentence contains the undocumented.</yoastmark>",
208+
original: "This sentence contains the undocumented." } } ]
209+
);
210+
} );
188211
} );

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/cultureAssessments.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ const cultureAssessments = [
233233
{
234234
identifier: "firstWorldCountries",
235235
nonInclusivePhrases: [ "first world countries" ],
236-
inclusiveAlternatives: "specific name for the countries or regions",
236+
inclusiveAlternatives: "the specific name for the countries or regions",
237237
score: SCORES.NON_INCLUSIVE,
238238
feedbackFormat: overgeneralizing,
239239
},
240240
{
241241
identifier: "firstWorldHyphen",
242242
nonInclusivePhrases: [ "first-world" ],
243-
inclusiveAlternatives: "specific name for the country or region",
243+
inclusiveAlternatives: "the specific name for the country or region",
244244
score: SCORES.NON_INCLUSIVE,
245245
feedbackFormat: overgeneralizing,
246246
},

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/disabilityAssessments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const disabilityAssessments = [
9494
{
9595
identifier: "daft",
9696
nonInclusivePhrases: [ "daft" ],
97-
inclusiveAlternatives: "<i>dense, uninformed, ignorant, foolish, inconsiderate, irrational, reckless</i>",
97+
inclusiveAlternatives: "<i>uninformed, ignorant, foolish, inconsiderate, irrational, reckless</i>",
9898
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
9999
feedbackFormat: potentiallyHarmfulCareful,
100100
},

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/sesAssessments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const sesAssessments = [
6868
{
6969
identifier: "theUndocumented",
7070
nonInclusivePhrases: [ "the undocumented" ],
71-
inclusiveAlternatives: "<i>people who are undocumented/ undocumented people, people without papers </i>",
71+
inclusiveAlternatives: "<i>people who are undocumented, undocumented people, people without papers </i>",
7272
score: SCORES.NON_INCLUSIVE,
7373
feedbackFormat: "Avoid using <i>%1$s</i> as it is potentially overgeneralizing. Consider using %2$s instead.",
7474
rule: ( words, nonInclusivePhrase ) => {

0 commit comments

Comments
 (0)