axyseo 2.1.29 → 2.1.31
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/cjs/scoring/assessments/readability/SentenceBeginningsAssessment.js +0 -2
- package/build/cjs/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/readability/SentenceLengthInTextAssessment.js +2 -11
- package/build/cjs/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/FAQsStructureDataAssessment.js +1 -1
- package/build/cjs/scoring/assessments/seo/FAQsStructureDataAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/InternalLinksAssessment.js +0 -2
- package/build/cjs/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/IntroductionKeywordAssessment.js +0 -2
- package/build/cjs/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/KeyphraseLengthAssessment.js +0 -2
- package/build/cjs/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/KeywordDensityAssessment.js +4 -1
- package/build/cjs/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +0 -3
- package/build/cjs/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/OutboundLinksAssessment.js +0 -2
- package/build/cjs/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/SchemaAssessment.js +18 -1
- package/build/cjs/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/TextImagesAssessment.js +0 -3
- package/build/cjs/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
- package/build/cjs/scoring/assessments/seo/TextLengthAssessment.js +2 -1
- package/build/cjs/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
- package/build/cjs/scoring/assessors/assessor.js +27 -7
- package/build/cjs/scoring/assessors/assessor.js.map +1 -1
- package/build/esm/scoring/assessments/readability/SentenceBeginningsAssessment.js +0 -2
- package/build/esm/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/readability/SentenceLengthInTextAssessment.js +2 -11
- package/build/esm/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/FAQsStructureDataAssessment.js +1 -1
- package/build/esm/scoring/assessments/seo/FAQsStructureDataAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/InternalLinksAssessment.js +0 -2
- package/build/esm/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/IntroductionKeywordAssessment.js +0 -2
- package/build/esm/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/KeyphraseLengthAssessment.js +0 -2
- package/build/esm/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/KeywordDensityAssessment.js +4 -1
- package/build/esm/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +1 -4
- package/build/esm/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/OutboundLinksAssessment.js +0 -2
- package/build/esm/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/SchemaAssessment.js +18 -1
- package/build/esm/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/TextImagesAssessment.js +0 -3
- package/build/esm/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
- package/build/esm/scoring/assessments/seo/TextLengthAssessment.js +2 -1
- package/build/esm/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
- package/build/esm/scoring/assessors/assessor.js +27 -7
- package/build/esm/scoring/assessors/assessor.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
9
9
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
10
|
var _analysis = require("../../../const/analysis");
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
const maximumConsecutiveDuplicates = 2;
|
|
@@ -31,7 +30,6 @@ class SentenceBeginningsAssessment extends _assessment.default {
|
|
|
31
30
|
ctaType: 'fix',
|
|
32
31
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-beginnings',
|
|
33
32
|
fixPosition: 'description',
|
|
34
|
-
icon: _polarisIcons.TextBlockIcon,
|
|
35
33
|
title: 'Sentence beginnings',
|
|
36
34
|
content: {
|
|
37
35
|
improve: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentenceBeginningsAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","
|
|
1
|
+
{"version":3,"file":"SentenceBeginningsAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","maximumConsecutiveDuplicates","SentenceBeginningsAssessment","Assessment","constructor","config","defaultConfig","id","SENTENCE_BEGINNINGS_ID","priority","ctaType","docUrl","fixPosition","title","content","improve","bad","good","identifier","_config","merge","groupSentenceBeginnings","sentenceBeginnings","tooOften","partition","word","count","length","total","sortedCounts","sortBy","lowestCount","calculateSentenceBeginningsResult","groupedSentenceBeginnings","status","score","getScore","MAIN_CONTENT_POINTS","getResult","paper","researcher","getResearch","sentenceBeginningsErrors","filter","sentenceBeginning","calculatedResult","assessmentResult","AssessmentResult","setData","setScore","setStatus","isApplicable","hasEnoughContentForAssessment","hasResearch","exports"],"sources":["../../../../../src/scoring/assessments/readability/SentenceBeginningsAssessment.js"],"sourcesContent":["import {merge, partition, sortBy} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, SENTENCE_BEGINNINGS_ID} from '@axyseo/const/analysis';\n\nconst maximumConsecutiveDuplicates = 2;\n\n/**\n * Represents the assessment that checks whether there are three or more consecutive sentences beginning with the same word.\n */\nexport default class SentenceBeginningsAssessment 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: SENTENCE_BEGINNINGS_ID,\n priority: 'medium',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-beginnings',\n fixPosition: 'description',\n title: 'Sentence beginnings',\n content: {\n improve: '',\n bad:\n 'Found sentences with repetitive beginnings. Change the wording for more engaging content.',\n good: 'No sentences with repetitive beginnings found.'\n }\n };\n\n this.identifier = SENTENCE_BEGINNINGS_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Counts and groups the number too often used sentence beginnings and determines the lowest count within that group.\n *\n * @param {array} sentenceBeginnings The array containing the objects containing the beginning words and counts.\n *\n * @returns {object} The object containing the total number of too often used beginnings and the lowest count within those.\n */\n groupSentenceBeginnings(sentenceBeginnings) {\n const tooOften = partition(sentenceBeginnings, function(word) {\n return word.count > maximumConsecutiveDuplicates;\n });\n\n if (tooOften[0].length === 0) {\n return {total: 0};\n }\n\n const sortedCounts = sortBy(tooOften[0], function(word) {\n return word.count;\n });\n\n return {total: tooOften[0].length, lowestCount: sortedCounts[0].count};\n }\n\n /**\n *\n * @param groupedSentenceBeginnings\n * @returns {{score: number, status: string}}\n */\n calculateSentenceBeginningsResult(groupedSentenceBeginnings) {\n let status = '';\n if (groupedSentenceBeginnings.total > 0) {\n status = 'bad';\n } else {\n status = 'good';\n }\n\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const sentenceBeginnings = researcher.getResearch('getSentenceBeginnings');\n const sentenceBeginningsErrors = sentenceBeginnings.filter(\n sentenceBeginning => sentenceBeginning.count > maximumConsecutiveDuplicates\n );\n\n const groupedSentenceBeginnings = this.groupSentenceBeginnings(sentenceBeginnings);\n const calculatedResult = this.calculateSentenceBeginningsResult(groupedSentenceBeginnings);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setData(sentenceBeginningsErrors);\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the sentence beginnings assessment is applicable to the paper.\n *\n * @param {Object} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available and the paper is not empty.\n */\n isApplicable(paper, researcher) {\n return (\n this.hasEnoughContentForAssessment(paper) && researcher.hasResearch('getSentenceBeginnings')\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAmF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnF,MAAMG,4BAA4B,GAAG,CAAC;;AAEtC;AACA;AACA;AACe,MAAMC,4BAA4B,SAASC,mBAAU,CAAC;EACnE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAA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AAM,GAAG,KAAK;IAChB,CAAC,MAAM;MACLA,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,CAACC,6BAAmB,EAAEH,MAAM,CAAC;IAExD,OAAO;MACLC,KAAK;MACLD;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEI,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMlB,kBAAkB,GAAGkB,UAAU,CAACC,WAAW,CAAC,uBAAuB,CAAC;IAC1E,MAAMC,wBAAwB,GAAGpB,kBAAkB,CAACqB,MAAM,CACxDC,iBAAiB,IAAIA,iBAAiB,CAAClB,KAAK,GAAGzB,4BACjD,CAAC;IAED,MAAMgC,yBAAyB,GAAG,IAAI,CAACZ,uBAAuB,CAACC,kBAAkB,CAAC;IAClF,MAAMuB,gBAAgB,GAAG,IAAI,CAACb,iCAAiC,CAACC,yBAAyB,CAAC;IAC1F,MAAMa,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC1C,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErE2B,gBAAgB,CAACE,OAAO,CAACN,wBAAwB,CAAC;IAClDI,gBAAgB,CAACG,QAAQ,CAACJ,gBAAgB,CAACV,KAAK,CAAC;IACjDW,gBAAgB,CAACI,SAAS,CAACL,gBAAgB,CAACX,MAAM,CAAC;IAEnD,OAAOY,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,YAAYA,CAACZ,KAAK,EAAEC,UAAU,EAAE;IAC9B,OACE,IAAI,CAACY,6BAA6B,CAACb,KAAK,CAAC,IAAIC,UAAU,CAACa,WAAW,CAAC,uBAAuB,CAAC;EAEhG;AACF;AAACC,OAAA,CAAAtD,OAAA,GAAAE,4BAAA","ignoreList":[]}
|
|
@@ -9,7 +9,6 @@ var _assessment = _interopRequireDefault(require("../assessment"));
|
|
|
9
9
|
var _checkForTooLongSentences = _interopRequireDefault(require("../../helpers/assessments/checkForTooLongSentences"));
|
|
10
10
|
var _formatNumber = _interopRequireDefault(require("../../../helpers/formatNumber"));
|
|
11
11
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
12
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
13
12
|
var _analysis = require("../../../const/analysis");
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
14
|
/**
|
|
@@ -20,11 +19,9 @@ class SentenceLengthInTextAssessment extends _assessment.default {
|
|
|
20
19
|
* Sets the identifier and the config.
|
|
21
20
|
*
|
|
22
21
|
* @param {object} config The scoring configuration that should be used.
|
|
23
|
-
* @param {boolean} isCornerstone Whether cornerstone configuration should be used.
|
|
24
|
-
* @param {boolean} isProduct Whether product configuration should be used.
|
|
25
22
|
* @returns {void}
|
|
26
23
|
*/
|
|
27
|
-
constructor(config = {}
|
|
24
|
+
constructor(config = {}) {
|
|
28
25
|
super();
|
|
29
26
|
const defaultConfig = {
|
|
30
27
|
id: _analysis.TEXT_SENTENCE_LENGTH_ID,
|
|
@@ -32,7 +29,6 @@ class SentenceLengthInTextAssessment extends _assessment.default {
|
|
|
32
29
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-length',
|
|
33
30
|
ctaType: 'fix',
|
|
34
31
|
fixPosition: 'sentenceLength',
|
|
35
|
-
icon: _polarisIcons.TextBlockIcon,
|
|
36
32
|
recommendedLength: 20,
|
|
37
33
|
slightlyTooMany: 25,
|
|
38
34
|
farTooMany: 30,
|
|
@@ -124,15 +120,10 @@ class SentenceLengthInTextAssessment extends _assessment.default {
|
|
|
124
120
|
*/
|
|
125
121
|
calculateResult(percentage, hasDescription) {
|
|
126
122
|
let status = 'bad';
|
|
127
|
-
if (percentage
|
|
123
|
+
if (percentage && hasDescription && percentage <= this._config.recommendedLength) {
|
|
128
124
|
status = 'good';
|
|
129
125
|
}
|
|
130
126
|
const score = this.getScore(_analysis.MAIN_CONTENT_POINTS, status);
|
|
131
|
-
this._config.content = {
|
|
132
|
-
improve: '',
|
|
133
|
-
bad: `Sentence too long. Keep sentence length less than ${this._config.recommendedLength} words to improve readability and flow.`,
|
|
134
|
-
good: `Sentences optimized`
|
|
135
|
-
};
|
|
136
127
|
return {
|
|
137
128
|
score,
|
|
138
129
|
status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentenceLengthInTextAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_checkForTooLongSentences","_formatNumber","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"SentenceLengthInTextAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_checkForTooLongSentences","_formatNumber","_AssessmentResult","_analysis","e","__esModule","default","SentenceLengthInTextAssessment","Assessment","constructor","config","defaultConfig","id","TEXT_SENTENCE_LENGTH_ID","priority","docUrl","ctaType","fixPosition","recommendedLength","slightlyTooMany","farTooMany","title","content","improve","bad","good","_config","merge","identifier","getResult","paper","researcher","sentences","getResearch","hasDescription","getConfig","getLanguageSpecificConfig","percentage","calculatePercentage","result","calculateResult","assessmentResult","AssessmentResult","setScore","score","setStatus","status","isApplicable","currentConfig","languageSpecificConfig","hasOwnProperty","length","tooLongTotal","countTooLongSentences","formatNumber","getScore","MAIN_CONTENT_POINTS","getTooLongSentences","_default","exports"],"sources":["../../../../../src/scoring/assessments/readability/SentenceLengthInTextAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport getTooLongSentences from '../../helpers/assessments/checkForTooLongSentences';\nimport formatNumber from '../../../helpers/formatNumber';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {MAIN_CONTENT_POINTS, TEXT_SENTENCE_LENGTH_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that will calculate the length of sentences in the text.\n */\nclass SentenceLengthInTextAssessment extends Assessment {\n /**\n\t * Sets the identifier and the config.\n\t *\n\t * @param {object} config\t\t\tThe scoring configuration that should be used.\n\n\t * @returns {void}\n\t */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: TEXT_SENTENCE_LENGTH_ID,\n priority: 'high',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-length',\n ctaType: 'fix',\n fixPosition: 'sentenceLength',\n recommendedLength: 20,\n slightlyTooMany: 25,\n farTooMany: 30,\n title: 'Text Sentence Length',\n content: {\n improve: '',\n bad:\n 'Sentence too long. Keep sentence length less than 20 words to improve readability and flow.',\n good: 'Sentence length is optimized for readability, less than 20 words.'\n }\n };\n\n this._config = merge(defaultConfig, config);\n this.identifier = TEXT_SENTENCE_LENGTH_ID;\n }\n\n /**\n * Scores the percentage of sentences including more than the recommended number of words.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @returns {AssessmentResult} The Assessment result.\n */\n getResult({paper, researcher}) {\n const sentences = researcher.getResearch('countSentencesFromText');\n const hasDescription = paper.hasDescription();\n if (researcher.getConfig('sentenceLength')) {\n this._config = this.getLanguageSpecificConfig(researcher);\n }\n const percentage = this.calculatePercentage(sentences);\n\n const result = this.calculateResult(percentage, hasDescription);\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\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 true;\n }\n\n /**\n * Check if there is language-specific config, and if so, overwrite the current config with it.\n *\n * @param {Researcher} researcher The researcher to use.\n *\n * @returns {Object} The config that should be used.\n */\n getLanguageSpecificConfig(researcher) {\n const currentConfig = this._config;\n const languageSpecificConfig = researcher.getConfig('sentenceLength');\n\n if (languageSpecificConfig.hasOwnProperty('recommendedLength')) {\n currentConfig.recommendedLength = languageSpecificConfig.recommendedLength;\n }\n\n return currentConfig;\n }\n\n /**\n * Calculates the percentage of sentences that are too long.\n *\n * @param {Array} sentences The sentences to calculate the percentage for.\n * @returns {number} The calculates percentage of too long sentences.\n */\n calculatePercentage(sentences) {\n let percentage = 0;\n\n if (sentences.length !== 0) {\n const tooLongTotal = this.countTooLongSentences(sentences);\n percentage = formatNumber((tooLongTotal / sentences.length) * 100);\n }\n\n return percentage;\n }\n\n /**\n *\n * @param percentage\n * @param hasDescription\n * @returns {{score: number, status: string}}\n */\n calculateResult(percentage, hasDescription) {\n let status = 'bad';\n if (percentage && hasDescription && percentage <= this._config.recommendedLength) {\n status = 'good';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status\n };\n }\n\n /**\n * Gets the sentences that are qualified as being too long.\n *\n * @param {array} sentences The sentences to filter through.\n * @returns {array} Array with all the sentences considered to be too long.\n */\n getTooLongSentences(sentences) {\n return getTooLongSentences(sentences, this._config.recommendedLength);\n }\n\n /**\n * Get the total amount of sentences that are qualified as being too long.\n *\n * @param {Array} sentences The sentences to filter through.\n * @returns {Number} The amount of sentences that are considered too long.\n */\n countTooLongSentences(sentences) {\n return this.getTooLongSentences(sentences).length;\n }\n}\n\nexport default SentenceLengthInTextAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAAoF,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpF;AACA;AACA;AACA,MAAMG,8BAA8B,SAASC,mBAAU,CAAC;EACtD;AACF;AACA;AACA;AACA;AACA;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A;AACA;AACA;EACEW,mBAAmBA,CAACzB,SAAS,EAAE;IAC7B,OAAO,IAAAyB,iCAAmB,EAACzB,SAAS,EAAE,IAAI,CAACN,OAAO,CAACR,iBAAiB,CAAC;EACvE;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEmC,qBAAqBA,CAACrB,SAAS,EAAE;IAC/B,OAAO,IAAI,CAACyB,mBAAmB,CAACzB,SAAS,CAAC,CAACmB,MAAM;EACnD;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEcC,8BAA8B","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ class FAQsStructureDataAssessment extends _assessment.default {
|
|
|
24
24
|
super();
|
|
25
25
|
const defaultConfig = {
|
|
26
26
|
id: _analysis.FAQs_STRUCTURE_DATA_ID,
|
|
27
|
-
ctaType: '
|
|
27
|
+
ctaType: 'contactUs',
|
|
28
28
|
docUrl: 'https://blog.google/products/search/generative-ai-search/',
|
|
29
29
|
priority: 'high',
|
|
30
30
|
fixPosition: 'faqs',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FAQsStructureDataAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","e","__esModule","default","FAQsStructureDataAssessment","Assessment","constructor","config","defaultConfig","id","FAQs_STRUCTURE_DATA_ID","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","calculatedResult","calculateResult","assessmentResult","AssessmentResult","setScore","score","setStatus","status","hasSchema","hasFAQsSchema","getScore","FAQS_POINTS","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/FAQsStructureDataAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {FAQS_POINTS, FAQs_STRUCTURE_DATA_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents an assessment that checks FAQs content and structure for SGE optimization.\n */\nexport default class FAQsStructureDataAssessment 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: FAQs_STRUCTURE_DATA_ID,\n ctaType: '
|
|
1
|
+
{"version":3,"file":"FAQsStructureDataAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","e","__esModule","default","FAQsStructureDataAssessment","Assessment","constructor","config","defaultConfig","id","FAQs_STRUCTURE_DATA_ID","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","calculatedResult","calculateResult","assessmentResult","AssessmentResult","setScore","score","setStatus","status","hasSchema","hasFAQsSchema","getScore","FAQS_POINTS","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/FAQsStructureDataAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {FAQS_POINTS, FAQs_STRUCTURE_DATA_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents an assessment that checks FAQs content and structure for SGE optimization.\n */\nexport default class FAQsStructureDataAssessment 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: FAQs_STRUCTURE_DATA_ID,\n ctaType: 'contactUs',\n docUrl: 'https://blog.google/products/search/generative-ai-search/',\n priority: 'high',\n fixPosition: 'faqs',\n title: 'FAQs structured data',\n content: {\n good: 'FAQ structured data added',\n improve: '',\n bad: 'Add FAQs structured data for Google rich results eligibility.',\n }\n };\n\n this.identifier = FAQs_STRUCTURE_DATA_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 * @returns {AssessmentResult} The result of the assessment, containing both a score and a descriptive text.\n */\n getResult({paper, researcher}) {\n const calculatedResult = this.calculateResult(paper);\n const assessmentResult = new AssessmentResult({config: this._config});\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @returns {{score: number, status: string, data: {hasSchema: ((function(): *)|boolean), hasProperStructure: boolean, hasMinimumFAQs: boolean}}|{score: number, status: string, data: {hasFAQs: boolean}}}\n */\n calculateResult(paper) {\n // Check FAQ structure and content\n const hasSchema = paper.hasFAQsSchema();\n const status = hasSchema ? 'good' : 'bad';\n const score = this.getScore(FAQS_POINTS, status);\n return {\n score,\n status\n };\n }\n\n\n\n\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAA2E,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3E;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,EAAEC,gCAAsB;MAC1BC,OAAO,EAAE,WAAW;MACpBC,MAAM,EAAE,2DAA2D;MACnEC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,MAAM;MACnBC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;QACPC,IAAI,EAAE,2BAA2B;QACjCC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGV,gCAAsB;IACxC,IAAI,CAACW,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMC,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACH,KAAK,CAAC;IACpD,MAAMI,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAACtB,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IACrEO,gBAAgB,CAACE,QAAQ,CAACJ,gBAAgB,CAACK,KAAK,CAAC;IACjDH,gBAAgB,CAACI,SAAS,CAACN,gBAAgB,CAACO,MAAM,CAAC;IACnD,OAAOL,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACED,eAAeA,CAACH,KAAK,EAAE;IACrB;IACA,MAAMU,SAAS,GAAGV,KAAK,CAACW,aAAa,CAAC,CAAC;IACvC,MAAMF,MAAM,GAAGC,SAAS,GAAG,MAAM,GAAG,KAAK;IAC1C,MAAMH,KAAK,GAAG,IAAI,CAACK,QAAQ,CAACC,qBAAW,EAAEJ,MAAM,CAAC;IAC/C,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;EAKAK,YAAYA,CAACd,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAACe,OAAA,CAAApC,OAAA,GAAAC,2BAAA","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
10
|
var _analysis = require("../../../const/analysis");
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
/**
|
|
@@ -33,7 +32,6 @@ class InternalLinksAssessment extends _assessment.default {
|
|
|
33
32
|
id: _analysis.INTERNAL_LINKS_ID,
|
|
34
33
|
fixPosition: '',
|
|
35
34
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',
|
|
36
|
-
icon: _polarisIcons.LinkIcon,
|
|
37
35
|
priority: 'high',
|
|
38
36
|
title: 'Internal links',
|
|
39
37
|
content: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalLinksAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"InternalLinksAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","e","__esModule","default","InternalLinksAssessment","Assessment","constructor","config","defaultConfig","id","INTERNAL_LINKS_ID","fixPosition","docUrl","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","internalTotal","getScore","LINK_RECOMMEND_POINTS","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/InternalLinksAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {INTERNAL_LINKS_ID, LINK_RECOMMEND_POINTS} 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 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 * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher}) {\n this.linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult();\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\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 true;\n }\n\n /**\n *\n * @returns {{score: number, status: string}}\n */\n calculateResult() {\n let status = 'good';\n if (this.linkStatistics.internalTotal === 0) {\n status = 'bad';\n }\n\n const score = this.getScore(LINK_RECOMMEND_POINTS, status);\n\n return {\n score,\n status\n };\n }\n}\n\nexport default InternalLinksAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAgF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,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B,IAAI,IAAI,CAACT,cAAc,CAACW,aAAa,KAAK,CAAC,EAAE;MAC3CF,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAACC,+BAAqB,EAAEJ,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAArC,OAAA,GAEcC,uBAAuB","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
10
|
var _analysis = require("../../../const/analysis");
|
|
12
11
|
var _chineseHelperFactory = require("../../../languageProcessing/helpers/language/chineseHelperFactory.js");
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -31,7 +30,6 @@ class IntroductionKeywordAssessment extends _assessment.default {
|
|
|
31
30
|
priority: 'low',
|
|
32
31
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-introduction',
|
|
33
32
|
fixPosition: 'highlightFirstParagraph',
|
|
34
|
-
icon: _polarisIcons.KeyIcon,
|
|
35
33
|
title: 'Introduction Keyword',
|
|
36
34
|
content: {
|
|
37
35
|
improve: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntroductionKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"IntroductionKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","_chineseHelperFactory","e","__esModule","default","IntroductionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","INTRODUCTION_KEYWORD_ID","ctaType","priority","docUrl","fixPosition","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","assessmentResult","AssessmentResult","enhancedResearcher","enhanceResearcherForChinese","getText","getKeyword","_firstParagraphMatches","getResearch","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","foundInOneSentence","foundInParagraph","getScore","MAIN_CONTENT_POINTS","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/IntroductionKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {INTRODUCTION_KEYWORD_ID, MAIN_CONTENT_POINTS} from '@axyseo/const/analysis';\nimport {enhanceResearcherForChinese} from '../../../languageProcessing/helpers/language/chineseHelperFactory.js';\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 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 * @returns {AssessmentResult} The result of this assessment.\n */\n getResult({paper, researcher}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n // Enhance researcher for Chinese if needed\n const enhancedResearcher = enhanceResearcherForChinese(\n researcher,\n paper.getText(),\n paper.getKeyword()\n );\n\n this._firstParagraphMatches = enhancedResearcher.getResearch('findKeywordInFirstParagraph');\n const calculatedResult = this.calculateResult();\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\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 true;\n }\n\n /**\n *\n * @returns {{score: number, status: string}}\n */\n calculateResult() {\n let status = 'bad';\n\n if (\n this._firstParagraphMatches.foundInOneSentence ||\n this._firstParagraphMatches.foundInParagraph\n ) {\n status = 'good';\n }\n\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status\n };\n }\n}\n\nexport default IntroductionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AAAiH,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEjH;AACA;AACA;AACA,MAAMG,6BAA6B,SAASC,mBAAU,CAAC;EACrD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEC,iCAAuB;MAC3BC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,KAAK;MACfC,MAAM,EACJ,qGAAqG;MACvGC,WAAW,EAAE,yBAAyB;MACtCC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAA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E;IACF,CAAC;EACH;AACF;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcC,6BAA6B","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
10
|
var _helpers = require("../../../helpers");
|
|
12
11
|
var _analysis = require("../../../const/analysis");
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -30,7 +29,6 @@ class KeyphraseLengthAssessment extends _assessment.default {
|
|
|
30
29
|
priority: 'low',
|
|
31
30
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-length',
|
|
32
31
|
fixPosition: 'keyword search',
|
|
33
|
-
icon: _polarisIcons.KeyIcon,
|
|
34
32
|
title: 'Keyword length',
|
|
35
33
|
content: {
|
|
36
34
|
improve: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"KeyphraseLengthAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_helpers","_analysis","e","__esModule","default","KeyphraseLengthAssessment","Assessment","constructor","config","defaultConfig","id","KEYPHRASE_LENGTH_ID","ctaType","priority","docUrl","fixPosition","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","keywordLength","countWords","getKeyword","getScore","MAIN_CONTENT_POINTS","isApplicable","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/KeyphraseLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {countWords} from '@axyseo/helpers';\nimport {KEYPHRASE_LENGTH_ID, MAIN_CONTENT_POINTS} 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 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 * @returns {AssessmentResult} The result of this assessment.\n */\n getResult({paper, researcher}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper);\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) {\n const keywordLength = countWords(paper.getKeyword());\n\n let status = 'bad';\n if (keywordLength <= 4) {\n status = 'good';\n }\n\n const score = this.getScore(MAIN_CONTENT_POINTS, 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 true;\n }\n}\n\nexport default KeyphraseLengthAssessment;\n"],"mappings":";;;;;;AAAA,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B,CAACK,MAAM,CAAC;IAEnD,OAAOP,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACEG,eAAeA,CAACL,KAAK,EAAE;IACrB,MAAMU,aAAa,GAAG,IAAAC,mBAAU,EAACX,KAAK,CAACY,UAAU,CAAC,CAAC,CAAC;IAEpD,IAAIH,MAAM,GAAG,KAAK;IAClB,IAAIC,aAAa,IAAI,CAAC,EAAE;MACtBD,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACM,QAAQ,CAACC,6BAAmB,EAAEL,MAAM,CAAC;IAExD,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEM,YAAYA,CAACf,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEcC,yBAAyB","ignoreList":[]}
|
|
@@ -76,8 +76,11 @@ class KeyphraseDensityAssessment extends _assessment.default {
|
|
|
76
76
|
status = 'good';
|
|
77
77
|
}
|
|
78
78
|
const score = this.getScore(_analysis.MAIN_CONTENT_POINTS, status);
|
|
79
|
+
this._config = (0, _lodash.merge)(this._config, {
|
|
80
|
+
roundedDensity
|
|
81
|
+
});
|
|
79
82
|
return {
|
|
80
|
-
|
|
83
|
+
roundedDensity,
|
|
81
84
|
score,
|
|
82
85
|
status
|
|
83
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_keyphraseLengthFactor","_analysis","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","KEYPHRASE_DENSITY_ID","fixPosition","docUrl","ctaType","priority","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setTitle","density","roundedDensity","parseFloat","toFixed","getScore","MAIN_CONTENT_POINTS","isApplicable","_default","exports"],"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, MAIN_CONTENT_POINTS} 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 * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher}) {\n\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);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n *\n * @returns {{title: string, score: number, status: string}}\n */\n calculateResult() {\n const density = this._keyphraseDensity;\n const roundedDensity = parseFloat(density.toFixed(2));\n\n let status = 'bad';\n if (roundedDensity >= 1 && roundedDensity <= 1.5) {\n status = 'good';\n }\n\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n
|
|
1
|
+
{"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_keyphraseLengthFactor","_analysis","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","KEYPHRASE_DENSITY_ID","fixPosition","docUrl","ctaType","priority","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setTitle","density","roundedDensity","parseFloat","toFixed","getScore","MAIN_CONTENT_POINTS","isApplicable","_default","exports"],"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, MAIN_CONTENT_POINTS} 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 * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher}) {\n\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);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n *\n * @returns {{title: string, score: number, status: string}}\n */\n calculateResult() {\n const density = this._keyphraseDensity;\n const roundedDensity = parseFloat(density.toFixed(2));\n\n let status = 'bad';\n if (roundedDensity >= 1 && roundedDensity <= 1.5) {\n status = 'good';\n }\n\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n this._config = merge(this._config, {\n roundedDensity\n });\n return {\n 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 true;\n }\n}\n\nexport default KeyphraseDensityAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sB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,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErE,MAAMY,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACV,KAAK,CAAC;IAEpDO,gBAAgB,CAACI,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDL,gBAAgB,CAACM,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IACnDP,gBAAgB,CAACQ,QAAQ,CAACN,gBAAgB,CAAClB,KAAK,CAAC;IACjD,OAAOgB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;EACEG,eAAeA,CAAA,EAAG;IAChB,MAAMM,OAAO,GAAG,IAAI,CAACX,iBAAiB;IACtC,MAAMY,cAAc,GAAGC,UAAU,CAACF,OAAO,CAACG,OAAO,CAAC,CAAC,CAAC,CAAC;IAErD,IAAIL,MAAM,GAAG,KAAK;IAClB,IAAIG,cAAc,IAAI,CAAC,IAAIA,cAAc,IAAI,GAAG,EAAE;MAChDH,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAACC,6BAAmB,EAAEP,MAAM,CAAC;IACxD,IAAI,CAACjB,OAAO,GAAG,IAAAC,aAAK,EAAC,IAAI,CAACD,OAAO,EAAE;MACjCoB;IACF,CAAC,CAAC;IACF,OAAO;MACLA,cAAc;MACdL,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEQ,YAAYA,CAACtB,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAAC,IAAAsB,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAEcC,0BAA0B","ignoreList":[]}
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
|
-
var _matchTextWithWord = _interopRequireDefault(require("../../../languageProcessing/helpers/match/matchTextWithWord"));
|
|
12
10
|
var _analysis = require("../../../const/analysis");
|
|
13
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
12
|
/**
|
|
@@ -34,7 +32,6 @@ class MetaDescriptionKeywordAssessment extends _assessment.default {
|
|
|
34
32
|
fixPosition: 'meta description',
|
|
35
33
|
ctaType: 'fix',
|
|
36
34
|
docUrl: 'https://help.seoon.io/seo/seo-checklist',
|
|
37
|
-
icon: _polarisIcons.KeyIcon,
|
|
38
35
|
title: 'Meta description keyword',
|
|
39
36
|
content: {
|
|
40
37
|
bad: 'No keywords found in meta description. Add at least one to improve keyword rank.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","e","__esModule","default","MetaDescriptionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","META_DESCRIPTION_KEYWORD_ID","priority","fixPosition","ctaType","docUrl","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","_keyphraseCounts","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","getScore","META_TAG_POINTS","isApplicable","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import { merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {META_DESCRIPTION_KEYWORD_ID, META_TAG_POINTS} 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 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 * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher}) {\n this._keyphraseCounts = researcher.getResearch('metaDescriptionKeyword');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n\n return assessmentResult;\n }\n\n /**\n *\n * @returns {{score: number, status: string}}\n */\n calculateResult() {\n let status = 'bad';\n if (this._keyphraseCounts > 0) {\n status = 'good';\n }\n const score = this.getScore(META_TAG_POINTS, 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 true;\n }\n}\n\nexport default MetaDescriptionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAA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SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IAEnD,OAAOP,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;EACEG,eAAeA,CAAA,EAAG;IAChB,IAAII,MAAM,GAAG,KAAK;IAClB,IAAI,IAAI,CAACT,gBAAgB,GAAG,CAAC,EAAE;MAC7BS,MAAM,GAAG,MAAM;IACjB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACG,QAAQ,CAACC,yBAAe,EAAEF,MAAM,CAAC;IAEpD,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACd,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAArC,OAAA,GAEcC,gCAAgC","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
11
10
|
var _analysis = require("../../../const/analysis");
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
/**
|
|
@@ -27,7 +26,6 @@ class OutboundLinksAssessment extends _assessment.default {
|
|
|
27
26
|
id: _analysis.EXTERNAL_LINKS_ID,
|
|
28
27
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',
|
|
29
28
|
fixPosition: 'description',
|
|
30
|
-
icon: _polarisIcons.ExternalIcon,
|
|
31
29
|
title: 'External links',
|
|
32
30
|
priority: 'high',
|
|
33
31
|
content: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","
|
|
1
|
+
{"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","e","__esModule","default","OutboundLinksAssessment","Assessment","constructor","config","defaultConfig","id","EXTERNAL_LINKS_ID","docUrl","fixPosition","title","priority","content","improve","good","bad","identifier","_config","merge","getResult","paper","researcher","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isEmpty","setScore","score","setStatus","status","isApplicable","externalTotal","getScore","LINK_RECOMMEND_POINTS","exports"],"sources":["../../../../../src/scoring/assessments/seo/OutboundLinksAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {EXTERNAL_LINKS_ID, LINK_RECOMMEND_POINTS} from '@axyseo/const/analysis';\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: EXTERNAL_LINKS_ID,\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 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 = EXTERNAL_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 *\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher}) {\n const linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(linkStatistics);\n\n if (!isEmpty(linkStatistics)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\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 true;\n }\n\n /**\n *\n * @param linkStatistics\n * @returns {{score: number, status: string}}\n */\n calculateResult(linkStatistics) {\n let status = 'good';\n if (linkStatistics.externalTotal === 0) {\n status = 'bad';\n }\n\n const score = this.getScore(LINK_RECOMMEND_POINTS, status);\n\n return {\n score,\n status\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAgF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhF;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,EAAEC,2BAAiB;MACrBC,MAAM,EACJ,2GAA2G;MAC7GC,WAAW,EAAE,aAAa;MAC1BC,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,GAAGT,2BAAiB;IACnC,IAAI,CAACU,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMC,cAAc,GAAGD,UAAU,CAACE,WAAW,CAAC,mBAAmB,CAAC;IAClE,MAAMC,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAACrB,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMS,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAACL,cAAc,CAAC;IAE7D,IAAI,CAAC,IAAAM,eAAO,EAACN,cAAc,CAAC,EAAE;MAC5BE,gBAAgB,CAACK,QAAQ,CAACH,gBAAgB,CAACI,KAAK,CAAC;MACjDN,gBAAgB,CAACO,SAAS,CAACL,gBAAgB,CAACM,MAAM,CAAC;IACrD;IACA,OAAOR,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACES,YAAYA,CAACb,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEO,eAAeA,CAACL,cAAc,EAAE;IAC9B,IAAIU,MAAM,GAAG,MAAM;IACnB,IAAIV,cAAc,CAACY,aAAa,KAAK,CAAC,EAAE;MACtCF,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAACC,+BAAqB,EAAEJ,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF;AAACK,OAAA,CAAArC,OAAA,GAAAC,uBAAA","ignoreList":[]}
|
|
@@ -46,8 +46,9 @@ class SchemaAssessment extends _assessment.default {
|
|
|
46
46
|
calculateResult(paper) {
|
|
47
47
|
let status = '';
|
|
48
48
|
const url = paper.getSlug();
|
|
49
|
-
if (url.includes('product')
|
|
49
|
+
if (url.includes('product')) {
|
|
50
50
|
this._config = (0, _lodash.merge)(this._config, {
|
|
51
|
+
type: "product",
|
|
51
52
|
title: 'Missing product structured data',
|
|
52
53
|
content: {
|
|
53
54
|
good: 'Product structured data added',
|
|
@@ -60,8 +61,24 @@ class SchemaAssessment extends _assessment.default {
|
|
|
60
61
|
status = 'bad';
|
|
61
62
|
}
|
|
62
63
|
}
|
|
64
|
+
if (url.includes('collection')) {
|
|
65
|
+
this._config = (0, _lodash.merge)(this._config, {
|
|
66
|
+
type: "collection",
|
|
67
|
+
title: 'Missing collection structured data',
|
|
68
|
+
content: {
|
|
69
|
+
good: 'Collection structured data added',
|
|
70
|
+
bad: 'Add Collection structured data for Google rich results eligibility.'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if (paper.hasProductSchema()) {
|
|
74
|
+
status = 'good';
|
|
75
|
+
} else {
|
|
76
|
+
status = 'bad';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
63
79
|
if (url.includes('blogs')) {
|
|
64
80
|
this._config = (0, _lodash.merge)(this._config, {
|
|
81
|
+
type: "article",
|
|
65
82
|
title: 'Missing article structured data',
|
|
66
83
|
content: {
|
|
67
84
|
good: 'Article structured data added',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","SchemaAssessment","Assessment","constructor","config","defaultConfig","id","SCHEMA_ID","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","status","url","getSlug","includes","hasProductSchema","hasArticleSchema","score","getScore","TECHNICAL_SEO_POINTS","getResult","researcher","calculatedResult","assessmentResult","AssessmentResult","setScore","setStatus","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/SchemaAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {SCHEMA_ID, TECHNICAL_SEO_POINTS} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks shop has schema.\n */\nexport default class SchemaAssessment 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: SCHEMA_ID,\n priority: 'high',\n docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#schema',\n ctaType: 'contactUs',\n title: 'Schema',\n content: {\n good: 'Schema markup is applied effectively.',\n improve: '',\n bad: 'No schema markup applied. Add schema to optimize visibility for search engines.'\n }\n };\n\n this.identifier = SCHEMA_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param paper\n * @returns {{score: number, status: string}}\n */\n calculateResult(paper) {\n let status = '';\n const url = paper.getSlug();\n\n if (url.includes('product')
|
|
1
|
+
{"version":3,"file":"SchemaAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","SchemaAssessment","Assessment","constructor","config","defaultConfig","id","SCHEMA_ID","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","status","url","getSlug","includes","type","hasProductSchema","hasArticleSchema","score","getScore","TECHNICAL_SEO_POINTS","getResult","researcher","calculatedResult","assessmentResult","AssessmentResult","setScore","setStatus","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/SchemaAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {SCHEMA_ID, TECHNICAL_SEO_POINTS} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks shop has schema.\n */\nexport default class SchemaAssessment 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: SCHEMA_ID,\n priority: 'high',\n docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#schema',\n ctaType: 'contactUs',\n title: 'Schema',\n content: {\n good: 'Schema markup is applied effectively.',\n improve: '',\n bad: 'No schema markup applied. Add schema to optimize visibility for search engines.'\n }\n };\n\n this.identifier = SCHEMA_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param paper\n * @returns {{score: number, status: string}}\n */\n calculateResult(paper) {\n let status = '';\n const url = paper.getSlug();\n\n if (url.includes('product')) {\n this._config = merge(this._config, {\n type: \"product\",\n title: 'Missing product structured data',\n content: {\n good: 'Product structured data added',\n bad: 'Add Product structured data for Google rich results eligibility.'\n }\n });\n if (paper.hasProductSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n if (url.includes('collection')) {\n this._config = merge(this._config, {\n type: \"collection\",\n title: 'Missing collection structured data',\n content: {\n good: 'Collection structured data added',\n bad: 'Add Collection structured data for Google rich results eligibility.'\n }\n });\n if (paper.hasProductSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n if (url.includes('blogs')) {\n this._config = merge(this._config, {\n type: \"article\",\n title: 'Missing article structured data',\n content: {\n good: 'Article structured data added',\n bad: 'Add Article structured data for Google rich results eligibility.'\n }\n });\n if (paper.hasArticleSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n\n const score = this.getScore(TECHNICAL_SEO_POINTS, status);\n\n return {\n score,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param config\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const calculatedResult = this.calculateResult(paper);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the sentence beginnings assessment is applicable to the paper.\n *\n * @param {Object} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n * @returns {boolean} Returns true if the language is available and the paper is not empty.\n */\n isApplicable(paper, researcher) {\n return true\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,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BAAgB,CAACL,KAAK,CAAC;IACjDM,gBAAgB,CAACG,SAAS,CAACJ,gBAAgB,CAACZ,MAAM,CAAC;IAEnD,OAAOa,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAAClB,KAAK,EAAEY,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAACO,OAAA,CAAAvC,OAAA,GAAAC,gBAAA","ignoreList":[]}
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _assessment = _interopRequireDefault(require("../assessment"));
|
|
9
9
|
var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
|
|
10
|
-
var _helpers = require("../../../helpers");
|
|
11
|
-
var _polarisIcons = require("@shopify/polaris-icons");
|
|
12
10
|
var _analysis = require("../../../const/analysis");
|
|
13
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
12
|
/**
|
|
@@ -29,7 +27,6 @@ class TextImagesAssessment extends _assessment.default {
|
|
|
29
27
|
ctaType: 'fix',
|
|
30
28
|
docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#alt-text',
|
|
31
29
|
fixPosition: 'description',
|
|
32
|
-
icon: _polarisIcons.ExternalIcon,
|
|
33
30
|
priority: 'high',
|
|
34
31
|
title: 'Alt text',
|
|
35
32
|
content: {
|