axyseo 2.0.0-alpha.0.0.53 → 2.0.0-alpha.0.0.55

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.
@@ -37,7 +37,7 @@ export default class RelatedKeywordsAssessment extends Assessment {
37
37
  * @param data
38
38
  * @param relatedKeywords
39
39
  * @param i18n
40
- * @returns {{score: number, body: React.JSX.Element, status: string}}
40
+ * @returns {{score: number, status: string, words}}
41
41
  */
42
42
  calculateResult(data, relatedKeywords, i18n) {
43
43
  const {
@@ -80,6 +80,7 @@ export default class RelatedKeywordsAssessment extends Assessment {
80
80
  });
81
81
  assessmentResult.setScore(result.score);
82
82
  assessmentResult.setStatus(result.status);
83
+ assessmentResult.setBody(result.words);
83
84
  return assessmentResult;
84
85
  }
85
86
 
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","status","related_keywords","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","isApplicable","hasRelatedKeywords"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment 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: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(data, relatedKeywords, i18n) {\n const {totalWordUsed, words, isWordUsedExceeding} = relatedKeywords;\n let status = 'good';\n if (!data?.related_keywords?.length || totalWordUsed <= 0) {\n status = 'bad';\n }\n\n if (isWordUsedExceeding) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n\n const result = this.calculateResult(data, relatedKeywords, i18n);\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 if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return paper.hasRelatedKeywords();\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;;AAEjB;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASD,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC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C,eAAe,EAAEC,IAAI,CAAC;IAChE,MAAMe,gBAAgB,GAAG,IAAIpC,gBAAgB,CAAC;MAACI,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErEmB,gBAAgB,CAACC,QAAQ,CAACF,MAAM,CAACP,KAAK,CAAC;IACvCQ,gBAAgB,CAACE,SAAS,CAACH,MAAM,CAACV,MAAM,CAAC;IAEzC,OAAOW,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACR,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAACS,kBAAkB,CAAC,CAAC;EACnC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","i18n","totalWordUsed","words","isWordUsedExceeding","status","related_keywords","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","setBody","isApplicable","hasRelatedKeywords"],"sources":["../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsAssessment 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: 'relatedKeywords',\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#duplicate-title',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keyword density is optimized',\n bad:\n 'Consider using at least a related keyword in your page to establish topical relevance.',\n improve: 'Too high related keyword density. Keep related keyword density from 0.5% - 1%.'\n }\n };\n\n this.identifier = 'relatedKeywords';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param i18n\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, i18n) {\n const {totalWordUsed, words, isWordUsedExceeding} = relatedKeywords;\n let status = 'good';\n if (!data?.related_keywords?.length || totalWordUsed <= 0) {\n status = 'bad';\n }\n\n if (isWordUsedExceeding) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n\n const result = this.calculateResult(data, relatedKeywords, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setBody(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return paper.hasRelatedKeywords();\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;;AAEjB;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASD,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,iBAAiB;MACrBC,WAAW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AAgB,CAAC;MAACI,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErEmB,gBAAgB,CAACC,QAAQ,CAACF,MAAM,CAACP,KAAK,CAAC;IACvCQ,gBAAgB,CAACE,SAAS,CAACH,MAAM,CAACV,MAAM,CAAC;IACzCW,gBAAgB,CAACG,OAAO,CAACJ,MAAM,CAACZ,KAAK,CAAC;IAEtC,OAAOa,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACT,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAACU,kBAAkB,CAAC,CAAC;EACnC;AACF","ignoreList":[]}
@@ -1,7 +1,8 @@
1
1
  import { merge } from 'lodash';
2
2
  import Assessment from "../assessment";
3
3
  import AssessmentResult from "../../../values/AssessmentResult";
4
- import { countWordInHtml } from "../../../helpers";
4
+ import countWords from "../../../languageProcessing/helpers/word/countWords";
5
+ import countCharacters from "../../../languageProcessing/languages/ja/helpers/countCharacters";
5
6
 
6
7
  /**
7
8
  * Represents an assessment that checks the length of the text and gives feedback accordingly.
@@ -63,10 +64,8 @@ export default class TextLengthAssessment extends Assessment {
63
64
  * @returns {{score: number, body: React.JSX.Element, status: string}}
64
65
  */
