Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Td/class syntax #21325

Draft
wants to merge 12 commits into
base: trunk
Choose a base branch
from
Prev Previous commit
Next Next commit
Alternative way of providing cornerstone values
  • Loading branch information
mhkuu committed Apr 24, 2024
commit 995dc7ac4639b2e734a499452d494915f69b2a71
1 change: 0 additions & 1 deletion packages/yoastseo/src/scoring/assessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ class Assessor {
* @param {string} name The name of the assessment.
* @param {object} assessment The object containing function to run as an assessment and it's requirements.
* @returns {boolean} Whether registering the assessment was successful.
* @private
*/
addAssessment( name, assessment ) {
if ( ! assessment.hasOwnProperty( "identifier" ) ) {
Expand Down
93 changes: 23 additions & 70 deletions packages/yoastseo/src/scoring/cornerstone/seoAssessor.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import SEOAssessor from "../seoAssessor";
import IntroductionKeywordAssessment from "../assessments/seo/IntroductionKeywordAssessment";
import KeyphraseLengthAssessment from "../assessments/seo/KeyphraseLengthAssessment";
import KeyphraseDensityAssessment from "../assessments/seo/KeywordDensityAssessment";
import MetaDescriptionKeywordAssessment from "../assessments/seo/MetaDescriptionKeywordAssessment";
import TextCompetingLinksAssessment from "../assessments/seo/TextCompetingLinksAssessment";
import InternalLinksAssessment from "../assessments/seo/InternalLinksAssessment";
import KeyphraseInSEOTitleAssessment from "../assessments/seo/KeyphraseInSEOTitleAssessment";
import SlugKeywordAssessment from "../assessments/seo/UrlKeywordAssessment";
import MetaDescriptionLength from "../assessments/seo/MetaDescriptionLengthAssessment";
import SubheadingsKeyword from "../assessments/seo/SubHeadingsKeywordAssessment";
import ImageKeyphrase from "../assessments/seo/KeyphraseInImageTextAssessment";
import ImageCount from "../assessments/seo/ImageCountAssessment";
import TextLength from "../assessments/seo/TextLengthAssessment";
import OutboundLinks from "../assessments/seo/OutboundLinksAssessment";
import TitleWidth from "../assessments/seo/PageTitleWidthAssessment";
import FunctionWordsInKeyphrase from "../assessments/seo/FunctionWordsInKeyphraseAssessment";
import SingleH1Assessment from "../assessments/seo/SingleH1Assessment";
import SlugKeywordAssessment from "../assessments/seo/UrlKeywordAssessment";

/**
* The CornerstoneSEOAssessor class is used for the SEO analysis for cornerstone content.
Expand All @@ -30,63 +19,27 @@ export default class CornerstoneSEOAssessor extends SEOAssessor {
super( researcher, options );
this.type = "cornerstoneSEOAssessor";

this._assessments = [
new IntroductionKeywordAssessment(),
new KeyphraseLengthAssessment(),
new KeyphraseDensityAssessment(),
new MetaDescriptionKeywordAssessment(),
new MetaDescriptionLength( {
scores: {
tooLong: 3,
tooShort: 3,
},
} ),
new SubheadingsKeyword(),
new TextCompetingLinksAssessment(),
new ImageKeyphrase( {
scores: {
withAltNonKeyword: 3,
withAlt: 3,
noAlt: 3,
},
} ),
new ImageCount(),
new TextLength( {
recommendedMinimum: 900,
slightlyBelowMinimum: 400,
belowMinimum: 300,

scores: {
belowMinimum: -20,
farBelowMinimum: -20,
},

cornerstoneContent: true,
} ),
new OutboundLinks( {
scores: {
noLinks: 3,
},
} ),
new KeyphraseInSEOTitleAssessment(),
new InternalLinksAssessment(),
new TitleWidth(
{
scores: {
widthTooShort: 9,
},
},
true
),
new SlugKeywordAssessment(
{
scores: {
okay: 3,
},
}
),
new FunctionWordsInKeyphrase(),
new SingleH1Assessment(),
];
this.addAssessment( "metaDescriptionLength", new MetaDescriptionLength( {
scores: { tooLong: 3, tooShort: 3 },
} ) );
this.addAssessment( "imageKeyphrase", new ImageKeyphrase( {
scores: { withAltNonKeyword: 3, withAlt: 3, noAlt: 3 },
} ) );
this.addAssessment( "textLength", new TextLength( {
recommendedMinimum: 900,
slightlyBelowMinimum: 400,
belowMinimum: 300,
scores: { belowMinimum: -20, farBelowMinimum: -20 },
cornerstoneContent: true,
} ) );
this.addAssessment( "externalLinks", new OutboundLinks( {
scores: { noLinks: 3 },
} ) );
this.addAssessment( "titleWidth", new TitleWidth( {
scores: { widthTooShort: 9 },
}, true ) );
this.addAssessment( "slugKeyword", new SlugKeywordAssessment( {
scores: { okay: 3 },
} ) );
}
}