axyseo 2.0.0-alpha.0.0.19 → 2.0.0-alpha.0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/parsedPaper/assess/assessments/Assessment.js +14 -2
- package/build/parsedPaper/assess/assessments/Assessment.js.map +1 -1
- package/build/scoring/assessments/assessment.js +5 -1
- package/build/scoring/assessments/assessment.js.map +1 -1
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js +5 -1
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js +5 -1
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js +5 -1
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js +5 -1
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/ImageCountAssessment.js +5 -1
- package/build/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/InternalLinksAssessment.js +5 -1
- package/build/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js +5 -1
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseAssessment.js +5 -1
- package/build/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js +5 -1
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js +6 -2
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +5 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +5 -1
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +5 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js +5 -1
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js +5 -1
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js +5 -1
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SingleH1Assessment.js +5 -1
- package/build/scoring/assessments/seo/SingleH1Assessment.js.map +1 -1
- package/build/scoring/assessments/seo/SingleTitleAssessment.js +5 -1
- package/build/scoring/assessments/seo/SingleTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +5 -1
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextImagesAssessment.js +5 -1
- package/build/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextLengthAssessment.js +5 -1
- package/build/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js +5 -1
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlLengthAssessment.js +5 -1
- package/build/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
- package/build/scoring/assessors/assessor.js +20 -7
- package/build/scoring/assessors/assessor.js.map +1 -1
- package/build/scoring/assessors/avadaAssessor.js +5 -4
- package/build/scoring/assessors/avadaAssessor.js.map +1 -1
- package/build/scoring/assessors/contentAssessor.js +3 -3
- package/build/scoring/assessors/contentAssessor.js.map +1 -1
- package/build/scoring/assessors/seoAssessor.js +3 -3
- package/build/scoring/assessors/seoAssessor.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_polarisIcons","_helpers","_react","_polaris","e","__esModule","default","KeyphraseLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","KeyIcon","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keywordLength","countWords","getKeyword","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {countWords} from '@axyseo/helpers';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\n/**\n * Assessment to check whether the keyphrase has a good length.\n */\nclass KeyphraseLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config) {\n super();\n\n this.defaultConfig = {\n id: 'keyphraseLength',\n ctaType: 'fix',\n priority: 'low',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-length',\n fixPosition: 'keyword search',\n icon: KeyIcon,\n title: 'Keyword length',\n content: {\n improve: '',\n bad: 'Keyword too long. Keep keyword length less than 4 words for readability.',\n good: 'Keyword length is optimized, less than 4 words.'\n }\n };\n\n this.identifier = 'keyphraseLength';\n this._config = merge(this.defaultConfig, config);\n }\n\n /**\n * Assesses the keyphrase presence and length.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of this assessment.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Calculates the result based on the keyphraseLength research.\n *\n * @returns {Object} Object with score and text.\n */\n calculateResult(paper, i18n) {\n const keywordLength = countWords(paper.getKeyword());\n\n let status = '';\n if (keywordLength <= 4) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n\nexport default KeyphraseLengthAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAsC,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtC;AACA;AACA;AACA,MAAMG,yBAAyB,SAASC,mBAAU,CAAC;EACjD;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,aAAa,GAAG;MACnBC,EAAE,EAAE,iBAAiB;MACrBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,KAAK;MACfC,MAAM,EACJ,4FAA4F;MAC9FC,WAAW,EAAE,gBAAgB;MAC7BC,IAAI,EAAEC,qBAAO;MACbC,KAAK,EAAE,gBAAgB;MACvBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE,0EAA0E;QAC/EC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,iBAAiB;IACnC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAAC,IAAI,CAACf,aAAa,EAAED,MAAM,CAAC;EAClD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEiB,SAASA,
|
|
1
|
+
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_polarisIcons","_helpers","_react","_polaris","e","__esModule","default","KeyphraseLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","KeyIcon","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keywordLength","countWords","getKeyword","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {countWords} from '@axyseo/helpers';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\n/**\n * Assessment to check whether the keyphrase has a good length.\n */\nclass KeyphraseLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config) {\n super();\n\n this.defaultConfig = {\n id: 'keyphraseLength',\n ctaType: 'fix',\n priority: 'low',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-length',\n fixPosition: 'keyword search',\n icon: KeyIcon,\n title: 'Keyword length',\n content: {\n improve: '',\n bad: 'Keyword too long. Keep keyword length less than 4 words for readability.',\n good: 'Keyword length is optimized, less than 4 words.'\n }\n };\n\n this.identifier = 'keyphraseLength';\n this._config = merge(this.defaultConfig, config);\n }\n\n /**\n * Assesses the keyphrase presence and length.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of this assessment.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Calculates the result based on the keyphraseLength research.\n *\n * @returns {Object} Object with score and text.\n */\n calculateResult(paper, i18n) {\n const keywordLength = countWords(paper.getKeyword());\n\n let status = '';\n if (keywordLength <= 4) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n\nexport default KeyphraseLengthAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA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AEcC,yBAAyB","ignoreList":[]}
|
|
@@ -48,7 +48,11 @@ class KeyphraseDensityAssessment extends _assessment.default {
|
|
|
48
48
|
* @param i18n
|
|
49
49
|
* @returns {AssessmentResult} The result of the assessment.
|
|
50
50
|
*/
|
|
51
|
-
getResult(
|
|
51
|
+
getResult({
|
|
52
|
+
paper,
|
|
53
|
+
researcher,
|
|
54
|
+
i18n
|
|
55
|
+
}) {
|
|
52
56
|
this._keyphraseCount = researcher.getResearch('getKeyphraseCount');
|
|
53
57
|
const keyphraseLength = this._keyphraseCount.keyphraseLength;
|
|
54
58
|
this._keyphraseDensity = researcher.getResearch('getKeyphraseDensity');
|
|
@@ -80,7 +84,7 @@ class KeyphraseDensityAssessment extends _assessment.default {
|
|
|
80
84
|
}
|
|
81
85
|
const score = this.getScore(this._config.priority, status);
|
|
82
86
|
return {
|
|
83
|
-
title: 'Main keyword density' + ': ' + density.toFixed(2) + '%',
|
|
87
|
+
title: (this._config.title || 'Main keyword density') + ': ' + density.toFixed(2) + '%',
|
|
84
88
|
score,
|
|
85
89
|
status,
|
|
86
90
|
body: /*#__PURE__*/_react.default.createElement(_polaris.Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_helpers","_keyphraseLengthFactor","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","setTitle","title","density","getScore","toFixed","createElement","Text","as","href","target","rel","isApplicable","hasText","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\nimport {calculateKeywordDensity} from '../../../helpers';\nimport keyphraseLengthFactor from '../../../scoring/helpers/assessments/keyphraseLengthFactor';\n\n/**\n * Represents the assessment that will look if the keyphrase density is within the recommended range.\n */\nclass KeyphraseDensityAssessment extends Assessment {\n /**\n *\n * @param config\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'keyphraseDensity',\n fixPosition: 'highlightKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',\n ctaType: 'fix',\n priority: 'high',\n content: {\n good: 'Keyword density is optimized, between 1 - 1.5%.',\n bad: 'Keep keyword density from 1% - 1.5%.',\n improve: ''\n }\n };\n\n this.identifier = 'keyphraseDensity';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the keyphrase density module, based on this returns an assessment\n * result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment.\n */\n getResult(paper, researcher, i18n) {\n this._keyphraseCount = researcher.getResearch('getKeyphraseCount');\n const keyphraseLength = this._keyphraseCount.keyphraseLength;\n\n this._keyphraseDensity = researcher.getResearch('getKeyphraseDensity');\n this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor(keyphraseLength);\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n * Returns the score for the keyphrase density.\n *\n * @returns {Object} The object with calculated score and resultText.\n */\n calculateResult(paper, i18n) {\n const density = this._keyphraseDensity;\n let status = '';\n if (density < 1 || density > 1.5) {\n status = 'bad';\n }\n if (density >= 1 && density <= 1.5) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n title: 'Main keyword density' + ': ' + density.toFixed(2) + '%',\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text of the minimum required length and a keyphrase is set. Language-specific length requirements and methods\n * of counting text length may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum\n * required length higher).\n *\n * @param {Paper} \t\tpaper \t\tThe paper to use for the assessment.\n * @param {Researcher} researcher The paper to use for the assessment.\n *\n * @returns {boolean} True if applicable.\n */\n isApplicable(paper, researcher) {\n return paper.hasText() && paper.hasKeyword();\n }\n}\n\nexport default KeyphraseDensityAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA+F,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/F;AACA;AACA;AACA,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EAClD;AACF;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,kBAAkB;MACtBC,WAAW,EAAE,kBAAkB;MAC/BC,MAAM,EACJ,kGAAkG;MACpGC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,IAAI,EAAE,iDAAiD;QACvDC,GAAG,EAAE,sCAAsC;QAC3CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,kBAAkB;IACpC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACZ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,
|
|
1
|
+
{"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_helpers","_keyphraseLengthFactor","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","setTitle","title","density","getScore","toFixed","createElement","Text","as","href","target","rel","isApplicable","hasText","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\nimport {calculateKeywordDensity} from '../../../helpers';\nimport keyphraseLengthFactor from '../../../scoring/helpers/assessments/keyphraseLengthFactor';\n\n/**\n * Represents the assessment that will look if the keyphrase density is within the recommended range.\n */\nclass KeyphraseDensityAssessment extends Assessment {\n /**\n *\n * @param config\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'keyphraseDensity',\n fixPosition: 'highlightKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',\n ctaType: 'fix',\n priority: 'high',\n content: {\n good: 'Keyword density is optimized, between 1 - 1.5%.',\n bad: 'Keep keyword density from 1% - 1.5%.',\n improve: ''\n }\n };\n\n this.identifier = 'keyphraseDensity';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the keyphrase density module, based on this returns an assessment\n * result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher, i18n}) {\n this._keyphraseCount = researcher.getResearch('getKeyphraseCount');\n const keyphraseLength = this._keyphraseCount.keyphraseLength;\n\n this._keyphraseDensity = researcher.getResearch('getKeyphraseDensity');\n this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor(keyphraseLength);\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n * Returns the score for the keyphrase density.\n *\n * @returns {Object} The object with calculated score and resultText.\n */\n calculateResult(paper, i18n) {\n const density = this._keyphraseDensity;\n let status = '';\n if (density < 1 || density > 1.5) {\n status = 'bad';\n }\n if (density >= 1 && density <= 1.5) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n title: (this._config.title || 'Main keyword density') + ': ' + density.toFixed(2) + '%',\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text of the minimum required length and a keyphrase is set. Language-specific length requirements and methods\n * of counting text length may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum\n * required length higher).\n *\n * @param {Paper} \t\tpaper \t\tThe paper to use for the assessment.\n * @param {Researcher} researcher The paper to use for the assessment.\n *\n * @returns {boolean} True if applicable.\n */\n isApplicable(paper, researcher) {\n return paper.hasText() && paper.hasKeyword();\n }\n}\n\nexport default KeyphraseDensityAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA+F,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/F;AACA;AACA;AACA,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EAClD;AACF;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,kBAAkB;MACtBC,WAAW,EAAE,kBAAkB;MAC/BC,MAAM,EACJ,kGAAkG;MACpGC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,IAAI,EAAE,iDAAiD;QACvDC,GAAG,EAAE,sCAAsC;QAC3CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,kBAAkB;IACpC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACZ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,IAAI,CAACC,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,IAAI,sBAAsB,IAAI,IAAI,GAAGC,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG;MACvFT,KAAK;MACLE,MAAM;MACNE,IAAI,eACF7C,MAAA,CAAAS,OAAA,CAAA0C,aAAA,CAACjD,QAAA,CAAAkD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC5B,OAAO,CAACL,OAAO,CAACuB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAAClB,OAAO,CAACR,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAA0C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC7B,OAAO,CAACR,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC7B,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAAC8B,OAAO,CAAC,CAAC,IAAI9B,KAAK,CAAC+B,UAAU,CAAC,CAAC;EAC9C;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApD,OAAA,GAEcC,0BAA0B","ignoreList":[]}
|
|
@@ -57,7 +57,11 @@ class MetaDescriptionKeywordAssessment extends _assessment.default {
|
|
|
57
57
|
* @param i18n
|
|
58
58
|
* @returns {AssessmentResult} The assessment result.
|
|
59
59
|
*/
|
|
60
|
-
getResult(
|
|
60
|
+
getResult({
|
|
61
|
+
paper,
|
|
62
|
+
researcher,
|
|
63
|
+
i18n
|
|
64
|
+
}) {
|
|
61
65
|
const assessmentResult = new _AssessmentResult.default({
|
|
62
66
|
config: this._config
|
|
63
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_polarisIcons","_helpers","_matchTextWithWord","e","__esModule","default","MetaDescriptionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","KeyIcon","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","description","getDescription","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","hasDescription","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {isIncludes} from '../../../helpers';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta description.\n */\nclass MetaDescriptionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionKeyword',\n priority: 'high',\n fixPosition: 'meta description',\n ctaType: 'fix',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n icon: KeyIcon,\n title: 'Meta description keyword',\n content: {\n bad: 'No keywords found in meta description. Add at least one to improve keyword rank.',\n good: 'Keywords are included meta description.',\n improve: ''\n }\n };\n\n this.identifier = 'metaDescriptionKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const description = paper.getDescription();\n const {count} = matchTextWithWord(description, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword() && paper.hasDescription();\n }\n}\n\nexport default MetaDescriptionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACA,MAAMG,gCAAgC,SAASC,mBAAU,CAAC;EACxD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,wBAAwB;MAC5BC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,kBAAkB;MAC/BC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,yCAAyC;MACjDC,IAAI,EAAEC,qBAAO;MACbC,KAAK,EAAE,0BAA0B;MACjCC,OAAO,EAAE;QACPC,GAAG,EAAE,kFAAkF;QACvFC,IAAI,EAAE,yCAAyC;QAC/CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,wBAAwB;IAC1C,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACf,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEiB,SAASA,
|
|
1
|
+
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_polarisIcons","_helpers","_matchTextWithWord","e","__esModule","default","MetaDescriptionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","KeyIcon","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","description","getDescription","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","hasDescription","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {isIncludes} from '../../../helpers';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta description.\n */\nclass MetaDescriptionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionKeyword',\n priority: 'high',\n fixPosition: 'meta description',\n ctaType: 'fix',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n icon: KeyIcon,\n title: 'Meta description keyword',\n content: {\n bad: 'No keywords found in meta description. Add at least one to improve keyword rank.',\n good: 'Keywords are included meta description.',\n improve: ''\n }\n };\n\n this.identifier = 'metaDescriptionKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const description = paper.getDescription();\n const {count} = matchTextWithWord(description, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword() && paper.hasDescription();\n }\n}\n\nexport default MetaDescriptionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACA,MAAMG,gCAAgC,SAASC,mBAAU,CAAC;EACxD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,wBAAwB;MAC5BC,QAAQ,EAAE,MAAM;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I,IAAAU,gBAAQ,EAACH,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;MAChCP,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACa,QAAQ,CAAC,IAAI,CAACxB,OAAO,CAACZ,QAAQ,EAAEyB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF9C,MAAA,CAAAY,OAAA,CAAA4C,aAAA,CAACrD,QAAA,CAAAsD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC3B,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBtB,MAAA,CAAAY,OAAA,CAAA4C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC5B,OAAO,CAACT,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC5B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC6B,UAAU,CAAC,CAAC,IAAI7B,KAAK,CAAC8B,cAAc,CAAC,CAAC;EACrD;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAEcC,gCAAgC","ignoreList":[]}
|
|
@@ -49,7 +49,11 @@ class MetaDescriptionLengthAssessment extends _assessment.default {
|
|
|
49
49
|
* @param i18n
|
|
50
50
|
* @returns {AssessmentResult} The assessment result.
|
|
51
51
|
*/
|
|
52
|
-
getResult(
|
|
52
|
+
getResult({
|
|
53
|
+
paper,
|
|
54
|
+
researcher,
|
|
55
|
+
i18n
|
|
56
|
+
}) {
|
|
53
57
|
const assessmentResult = new _AssessmentResult.default({
|
|
54
58
|
config: this._config
|
|
55
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","MetaDescriptionLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getDescription","getScore","createElement","Text","as","href","target","rel","isApplicable","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Assessment for calculating the length of the meta description.\n */\nexport default class MetaDescriptionLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#meta-description',\n priority: 'high',\n fixPosition: 'meta description',\n title: 'Meta description length',\n content: {\n good: 'Meta description is optimized, less than 160 characters.',\n improve: 'Write a unique and compelling description of 150-160 characters.',\n bad:\n 'Missing meta description. Write a unique and compelling description under 160 characters.'\n }\n };\n\n this.identifier = 'metaDescriptionLength';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionLength module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getDescription().length;\n\n let status = '';\n\n if (length === 0) {\n status = 'bad';\n }\n if (length > 0 && (length < 150 || length > 160)) {\n status = 'improve';\n }\n\n if (length <= 160 && length >= 150) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns true\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,+BAA+B,SAASC,mBAAU,CAAC;EACtE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,uBAAuB;MAC3BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,8FAA8F;MAChGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,kBAAkB;MAC/BC,KAAK,EAAE,yBAAyB;MAChCC,OAAO,EAAE;QACPC,IAAI,EAAE,0DAA0D;QAChEC,OAAO,EAAE,kEAAkE;QAC3EC,GAAG,EACD;MACJ;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,uBAAuB;IACzC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,
|
|
1
|
+
{"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","MetaDescriptionLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getDescription","getScore","createElement","Text","as","href","target","rel","isApplicable","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Assessment for calculating the length of the meta description.\n */\nexport default class MetaDescriptionLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#meta-description',\n priority: 'high',\n fixPosition: 'meta description',\n title: 'Meta description length',\n content: {\n good: 'Meta description is optimized, less than 160 characters.',\n improve: 'Write a unique and compelling description of 150-160 characters.',\n bad:\n 'Missing meta description. Write a unique and compelling description under 160 characters.'\n }\n };\n\n this.identifier = 'metaDescriptionLength';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionLength module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getDescription().length;\n\n let status = '';\n\n if (length === 0) {\n status = 'bad';\n }\n if (length > 0 && (length < 150 || length > 160)) {\n status = 'improve';\n }\n\n if (length <= 160 && length >= 150) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns true\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,+BAA+B,SAASC,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G,MAAM,KAAK,CAAC,EAAE;MAChBH,MAAM,GAAG,KAAK;IAChB;IACA,IAAIG,MAAM,GAAG,CAAC,KAAKA,MAAM,GAAG,GAAG,IAAIA,MAAM,GAAG,GAAG,CAAC,EAAE;MAChDH,MAAM,GAAG,SAAS;IACpB;IAEA,IAAIG,MAAM,IAAI,GAAG,IAAIA,MAAM,IAAI,GAAG,EAAE;MAClCH,MAAM,GAAG,MAAM;IACjB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACO,QAAQ,CAAC,IAAI,CAAClB,OAAO,CAACR,QAAQ,EAAEqB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACFzC,MAAA,CAAAS,OAAA,CAAAoC,aAAA,CAAC1C,QAAA,CAAA2C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACrB,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACtB,OAAO,CAACT,MAAO;QAACgC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACtB,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAACuB,OAAA,CAAA3C,OAAA,GAAAC,+BAAA","ignoreList":[]}
|
|
@@ -54,7 +54,11 @@ class MetaTitleKeywordAssessment extends _assessment.default {
|
|
|
54
54
|
* @param i18n
|
|
55
55
|
* @returns {AssessmentResult} The assessment result.
|
|
56
56
|
*/
|
|
57
|
-
getResult(
|
|
57
|
+
getResult({
|
|
58
|
+
paper,
|
|
59
|
+
researcher,
|
|
60
|
+
i18n
|
|
61
|
+
}) {
|
|
58
62
|
const assessmentResult = new _AssessmentResult.default({
|
|
59
63
|
config: this._config
|
|
60
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaTitleKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_matchTextWithWord","e","__esModule","default","MetaTitleKeywordAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","getTitle","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta title.\n */\nexport default class MetaTitleKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-title',\n fixPosition: 'meta title',\n ctaType: 'fix',\n priority: 'high',\n title: 'Keyword in meta title',\n content: {\n bad:\n 'No keywords found in meta title. Add one to improve keyword rank and click through rate.',\n good: 'Keyword is included in meta title.',\n improve: ''\n }\n };\n\n this.identifier = 'titleKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const title = paper.getTitle();\n const {count} = matchTextWithWord(title, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACe,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EACjE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,cAAc;MAClBC,MAAM,EACJ,8FAA8F;MAChGC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,GAAG,EACD,0FAA0F;QAC5FC,IAAI,EAAE,oCAAoC;QAC1CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,cAAc;IAChC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,
|
|
1
|
+
{"version":3,"file":"MetaTitleKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_matchTextWithWord","e","__esModule","default","MetaTitleKeywordAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","getTitle","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta title.\n */\nexport default class MetaTitleKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-title',\n fixPosition: 'meta title',\n ctaType: 'fix',\n priority: 'high',\n title: 'Keyword in meta title',\n content: {\n bad:\n 'No keywords found in meta title. Add one to improve keyword rank and click through rate.',\n good: 'Keyword is included in meta title.',\n improve: ''\n }\n };\n\n this.identifier = 'titleKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const title = paper.getTitle();\n const {count} = matchTextWithWord(title, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACe,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EACjE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,cAAc;MAClBC,MAAM,EACJ,8FAA8F;MAChGC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,GAAG,EACD,0FAA0F;QAC5FC,IAAI,EAAE,oCAAoC;QAC1CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,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,MAAM;MACNE,IAAI,eACF1C,MAAA,CAAAU,OAAA,CAAAyC,aAAA,CAAChD,QAAA,CAAAiD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC1B,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACV,MAAM,iBAClBjB,MAAA,CAAAU,OAAA,CAAAyC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC3B,OAAO,CAACV,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC3B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC4B,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAAjD,OAAA,GAAAC,0BAAA","ignoreList":[]}
|
|
@@ -49,7 +49,11 @@ class NumberInMetaTitleAssessment extends _assessment.default {
|
|
|
49
49
|
* @param i18n
|
|
50
50
|
* @returns {AssessmentResult} The assessment result.
|
|
51
51
|
*/
|
|
52
|
-
getResult(
|
|
52
|
+
getResult({
|
|
53
|
+
paper,
|
|
54
|
+
researcher,
|
|
55
|
+
i18n
|
|
56
|
+
}) {
|
|
53
57
|
const assessmentResult = new _AssessmentResult.default({
|
|
54
58
|
config: this._config
|
|
55
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInMetaTitleAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","NumberInMetaTitleAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","setBody","body","getTitle","test","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class NumberInMetaTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'numberTitle',\n ctaType: 'fix',\n status: 'good',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#using-number-in-title',\n priority: 'high',\n fixPosition: 'meta title',\n title: 'Number in meta title',\n content: {\n good: 'Number is used effectively in the title tag.',\n improve: '',\n bad: 'No number found in title tag. Consider adding a number to make it more engaging.'\n }\n };\n\n this.identifier = 'numberTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const title = paper.getTitle();\n\n let status = '';\n if (!/\\d/.test(title)) {\n status = 'bad';\n }\n\n if (!title || /\\d/.test(title)) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,2BAA2B,SAASC,mBAAU,CAAC;EAClE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,aAAa;MACjBC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,MAAM;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;QACPC,IAAI,EAAE,8CAA8C;QACpDC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,aAAa;IAC/B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,SAASA,
|
|
1
|
+
{"version":3,"file":"NumberInMetaTitleAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","NumberInMetaTitleAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","setBody","body","getTitle","test","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class NumberInMetaTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'numberTitle',\n ctaType: 'fix',\n status: 'good',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#using-number-in-title',\n priority: 'high',\n fixPosition: 'meta title',\n title: 'Number in meta title',\n content: {\n good: 'Number is used effectively in the title tag.',\n improve: '',\n bad: 'No number found in title tag. Consider adding a number to make it more engaging.'\n }\n };\n\n this.identifier = 'numberTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const title = paper.getTitle();\n\n let status = '';\n if (!/\\d/.test(title)) {\n status = 'bad';\n }\n\n if (!title || /\\d/.test(title)) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,2BAA2B,SAASC,mBAAU,CAAC;EAClE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,aAAa;MACjBC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,MAAM;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;QACPC,IAAI,EAAE,8CAA8C;QACpDC,OAAO,EAAE,EAAE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QAAA,CAAA4C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACpB,OAAO,CAACL,OAAO,CAACL,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACU,OAAO,CAACT,MAAM,iBAClBf,MAAA,CAAAM,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACrB,OAAO,CAACT,MAAO;QAAC+B,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACrB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACsB,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA5C,OAAA,GAAAC,2BAAA","ignoreList":[]}
|
|
@@ -50,7 +50,11 @@ class OutboundLinksAssessment extends _assessment.default {
|
|
|
50
50
|
* @param i18n
|
|
51
51
|
* @returns {AssessmentResult} The assessment result.
|
|
52
52
|
*/
|
|
53
|
-
getResult(
|
|
53
|
+
getResult({
|
|
54
|
+
paper,
|
|
55
|
+
researcher,
|
|
56
|
+
i18n
|
|
57
|
+
}) {
|
|
54
58
|
const linkStatistics = researcher.getResearch('getLinkStatistics');
|
|
55
59
|
const assessmentResult = new _AssessmentResult.default({
|
|
56
60
|
config: this._config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_polarisIcons","e","__esModule","default","OutboundLinksAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","icon","ExternalIcon","title","priority","content","improve","good","bad","identifier","_config","merge","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isEmpty","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","externalTotal","externalNofollow","externalDofollow","getScore","createElement","Text","as","href","target","rel","exports"],"sources":["../../../../src/scoring/assessments/seo/OutboundLinksAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {ExternalIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment for calculating the outbound links in the text.\n */\nexport default class OutboundLinksAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'externalLinks',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',\n fixPosition: 'description',\n icon: ExternalIcon,\n title: 'External links',\n priority: 'high',\n content: {\n improve: '',\n good: 'External links are used effectively.',\n bad: 'No external links found. Add relevant links to be more authoritative and informative.'\n }\n };\n\n this.identifier = 'externalLinks';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the getLinkStatistics module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(linkStatistics, i18n);\n\n if (!isEmpty(linkStatistics)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n return assessmentResult;\n }\n\n /**\n * Checks whether paper has text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n\n /**\n *\n * @param linkStatistics\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(linkStatistics, i18n) {\n let status = '';\n if (linkStatistics.externalTotal === 0) {\n status = 'bad';\n } else if (linkStatistics.externalNofollow === linkStatistics.externalTotal) {\n status = 'bad';\n } else if (linkStatistics.externalDofollow < linkStatistics.externalTotal) {\n status = 'good';\n } else if (linkStatistics.externalDofollow === linkStatistics.externalTotal) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAoD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpD;AACA;AACA;AACe,MAAMG,uBAAuB,SAASC,mBAAU,CAAC;EAC9D;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,eAAe;MACnBC,MAAM,EACJ,2GAA2G;MAC7GC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAEC,0BAAY;MAClBC,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,IAAI,EAAE,sCAAsC;QAC5CC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,eAAe;IACjC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,SAASA,
|
|
1
|
+
{"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_polarisIcons","e","__esModule","default","OutboundLinksAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","icon","ExternalIcon","title","priority","content","improve","good","bad","identifier","_config","merge","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isEmpty","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","externalTotal","externalNofollow","externalDofollow","getScore","createElement","Text","as","href","target","rel","exports"],"sources":["../../../../src/scoring/assessments/seo/OutboundLinksAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {ExternalIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment for calculating the outbound links in the text.\n */\nexport default class OutboundLinksAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'externalLinks',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',\n fixPosition: 'description',\n icon: ExternalIcon,\n title: 'External links',\n priority: 'high',\n content: {\n improve: '',\n good: 'External links are used effectively.',\n bad: 'No external links found. Add relevant links to be more authoritative and informative.'\n }\n };\n\n this.identifier = 'externalLinks';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the getLinkStatistics module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(linkStatistics, i18n);\n\n if (!isEmpty(linkStatistics)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n return assessmentResult;\n }\n\n /**\n * Checks whether paper has text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n\n /**\n *\n * @param linkStatistics\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(linkStatistics, i18n) {\n let status = '';\n if (linkStatistics.externalTotal === 0) {\n status = 'bad';\n } else if (linkStatistics.externalNofollow === linkStatistics.externalTotal) {\n status = 'bad';\n } else if (linkStatistics.externalDofollow < linkStatistics.externalTotal) {\n status = 'good';\n } else if (linkStatistics.externalDofollow === linkStatistics.externalTotal) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAoD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA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{
|
|
|
48
48
|
* @param i18n
|
|
49
49
|
* @returns {AssessmentResult} The assessment result.
|
|
50
50
|
*/
|
|
51
|
-
getResult(
|
|
51
|
+
getResult({
|
|
52
|
+
paper,
|
|
53
|
+
researcher,
|
|
54
|
+
i18n
|
|
55
|
+
}) {
|
|
52
56
|
const assessmentResult = new _AssessmentResult.default({
|
|
53
57
|
config: this._config
|
|
54
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTitleWidthAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","PageTitleWidthAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getTitle","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/PageTitleWidthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class PageTitleWidthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleWidth',\n fixPosition: 'meta title',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#title-width',\n ctaType: 'fix',\n priority: 'high',\n title: 'Meta title width',\n content: {\n good: 'Title width is optimized, between 50 - 70 characters.',\n improve: '',\n bad:\n 'Title too long or too short. Aim for 50-70 characters for best display in search results.'\n }\n };\n\n this.identifier = 'titleWidth';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getTitle().length;\n\n let status = '';\n if (length <= 70 && length >= 50) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,wBAAwB,SAASC,mBAAU,CAAC;EAC/D;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,YAAY;MAChBC,WAAW,EAAE,YAAY;MACzBC,MAAM,EACJ,yFAAyF;MAC3FC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,kBAAkB;MACzBC,OAAO,EAAE;QACPC,IAAI,EAAE,uDAAuD;QAC7DC,OAAO,EAAE,EAAE;QACXC,GAAG,EACD;MACJ;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,YAAY;IAC9B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,
|
|
1
|
+
{"version":3,"file":"PageTitleWidthAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","PageTitleWidthAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getTitle","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/PageTitleWidthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class PageTitleWidthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleWidth',\n fixPosition: 'meta title',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#title-width',\n ctaType: 'fix',\n priority: 'high',\n title: 'Meta title width',\n content: {\n good: 'Title width is optimized, between 50 - 70 characters.',\n improve: '',\n bad:\n 'Title too long or too short. Aim for 50-70 characters for best display in search results.'\n }\n };\n\n this.identifier = 'titleWidth';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getTitle().length;\n\n let status = '';\n if (length <= 70 && length >= 50) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,C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,MAAM,GAAGb,KAAK,CAACc,QAAQ,CAAC,CAAC,CAACD,MAAM;IAEtC,IAAIH,MAAM,GAAG,EAAE;IACf,IAAIG,MAAM,IAAI,EAAE,IAAIA,MAAM,IAAI,EAAE,EAAE;MAChCH,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACO,QAAQ,CAAC,IAAI,CAAClB,OAAO,CAACP,QAAQ,EAAEoB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACFtC,MAAA,CAAAM,OAAA,CAAAoC,aAAA,CAAC3C,QAAA,CAAA4C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACrB,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBd,MAAA,CAAAM,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACtB,OAAO,CAACT,MAAO;QAACgC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACtB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACuB,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA5C,OAAA,GAAAC,wBAAA","ignoreList":[]}
|
|
@@ -49,7 +49,11 @@ class SingleH1Assessment extends _assessment.default {
|
|
|
49
49
|
* @param i18n
|
|
50
50
|
* @returns {AssessmentResult} The assessment result.
|
|
51
51
|
*/
|
|
52
|
-
getResult(
|
|
52
|
+
getResult({
|
|
53
|
+
paper,
|
|
54
|
+
researcher,
|
|
55
|
+
i18n
|
|
56
|
+
}) {
|
|
53
57
|
this._h1Count = researcher.getResearch('h1s');
|
|
54
58
|
const assessmentResult = new _AssessmentResult.default({
|
|
55
59
|
config: this._config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleH1Assessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleH1Assessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","_h1Count","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","htmlString","getText","desHasH1Tag","includes","getScore","createElement","Text","as","href","target","rel","isApplicable","hasText","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleH1Assessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleH1Assessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleH1',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n fixPosition: 'description',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'H1 tag',\n content: {\n good: 'H1 tag is optimized.',\n improve: 'You should use only one H1 tag',\n bad: 'Missing H1 tag. Add one H1 to clearly define your page`s topic.'\n }\n };\n\n this.identifier = 'singleH1';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n this._h1Count = researcher.getResearch('h1s');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const htmlString = paper.getText();\n const desHasH1Tag = htmlString.includes('<h1>');\n\n let status = '';\n if (this._h1Count === 1) {\n status = 'good';\n }\n\n if (this._h1Count === 0 && !desHasH1Tag) {\n status = 'good';\n }\n\n if (this._h1Count > 1) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n}\n\nexport default SingleH1Assessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE;AACA;AACA;AACA;AACA,MAAMG,kBAAkB,SAASC,mBAAU,CAAC;EAC1C;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,UAAU;MACdC,MAAM,EAAE,yCAAyC;MACjDC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,WAAW;MACpBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,QAAQ;MACfC,OAAO,EAAE;QACPC,IAAI,EAAE,sBAAsB;QAC5BC,OAAO,EAAE,gCAAgC;QACzCC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,UAAU;IAC5B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,
|
|
1
|
+
{"version":3,"file":"SingleH1Assessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleH1Assessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","_h1Count","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","htmlString","getText","desHasH1Tag","includes","getScore","createElement","Text","as","href","target","rel","isApplicable","hasText","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleH1Assessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleH1Assessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleH1',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n fixPosition: 'description',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'H1 tag',\n content: {\n good: 'H1 tag is optimized.',\n improve: 'You should use only one H1 tag',\n bad: 'Missing H1 tag. Add one H1 to clearly define your page`s topic.'\n }\n };\n\n this.identifier = 'singleH1';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._h1Count = researcher.getResearch('h1s');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const htmlString = paper.getText();\n const desHasH1Tag = htmlString.includes('<h1>');\n\n let status = '';\n if (this._h1Count === 1) {\n status = 'good';\n }\n\n if (this._h1Count === 0 && !desHasH1Tag) {\n status = 'good';\n }\n\n if (this._h1Count > 1) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n}\n\nexport default SingleH1Assessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAA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AAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC3B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC4B,OAAO,CAAC,CAAC;EACxB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEcC,kBAAkB","ignoreList":[]}
|
|
@@ -48,7 +48,11 @@ class SingleTitleAssessment extends _assessment.default {
|
|
|
48
48
|
* @param i18n
|
|
49
49
|
* @returns {AssessmentResult} The assessment result.
|
|
50
50
|
*/
|
|
51
|
-
getResult(
|
|
51
|
+
getResult({
|
|
52
|
+
paper,
|
|
53
|
+
researcher,
|
|
54
|
+
i18n
|
|
55
|
+
}) {
|
|
52
56
|
const assessmentResult = new _AssessmentResult.default({
|
|
53
57
|
config: this._config
|
|
54
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleTitleAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleTitleAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","ctaType","priority","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","count","getTitleCount","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleTitleAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleTitle',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'Duplicate title',\n content: {\n improve: '',\n bad: 'Found duplicate titles. Check your content and create unique titles.',\n good: 'No duplicate titles found.'\n }\n };\n\n this.identifier = 'singleTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const count = paper.getTitleCount();\n\n let status = '';\n if (count === 1) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n\nexport default SingleTitleAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE;AACA;AACA;AACA;AACA,MAAMG,qBAAqB,SAASC,mBAAU,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,aAAa;MACjBC,MAAM,EAAE,yCAAyC;MACjDC,OAAO,EAAE,WAAW;MACpBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,iBAAiB;MACxBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE,sEAAsE;QAC3EC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,aAAa;IAC/B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACZ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,
|
|
1
|
+
{"version":3,"file":"SingleTitleAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleTitleAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","ctaType","priority","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","count","getTitleCount","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleTitleAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleTitle',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'Duplicate title',\n content: {\n improve: '',\n bad: 'Found duplicate titles. Check your content and create unique titles.',\n good: 'No duplicate titles found.'\n }\n };\n\n this.identifier = 'singleTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const count = paper.getTitleCount();\n\n let status = '';\n if (count === 1) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\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AA7C,OAAA,GAEcC,qBAAqB","ignoreList":[]}
|
|
@@ -49,7 +49,11 @@ class SubHeadingsKeywordAssessment extends _assessment.default {
|
|
|
49
49
|
* @param i18n
|
|
50
50
|
* @returns {AssessmentResult} The assessment result.
|
|
51
51
|
*/
|
|
52
|
-
getResult(
|
|
52
|
+
getResult({
|
|
53
|
+
paper,
|
|
54
|
+
researcher,
|
|
55
|
+
i18n
|
|
56
|
+
}) {
|
|
53
57
|
this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');
|
|
54
58
|
const assessmentResult = new _AssessmentResult.default({
|
|
55
59
|
config: this._config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_helpers","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {containsKeywordInSubheadings} from '../../../helpers';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult(paper, researcher, i18n) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n if (this._subHeadings.match > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA8D,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9D;AACA;AACA;AACe,MAAMG,4BAA4B,SAASC,mBAAU,CAAC;EACnE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,oBAAoB;MACxBC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,IAAI,EAAE,uCAAuC;QAC7CC,GAAG,EACD,6FAA6F;QAC/FC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,oBAAoB;IACtC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,
|
|
1
|
+
{"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_helpers","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {containsKeywordInSubheadings} from '../../../helpers';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n if (this._subHeadings.match > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA8D,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9D;AACA;AACA;AACe,MAAMG,4BAA4B,SAASC,mBAAU,CAAC;EACnE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,oBAAoB;MACxBC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,IAAI,EAAE,uCAAuC;QAC7CC,GAAG,EACD,6FAA6F;QAC/FC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,oBAAoB;IACtC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,IAAI,CAACC,YAAY,GAAGF,UAAU,CAACG,WAAW,CAAC,2BAA2B,CA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E;IAClB,OAAOA,KAAK,CAACwB,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAA7C,OAAA,GAAAC,4BAAA","ignoreList":[]}
|
|
@@ -51,7 +51,11 @@ class TextImagesAssessment extends _assessment.default {
|
|
|
51
51
|
* @param i18n
|
|
52
52
|
* @returns {AssessmentResult} The assessment result.
|
|
53
53
|
*/
|
|
54
|
-
getResult(
|
|
54
|
+
getResult({
|
|
55
|
+
paper,
|
|
56
|
+
researcher,
|
|
57
|
+
i18n
|
|
58
|
+
}) {
|
|
55
59
|
const assessmentResult = new _AssessmentResult.default({
|
|
56
60
|
config: this._config
|
|
57
61
|
});
|