65
66
  calculateResult(paper, i18n) {
66
- const {
67
- wordCount,
68
- charCount
69
- } = countWordInHtml(paper.getText(), true);
67
+ const wordCount = countWords(paper.getText());
68
+ const charCount = countCharacters(paper.getText());
70
69
  let status = 'bad';
71
70
  if (charCount < 2500 && wordCount >= 600) {
72
71
  status = 'improve';
@@ -1 +1 @@
1
- {"version":3,"file":"TextLengthAssessment.js","names":["merge","Assessment","AssessmentResult","countWordInHtml","TextLengthAssessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","calculatedResult","calculateResult","assessmentResult","setScore","score","setStatus","status","wordCount","charCount","getText","getScore"],"sources":["../../../../src/scoring/assessments/seo/TextLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {countWordInHtml} from '@axyseo/helpers';\n\n/**\n * Represents an assessment that checks the length of the text and gives feedback accordingly.\n */\nexport default class TextLengthAssessment 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: 'textLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#text-length',\n priority: 'high',\n fixPosition: 'description',\n title: 'Text length',\n content: {\n good: 'Text length is optimized.',\n improve:\n 'Content length is acceptable, but could be expanded to 2,500 characters for more value.',\n bad:\n 'Insufficient content. Aim for at least 600 words to provide value and rank well in search results.'\n }\n };\n\n this.identifier = 'textLength';\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 calculatedResult = this.calculateResult(paper, i18n);\n\n const assessmentResult = new AssessmentResult({config: this._config});\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 {wordCount, charCount} = countWordInHtml(paper.getText(), true);\n let status = 'bad';\n if (charCount < 2500 && wordCount >= 600) {\n status = 'improve';\n }\n if (wordCount < 600 && charCount < 2500) {\n status = 'bad';\n }\n if (charCount >= 2500 && wordCount >= 600) {\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,SA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,eAAe,CAACkB,KAAK,CAACY,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC;IACrE,IAAIH,MAAM,GAAG,KAAK;IAClB,IAAIE,SAAS,GAAG,IAAI,IAAID,SAAS,IAAI,GAAG,EAAE;MACxCD,MAAM,GAAG,SAAS;IACpB;IACA,IAAIC,SAAS,GAAG,GAAG,IAAIC,SAAS,GAAG,IAAI,EAAE;MACvCF,MAAM,GAAG,KAAK;IAChB;IACA,IAAIE,SAAS,IAAI,IAAI,IAAID,SAAS,IAAI,GAAG,EAAE;MACzCD,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACf,OAAO,CAACR,QAAQ,EAAEmB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF","ignoreList":[]}
1
+ {"version":3,"file":"TextLengthAssessment.js","names":["merge","Assessment","AssessmentResult","countWords","countCharacters","TextLengthAssessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","getResult","paper","researcher","i18n","calculatedResult","calculateResult","assessmentResult","setScore","score","setStatus","status","wordCount","getText","charCount","getScore"],"sources":["../../../../src/scoring/assessments/seo/TextLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport countWords from '@axyseo/languageProcessing/helpers/word/countWords';\nimport countCharacters from '@axyseo/languageProcessing/languages/ja/helpers/countCharacters';\n\n/**\n * Represents an assessment that checks the length of the text and gives feedback accordingly.\n */\nexport default class TextLengthAssessment 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: 'textLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#text-length',\n priority: 'high',\n fixPosition: 'description',\n title: 'Text length',\n content: {\n good: 'Text length is optimized.',\n improve:\n 'Content length is acceptable, but could be expanded to 2,500 characters for more value.',\n bad:\n 'Insufficient content. Aim for at least 600 words to provide value and rank well in search results.'\n }\n };\n\n this.identifier = 'textLength';\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 calculatedResult = this.calculateResult(paper, i18n);\n\n const assessmentResult = new AssessmentResult({config: this._config});\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 wordCount = countWords(paper.getText());\n const charCount = countCharacters(paper.getText());\n\n let status = 'bad';\n if (charCount < 2500 && wordCount >= 600) {\n status = 'improve';\n }\n if (wordCount < 600 && charCount < 2500) {\n status = 'bad';\n }\n if (charCount >= 2500 && wordCount >= 600) {\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,OAAOC,UAAU;AACjB,OAAOC,eAAe;;AAEtB;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASJ,UAAU,CAAC;EAC3D;AACF;AACA;AACA;AACA;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,YAAY;MAChBC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,yFAAyF;MAC3FC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IAAI,GAAG,EAAE;MACzCD,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACf,OAAO,CAACR,QAAQ,EAAEmB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axyseo",
3
- "version": "2.0.0-alpha.0.0.53",
3
+ "version": "2.0.0-alpha.0.0.55",
4
4
  "main": "build/index.js",
5
5
  "scripts": {
6
6
  "prepublishOnly": "npm run build && npm version prerelease --preid=alpha",