axyseo 2.0.0-alpha.0.0.56 → 2.0.0-alpha.0.0.58
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/const/analysis.js +28 -2
- package/build/const/analysis.js.map +1 -1
- package/build/languageProcessing/researches/getSentenceBeginnings.js +13 -12
- package/build/languageProcessing/researches/getSentenceBeginnings.js.map +1 -1
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js +3 -3
- package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js +3 -2
- package/build/scoring/assessments/readability/RelatedKeywordsAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js +3 -2
- package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js +3 -2
- package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js +3 -2
- package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/ImageCountAssessment.js +3 -2
- package/build/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/InternalLinksAssessment.js +3 -2
- package/build/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js +3 -2
- package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseAssessment.js +3 -2
- package/build/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js +3 -2
- package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js +3 -2
- package/build/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +3 -2
- package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +3 -2
- package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +3 -2
- package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js +3 -2
- package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js +3 -2
- package/build/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js +3 -2
- package/build/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SchemaAssessment.js +3 -2
- package/build/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SingleH1Assessment.js +3 -2
- package/build/scoring/assessments/seo/SingleH1Assessment.js.map +1 -1
- package/build/scoring/assessments/seo/SingleTitleAssessment.js +3 -2
- package/build/scoring/assessments/seo/SingleTitleAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +3 -2
- package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextImagesAssessment.js +3 -2
- package/build/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/TextLengthAssessment.js +3 -2
- package/build/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js +3 -2
- package/build/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
- package/build/scoring/assessments/seo/UrlLengthAssessment.js +3 -2
- package/build/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCountAssessment.js","names":["merge","Assessment","AssessmentResult","TextImagesAssessment","constructor","config","countVideos","defaultConfig","id","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","_countVideos","getResult","paper","researcher","i18n","imageCount","getResearch","videoCount","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","mediaCount","getScore"],"sources":["../../../../src/scoring/assessments/seo/ImageCountAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that checks if the text has any images present, including videos in product pages.\n */\nexport default class TextImagesAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n * @param {boolean} countVideos Whether videos are also included in the assessment or not.\n *\n * @returns {void}\n */\n constructor(config = {}, countVideos = true) {\n super();\n\n const defaultConfig = {\n id:
|
|
1
|
+
{"version":3,"file":"ImageCountAssessment.js","names":["merge","Assessment","AssessmentResult","MEDIA_ID","TextImagesAssessment","constructor","config","countVideos","defaultConfig","id","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","_countVideos","getResult","paper","researcher","i18n","imageCount","getResearch","videoCount","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","mediaCount","getScore"],"sources":["../../../../src/scoring/assessments/seo/ImageCountAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {MEDIA_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks if the text has any images present, including videos in product pages.\n */\nexport default class TextImagesAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n * @param {boolean} countVideos Whether videos are also included in the assessment or not.\n *\n * @returns {void}\n */\n constructor(config = {}, countVideos = true) {\n super();\n\n const defaultConfig = {\n id: MEDIA_ID,\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#images-and-videos',\n priority: 'high',\n fixPosition: 'description',\n title: 'Media',\n content: {\n good: 'Media are used effectively.',\n improve: '',\n bad: 'No media found. Add visual content to enhance engagement.'\n }\n };\n\n this.identifier = MEDIA_ID;\n this._config = merge(defaultConfig, config);\n this._countVideos = countVideos;\n }\n\n /**\n * Execute the Assessment and return a result.\n *\n * @param {Paper} paper The Paper object to assess.\n * @param {Researcher} researcher The Researcher object containing all available researches.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment, containing both a score and a descriptive text.\n */\n getResult({paper, researcher, i18n}) {\n this.imageCount = researcher.getResearch('imageCount');\n this.videoCount = researcher.getResearch('videoCount');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(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 * Checks whether the 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 * Calculate the result based on the availability of images in the text, including videos in product pages.\n *\n * @returns {Object} The calculated result.\n */\n calculateResult(i18n) {\n // If \"countVideos\" is on, we include videos in the assessment\n const mediaCount = this._countVideos ? this.imageCount + this.videoCount : this.imageCount;\n\n let status = '';\n // No images.\n if (mediaCount === 0) {\n status = 'bad';\n } else {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status\n };\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,QAAQ;;AAEhB;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASH,UAAU,CAAC;EAC3D;AACF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,EAAE;IAClB,OAAOA,KAAK,CAACgB,OAAO,CAAC,CAAC;EACxB;;EAEA;AACF;AACA;AACA;AACA;EACER,eAAeA,CAACN,IAAI,EAAE;IACpB;IACA,MAAMe,UAAU,GAAG,IAAI,CAACnB,YAAY,GAAG,IAAI,CAACK,UAAU,GAAG,IAAI,CAACE,UAAU,GAAG,IAAI,CAACF,UAAU;IAE1F,IAAIS,MAAM,GAAG,EAAE;IACf;IACA,IAAIK,UAAU,KAAK,CAAC,EAAE;MACpBL,MAAM,GAAG,KAAK;IAChB,CAAC,MAAM;MACLA,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAAC,IAAI,CAACrB,OAAO,CAACR,QAAQ,EAAEuB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { merge } from 'lodash';
|
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import { LinkIcon } from '@shopify/polaris-icons';
|
|
5
|
+
import { INTERNAL_LINKS_ID } from "../../../const/analysis";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Assessment to check whether the text has internal links and whether they are followed or no-followed.
|
|
@@ -23,7 +24,7 @@ class InternalLinksAssessment extends Assessment {
|
|
|
23
24
|
constructor(config = {}) {
|
|
24
25
|
super();
|
|
25
26
|
const defaultConfig = {
|
|
26
|
-
id:
|
|
27
|
+
id: INTERNAL_LINKS_ID,
|
|
27
28
|
fixPosition: '',
|
|
28
29
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',
|
|
29
30
|
icon: LinkIcon,
|
|
@@ -35,7 +36,7 @@ class InternalLinksAssessment extends Assessment {
|
|
|
35
36
|
bad: 'No internal links found. Add links to other relevant pages on your website.'
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
this.identifier =
|
|
39
|
+
this.identifier = INTERNAL_LINKS_ID;
|
|
39
40
|
this._config = merge(defaultConfig, config);
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalLinksAssessment.js","names":["merge","Assessment","AssessmentResult","LinkIcon","InternalLinksAssessment","constructor","config","defaultConfig","id","fixPosition","docUrl","icon","priority","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","internalTotal","internalNofollow","getScore"],"sources":["../../../../src/scoring/assessments/seo/InternalLinksAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {LinkIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment to check whether the text has internal links and whether they are followed or no-followed.\n */\nclass InternalLinksAssessment 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 number of internal links in the text.\n * @param {number} [config.scores.allInternalFollow] The score to return if all internal links are do-follow.\n * @param {number} [config.scores.someInternalFollow] The score to return if some but not all internal links are do-follow.\n * @param {number} [config.scores.noneInternalFollow] The score to return if all internal links are no-follow.\n * @param {number} [config.scores.noInternal] The score to return if there are no internal links.\n * @param {string} [config.url] The URL to the relevant KB article.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id:
|
|
1
|
+
{"version":3,"file":"InternalLinksAssessment.js","names":["merge","Assessment","AssessmentResult","LinkIcon","INTERNAL_LINKS_ID","InternalLinksAssessment","constructor","config","defaultConfig","id","fixPosition","docUrl","icon","priority","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","internalTotal","internalNofollow","getScore"],"sources":["../../../../src/scoring/assessments/seo/InternalLinksAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {LinkIcon} from '@shopify/polaris-icons';\nimport {INTERNAL_LINKS_ID} from '@axyseo/const/analysis';\n\n/**\n * Assessment to check whether the text has internal links and whether they are followed or no-followed.\n */\nclass InternalLinksAssessment 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 number of internal links in the text.\n * @param {number} [config.scores.allInternalFollow] The score to return if all internal links are do-follow.\n * @param {number} [config.scores.someInternalFollow] The score to return if some but not all internal links are do-follow.\n * @param {number} [config.scores.noneInternalFollow] The score to return if all internal links are no-follow.\n * @param {number} [config.scores.noInternal] The score to return if there are no internal links.\n * @param {string} [config.url] The URL to the relevant KB article.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: INTERNAL_LINKS_ID,\n fixPosition: '',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',\n icon: LinkIcon,\n priority: 'high',\n title: 'Internal links',\n content: {\n good: 'Internal links are used effectively.',\n improve: '',\n bad: 'No internal links found. Add links to other relevant pages on your website.'\n }\n };\n\n this.identifier = INTERNAL_LINKS_ID;\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 * @param i18n\n * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher, i18n}) {\n this.linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(i18n);\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if assessment is applicable to the paper.\n *\n * @param {Paper} paper The paper to be analyzed.\n *\n * @returns {boolean} Whether the paper has text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n\n /**\n * Returns a score and text based on the linkStatistics object.\n *\n * @returns {Object} ResultObject with score and text\n */\n calculateResult(i18n) {\n let status = '';\n if (\n this.linkStatistics.internalTotal === 0 ||\n this.linkStatistics.internalNofollow === this.linkStatistics.internalTotal\n ) {\n status = 'bad';\n } else {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status\n };\n }\n}\n\nexport default InternalLinksAssessment;\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,QAAQ,QAAO,wBAAwB;AAC/C,SAAQC,iBAAiB;;AAEzB;AACA;AACA;AACA,MAAMC,uBAAuB,SAASJ,UAAU,CAAC;EAC/C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,iBAAiB;MACrBM,WAAW,EAAE,EAAE;MACfC,MAAM,EACJ,2GAA2G;MAC7GC,IAAI,EAAET,QAAQ;MACdU,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,gBAAgB;MACvBC,OAAO,EAAE;QACPC,IAAI,EAAE,sCAAsC;QAC5CC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,iBAAiB;IACnC,IAAI,CAACgB,OAAO,GAAGpB,KAAK,CAACQ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,IAAI,CAACC,cAAc,GAAGF,UAAU,CAACG,WAAW,CAAC,mBAAmB,CAAC;IACjE,MAAMC,gBAAgB,GAAG,IAAIzB,gBAAgB,CAAC;MAACK,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMQ,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACL,IAAI,CAAC;IACnDG,gBAAgB,CAACG,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDJ,gBAAgB,CAACK,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IACnDN,gBAAgB,CAACO,OAAO,CAACN,gBAAgB,CAACO,IAAI,CAAC;IAE/C,OAAOR,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACES,YAAYA,CAACd,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACe,OAAO,CAAC,CAAC;EACxB;;EAEA;AACF;AACA;AACA;AACA;EACER,eAAeA,CAACL,IAAI,EAAE;IACpB,IAAIS,MAAM,GAAG,EAAE;IACf,IACE,IAAI,CAACR,cAAc,CAACa,aAAa,KAAK,CAAC,IACvC,IAAI,CAACb,cAAc,CAACc,gBAAgB,KAAK,IAAI,CAACd,cAAc,CAACa,aAAa,EAC1E;MACAL,MAAM,GAAG,KAAK;IAChB,CAAC,MAAM;MACLA,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACS,QAAQ,CAAC,IAAI,CAACpB,OAAO,CAACP,QAAQ,EAAEoB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF;AAEA,eAAe5B,uBAAuB","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { merge } from 'lodash';
|
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import { KeyIcon } from '@shopify/polaris-icons';
|
|
5
|
+
import { INTRODUCTION_KEYWORD_ID } from "../../../const/analysis";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Assessment to check whether the keyphrase or synonyms are encountered in the first paragraph of the article.
|
|
@@ -18,7 +19,7 @@ class IntroductionKeywordAssessment extends Assessment {
|
|
|
18
19
|
constructor(config = {}) {
|
|
19
20
|
super();
|
|
20
21
|
const defaultConfig = {
|
|
21
|
-
id:
|
|
22
|
+
id: INTRODUCTION_KEYWORD_ID,
|
|
22
23
|
ctaType: 'fix',
|
|
23
24
|
priority: 'low',
|
|
24
25
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-introduction',
|
|
@@ -31,7 +32,7 @@ class IntroductionKeywordAssessment extends Assessment {
|
|
|
31
32
|
good: 'Keyword is included in the first sentence.'
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
this.identifier =
|
|
35
|
+
this.identifier = INTRODUCTION_KEYWORD_ID;
|
|
35
36
|
this._config = merge(defaultConfig, config);
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntroductionKeywordAssessment.js","names":["merge","Assessment","AssessmentResult","KeyIcon","IntroductionKeywordAssessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","_firstParagraphMatches","getResearch","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasKeyword","hasText","foundInOneSentence","foundInParagraph","getScore"],"sources":["../../../../src/scoring/assessments/seo/IntroductionKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment to check whether the keyphrase or synonyms are encountered in the first paragraph of the article.\n */\nclass IntroductionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\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:
|
|
1
|
+
{"version":3,"file":"IntroductionKeywordAssessment.js","names":["merge","Assessment","AssessmentResult","KeyIcon","INTRODUCTION_KEYWORD_ID","IntroductionKeywordAssessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","_firstParagraphMatches","getResearch","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasKeyword","hasText","foundInOneSentence","foundInParagraph","getScore"],"sources":["../../../../src/scoring/assessments/seo/IntroductionKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {INTRODUCTION_KEYWORD_ID} from '@axyseo/const/analysis';\n\n/**\n * Assessment to check whether the keyphrase or synonyms are encountered in the first paragraph of the article.\n */\nclass IntroductionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\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: INTRODUCTION_KEYWORD_ID,\n ctaType: 'fix',\n priority: 'low',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-introduction',\n fixPosition: 'highlightFirstParagraph',\n icon: KeyIcon,\n title: 'Introduction Keyword',\n content: {\n improve: '',\n bad: 'No keywords found in the first sentence. Add one to improve keyword rank.',\n good: 'Keyword is included in the first sentence.'\n }\n };\n\n this.identifier = INTRODUCTION_KEYWORD_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Assesses the presence of keyphrase or synonyms in the first paragraph.\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 this._firstParagraphMatches = researcher.getResearch('findKeywordInFirstParagraph');\n const calculatedResult = this.calculateResult(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 * Checks if the paper has both keyword and text.\n *\n * @param {Paper} paper The paper to be analyzed.\n *\n * @returns {boolean} Whether the assessment is applicable or not.\n */\n isApplicable(paper) {\n return paper.hasKeyword() && paper.hasText();\n }\n\n /**\n * Returns a result based on the number of occurrences of keyphrase in the first paragraph.\n *\n * @returns {Object} result object with a score and translation text.\n */\n calculateResult(i18n) {\n let status = 'bad';\n\n if (\n this._firstParagraphMatches.foundInOneSentence ||\n this._firstParagraphMatches.foundInParagraph\n ) {\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 };\n }\n}\n\nexport default IntroductionKeywordAssessment;\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,OAAO,QAAO,wBAAwB;AAC9C,SAAQC,uBAAuB;;AAE/B;AACA;AACA;AACA,MAAMC,6BAA6B,SAASJ,UAAU,CAAC;EACrD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,uBAAuB;MAC3BM,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,KAAK;MACfC,MAAM,EACJ,qGAAqG;MACv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CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACU,QAAQ,CAAC,IAAI,CAACrB,OAAO,CAACV,QAAQ,EAAEuB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF;AAEA,eAAe7B,6BAA6B","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { merge } from 'lodash';
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
|
+
import { KEYPHRASE_ID } from "../../../const/analysis";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Represents the Slug keyword assessment. This assessment checks if the keyword is present in the slug.
|
|
@@ -15,7 +16,7 @@ class KeyphraseAssessment extends Assessment {
|
|
|
15
16
|
constructor(config = {}) {
|
|
16
17
|
super();
|
|
17
18
|
const defaultConfig = {
|
|
18
|
-
id:
|
|
19
|
+
id: KEYPHRASE_ID,
|
|
19
20
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#use-of-main-keyword',
|
|
20
21
|
ctaType: 'fix',
|
|
21
22
|
fixPosition: 'keyword search',
|
|
@@ -27,7 +28,7 @@ class KeyphraseAssessment extends Assessment {
|
|
|
27
28
|
good: 'Main keyword is used effectively.'
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
|
-
this.identifier =
|
|
31
|
+
this.identifier = KEYPHRASE_ID;
|
|
31
32
|
this._config = merge(defaultConfig, config);
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyphraseAssessment.js","names":["merge","Assessment","AssessmentResult","KeyphraseAssessment","constructor","config","defaultConfig","id","docUrl","ctaType","fixPosition","priority","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasKeyphrase","hasKeyword","getScore"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseAssessment.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"KeyphraseAssessment.js","names":["merge","Assessment","AssessmentResult","KEYPHRASE_ID","KeyphraseAssessment","constructor","config","defaultConfig","id","docUrl","ctaType","fixPosition","priority","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","isApplicable","hasKeyphrase","hasKeyword","getScore"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KEYPHRASE_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the Slug keyword assessment. This assessment checks if the keyword is present in the slug.\n */\nclass KeyphraseAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: KEYPHRASE_ID,\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#use-of-main-keyword',\n ctaType: 'fix',\n fixPosition: 'keyword search',\n priority: 'high',\n title: 'Use of main keyword',\n content: {\n improve: '',\n bad: 'No keywords found. Include keywords throughout the text.',\n good: 'Main keyword is used effectively.'\n }\n };\n\n this.identifier = KEYPHRASE_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Executes the Assessment and returns a result.\n *\n * @param {Paper} paper The Paper object to assess.\n * @param {Researcher} researcher The Researcher object containing all available researches.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment, containing both a score and a descriptive text.\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 return assessmentResult;\n }\n\n /**\n * Checks whether the paper has a keyword and a slug.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} True if the paper contains a keyword and a slug, and if the keywordCountInSlug research is available on the researcher.\n */\n isApplicable(paper, researcher) {\n return true;\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 status = (() => {\n const hasKeyphrase = paper.hasKeyword();\n\n return hasKeyphrase ? 'good' : 'bad';\n })();\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status\n };\n }\n}\n\nexport default KeyphraseAssessment;\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAE5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,YAAY;;AAEpB;AACA;AACA;AACA,MAAMC,mBAAmB,SAASH,UAAU,CAAC;EAC3C;AACF;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,YAAY;MAChBM,MAAM,EACJ,iGAAiG;MACnGC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,qBAAqB;MAC5BC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE,0DAA0D;QAC/DC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,YAAY;IAC9B,IAAI,CAACgB,OAAO,GAAGnB,KAAK,CAACO,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAMC,gBAAgB,GAAG,IAAItB,gBAAgB,CAAC;MAACI,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMM,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACL,KAAK,EAAEE,IAAI,CAAC;IAE1DC,gBAAgB,CAACG,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDJ,gBAAgB,CAACK,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IACnDN,gBAAgB,CAACO,OAAO,CAACN,gBAAgB,CAACO,IAAI,CAAC;IAC/C,OAAOR,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACES,YAAYA,CAACZ,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEI,eAAeA,CAACL,KAAK,EAAEE,IAAI,EAAE;IAC3B,MAAMO,MAAM,GAAG,CAAC,MAAM;MACpB,MAAMI,YAAY,GAAGb,KAAK,CAACc,UAAU,CAAC,CAAC;MAEvC,OAAOD,YAAY,GAAG,MAAM,GAAG,KAAK;IACtC,CAAC,EAAE,CAAC;IAEJ,MAAMN,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAAC,IAAI,CAACjB,OAAO,CAACP,QAAQ,EAAEkB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF;AAEA,eAAe1B,mBAAmB","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@ import Assessment from "../assessment";
|
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import { KeyIcon } from '@shopify/polaris-icons';
|
|
5
5
|
import { countWords } from "../../../helpers";
|
|
6
|
+
import { KEYPHRASE_LENGTH_ID } from "../../../const/analysis";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Assessment to check whether the keyphrase has a good length.
|
|
@@ -18,7 +19,7 @@ class KeyphraseLengthAssessment extends Assessment {
|
|
|
18
19
|
constructor(config) {
|
|
19
20
|
super();
|
|
20
21
|
this.defaultConfig = {
|
|
21
|
-
id:
|
|
22
|
+
id: KEYPHRASE_LENGTH_ID,
|
|
22
23
|
ctaType: 'fix',
|
|
23
24
|
priority: 'low',
|
|
24
25
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-length',
|
|
@@ -31,7 +32,7 @@ class KeyphraseLengthAssessment extends Assessment {
|
|
|
31
32
|
good: 'Keyword length is optimized, less than 4 words.'
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
this.identifier =
|
|
35
|
+
this.identifier = KEYPHRASE_LENGTH_ID;
|
|
35
36
|
this._config = merge(this.defaultConfig, config);
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["merge","Assessment","AssessmentResult","KeyIcon","countWords","KeyphraseLengthAssessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","keywordLength","getKeyword","getScore","isApplicable","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {countWords} from '@axyseo/helpers';\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:
|
|
1
|
+
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["merge","Assessment","AssessmentResult","KeyIcon","countWords","KEYPHRASE_LENGTH_ID","KeyphraseLengthAssessment","constructor","config","defaultConfig","id","ctaType","priority","docUrl","fixPosition","icon","title","content","improve","bad","good","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","keywordLength","getKeyword","getScore","isApplicable","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/KeyphraseLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {countWords} from '@axyseo/helpers';\nimport {KEYPHRASE_LENGTH_ID} from '@axyseo/const/analysis';\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: KEYPHRASE_LENGTH_ID,\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 = KEYPHRASE_LENGTH_ID;\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\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 };\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,OAAO,QAAO,wBAAwB;AAC9C,SAAQC,UAAU;AAClB,SAAQC,mBAAmB;;AAE3B;AACA;AACA;AACA,MAAMC,yBAAyB,SAASL,UAAU,CAAC;EACjD;AACF;AACA;AACA;AACA;AACA;AACA;EACEM,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,aAAa,GAAG;MACnBC,EAAE,EAAEL,mBAAmB;MACvBM,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,KAAK;MACfC,MAAM,EACJ,4FAA4F;MAC9FC,WAAW,EAAE,gBAAgB;MAC7BC,IAAI,EAAEZ,OAAO;MACba,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,GAAGhB,mBAAmB;IACrC,IAAI,CAACiB,OAAO,GAAGtB,KAAK,CAAC,IAAI,CAACS,aAAa,EAAED,MAAM,CAAC;EAClD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAMC,gBAAgB,GAAG,IAAIzB,gBAAgB,CAAC;MAACM,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErE,MAAMM,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACL,KAAK,EAAEE,IAAI,CAAC;IAE1DC,gBAAgB,CAACG,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDJ,gBAAgB,CAACK,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IAEnD,OAAON,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACEE,eAAeA,CAACL,KAAK,EAAEE,IAAI,EAAE;IAC3B,MAAMQ,aAAa,GAAG9B,UAAU,CAACoB,KAAK,CAACW,UAAU,CAAC,CAAC,CAAC;IAEpD,IAAIF,MAAM,GAAG,EAAE;IACf,IAAIC,aAAa,IAAI,CAAC,EAAE;MACtBD,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAAC,IAAI,CAACd,OAAO,CAACV,QAAQ,EAAEqB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACb,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACc,UAAU,CAAC,CAAC;EAC3B;AACF;AAEA,eAAehC,yBAAyB","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { merge } from 'lodash';
|
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import keyphraseLengthFactor from "../../../scoring/helpers/assessments/keyphraseLengthFactor";
|
|
5
|
+
import { KEYPHRASE_DENSITY_ID } from "../../../const/analysis";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Represents the assessment that will look if the keyphrase density is within the recommended range.
|
|
@@ -14,7 +15,7 @@ class KeyphraseDensityAssessment extends Assessment {
|
|
|
14
15
|
constructor(config = {}) {
|
|
15
16
|
super();
|
|
16
17
|
const defaultConfig = {
|
|
17
|
-
id:
|
|
18
|
+
id: KEYPHRASE_DENSITY_ID,
|
|
18
19
|
fixPosition: 'highlightKeyword',
|
|
19
20
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',
|
|
20
21
|
ctaType: 'fix',
|
|
@@ -26,7 +27,7 @@ class KeyphraseDensityAssessment extends Assessment {
|
|
|
26
27
|
improve: ''
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
this.identifier =
|
|
30
|
+
this.identifier = KEYPHRASE_DENSITY_ID;
|
|
30
31
|
this._config = merge(defaultConfig, config);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeywordDensityAssessment.js","names":["merge","Assessment","AssessmentResult","keyphraseLengthFactor","KeyphraseDensityAssessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","bad","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setTitle","density","roundedDensity","parseFloat","toFixed","getScore","isApplicable","hasText","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\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:
|
|
1
|
+
{"version":3,"file":"KeywordDensityAssessment.js","names":["merge","Assessment","AssessmentResult","keyphraseLengthFactor","KEYPHRASE_DENSITY_ID","KeyphraseDensityAssessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","bad","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setTitle","density","roundedDensity","parseFloat","toFixed","getScore","isApplicable","hasText","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\nimport keyphraseLengthFactor from '../../../scoring/helpers/assessments/keyphraseLengthFactor';\nimport {KEYPHRASE_DENSITY_ID} from '@axyseo/const/analysis';\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: KEYPHRASE_DENSITY_ID,\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 title: 'Main keyword density',\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 = KEYPHRASE_DENSITY_ID;\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\n this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor(keyphraseLength);\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.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 const roundedDensity = parseFloat(density.toFixed(2));\n\n let status = '';\n if (roundedDensity >= 1 && roundedDensity <= 1.5) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n title: (this._config.title || 'Main keyword density') + ': ' + roundedDensity + '%',\n score,\n status\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AAEvB,OAAOC,qBAAqB;AAC5B,SAAQC,oBAAoB;;AAE5B;AACA;AACA;AACA,MAAMC,0BAA0B,SAASJ,UAAU,CAAC;EAClD;AACF;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,oBAAoB;MACxBM,WAAW,EAAE,kBAAkB;MAC/BC,MAAM,EACJ,kGAAkG;MACpGC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;Q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;IACf,IAAIG,cAAc,IAAI,CAAC,IAAIA,cAAc,IAAI,GAAG,EAAE;MAChDH,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAAC,IAAI,CAACrB,OAAO,CAACP,QAAQ,EAAEsB,MAAM,CAAC;IAE1D,OAAO;MACLrB,KAAK,EAAE,CAAC,IAAI,CAACM,OAAO,CAACN,KAAK,IAAI,sBAAsB,IAAI,IAAI,GAAGwB,cAAc,GAAG,GAAG;MACnFL,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,YAAYA,CAACpB,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAACqB,OAAO,CAAC,CAAC,IAAIrB,KAAK,CAACsB,UAAU,CAAC,CAAC;EAC9C;AACF;AAEA,eAAevC,0BAA0B","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@ import Assessment from "../assessment";
|
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import { KeyIcon } from '@shopify/polaris-icons';
|
|
5
5
|
import matchTextWithWord from "../../../languageProcessing/helpers/match/matchTextWithWord";
|
|
6
|
+
import { META_DESCRIPTION_KEYWORD_ID } from "../../../const/analysis";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Assessment for checking the keyword matches in the meta description.
|
|
@@ -22,7 +23,7 @@ class MetaDescriptionKeywordAssessment extends Assessment {
|
|
|
22
23
|
constructor(config = {}) {
|
|
23
24
|
super();
|
|
24
25
|
const defaultConfig = {
|
|
25
|
-
id:
|
|
26
|
+
id: META_DESCRIPTION_KEYWORD_ID,
|
|
26
27
|
priority: 'high',
|
|
27
28
|
fixPosition: 'meta description',
|
|
28
29
|
ctaType: 'fix',
|
|
@@ -35,7 +36,7 @@ class MetaDescriptionKeywordAssessment extends Assessment {
|
|
|
35
36
|
improve: ''
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
this.identifier =
|
|
39
|
+
this.identifier = META_DESCRIPTION_KEYWORD_ID;
|
|
39
40
|
this._config = merge(defaultConfig, config);
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["isNumber","merge","Assessment","AssessmentResult","KeyIcon","matchTextWithWord","MetaDescriptionKeywordAssessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","title","content","bad","good","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseCounts","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","getScore","isApplicable","hasKeyword","hasDescription"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\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:
|
|
1
|
+
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["isNumber","merge","Assessment","AssessmentResult","KeyIcon","matchTextWithWord","META_DESCRIPTION_KEYWORD_ID","MetaDescriptionKeywordAssessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","title","content","bad","good","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseCounts","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","getScore","isApplicable","hasKeyword","hasDescription"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\nimport {META_DESCRIPTION_KEYWORD_ID} from '@axyseo/const/analysis';\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: META_DESCRIPTION_KEYWORD_ID,\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 = META_DESCRIPTION_KEYWORD_ID;\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 this._keyphraseCounts = researcher.getResearch('metaDescriptionKeyword');\n\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\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 let status = '';\n if (this._keyphraseCounts > 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 };\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,SAAQA,QAAQ,EAAEC,KAAK,QAAO,QAAQ;AACtC,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,OAAO,QAAO,wBAAwB;AAC9C,OAAOC,iBAAiB;AACxB,SAAQC,2BAA2B;;AAEnC;AACA;AACA;AACA,MAAMC,gCAAgC,SAASL,UAAU,CAAC;EACxD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,2BAA2B;MAC/BM,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,kBAAkB;MAC/BC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,yCAAyC;MACjDC,IAAI,EAAEZ,OAAO;MACba,KAAK,EAAE,0BAA0B;MACjCC,OAAO,EAAE;QACPC,GAAG,EAAE,kFAAkF;QACvFC,IAAI,EAAE,yCAAyC;QAC/CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAA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import { merge } from 'lodash';
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
|
+
import { META_DESCRIPTION_LENGTH_ID } from "../../../const/analysis";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Assessment for calculating the length of the meta description.
|
|
@@ -16,7 +17,7 @@ export default class MetaDescriptionLengthAssessment extends Assessment {
|
|
|
16
17
|
constructor(config = {}) {
|
|
17
18
|
super();
|
|
18
19
|
const defaultConfig = {
|
|
19
|
-
id:
|
|
20
|
+
id: META_DESCRIPTION_LENGTH_ID,
|
|
20
21
|
ctaType: 'fix',
|
|
21
22
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#meta-description',
|
|
22
23
|
priority: 'high',
|
|
@@ -28,7 +29,7 @@ export default class MetaDescriptionLengthAssessment extends Assessment {
|
|
|
28
29
|
bad: 'Missing meta description. Write a unique and compelling description under 160 characters.'
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
this.identifier =
|
|
32
|
+
this.identifier = META_DESCRIPTION_LENGTH_ID;
|
|
32
33
|
this._config = merge(defaultConfig, config);
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["merge","Assessment","AssessmentResult","MetaDescriptionLengthAssessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","length","getDescription","getScore","isApplicable"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import {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:
|
|
1
|
+
{"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["merge","Assessment","AssessmentResult","META_DESCRIPTION_LENGTH_ID","MetaDescriptionLengthAssessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","length","getDescription","getScore","isApplicable"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {META_DESCRIPTION_LENGTH_ID} from '@axyseo/const/analysis';\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: META_DESCRIPTION_LENGTH_ID,\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 = META_DESCRIPTION_LENGTH_ID;\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\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 };\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,0BAA0B;;AAElC;AACA;AACA;AACA,eAAe,MAAMC,+BAA+B,SAASH,UAAU,CAAC;EACtE;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,0BAA0B;MAC9BM,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,GAAGf,0BAA0B;IAC5C,IAAI,CAACgB,OAAO,GAAGnB,KAAK,CAACO,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAMC,gBAAgB,GAAG,IAAItB,gBAAgB,CAAC;MAACI,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMM,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACL,KAAK,EAAEE,IAAI,CAAC;IAE1DC,gBAAgB,CAACG,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDJ,gBAAgB,CAACK,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IAEnD,OAAON,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEE,eAAeA,CAACL,KAAK,EAAEE,IAAI,EAAE;IAC3B,MAAMQ,MAAM,GAAGV,KAAK,CAACW,cAAc,CAAC,CAAC,CAACD,MAAM;IAE5C,IAAID,MAAM,GAAG,EAAE;IAEf,IAAIC,MAAM,KAAK,CAAC,EAAE;MAChBD,MAAM,GAAG,KAAK;IAChB;IACA,IAAIC,MAAM,GAAG,CAAC,KAAKA,MAAM,GAAG,GAAG,IAAIA,MAAM,GAAG,GAAG,CAAC,EAAE;MAChDD,MAAM,GAAG,SAAS;IACpB;IAEA,IAAIC,MAAM,IAAI,GAAG,IAAIA,MAAM,IAAI,GAAG,EAAE;MAClCD,MAAM,GAAG,MAAM;IACjB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAAC,IAAI,CAACd,OAAO,CAACR,QAAQ,EAAEmB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACb,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { merge } from 'lodash';
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
|
+
import { TITLE_KEYWORD_ID } from "../../../const/analysis";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Assessment for checking the keyword matches in the meta title.
|
|
@@ -20,7 +21,7 @@ export default class MetaTitleKeywordAssessment extends Assessment {
|
|
|
20
21
|
constructor(config = {}) {
|
|
21
22
|
super();
|
|
22
23
|
const defaultConfig = {
|
|
23
|
-
id:
|
|
24
|
+
id: TITLE_KEYWORD_ID,
|
|
24
25
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-title',
|
|
25
26
|
fixPosition: 'meta title',
|
|
26
27
|
ctaType: 'fix',
|
|
@@ -32,7 +33,7 @@ export default class MetaTitleKeywordAssessment extends Assessment {
|
|
|
32
33
|
improve: ''
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
this.identifier =
|
|
36
|
+
this.identifier = TITLE_KEYWORD_ID;
|
|
36
37
|
this._config = merge(defaultConfig, config);
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaTitleKeywordAssessment.js","names":["merge","Assessment","AssessmentResult","MetaTitleKeywordAssessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseMatches","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","exactMatchFound","allWordsFound","exactMatchKeyphrase","getScore","isApplicable","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\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:
|
|
1
|
+
{"version":3,"file":"MetaTitleKeywordAssessment.js","names":["merge","Assessment","AssessmentResult","TITLE_KEYWORD_ID","MetaTitleKeywordAssessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","getResult","paper","researcher","i18n","_keyphraseMatches","getResearch","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","exactMatchFound","allWordsFound","exactMatchKeyphrase","getScore","isApplicable","hasKeyword"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {TITLE_KEYWORD_ID} from '@axyseo/const/analysis';\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: TITLE_KEYWORD_ID,\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 = TITLE_KEYWORD_ID;\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 this._keyphraseMatches = researcher.getResearch('findKeyphraseInSEOTitle');\n\n const assessmentResult = new AssessmentResult({\n config: this._config\n });\n const calculatedResult = this.calculateResult({\n i18n\n });\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({i18n}) {\n const exactMatchFound = this._keyphraseMatches.exactMatchFound;\n const allWordsFound = this._keyphraseMatches.allWordsFound;\n const exactMatchKeyphrase = this._keyphraseMatches.exactMatchKeyphrase;\n\n let status = 'bad';\n if (exactMatchFound === true || allWordsFound) {\n status = 'good';\n }\n if (exactMatchKeyphrase) {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,gBAAgB;;AAExB;AACA;AACA;AACA,eAAe,MAAMC,0BAA0B,SAASH,UAAU,CAAC;EACjE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC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AG,KAAK;IAClB,IAAIG,eAAe,KAAK,IAAI,IAAIC,aAAa,EAAE;MAC7CJ,MAAM,GAAG,MAAM;IACjB;IACA,IAAIK,mBAAmB,EAAE;MACvBL,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAAC,IAAI,CAACnB,OAAO,CAACP,QAAQ,EAAEoB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEO,YAAYA,CAAClB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACmB,UAAU,CAAC,CAAC;EAC3B;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { merge } from 'lodash';
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
|
+
import { NUMBER_TITLE_ID } from "../../../const/analysis";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Represents the assessment that assesses the SEO title width and gives the feedback accordingly.
|
|
@@ -16,7 +17,7 @@ export default class NumberInMetaTitleAssessment extends Assessment {
|
|
|
16
17
|
constructor(config = {}) {
|
|
17
18
|
super();
|
|
18
19
|
const defaultConfig = {
|
|
19
|
-
id:
|
|
20
|
+
id: NUMBER_TITLE_ID,
|
|
20
21
|
ctaType: 'fix',
|
|
21
22
|
status: 'good',
|
|
22
23
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#using-number-in-title',
|
|
@@ -29,7 +30,7 @@ export default class NumberInMetaTitleAssessment extends Assessment {
|
|
|
29
30
|
bad: 'No number found in title tag. Consider adding a number to make it more engaging.'
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
this.identifier =
|
|
33
|
+
this.identifier = NUMBER_TITLE_ID;
|
|
33
34
|
this._config = merge(defaultConfig, config);
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInMetaTitleAssessment.js","names":["merge","Assessment","AssessmentResult","NumberInMetaTitleAssessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","getTitle","test","getScore","isApplicable","hasTitle"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\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:
|
|
1
|
+
{"version":3,"file":"NumberInMetaTitleAssessment.js","names":["merge","Assessment","AssessmentResult","NUMBER_TITLE_ID","NumberInMetaTitleAssessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","getTitle","test","getScore","isApplicable","hasTitle"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {NUMBER_TITLE_ID} from '@axyseo/const/analysis';\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: NUMBER_TITLE_ID,\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 = NUMBER_TITLE_ID;\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\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 };\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,SAAQC,eAAe;;AAEvB;AACA;AACA;AACA,eAAe,MAAMC,2BAA2B,SAASH,UAAU,CAAC;EAClE;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,eAAe;MACnBM,OAAO,EAAE,KAAK;M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AACR,QAAQ,EAAEF,MAAM,CAAC;IAE1D,OAAO;MACLmB,KAAK;MACLnB;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEwB,YAAYA,CAACZ,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACa,QAAQ,CAAC,CAAC;EACzB;AACF","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { isEmpty, merge } from 'lodash';
|
|
|
2
2
|
import Assessment from "../assessment";
|
|
3
3
|
import AssessmentResult from "../../../values/AssessmentResult";
|
|
4
4
|
import { ExternalIcon } from '@shopify/polaris-icons';
|
|
5
|
+
import { EXTERNAL_LINKS_ID } from "../../../const/analysis";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Assessment for calculating the outbound links in the text.
|
|
@@ -17,7 +18,7 @@ export default class OutboundLinksAssessment extends Assessment {
|
|
|
17
18
|
constructor(config = {}) {
|
|
18
19
|
super();
|
|
19
20
|
const defaultConfig = {
|
|
20
|
-
id:
|
|
21
|
+
id: EXTERNAL_LINKS_ID,
|
|
21
22
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',
|
|
22
23
|
fixPosition: 'description',
|
|
23
24
|
icon: ExternalIcon,
|
|
@@ -29,7 +30,7 @@ export default class OutboundLinksAssessment extends Assessment {
|
|
|
29
30
|
bad: 'No external links found. Add relevant links to be more authoritative and informative.'
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
this.identifier =
|
|
33
|
+
this.identifier = EXTERNAL_LINKS_ID;
|
|
33
34
|
this._config = merge(defaultConfig, config);
|
|
34
35
|
}
|
|
35
36
|
|