axyseo 2.1.57 → 2.1.60

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.
Files changed (109) hide show
  1. package/build/cjs/languageProcessing/researches/getLinkStatistics.js +2 -1
  2. package/build/cjs/languageProcessing/researches/getLinkStatistics.js.map +1 -1
  3. package/build/cjs/scoring/assessments/readability/ParagraphTooLongAssessment.js +1 -1
  4. package/build/cjs/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
  5. package/build/cjs/scoring/assessments/readability/RelatedKeywordsAssessment.js +1 -1
  6. package/build/cjs/scoring/assessments/readability/RelatedKeywordsAssessment.js.map +1 -1
  7. package/build/cjs/scoring/assessments/readability/SentenceBeginningsAssessment.js +1 -1
  8. package/build/cjs/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
  9. package/build/cjs/scoring/assessments/readability/SentenceLengthInTextAssessment.js +1 -1
  10. package/build/cjs/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
  11. package/build/cjs/scoring/assessments/readability/TransitionWordsAssessment.js +1 -1
  12. package/build/cjs/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
  13. package/build/cjs/scoring/assessments/seo/ImageCountAssessment.js +1 -1
  14. package/build/cjs/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
  15. package/build/cjs/scoring/assessments/seo/InternalLinksAssessment.js +1 -1
  16. package/build/cjs/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
  17. package/build/cjs/scoring/assessments/seo/IntroductionKeywordAssessment.js +1 -1
  18. package/build/cjs/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
  19. package/build/cjs/scoring/assessments/seo/InvalidCharactersInUrl.js +1 -1
  20. package/build/cjs/scoring/assessments/seo/InvalidCharactersInUrl.js.map +1 -1
  21. package/build/cjs/scoring/assessments/seo/KeyphraseAssessment.js +1 -1
  22. package/build/cjs/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
  23. package/build/cjs/scoring/assessments/seo/KeyphraseLengthAssessment.js +1 -1
  24. package/build/cjs/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
  25. package/build/cjs/scoring/assessments/seo/KeywordDensityAssessment.js +1 -1
  26. package/build/cjs/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
  27. package/build/cjs/scoring/assessments/seo/KeywordFAQsAssessment.js +1 -1
  28. package/build/cjs/scoring/assessments/seo/KeywordFAQsAssessment.js.map +1 -1
  29. package/build/cjs/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +1 -1
  30. package/build/cjs/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
  31. package/build/cjs/scoring/assessments/seo/MetaTitleKeywordAssessment.js +1 -1
  32. package/build/cjs/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
  33. package/build/cjs/scoring/assessments/seo/NumberInMetaTitleAssessment.js +1 -1
  34. package/build/cjs/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
  35. package/build/cjs/scoring/assessments/seo/OutboundLinksAssessment.js +1 -1
  36. package/build/cjs/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
  37. package/build/cjs/scoring/assessments/seo/PageTitleWidthAssessment.js +1 -1
  38. package/build/cjs/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
  39. package/build/cjs/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js +1 -1
  40. package/build/cjs/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js.map +1 -1
  41. package/build/cjs/scoring/assessments/seo/SchemaAssessment.js +1 -1
  42. package/build/cjs/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
  43. package/build/cjs/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +1 -1
  44. package/build/cjs/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
  45. package/build/cjs/scoring/assessments/seo/TextImagesAssessment.js +1 -1
  46. package/build/cjs/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
  47. package/build/cjs/scoring/assessments/seo/TextLengthAssessment.js +1 -1
  48. package/build/cjs/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
  49. package/build/cjs/scoring/assessments/seo/UrlKeywordAssessment.js +1 -1
  50. package/build/cjs/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
  51. package/build/cjs/scoring/assessments/seo/UrlLengthAssessment.js +1 -1
  52. package/build/cjs/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
  53. package/build/cjs/values/Paper.js +12 -1
  54. package/build/cjs/values/Paper.js.map +1 -1
  55. package/build/esm/languageProcessing/researches/getLinkStatistics.js +2 -1
  56. package/build/esm/languageProcessing/researches/getLinkStatistics.js.map +1 -1
  57. package/build/esm/scoring/assessments/readability/ParagraphTooLongAssessment.js +1 -1
  58. package/build/esm/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
  59. package/build/esm/scoring/assessments/readability/RelatedKeywordsAssessment.js +1 -1
  60. package/build/esm/scoring/assessments/readability/RelatedKeywordsAssessment.js.map +1 -1
  61. package/build/esm/scoring/assessments/readability/SentenceBeginningsAssessment.js +1 -1
  62. package/build/esm/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
  63. package/build/esm/scoring/assessments/readability/SentenceLengthInTextAssessment.js +1 -1
  64. package/build/esm/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
  65. package/build/esm/scoring/assessments/readability/TransitionWordsAssessment.js +1 -1
  66. package/build/esm/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
  67. package/build/esm/scoring/assessments/seo/ImageCountAssessment.js +1 -1
  68. package/build/esm/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
  69. package/build/esm/scoring/assessments/seo/InternalLinksAssessment.js +1 -1
  70. package/build/esm/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
  71. package/build/esm/scoring/assessments/seo/IntroductionKeywordAssessment.js +1 -1
  72. package/build/esm/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
  73. package/build/esm/scoring/assessments/seo/InvalidCharactersInUrl.js +1 -1
  74. package/build/esm/scoring/assessments/seo/InvalidCharactersInUrl.js.map +1 -1
  75. package/build/esm/scoring/assessments/seo/KeyphraseAssessment.js +1 -1
  76. package/build/esm/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
  77. package/build/esm/scoring/assessments/seo/KeyphraseLengthAssessment.js +1 -1
  78. package/build/esm/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
  79. package/build/esm/scoring/assessments/seo/KeywordDensityAssessment.js +1 -1
  80. package/build/esm/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
  81. package/build/esm/scoring/assessments/seo/KeywordFAQsAssessment.js +1 -1
  82. package/build/esm/scoring/assessments/seo/KeywordFAQsAssessment.js.map +1 -1
  83. package/build/esm/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +1 -1
  84. package/build/esm/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
  85. package/build/esm/scoring/assessments/seo/MetaTitleKeywordAssessment.js +1 -1
  86. package/build/esm/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
  87. package/build/esm/scoring/assessments/seo/NumberInMetaTitleAssessment.js +1 -1
  88. package/build/esm/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
  89. package/build/esm/scoring/assessments/seo/OutboundLinksAssessment.js +1 -1
  90. package/build/esm/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
  91. package/build/esm/scoring/assessments/seo/PageTitleWidthAssessment.js +1 -1
  92. package/build/esm/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
  93. package/build/esm/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js +1 -1
  94. package/build/esm/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js.map +1 -1
  95. package/build/esm/scoring/assessments/seo/SchemaAssessment.js +1 -1
  96. package/build/esm/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
  97. package/build/esm/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +1 -1
  98. package/build/esm/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
  99. package/build/esm/scoring/assessments/seo/TextImagesAssessment.js +1 -1
  100. package/build/esm/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
  101. package/build/esm/scoring/assessments/seo/TextLengthAssessment.js +1 -1
  102. package/build/esm/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
  103. package/build/esm/scoring/assessments/seo/UrlKeywordAssessment.js +1 -1
  104. package/build/esm/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
  105. package/build/esm/scoring/assessments/seo/UrlLengthAssessment.js +1 -1
  106. package/build/esm/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
  107. package/build/esm/values/Paper.js +12 -1
  108. package/build/esm/values/Paper.js.map +1 -1
  109. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"UrlKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","_chineseHelperFactory","e","__esModule","default","SlugKeywordAssessment","Assessment","constructor","config","defaultConfig","id","SLUG_KEYWORD_ID","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","enhancedResearcher","enhanceResearcherForChinese","getSlug","getKeyword","_keywordInSlug","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","percentWordMatches","getScore","URLS_POINTS","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/UrlKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {SLUG_KEYWORD_ID, URLS_POINTS} from '@axyseo/const/analysis';\nimport {enhanceResearcherForChinese} from '@axyseo/languageProcessing/helpers/language/chineseHelperFactory';\n\n/**\n * Represents the Slug keyword assessment. This assessment checks if the keyword is present in the slug.\n */\nclass SlugKeywordAssessment 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: SLUG_KEYWORD_ID,\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-url',\n fixPosition: 'url handle',\n ctaType: 'fix',\n priority: 'medium',\n title: 'Keyword in URL',\n content: {\n good: 'Keyword is included in URL.',\n improve: '',\n bad: 'Missing keyword in URL. Include it for relevance and better SEO.'\n }\n };\n\n this.identifier = SLUG_KEYWORD_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 // Enhance researcher for Chinese if needed - specifically for URL context\n const enhancedResearcher = enhanceResearcherForChinese(\n researcher,\n paper.getSlug(),\n paper.getKeyword(),\n true // isUrlContext = true for enhanced Chinese URL matching\n );\n\n this._keywordInSlug = enhancedResearcher.getResearch('keywordCountInSlug');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult();\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\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 * @returns {{score: number, status: (string)}}\n */\n calculateResult() {\n const status = (() => {\n return this._keywordInSlug.percentWordMatches >= 50 ? 'good' : 'bad';\n })();\n\n return {\n score: this.getScore(URLS_PO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BAAkB,CAACK,WAAW,CAAC,oBAAoB,CAAC;IAE1E,MAAMC,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC1B,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErE,MAAMa,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAAC,CAAC;IAE/CH,gBAAgB,CAACI,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDL,gBAAgB,CAACM,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IACnD,OAAOP,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEQ,YAAYA,CAAChB,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEU,eAAeA,CAAA,EAAG;IAChB,MAAMI,MAAM,GAAG,CAAC,MAAM;MACpB,OAAO,IAAI,CAACT,cAAc,CAACW,kBAAkB,IAAI,EAAE,GAAG,MAAM,GAAG,KAAK;IACtE,CAAC,EAAE,CAAC;IAEJ,OAAO;MACLJ,KAAK,EAAE,IAAI,CAACK,QAAQ,CAACC,qBAAW,EAAEJ,MAAM,CAAC,IAAI,CAAC;MAC9CA;IACF,CAAC;EACH;AACF;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEcC,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"UrlKeywordAssessment.js","names":["_lodash","require","_assessment","_interopRequireDefault","_AssessmentResult","_analysis","_chineseHelperFactory","e","__esModule","default","SlugKeywordAssessment","Assessment","constructor","config","defaultConfig","id","SLUG_KEYWORD_ID","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","enhancedResearcher","enhanceResearcherForChinese","getSlug","getKeyword","_keywordInSlug","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","percentWordMatches","getScore","URLS_POINTS","_default","exports"],"sources":["../../../../../src/scoring/assessments/seo/UrlKeywordAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {SLUG_KEYWORD_ID, URLS_POINTS} from '@axyseo/const/analysis';\nimport {enhanceResearcherForChinese} from '@axyseo/languageProcessing/helpers/language/chineseHelperFactory';\n\n/**\n * Represents the Slug keyword assessment. This assessment checks if the keyword is present in the slug.\n */\nclass SlugKeywordAssessment 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: SLUG_KEYWORD_ID,\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#missing-main-keyword-in-url',\n fixPosition: 'url handle',\n ctaType: 'fix',\n priority: 'medium',\n title: 'Keyword in URL',\n content: {\n good: 'Keyword is included in URL.',\n improve: '',\n bad: 'Missing keyword in URL. Include it for relevance and better SEO.'\n }\n };\n\n this.identifier = SLUG_KEYWORD_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 // Enhance researcher for Chinese if needed - specifically for URL context\n const enhancedResearcher = enhanceResearcherForChinese(\n researcher,\n paper.getSlug(),\n paper.getKeyword(),\n true // isUrlContext = true for enhanced Chinese URL matching\n );\n\n this._keywordInSlug = enhancedResearcher.getResearch('keywordCountInSlug');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult();\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\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 * @returns {{score: number, status: (string)}}\n */\n calculateResult() {\n const status = (() => {\n return this._keywordInSlug.percentWordMatches >= 50 ? 'good' : 'bad';\n })();\n\n return {\n score: this.getScore(URLS_POINTS, status) || 0,\n status\n };\n }\n}\n\nexport default SlugKeywordAssessment;\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;AACA,IAAAK,qBAAA,GAAAL,OAAA;AAA6G,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7G;AACA;AACA;AACA,MAAMG,qBAAqB,SAASC,mBAAU,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEC,yBAAe;MACnBC,MAAM,EACJ,qGAAqG;MACvGC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,QAAQ;MAClBC,KAAK,EAAE,gBAAgB;MACvBC,OAAO,EAAE;QACPC,IAAI,EAAE,6BAA6B;QACnCC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGV,yBAAe;IACjC,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;IACA,MAAMC,kBAAkB,GAAG,IAAAC,iDAA2B,EACpDF,UAAU,EACVD,KAAK,CAACI,OAAO,CAAC,CAAC,EACfJ,KAAK,CAACK,UAAU,CAAC,CAAC,EAClB,IAAI,CAAC;IACP,CAAC;IAED,IAAI,CAACC,cAAc,GAAGJ,kBAAkB,CAACK,WAAW,CAAC,oBAAoB,CAAC;IAE1E,MAAMC,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC1B,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErE,MAAMa,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAAC,CAAC;IAE/CH,gBAAgB,CAACI,QAAQ,CAACF,gBAAgB,CAACG,KAAK,CAAC;IACjDL,gBAAgB,CAACM,SAAS,CAACJ,gBAAgB,CAACK,MAAM,CAAC;IACnD,OAAOP,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEQ,YAAYA,CAAChB,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEU,eAAeA,CAAA,EAAG;IAChB,MAAMI,MAAM,GAAG,CAAC,MAAM;MACpB,OAAO,IAAI,CAACT,cAAc,CAACW,kBAAkB,IAAI,EAAE,GAAG,MAAM,GAAG,KAAK;IACtE,CAAC,EAAE,CAAC;IAEJ,OAAO;MACLJ,KAAK,EAAE,IAAI,CAACK,QAAQ,CAACC,qBAAW,EAAEJ,MAAM,CAAC,IAAI,CAAC;MAC9CA;IACF,CAAC;EACH;AACF;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEcC,qBAAqB","ignoreList":[]}
@@ -25,7 +25,7 @@ class UrlLengthAssessment extends _assessment.default {
25
25
  const defaultConfig = {
26
26
  id: _analysis.URL_LENGTH_ID,
27
27
  priority: 'high',
28
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#url-length',
28
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#url-length-off-target',
29
29
  fixPosition: 'url handle',
30
30
  ctaType: 'fix',
31
31
  title: 'URL length',
@@ -1 +1 @@
1
- {"version":3,"file":"UrlLengthAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","UrlLengthAssessment","Assessment","constructor","config","defaultConfig","id","URL_LENGTH_ID","priority","docUrl","fixPosition","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","status","length","getDomain","getSlug","score","getScore","URLS_POINTS","getResult","researcher","calculatedResult","assessmentResult","AssessmentResult","setScore","setStatus","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/UrlLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {URL_LENGTH_ID, URLS_POINTS} from '@axyseo/const/analysis';\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 UrlLengthAssessment 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: URL_LENGTH_ID,\n priority: 'high',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#url-length',\n fixPosition: 'url handle',\n ctaType: 'fix',\n title: 'URL length',\n content: {\n good: 'URL length is optimized, less than 75 characters.',\n improve: '',\n bad: 'Keep it less than 75 characters for better readability and SEO.'\n }\n };\n\n this.identifier = URL_LENGTH_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 = 'bad';\n const length = paper.getDomain().length + paper.getSlug().length;\n if (length < 75) {\n status = 'good';\n }\n\n return {\n score: this.getScore(URLS_POINTS, status) || 0,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\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 *\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,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAkE,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE;AACA;AACA;AACe,MAAMG,mBAAmB,SAASC,mBAAU,CAAC;EAC1D;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,uBAAa;MACjBC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EACJ,wFAAwF;MAC1FC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,KAAK,EAAE,YAAY;MACnBC,OAAO,EAAE;QACPC,IAAI,EAAE,mDAAmD;QACzDC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGV,uBAAa;IAC/B,IAAI,CAACW,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;EACEgB,eAAeA,CAACC,KAAK,EAAE;IACrB,IAAIC,MAAM,GAAG,KAAK;IAClB,MAAMC,MAAM,GAAGF,KAAK,CAACG,SAAS,CAAC,CAAC,CAACD,MAAM,GAAGF,KAAK,CAACI,OAAO,CAAC,CAAC,CAACF,MAAM;IAChE,IAAIA,MAAM,GAAG,EAAE,EAAE;MACfD,MAAM,GAAG,MAAM;IACjB;IAEA,OAAO;MACLI,KAAK,EAAE,IAAI,CAACC,QAAQ,CAACC,qBAAW,EAAEN,MAAM,CAAC,IAAI,CAAC;MAC9CA;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEO,SAASA,CAAC;IAACR,KAAK;IAAES;EAAU,CAAC,EAAE;IAC7B,MAAMC,gBAAgB,GAAG,IAAI,CAACX,eAAe,CAACC,KAAK,CAAC;IACpD,MAAMW,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC7B,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErEc,gBAAgB,CAACE,QAAQ,CAACH,gBAAgB,CAACL,KAAK,CAAC;IACjDM,gBAAgB,CAACG,SAAS,CAACJ,gBAAgB,CAACT,MAAM,CAAC;IAEnD,OAAOU,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACf,KAAK,EAAES,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAACO,OAAA,CAAArC,OAAA,GAAAC,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"UrlLengthAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","UrlLengthAssessment","Assessment","constructor","config","defaultConfig","id","URL_LENGTH_ID","priority","docUrl","fixPosition","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","status","length","getDomain","getSlug","score","getScore","URLS_POINTS","getResult","researcher","calculatedResult","assessmentResult","AssessmentResult","setScore","setStatus","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/UrlLengthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {URL_LENGTH_ID, URLS_POINTS} from '@axyseo/const/analysis';\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 UrlLengthAssessment 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: URL_LENGTH_ID,\n priority: 'high',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#url-length-off-target',\n fixPosition: 'url handle',\n ctaType: 'fix',\n title: 'URL length',\n content: {\n good: 'URL length is optimized, less than 75 characters.',\n improve: '',\n bad: 'Keep it less than 75 characters for better readability and SEO.'\n }\n };\n\n this.identifier = URL_LENGTH_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 = 'bad';\n const length = paper.getDomain().length + paper.getSlug().length;\n if (length < 75) {\n status = 'good';\n }\n\n return {\n score: this.getScore(URLS_POINTS, status) || 0,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param i18n\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 *\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,G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ACA;AACA;AACA;EACEO,SAASA,CAAC;IAACR,KAAK;IAAES;EAAU,CAAC,EAAE;IAC7B,MAAMC,gBAAgB,GAAG,IAAI,CAACX,eAAe,CAACC,KAAK,CAAC;IACpD,MAAMW,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAAC7B,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErEc,gBAAgB,CAACE,QAAQ,CAACH,gBAAgB,CAACL,KAAK,CAAC;IACjDM,gBAAgB,CAACG,SAAS,CAACJ,gBAAgB,CAACT,MAAM,CAAC;IAEnD,OAAOU,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACf,KAAK,EAAES,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAACO,OAAA,CAAArC,OAAA,GAAAC,mBAAA","ignoreList":[]}
@@ -31,7 +31,8 @@ const defaultAttributes = {
31
31
  writingDirection: 'LTR',
32
32
  wpBlocks: [],
33
33
  isFrontPage: false,
34
- pageType: ''
34
+ pageType: '',
35
+ afterListContent: ''
35
36
  };
36
37
 
37
38
  /**
@@ -64,6 +65,7 @@ class Paper {
64
65
  * @param {string} [attributes.textTitle] The title of the text.
65
66
  * @param {string} [attributes.writingDirection=LTR] The writing direction of the paper. Defaults to left to right (LTR).
66
67
  * @param {boolean} [attributes.isFrontPage=false] Whether the current page is the front page of the site. Defaults to false.
68
+ * @param {string} [attributes.afterListContent] HTML content displayed after the product list on collection pages.
67
69
  */
68
70
  constructor(text, attributes) {
69
71
  this._text = (0, _helpers.cleanHTML)(text || '');
@@ -353,6 +355,15 @@ class Paper {
353
355
  getPageType() {
354
356
  return this._attributes?.pageType || '';
355
357
  }
358
+
359
+ /**
360
+ * Returns the HTML content displayed after the product list on collection pages.
361
+ * @returns {string} The after-list HTML, or '' if not set.
362
+ */
363
+ getAfterListContent() {
364
+ return this._attributes?.afterListContent || '';
365
+ }
366
+
356
367
  /**
357
368
  *
358
369
  * @returns {Object[String]|*[String]}
@@ -1 +1 @@
1
- {"version":3,"file":"Paper.js","names":["_lodash","require","_helpers","_checkRelatedKeywords","defaultAttributes","keyword","synonyms","description","title","titleWidth","titleCount","h1Count","slug","domain","locale","permalink","date","customData","textTitle","writingDirection","wpBlocks","isFrontPage","pageType","Paper","constructor","text","attributes","_text","cleanHTML","_tree","defaults","hasOwnProperty","url","onlyLetters","replace","isEmpty","_attributes","hasKeyword","getKeyword","getAttributes","hasSynonyms","getSynonyms","getRelatedKeywords","data","getData","related_keywords","map","hasH1Count","isNull","getH1Count","hasTitleCount","getTitleCount","hasText","getText","getDomain","setTree","tree","getTree","hasDescription","body_html","descriptionHtml","getDescription","hasTitle","getTitle","hasTitleWidth","getTitleWidth","hasSlug","hasShopSettings","shopSettings","getSlug","hasProductSchema","hasFAQsSchema","hasFAQs","getFAQs","length","hasArticleSchema","hasData","isObject","hasRelatedKeywords","relatedKeywords","Array","isArray","getIgnoredAssessments","ignoredAssessments","getPageType","getSkippedAssessments","skippedAssessments","getShopSettings","hasUrl","console","warn","getUrl","hasLocale","getLocale","getWritingDirection","hasPermalink","getPermalink","hasDate","getDate","faqs","hasCustomData","getCustomData","hasTextTitle","isNil","getTextTitle","serialize","_parseClass","equals","paper","isEqual","parse","serialized","exports","default"],"sources":["../../../src/values/Paper.js"],"sourcesContent":["import {defaults, isEmpty, isEqual, isNil, isNull, isObject} from 'lodash';\nimport {cleanHTML} from '@axyseo/helpers';\nimport {transformRelatedKeyword} from '@axyseo/languageProcessing/researches/checkRelatedKeywords';\n\n/**\n * Default attributes to be used by the Paper if they are left undefined.\n * @type {{keyword: string, synonyms: string, description: string, title: string, titleWidth: number,\n * \t\t slug: string, locale: string, permalink: string, date: string, customData: object, textTitle: string,\n * \t\t writingDirection: \"LTR\", isFrontPage: boolean }}\n */\nconst defaultAttributes = {\n keyword: '',\n synonyms: '',\n description: '',\n title: '',\n titleWidth: 0,\n titleCount: null,\n h1Count: null,\n slug: '',\n domain: '',\n locale: 'en_US',\n permalink: '',\n date: '',\n customData: {},\n textTitle: '',\n writingDirection: 'LTR',\n wpBlocks: [],\n isFrontPage: false,\n pageType: '',\n};\n\n/**\n * Represents an object where the analysis data is stored.\n */\nexport default class Paper {\n /**\n * Constructs the Paper object and sets its attributes.\n *\n * @param {string} text The text to use in the analysis.\n * @param {object} [attributes] The object containing all attributes.\n * @param {string} [attributes.keyword] The main keyword or keyphrase of the text.\n * @param {string} [attributes.synonyms] The synonyms of the main keyword or keyphrase. It should be separated by commas if multiple synonyms are added.\n * @param {string} [attributes.description] The SEO meta description.\n * @param {string} [attributes.title] The SEO title.\n * @param {string} [attributes.domain] The shop domain.\n * @param {number|null} [attributes.titleCount=null] The title tag count value.\n * @param {number|null} [attributes.h1Count=null] The h1 tag count value.\n * @param {number} [attributes.titleWidth=0] The width of the title in pixels.\n * @param {string} [attributes.slug] The slug.\n * @param {string} [attributes.locale=en_US] The locale.\n * @param {string} [attributes.permalink] The full URL for any given post, page, or other pieces of content on a site.\n * @param {string} [attributes.date] The date.\n * @param {Object[]} [attributes.wpBlocks] The array of texts, encoded in WordPress block editor blocks.\n * @param {Object[]} [attributes.ignoredAssessments] The array of texts, show which assessments should be ignored.\n * @param {Object[]} [attributes.skippedAssessments] The array of texts, show which assessments should be skipped (those assessments will have good result).\n * @param {Object} [attributes.data] Given data.\n * @param {Object} [attributes.customData] Custom data.\n * @param {Object} [attributes.shopSettings] Shop's settings.\n * @param {string} [attributes.textTitle] The title of the text.\n * @param {string} [attributes.writingDirection=LTR] The writing direction of the paper. Defaults to left to right (LTR).\n * @param {boolean} [attributes.isFrontPage=false] Whether the current page is the front page of the site. Defaults to false.\n */\n constructor(text, attributes) {\n this._text = cleanHTML(text || '');\n\n this._tree = null;\n\n attributes = attributes || {};\n defaults(attributes, defaultAttributes);\n\n if (attributes.locale === '') {\n attributes.locale = defaultAttributes.locale;\n }\n\n if (attributes.hasOwnProperty('url')) {\n attributes.slug = attributes.url || attributes.slug;\n }\n\n const onlyLetters = attributes.keyword.replace(\n /[‘’“”\"'.?!:;,¿¡«»&*@#±^%|~`[\\](){}⟨⟩<>/\\\\–\\-\\u2014\\u00d7\\u002b\\s]/g,\n ''\n );\n\n if (isEmpty(onlyLetters)) {\n attributes.keyword = defaultAttributes.keyword;\n }\n\n this._attributes = attributes;\n }\n\n /**\n * Checks whether a keyword is available.\n * @returns {boolean} Returns true if the Paper has a keyword.\n */\n hasKeyword() {\n return this._attributes.keyword !== '';\n }\n\n /**\n * Returns the associated keyword or an empty string if no keyword is available.\n * @returns {string} Returns Keyword\n */\n getKeyword() {\n return this._attributes.keyword;\n }\n\n /**\n *\n * @returns {*|{keyword?: string, synonyms?: string, description?: string, title?: string, titleCount?: (number|null), h1Count?: (number|null), titleWidth?: number, slug?: string, locale?: string, permalink?: string, date?: string, wpBlocks?: Object[], customData?: Object, textTitle?: string, writingDirection?: string, isFrontPage?: boolean}|{}|{}}\n */\n getAttributes() {\n return this._attributes;\n }\n\n /**\n * Checks whether synonyms are available.\n * @returns {boolean} Returns true if the Paper has synonyms.\n */\n hasSynonyms() {\n return this._attributes.synonyms !== '';\n }\n\n /**\n * Returns the associated synonyms or an empty string if no synonyms is available.\n * @returns {string} Returns synonyms.\n */\n getSynonyms() {\n return this._attributes.synonyms;\n }\n\n /**\n *\n * @returns {*|*[]}\n */\n getRelatedKeywords() {\n const data = this.getData();\n return (data?.related_keywords || []).map(keyword => keyword.text);\n }\n\n /**\n * Checks whether the h1 count value is available.\n * @returns {boolean} Returns true if the paper has a h1 count value.\n */\n hasH1Count() {\n return !isNull(this._attributes.h1Count);\n }\n\n /**\n * Returns the h1 tag count value.\n * @returns {number | null}\n */\n getH1Count() {\n return this._attributes.h1Count;\n }\n\n /**\n * Checks whether the title count value is available.\n * @returns {boolean} Returns true if the paper has a title count.\n */\n hasTitleCount() {\n return !isNull(this._attributes.titleCount);\n }\n\n /**\n * Returns the title count value.\n * @returns {number | null}\n */\n getTitleCount() {\n return this._attributes.titleCount;\n }\n\n /**\n * Checks whether the text is available.\n * @returns {boolean} Returns true if the paper has a text.\n */\n hasText() {\n return this._text !== '';\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getText() {\n return this._text;\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getDomain() {\n return this._attributes.domain;\n }\n\n /**\n * Sets the tree.\n *\n * @param {Node} tree The tree to set.\n *\n * @returns {void}\n */\n setTree(tree) {\n this._tree = tree;\n }\n\n /**\n * Returns the tree.\n *\n * @returns {Node} The tree.\n */\n getTree() {\n return this._tree;\n }\n\n /**\n * Checks whether a description is available.\n * @returns {boolean} Returns true if the paper has a description.\n */\n hasDescription() {\n return this._attributes?.data?.body_html !== '' || this._attributes?.data?.descriptionHtml !== '';\n }\n\n /**\n * Returns the description or an empty string if no description is available.\n * @returns {string} Returns the description.\n */\n getDescription() {\n return this._attributes.description;\n }\n\n /**\n * Checks whether an SEO title is available\n * @returns {boolean} Returns true if the Paper has an SEO title.\n */\n hasTitle() {\n return this._attributes.title !== '';\n }\n\n /**\n * Returns the SEO title, or an empty string if no title is available.\n * @returns {string} Returns the SEO title.\n */\n getTitle() {\n return this._attributes.title;\n }\n\n /**\n * Checks whether an SEO title width in pixels is available.\n * @returns {boolean} Returns true if the Paper's SEO title is wider than 0 pixels.\n */\n hasTitleWidth() {\n return this._attributes.titleWidth !== 0;\n }\n\n /**\n * Gets the SEO title width in pixels, or an empty string of no title width in pixels is available.\n * @returns {number} Returns the SEO title width in pixels.\n */\n getTitleWidth() {\n return this._attributes.titleWidth;\n }\n\n /**\n * Checks whether a slug is available.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasSlug() {\n return this._attributes.slug !== '';\n }\n\n /**\n * Checks whether a shop settings is available.\n * @returns {boolean} Returns true if the Paper has a shop settings.\n */\n hasShopSettings() {\n return !isEmpty(this._attributes?.shopSettings || {});\n }\n\n /**\n * Gets the paper's slug, or an empty string if no slug is available.\n * @returns {string} Returns the slug.\n */\n getSlug() {\n return this._attributes.slug;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasProductSchema() {\n return this._attributes?.hasProductSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasFAQsSchema() {\n return this._attributes?.hasFAQsSchema || false;\n }\n\n /**\n *\n * @returns {boolean}\n */\n hasFAQs() {\n return 'faqs' in this.getData() && this.getFAQs().length > 0;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasArticleSchema() {\n return this._attributes?.hasArticleSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasData() {\n const data = this._attributes?.data;\n return isObject(data) && !isEmpty(data);\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasRelatedKeywords() {\n const relatedKeywords = this._attributes?.data?.related_keywords || [];\n return Array.isArray(relatedKeywords) && relatedKeywords.length > 0;\n }\n\n /**\n *\n * @returns {Object|{}}\n */\n getData() {\n return this._attributes?.data || {};\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getIgnoredAssessments() {\n return this._attributes?.ignoredAssessments || [];\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getPageType() {\n return this._attributes?.pageType || '';\n }\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getSkippedAssessments() {\n return this._attributes?.skippedAssessments || [];\n }\n\n /**\n *\n * @returns {*|{}}\n */\n getShopSettings() {\n return this._attributes?.shopSettings || {};\n }\n\n /**\n * Checks if currently edited page is a front page.\n * @returns {boolean} Returns true if the current page is a front page.\n */\n isFrontPage() {\n return this._attributes.isFrontPage;\n }\n\n /**\n * Checks whether an url is available\n * @deprecated Since version 1.19.1. Use hasSlug instead.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasUrl() {\n console.warn('This function is deprecated, use hasSlug instead');\n return this.hasSlug();\n }\n\n /**\n * Returns the url, or an empty string if no url is available.\n * @deprecated Since version 1.19.1. Use getSlug instead.\n * @returns {string} Returns the url\n */\n getUrl() {\n console.warn('This function is deprecated, use getSlug instead');\n return this.getSlug();\n }\n\n /**\n * Checks whether a locale is available.\n * @returns {boolean} Returns true if the paper has a locale.\n */\n hasLocale() {\n return this._attributes.locale !== '';\n }\n\n /**\n * Returns the locale or an empty string if no locale is available\n * @returns {string} Returns the locale.\n */\n getLocale() {\n return this._attributes.locale;\n }\n\n /**\n * Gets the information of the writing direction of the paper.\n * It returns \"LTR\" (left to right) if this attribute is not provided.\n *\n * @returns {string} Returns the information of the writing direction of the paper.\n */\n getWritingDirection() {\n return this._attributes.writingDirection;\n }\n\n /**\n * Checks whether a permalink is available.\n * @returns {boolean} Returns true if the Paper has a permalink.\n */\n hasPermalink() {\n return this._attributes.permalink !== '';\n }\n\n /**\n * Returns the permalink, or an empty string if no permalink is available.\n * @returns {string} Returns the permalink.\n */\n getPermalink() {\n return this._attributes.permalink;\n }\n\n /**\n * Checks whether a date is available.\n * @returns {boolean} Returns true if the Paper has a date.\n */\n hasDate() {\n return this._attributes.date !== '';\n }\n\n /**\n * Returns the date, or an empty string if no date is available.\n * @returns {string} Returns the date.\n */\n getDate() {\n return this._attributes.date;\n }\n\n /**\n *\n * @returns {*|*[]}\n */\n getFAQs() {\n return this.getData()?.faqs || {};\n }\n\n\n /**\n * Checks whether custom data is available.\n * @returns {boolean} Returns true if the Paper has custom data.\n */\n hasCustomData() {\n return !isEmpty(this._attributes.customData);\n }\n\n /**\n * Returns the custom data, or an empty object if no data is available.\n * @returns {Object} Returns the custom data.\n */\n getCustomData() {\n return this._attributes.customData;\n }\n\n /**\n * Checks whether a text title is available.\n * @returns {boolean} Returns true if the Paper has a text title.\n */\n hasTextTitle() {\n return this._attributes.textTitle !== '' && !isNil(this._attributes.textTitle);\n }\n\n /**\n * Returns the text title, or an empty string if no data is available.\n * @returns {string} Returns the text title.\n */\n getTextTitle() {\n return this._attributes.textTitle;\n }\n\n /**\n * Serializes the Paper instance to an object.\n *\n * @returns {Object} The serialized Paper.\n */\n serialize() {\n return {\n _parseClass: 'Paper',\n text: this._text,\n ...this._attributes\n };\n }\n\n /**\n * Checks whether the given paper has the same properties as this instance.\n *\n * @param {Paper} paper The paper to compare to.\n *\n * @returns {boolean} Whether the given paper is identical or not.\n */\n equals(paper) {\n return this._text === paper.getText() && isEqual(this._attributes, paper._attributes);\n }\n\n /**\n * Parses the object to a Paper.\n *\n * @param {Object|Paper} serialized The serialized object or Paper instance.\n *\n * @returns {Paper} The parsed Paper.\n */\n static parse(serialized) {\n // For ease of use, check if it is not already a Paper instance.\n if (serialized instanceof Paper) {\n return serialized;\n }\n\n // _parseClass is taken here, so it doesn't end up in the attributes.\n // eslint-disable-next-line no-unused-vars\n const {text, _parseClass, ...attributes} = serialized;\n\n return new Paper(text, attributes);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,iBAAiB,GAAG;EACxBC,OAAO,EAAE,EAAE;EACXC,QAAQ,EAAE,EAAE;EACZC,WAAW,EAAE,EAAE;EACfC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,CAAC;EACbC,UAAU,EAAE,IAAI;EAChBC,OAAO,EAAE,IAAI;EACbC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,OAAO;EACfC,SAAS,EAAE,EAAE;EACbC,IAAI,EAAE,EAAE;EACRC,UAAU,EAAE,CAAC,CAAC;EACdC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,KAAK;EACvBC,QAAQ,EAAE,EAAE;EACZC,WAAW,EAAE,KAAK;EAClBC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACe,MAAMC,KAAK,CAAC;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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A;IACA;IACA,MAAM;MAACtF,IAAI;MAAEiF,WAAW;MAAE,GAAGhF;IAAU,CAAC,GAAGqF,UAAU;IAErD,OAAO,IAAIxF,KAAK,CAACE,IAAI,EAAEC,UAAU,CAAC;EACpC;AACF;AAACsF,OAAA,CAAAC,OAAA,GAAA1F,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"Paper.js","names":["_lodash","require","_helpers","_checkRelatedKeywords","defaultAttributes","keyword","synonyms","description","title","titleWidth","titleCount","h1Count","slug","domain","locale","permalink","date","customData","textTitle","writingDirection","wpBlocks","isFrontPage","pageType","afterListContent","Paper","constructor","text","attributes","_text","cleanHTML","_tree","defaults","hasOwnProperty","url","onlyLetters","replace","isEmpty","_attributes","hasKeyword","getKeyword","getAttributes","hasSynonyms","getSynonyms","getRelatedKeywords","data","getData","related_keywords","map","hasH1Count","isNull","getH1Count","hasTitleCount","getTitleCount","hasText","getText","getDomain","setTree","tree","getTree","hasDescription","body_html","descriptionHtml","getDescription","hasTitle","getTitle","hasTitleWidth","getTitleWidth","hasSlug","hasShopSettings","shopSettings","getSlug","hasProductSchema","hasFAQsSchema","hasFAQs","getFAQs","length","hasArticleSchema","hasData","isObject","hasRelatedKeywords","relatedKeywords","Array","isArray","getIgnoredAssessments","ignoredAssessments","getPageType","getAfterListContent","getSkippedAssessments","skippedAssessments","getShopSettings","hasUrl","console","warn","getUrl","hasLocale","getLocale","getWritingDirection","hasPermalink","getPermalink","hasDate","getDate","faqs","hasCustomData","getCustomData","hasTextTitle","isNil","getTextTitle","serialize","_parseClass","equals","paper","isEqual","parse","serialized","exports","default"],"sources":["../../../src/values/Paper.js"],"sourcesContent":["import {defaults, isEmpty, isEqual, isNil, isNull, isObject} from 'lodash';\nimport {cleanHTML} from '@axyseo/helpers';\nimport {transformRelatedKeyword} from '@axyseo/languageProcessing/researches/checkRelatedKeywords';\n\n/**\n * Default attributes to be used by the Paper if they are left undefined.\n * @type {{keyword: string, synonyms: string, description: string, title: string, titleWidth: number,\n * \t\t slug: string, locale: string, permalink: string, date: string, customData: object, textTitle: string,\n * \t\t writingDirection: \"LTR\", isFrontPage: boolean }}\n */\nconst defaultAttributes = {\n keyword: '',\n synonyms: '',\n description: '',\n title: '',\n titleWidth: 0,\n titleCount: null,\n h1Count: null,\n slug: '',\n domain: '',\n locale: 'en_US',\n permalink: '',\n date: '',\n customData: {},\n textTitle: '',\n writingDirection: 'LTR',\n wpBlocks: [],\n isFrontPage: false,\n pageType: '',\n afterListContent: '',\n};\n\n/**\n * Represents an object where the analysis data is stored.\n */\nexport default class Paper {\n /**\n * Constructs the Paper object and sets its attributes.\n *\n * @param {string} text The text to use in the analysis.\n * @param {object} [attributes] The object containing all attributes.\n * @param {string} [attributes.keyword] The main keyword or keyphrase of the text.\n * @param {string} [attributes.synonyms] The synonyms of the main keyword or keyphrase. It should be separated by commas if multiple synonyms are added.\n * @param {string} [attributes.description] The SEO meta description.\n * @param {string} [attributes.title] The SEO title.\n * @param {string} [attributes.domain] The shop domain.\n * @param {number|null} [attributes.titleCount=null] The title tag count value.\n * @param {number|null} [attributes.h1Count=null] The h1 tag count value.\n * @param {number} [attributes.titleWidth=0] The width of the title in pixels.\n * @param {string} [attributes.slug] The slug.\n * @param {string} [attributes.locale=en_US] The locale.\n * @param {string} [attributes.permalink] The full URL for any given post, page, or other pieces of content on a site.\n * @param {string} [attributes.date] The date.\n * @param {Object[]} [attributes.wpBlocks] The array of texts, encoded in WordPress block editor blocks.\n * @param {Object[]} [attributes.ignoredAssessments] The array of texts, show which assessments should be ignored.\n * @param {Object[]} [attributes.skippedAssessments] The array of texts, show which assessments should be skipped (those assessments will have good result).\n * @param {Object} [attributes.data] Given data.\n * @param {Object} [attributes.customData] Custom data.\n * @param {Object} [attributes.shopSettings] Shop's settings.\n * @param {string} [attributes.textTitle] The title of the text.\n * @param {string} [attributes.writingDirection=LTR] The writing direction of the paper. Defaults to left to right (LTR).\n * @param {boolean} [attributes.isFrontPage=false] Whether the current page is the front page of the site. Defaults to false.\n * @param {string} [attributes.afterListContent] HTML content displayed after the product list on collection pages.\n */\n constructor(text, attributes) {\n this._text = cleanHTML(text || '');\n\n this._tree = null;\n\n attributes = attributes || {};\n defaults(attributes, defaultAttributes);\n\n if (attributes.locale === '') {\n attributes.locale = defaultAttributes.locale;\n }\n\n if (attributes.hasOwnProperty('url')) {\n attributes.slug = attributes.url || attributes.slug;\n }\n\n const onlyLetters = attributes.keyword.replace(\n /[‘’“”\"'.?!:;,¿¡«»&*@#±^%|~`[\\](){}⟨⟩<>/\\\\–\\-\\u2014\\u00d7\\u002b\\s]/g,\n ''\n );\n\n if (isEmpty(onlyLetters)) {\n attributes.keyword = defaultAttributes.keyword;\n }\n\n this._attributes = attributes;\n }\n\n /**\n * Checks whether a keyword is available.\n * @returns {boolean} Returns true if the Paper has a keyword.\n */\n hasKeyword() {\n return this._attributes.keyword !== '';\n }\n\n /**\n * Returns the associated keyword or an empty string if no keyword is available.\n * @returns {string} Returns Keyword\n */\n getKeyword() {\n return this._attributes.keyword;\n }\n\n /**\n *\n * @returns {*|{keyword?: string, synonyms?: string, description?: string, title?: string, titleCount?: (number|null), h1Count?: (number|null), titleWidth?: number, slug?: string, locale?: string, permalink?: string, date?: string, wpBlocks?: Object[], customData?: Object, textTitle?: string, writingDirection?: string, isFrontPage?: boolean}|{}|{}}\n */\n getAttributes() {\n return this._attributes;\n }\n\n /**\n * Checks whether synonyms are available.\n * @returns {boolean} Returns true if the Paper has synonyms.\n */\n hasSynonyms() {\n return this._attributes.synonyms !== '';\n }\n\n /**\n * Returns the associated synonyms or an empty string if no synonyms is available.\n * @returns {string} Returns synonyms.\n */\n getSynonyms() {\n return this._attributes.synonyms;\n }\n\n /**\n *\n * @returns {*|*[]}\n */\n getRelatedKeywords() {\n const data = this.getData();\n return (data?.related_keywords || []).map(keyword => keyword.text);\n }\n\n /**\n * Checks whether the h1 count value is available.\n * @returns {boolean} Returns true if the paper has a h1 count value.\n */\n hasH1Count() {\n return !isNull(this._attributes.h1Count);\n }\n\n /**\n * Returns the h1 tag count value.\n * @returns {number | null}\n */\n getH1Count() {\n return this._attributes.h1Count;\n }\n\n /**\n * Checks whether the title count value is available.\n * @returns {boolean} Returns true if the paper has a title count.\n */\n hasTitleCount() {\n return !isNull(this._attributes.titleCount);\n }\n\n /**\n * Returns the title count value.\n * @returns {number | null}\n */\n getTitleCount() {\n return this._attributes.titleCount;\n }\n\n /**\n * Checks whether the text is available.\n * @returns {boolean} Returns true if the paper has a text.\n */\n hasText() {\n return this._text !== '';\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getText() {\n return this._text;\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getDomain() {\n return this._attributes.domain;\n }\n\n /**\n * Sets the tree.\n *\n * @param {Node} tree The tree to set.\n *\n * @returns {void}\n */\n setTree(tree) {\n this._tree = tree;\n }\n\n /**\n * Returns the tree.\n *\n * @returns {Node} The tree.\n */\n getTree() {\n return this._tree;\n }\n\n /**\n * Checks whether a description is available.\n * @returns {boolean} Returns true if the paper has a description.\n */\n hasDescription() {\n return this._attributes?.data?.body_html !== '' || this._attributes?.data?.descriptionHtml !== '';\n }\n\n /**\n * Returns the description or an empty string if no description is available.\n * @returns {string} Returns the description.\n */\n getDescription() {\n return this._attributes.description;\n }\n\n /**\n * Checks whether an SEO title is available\n * @returns {boolean} Returns true if the Paper has an SEO title.\n */\n hasTitle() {\n return this._attributes.title !== '';\n }\n\n /**\n * Returns the SEO title, or an empty string if no title is available.\n * @returns {string} Returns the SEO title.\n */\n getTitle() {\n return this._attributes.title;\n }\n\n /**\n * Checks whether an SEO title width in pixels is available.\n * @returns {boolean} Returns true if the Paper's SEO title is wider than 0 pixels.\n */\n hasTitleWidth() {\n return this._attributes.titleWidth !== 0;\n }\n\n /**\n * Gets the SEO title width in pixels, or an empty string of no title width in pixels is available.\n * @returns {number} Returns the SEO title width in pixels.\n */\n getTitleWidth() {\n return this._attributes.titleWidth;\n }\n\n /**\n * Checks whether a slug is available.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasSlug() {\n return this._attributes.slug !== '';\n }\n\n /**\n * Checks whether a shop settings is available.\n * @returns {boolean} Returns true if the Paper has a shop settings.\n */\n hasShopSettings() {\n return !isEmpty(this._attributes?.shopSettings || {});\n }\n\n /**\n * Gets the paper's slug, or an empty string if no slug is available.\n * @returns {string} Returns the slug.\n */\n getSlug() {\n return this._attributes.slug;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasProductSchema() {\n return this._attributes?.hasProductSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasFAQsSchema() {\n return this._attributes?.hasFAQsSchema || false;\n }\n\n /**\n *\n * @returns {boolean}\n */\n hasFAQs() {\n return 'faqs' in this.getData() && this.getFAQs().length > 0;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasArticleSchema() {\n return this._attributes?.hasArticleSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasData() {\n const data = this._attributes?.data;\n return isObject(data) && !isEmpty(data);\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasRelatedKeywords() {\n const relatedKeywords = this._attributes?.data?.related_keywords || [];\n return Array.isArray(relatedKeywords) && relatedKeywords.length > 0;\n }\n\n /**\n *\n * @returns {Object|{}}\n */\n getData() {\n return this._attributes?.data || {};\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getIgnoredAssessments() {\n return this._attributes?.ignoredAssessments || [];\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getPageType() {\n return this._attributes?.pageType || '';\n }\n\n /**\n * Returns the HTML content displayed after the product list on collection pages.\n * @returns {string} The after-list HTML, or '' if not set.\n */\n getAfterListContent() {\n return this._attributes?.afterListContent || '';\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getSkippedAssessments() {\n return this._attributes?.skippedAssessments || [];\n }\n\n /**\n *\n * @returns {*|{}}\n */\n getShopSettings() {\n return this._attributes?.shopSettings || {};\n }\n\n /**\n * Checks if currently edited page is a front page.\n * @returns {boolean} Returns true if the current page is a front page.\n */\n isFrontPage() {\n return this._attributes.isFrontPage;\n }\n\n /**\n * Checks whether an url is available\n * @deprecated Since version 1.19.1. Use hasSlug instead.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasUrl() {\n console.warn('This function is deprecated, use hasSlug instead');\n return this.hasSlug();\n }\n\n /**\n * Returns the url, or an empty string if no url is available.\n * @deprecated Since version 1.19.1. Use getSlug instead.\n * @returns {string} Returns the url\n */\n getUrl() {\n console.warn('This function is deprecated, use getSlug instead');\n return this.getSlug();\n }\n\n /**\n * Checks whether a locale is available.\n * @returns {boolean} Returns true if the paper has a locale.\n */\n hasLocale() {\n return this._attributes.locale !== '';\n }\n\n /**\n * Returns the locale or an empty string if no locale is available\n * @returns {string} Returns the locale.\n */\n getLocale() {\n return this._attributes.locale;\n }\n\n /**\n * Gets the information of the writing direction of the paper.\n * It returns \"LTR\" (left to right) if this attribute is not provided.\n *\n * @returns {string} Returns the information of the writing direction of the paper.\n */\n getWritingDirection() {\n return this._attributes.writingDirection;\n }\n\n /**\n * Checks whether a permalink is available.\n * @returns {boolean} Returns true if the Paper has a permalink.\n */\n hasPermalink() {\n return this._attributes.permalink !== '';\n }\n\n /**\n * Returns the permalink, or an empty string if no permalink is available.\n * @returns {string} Returns the permalink.\n */\n getPermalink() {\n return this._attributes.permalink;\n }\n\n /**\n * Checks whether a date is available.\n * @returns {boolean} Returns true if the Paper has a date.\n */\n hasDate() {\n return this._attributes.date !== '';\n }\n\n /**\n * Returns the date, or an empty string if no date is available.\n * @returns {string} Returns the date.\n */\n getDate() {\n return this._attributes.date;\n }\n\n /**\n *\n * @returns {*|*[]}\n */\n getFAQs() {\n return this.getData()?.faqs || {};\n }\n\n\n /**\n * Checks whether custom data is available.\n * @returns {boolean} Returns true if the Paper has custom data.\n */\n hasCustomData() {\n return !isEmpty(this._attributes.customData);\n }\n\n /**\n * Returns the custom data, or an empty object if no data is available.\n * @returns {Object} Returns the custom data.\n */\n getCustomData() {\n return this._attributes.customData;\n }\n\n /**\n * Checks whether a text title is available.\n * @returns {boolean} Returns true if the Paper has a text title.\n */\n hasTextTitle() {\n return this._attributes.textTitle !== '' && !isNil(this._attributes.textTitle);\n }\n\n /**\n * Returns the text title, or an empty string if no data is available.\n * @returns {string} Returns the text title.\n */\n getTextTitle() {\n return this._attributes.textTitle;\n }\n\n /**\n * Serializes the Paper instance to an object.\n *\n * @returns {Object} The serialized Paper.\n */\n serialize() {\n return {\n _parseClass: 'Paper',\n text: this._text,\n ...this._attributes\n };\n }\n\n /**\n * Checks whether the given paper has the same properties as this instance.\n *\n * @param {Paper} paper The paper to compare to.\n *\n * @returns {boolean} Whether the given paper is identical or not.\n */\n equals(paper) {\n return this._text === paper.getText() && isEqual(this._attributes, paper._attributes);\n }\n\n /**\n * Parses the object to a Paper.\n *\n * @param {Object|Paper} serialized The serialized object or Paper instance.\n *\n * @returns {Paper} The parsed Paper.\n */\n static parse(serialized) {\n // For ease of use, check if it is not already a Paper instance.\n if (serialized instanceof Paper) {\n return serialized;\n }\n\n // _parseClass is taken here, so it doesn't end up in the attributes.\n // eslint-disable-next-line no-unused-vars\n const {text, _parseClass, ...attributes} = serialized;\n\n return new Paper(text, attributes);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,iBAAiB,GAAG;EACxBC,OAAO,EAAE,EAAE;EACXC,QAAQ,EAAE,EAAE;EACZC,WAAW,EAAE,EAAE;EACfC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,CAAC;EACbC,UAAU,EAAE,IAAI;EAChBC,OAAO,EAAE,IAAI;EACbC,IAAI,EAAE,EAAE;EACRC,M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AASA,CAAA,EAAG;IACV,OAAO;MACLC,WAAW,EAAE,OAAO;MACpBlF,IAAI,EAAE,IAAI,CAACE,KAAK;MAChB,GAAG,IAAI,CAACS;IACV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEwE,MAAMA,CAACC,KAAK,EAAE;IACZ,OAAO,IAAI,CAAClF,KAAK,KAAKkF,KAAK,CAACxD,OAAO,CAAC,CAAC,IAAI,IAAAyD,eAAO,EAAC,IAAI,CAAC1E,WAAW,EAAEyE,KAAK,CAACzE,WAAW,CAAC;EACvF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAO2E,KAAKA,CAACC,UAAU,EAAE;IACvB;IACA,IAAIA,UAAU,YAAYzF,KAAK,EAAE;MAC/B,OAAOyF,UAAU;IACnB;;IAEA;IACA;IACA,MAAM;MAACvF,IAAI;MAAEkF,WAAW;MAAE,GAAGjF;IAAU,CAAC,GAAGsF,UAAU;IAErD,OAAO,IAAIzF,KAAK,CAACE,IAAI,EAAEC,UAAU,CAAC;EACpC;AACF;AAACuF,OAAA,CAAAC,OAAA,GAAA3F,KAAA","ignoreList":[]}
@@ -20,7 +20,8 @@ import getLinkType from "../helpers/link/getLinkType.js";
20
20
  * otherNofollow: other links with a nofollow attribute.
21
21
  */
22
22
  export default function (paper) {
23
- const anchors = getAnchors(paper.getText());
23
+ const text = paper.getPageType() === 'collection' ? paper.getText() + ' ' + paper.getAfterListContent() : paper.getText();
24
+ const anchors = getAnchors(text);
24
25
  /*
25
26
  * We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.
26
27
  * In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkStatistics.js","names":["checkNofollow","getAnchors","getLinkType","paper","anchors","getText","siteUrlOrDomain","getPermalink","linkCount","total","length","internalTotal","internalDofollow","internalNofollow","externalTotal","externalDofollow","externalNofollow","otherTotal","otherDofollow","otherNofollow","i","currentAnchor","linkType","linkFollow"],"sources":["../../../../src/languageProcessing/researches/getLinkStatistics.js"],"sourcesContent":["import checkNofollow from \"../helpers/link/checkNofollow.js\";\nimport getAnchors from \"../helpers/link/getAnchorsFromText.js\";\nimport getLinkType from \"../helpers/link/getLinkType.js\";\n\n/**\n * Counts the links found in the text.\n *\n * @param {Paper} paper The paper object containing text, keyword and url.\n *\n * @returns {object} The object containing all linktypes.\n * total: the total number of links found.\n * internalTotal: the total number of links that are internal.\n * internalDofollow: the internal links without a nofollow attribute.\n * internalNofollow: the internal links with a nofollow attribute.\n * externalTotal: the total number of links that are external.\n * externalDofollow: the external links without a nofollow attribute.\n * externalNofollow: the internal links with a dofollow attribute.\n * otherTotal: all links that are not HTTP or HTTPS.\n * otherDofollow: other links without a nofollow attribute.\n * otherNofollow: other links with a nofollow attribute.\n */\nexport default function( paper ) {\n\tconst anchors = getAnchors( paper.getText() );\n\t/*\n\t * We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.\n\t * In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.\n\t */\n\tconst siteUrlOrDomain = paper.getPermalink();\n\n\tconst linkCount = {\n\t\ttotal: anchors.length,\n\t\tinternalTotal: 0,\n\t\tinternalDofollow: 0,\n\t\tinternalNofollow: 0,\n\t\texternalTotal: 0,\n\t\texternalDofollow: 0,\n\t\texternalNofollow: 0,\n\t\totherTotal: 0,\n\t\totherDofollow: 0,\n\t\totherNofollow: 0,\n\t};\n\n\tfor ( let i = 0; i < anchors.length; i++ ) {\n\t\tconst currentAnchor = anchors[ i ];\n\n\t\tconst linkType = getLinkType( currentAnchor, siteUrlOrDomain );\n\t\tconst linkFollow = checkNofollow( currentAnchor );\n\n\t\tlinkCount[ linkType + \"Total\" ]++;\n\t\tlinkCount[ linkType + linkFollow ]++;\n\t}\n\n\treturn linkCount;\n}\n"],"mappings":"AAAA,OAAOA,aAAa;AACpB,OAAOC,UAAU;AACjB,OAAOC,WAAW;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAUC,KAAK,EAAG;EAChC,MAAMC,OAAO,GAAGH,UAAU,CAAEE,KAAK,CAACE,OAAO,CAAC,CAAE,CAAC;EAC7C;AACD;AACA;AACA;EACC,MAAMC,eAAe,GAAGH,KAAK,CAACI,YAAY,CAAC,CAAC;EAE5C,MAAMC,SAAS,GAAG;IACjBC,KAAK,EAAEL,OAAO,CAACM,MAAM;IACrBC,aAAa,EAAE,CAAC;IAChBC,gBAAgB,EAAE,CAAC;IACnBC,gBAAgB,EAAE,CAAC;IACnBC,aAAa,EAAE,CAAC;IAChBC,gBAAgB,EAAE,CAAC;IACnBC,gBAAgB,EAAE,CAAC;IACnBC,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE,CAAC;IAChBC,aAAa,EAAE;EAChB,CAAC;EAED,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGhB,OAAO,CAACM,MAAM,EAAEU,CAAC,EAAE,EAAG;IAC1C,MAAMC,aAAa,GAAGjB,OAAO,CAAEgB,CAAC,CAAE;IAElC,MAAME,QAAQ,GAAGpB,WAAW,CAAEmB,aAAa,EAAEf,eAAgB,CAAC;IAC9D,MAAMiB,UAAU,GAAGvB,aAAa,CAAEqB,aAAc,CAAC;IAEjDb,SAAS,CAAEc,QAAQ,GAAG,OAAO,CAAE,EAAE;IACjCd,SAAS,CAAEc,QAAQ,GAAGC,UAAU,CAAE,EAAE;EACrC;EAEA,OAAOf,SAAS;AACjB","ignoreList":[]}
1
+ {"version":3,"file":"getLinkStatistics.js","names":["checkNofollow","getAnchors","getLinkType","paper","text","getPageType","getText","getAfterListContent","anchors","siteUrlOrDomain","getPermalink","linkCount","total","length","internalTotal","internalDofollow","internalNofollow","externalTotal","externalDofollow","externalNofollow","otherTotal","otherDofollow","otherNofollow","i","currentAnchor","linkType","linkFollow"],"sources":["../../../../src/languageProcessing/researches/getLinkStatistics.js"],"sourcesContent":["import checkNofollow from \"../helpers/link/checkNofollow.js\";\nimport getAnchors from \"../helpers/link/getAnchorsFromText.js\";\nimport getLinkType from \"../helpers/link/getLinkType.js\";\n\n/**\n * Counts the links found in the text.\n *\n * @param {Paper} paper The paper object containing text, keyword and url.\n *\n * @returns {object} The object containing all linktypes.\n * total: the total number of links found.\n * internalTotal: the total number of links that are internal.\n * internalDofollow: the internal links without a nofollow attribute.\n * internalNofollow: the internal links with a nofollow attribute.\n * externalTotal: the total number of links that are external.\n * externalDofollow: the external links without a nofollow attribute.\n * externalNofollow: the internal links with a dofollow attribute.\n * otherTotal: all links that are not HTTP or HTTPS.\n * otherDofollow: other links without a nofollow attribute.\n * otherNofollow: other links with a nofollow attribute.\n */\nexport default function( paper ) {\n\tconst text = paper.getPageType() === 'collection'\n\t\t? paper.getText() + ' ' + paper.getAfterListContent()\n\t\t: paper.getText();\n\tconst anchors = getAnchors( text );\n\t/*\n\t * We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.\n\t * In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.\n\t */\n\tconst siteUrlOrDomain = paper.getPermalink();\n\n\tconst linkCount = {\n\t\ttotal: anchors.length,\n\t\tinternalTotal: 0,\n\t\tinternalDofollow: 0,\n\t\tinternalNofollow: 0,\n\t\texternalTotal: 0,\n\t\texternalDofollow: 0,\n\t\texternalNofollow: 0,\n\t\totherTotal: 0,\n\t\totherDofollow: 0,\n\t\totherNofollow: 0,\n\t};\n\n\tfor ( let i = 0; i < anchors.length; i++ ) {\n\t\tconst currentAnchor = anchors[ i ];\n\n\t\tconst linkType = getLinkType( currentAnchor, siteUrlOrDomain );\n\t\tconst linkFollow = checkNofollow( currentAnchor );\n\n\t\tlinkCount[ linkType + \"Total\" ]++;\n\t\tlinkCount[ linkType + linkFollow ]++;\n\t}\n\n\treturn linkCount;\n}\n"],"mappings":"AAAA,OAAOA,aAAa;AACpB,OAAOC,UAAU;AACjB,OAAO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
20
  const defaultConfig = {
21
21
  id: TEXT_PARAGRAPH_TOO_LONG_ID,
22
22
  priority: 'high',
23
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#paragraph-length',
23
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#paragraphs-off-target',
24
24
  fixPosition: 'longParagraph',
25
25
  ctaType: 'fix',
26
26
  parameters: {
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphTooLongAssessment.js","names":["merge","inRangeEndInclusive","inRange","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","TEXT_PARAGRAPH_TOO_LONG_ID","ParagraphTooLongAssessment","constructor","config","defaultConfig","id","priority","docUrl","fixPosition","ctaType","parameters","recommendedLength","maximumRecommendedLength","title","content","bad","improve","good","identifier","_config","getConfig","researcher","currentConfig","languageSpecificConfig","_isProduct","productPageParams","defaultPageParams","calculateResult","paragraphsLength","hasDescription","status","length","countLength","isGood","score","getScore","sortParagraphs","paragraphs","sort","a","b","getResult","paper","getResearch","paragraphLengthResult","assessmentResult","setScore","setStatus","isApplicable"],"sources":["../../../../../src/scoring/assessments/readability/ParagraphTooLongAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {inRangeEndInclusive as inRange} from '../../helpers/assessments/inRange';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, TEXT_PARAGRAPH_TOO_LONG_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that will look if the text has too long paragraphs.\n */\nexport default class ParagraphTooLongAssessment 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: TEXT_PARAGRAPH_TOO_LONG_ID,\n priority: 'high',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#paragraph-length',\n fixPosition: 'longParagraph',\n ctaType: 'fix',\n parameters: {\n recommendedLength: 150,\n maximumRecommendedLength: 150\n },\n title: 'Paragraph length',\n content: {\n bad: 'Paragraph too long. Keep paragraph length less than 150 words for readability.',\n improve: '',\n good: 'Paragraph is optimized, with less than 150 words.'\n }\n };\n\n this.identifier = TEXT_PARAGRAPH_TOO_LONG_ID;\n this._config = merge(defaultConfig, config);\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 getConfig(researcher) {\n const currentConfig = this._config;\n const languageSpecificConfig = researcher.getConfig('paragraphLength');\n\n /*\n * If a language has a specific paragraph length config, check further if the assessment is run in product pages.\n * If it's run in product pages, override the default config parameters with the language specific config for product pages,\n * otherwise override it with the language specific config for default pages analysis.\n */\n if (languageSpecificConfig) {\n currentConfig.parameters = this._isProduct\n ? languageSpecificConfig.productPageParams\n : languageSpecificConfig.defaultPageParams;\n }\n\n return currentConfig;\n }\n\n /**\n *\n * @param paragraphsLength\n * @param config\n * @param hasDescription\n * @returns {{score: number, status: (string)}}\n */\n calculateResult({paragraphsLength, config, hasDescription}) {\n let status = 'bad';\n if (paragraphsLength.length === 0 || !hasDescription) {\n status = 'bad';\n } else {\n const { recommendedLength, maximumRecommendedLength } = config.parameters;\n const length = paragraphsLength[0].countLength;\n\n const isGood =\n length <= recommendedLength ||\n inRange(length, recommendedLength, maximumRecommendedLength);\n\n status = isGood ? 'good' : 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status\n };\n }\n\n /**\n * Sort the paragraphs based on word count.\n *\n * @param {Array} paragraphs The array with paragraphs.\n *\n * @returns {Array} The array sorted on word counts.\n */\n sortParagraphs(paragraphs) {\n return paragraphs.sort(function(a, b) {\n return b.countLength - a.countLength;\n });\n }\n\n /**\n * Runs the getParagraphLength module, based on this returns an assessment result with score and text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n * @returns {object} The assessment result.\n */\n getResult({paper, researcher}) {\n let paragraphsLength = researcher.getResearch('getParagraphLength');\n\n paragraphsLength = this.sortParagraphs(paragraphsLength);\n const config = this.getConfig(researcher);\n const hasDescription = paper.hasDescription();\n const paragraphLengthResult = this.calculateResult({\n paragraphsLength,\n config,\n hasDescription\n });\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(paragraphLengthResult.score);\n assessmentResult.setStatus(paragraphLengthResult.status);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the paragraphTooLong assessment is applicable to the paper.\n *\n * @param {Paper} paper The paper to check.\n *\n * @returns {boolean} Returns true if the assessment is applicable to the paper.\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,SAAQC,mBAAmB,IAAIC,OAAO;AACtC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,mBAAmB,EAAEC,0BAA0B;;AAEvD;AACA;AACA;AACA,eAAe,MAAMC,0BAA0B,SAASH,UAAU,CAAC;EACjE;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,QAAQ,EAAE,MAAM;MAChBC,MAAM,EACJ,8FAA8F;MAChGC,WAAW,EAAE,eAAe;MAC5BC,OAAO,EAAE,KAAK;MACdC,UAAU,EAAE;QACVC,iBAAiB,EAAE,GAAG;QACtBC,wBAAwB,EAAE;MAC5B,CAAC;MACDC,KAAK,EAAE,kBAAkB;MACzBC,OAAO,EAAE;QACPC,GAAG,EAAE,gFAAgF;QACrFC,OAAO,EAAE,EAAE;QACXC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGlB,0BAA0B;IAC5C,IAAI,CAACmB,OAAO,GAA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ASC,CAAC,EAAEC,CAAC,EAAE;MACpC,OAAOA,CAAC,CAACR,WAAW,GAAGO,CAAC,CAACP,WAAW;IACtC,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACES,SAASA,CAAC;IAACC,KAAK;IAAErB;EAAU,CAAC,EAAE;IAC7B,IAAIO,gBAAgB,GAAGP,UAAU,CAACsB,WAAW,CAAC,oBAAoB,CAAC;IAEnEf,gBAAgB,GAAG,IAAI,CAACQ,cAAc,CAACR,gBAAgB,CAAC;IACxD,MAAMzB,MAAM,GAAG,IAAI,CAACiB,SAAS,CAACC,UAAU,CAAC;IACzC,MAAMQ,cAAc,GAAGa,KAAK,CAACb,cAAc,CAAC,CAAC;IAC7C,MAAMe,qBAAqB,GAAG,IAAI,CAACjB,eAAe,CAAC;MACjDC,gBAAgB;MAChBzB,MAAM;MACN0B;IACF,CAAC,CAAC;IACF,MAAMgB,gBAAgB,GAAG,IAAIhD,gBAAgB,CAAC;MAACM,MAAM,EAAE,IAAI,CAACgB;IAAO,CAAC,CAAC;IAErE0B,gBAAgB,CAACC,QAAQ,CAACF,qBAAqB,CAACV,KAAK,CAAC;IACtDW,gBAAgB,CAACE,SAAS,CAACH,qBAAqB,CAACd,MAAM,CAAC;IAExD,OAAOe,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACN,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ParagraphTooLongAssessment.js","names":["merge","inRangeEndInclusive","inRange","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","TEXT_PARAGRAPH_TOO_LONG_ID","ParagraphTooLongAssessment","constructor","config","defaultConfig","id","priority","docUrl","fixPosition","ctaType","parameters","recommendedLength","maximumRecommendedLength","title","content","bad","improve","good","identifier","_config","getConfig","researcher","currentConfig","languageSpecificConfig","_isProduct","productPageParams","defaultPageParams","calculateResult","paragraphsLength","hasDescription","status","length","countLength","isGood","score","getScore","sortParagraphs","paragraphs","sort","a","b","getResult","paper","getResearch","paragraphLengthResult","assessmentResult","setScore","setStatus","isApplicable"],"sources":["../../../../../src/scoring/assessments/readability/ParagraphTooLongAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {inRangeEndInclusive as inRange} from '../../helpers/assessments/inRange';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, TEXT_PARAGRAPH_TOO_LONG_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that will look if the text has too long paragraphs.\n */\nexport default class ParagraphTooLongAssessment 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: TEXT_PARAGRAPH_TOO_LONG_ID,\n priority: 'high',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#paragraphs-off-target',\n fixPosition: 'longParagraph',\n ctaType: 'fix',\n parameters: {\n recommendedLength: 150,\n maximumRecommendedLength: 150\n },\n title: 'Paragraph length',\n content: {\n bad: 'Paragraph too long. Keep paragraph length less than 150 words for readability.',\n improve: '',\n good: 'Paragraph is optimized, with less than 150 words.'\n }\n };\n\n this.identifier = TEXT_PARAGRAPH_TOO_LONG_ID;\n this._config = merge(defaultConfig, config);\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 getConfig(researcher) {\n const currentConfig = this._config;\n const languageSpecificConfig = researcher.getConfig('paragraphLength');\n\n /*\n * If a language has a specific paragraph length config, check further if the assessment is run in product pages.\n * If it's run in product pages, override the default config parameters with the language specific config for product pages,\n * otherwise override it with the language specific config for default pages analysis.\n */\n if (languageSpecificConfig) {\n currentConfig.parameters = this._isProduct\n ? languageSpecificConfig.productPageParams\n : languageSpecificConfig.defaultPageParams;\n }\n\n return currentConfig;\n }\n\n /**\n *\n * @param paragraphsLength\n * @param config\n * @param hasDescription\n * @returns {{score: number, status: (string)}}\n */\n calculateResult({paragraphsLength, config, hasDescription}) {\n let status = 'bad';\n if (paragraphsLength.length === 0 || !hasDescription) {\n status = 'bad';\n } else {\n const { recommendedLength, maximumRecommendedLength } = config.parameters;\n const length = paragraphsLength[0].countLength;\n\n const isGood =\n length <= recommendedLength ||\n inRange(length, recommendedLength, maximumRecommendedLength);\n\n status = isGood ? 'good' : 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status\n };\n }\n\n /**\n * Sort the paragraphs based on word count.\n *\n * @param {Array} paragraphs The array with paragraphs.\n *\n * @returns {Array} The array sorted on word counts.\n */\n sortParagraphs(paragraphs) {\n return paragraphs.sort(function(a, b) {\n return b.countLength - a.countLength;\n });\n }\n\n /**\n * Runs the getParagraphLength module, based on this returns an assessment result with score and text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n * @returns {object} The assessment result.\n */\n getResult({paper, researcher}) {\n let paragraphsLength = researcher.getResearch('getParagraphLength');\n\n paragraphsLength = this.sortParagraphs(paragraphsLength);\n const config = this.getConfig(researcher);\n const hasDescription = paper.hasDescription();\n const paragraphLengthResult = this.calculateResult({\n paragraphsLength,\n config,\n hasDescription\n });\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(paragraphLengthResult.score);\n assessmentResult.setStatus(paragraphLengthResult.status);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the paragraphTooLong assessment is applicable to the paper.\n *\n * @param {Paper} paper The paper to check.\n *\n * @returns {boolean} Returns true if the assessment is applicable to the paper.\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,SAAQC,mBAAmB,IAAIC,OAAO;AACtC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,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,IAAIhD,gBAAgB,CAAC;MAACM,MAAM,EAAE,IAAI,CAACgB;IAAO,CAAC,CAAC;IAErE0B,gBAAgB,CAACC,QAAQ,CAACF,qBAAqB,CAACV,KAAK,CAAC;IACtDW,gBAAgB,CAACE,SAAS,CAACH,qBAAqB,CAACd,MAAM,CAAC;IAExD,OAAOe,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACN,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -20,7 +20,7 @@ export default class RelatedKeywordsAssessment extends Assessment {
20
20
  id: RELATED_KEYWORDS_ID,
21
21
  fixPosition: 'description',
22
22
  ctaType: 'fix',
23
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',
23
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#missing-related-keywords',
24
24
  priority: 'high',
25
25
  title: 'Related keywords',
26
26
  content: {
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","KEYWORD_POINTS","RELATED_KEYWORDS_ID","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","relatedKeywords","isHasRelatedKeywords","length","status","score","getScore","getResult","paper","researcher","getRelatedKeywords","result","assessmentResult","setScore","setStatus","isApplicable"],"sources":["../../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {KEYWORD_POINTS, RELATED_KEYWORDS_ID} from '@axyseo/const/analysis';\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: RELATED_KEYWORDS_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keywords set',\n bad:\n 'Related keywords field is empty. Add a few relevant phrases.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param relatedKeywords\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(relatedKeywords) {\n const isHasRelatedKeywords = relatedKeywords && relatedKeywords?.length > 0;\n const status = isHasRelatedKeywords ? 'good' : 'bad';\n const score = this.getScore(KEYWORD_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 relatedKeywords = paper.getRelatedKeywords()\n const result = this.calculateResult( relatedKeywords);\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 true;\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,cAAc,EAAEC,mBAAmB;;AAE3C;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASH,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EA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;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACP,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"file":"RelatedKeywordsAssessment.js","names":["merge","AssessmentResult","Assessment","KEYWORD_POINTS","RELATED_KEYWORDS_ID","RelatedKeywordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","relatedKeywords","isHasRelatedKeywords","length","status","score","getScore","getResult","paper","researcher","getRelatedKeywords","result","assessmentResult","setScore","setStatus","isApplicable"],"sources":["../../../../../src/scoring/assessments/readability/RelatedKeywordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {KEYWORD_POINTS, RELATED_KEYWORDS_ID} from '@axyseo/const/analysis';\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: RELATED_KEYWORDS_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#missing-related-keywords',\n priority: 'high',\n title: 'Related keywords',\n content: {\n good: 'Related keywords set',\n bad:\n 'Related keywords field is empty. Add a few relevant phrases.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param relatedKeywords\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(relatedKeywords) {\n const isHasRelatedKeywords = relatedKeywords && relatedKeywords?.length > 0;\n const status = isHasRelatedKeywords ? 'good' : 'bad';\n const score = this.getScore(KEYWORD_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 relatedKeywords = paper.getRelatedKeywords()\n const result = this.calculateResult( relatedKeywords);\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 true;\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,cAAc,EAAEC,mBAAmB;;AAE3C;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASH,UAAU,CAAC;EAChE;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,mBAAmB;MACvBM,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,kGAAkG;MACpGC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,kBAAkB;MACzBC,OAAO,EAAE;QACPC,IAAI,EAAE,sBAAsB;QAC5BC,GAAG,EACD,8DAA8D;QAChEC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,mBAAmB;IACrC,IAAI,CAACgB,OAAO,GAAGpB,KAAK,CAACQ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;EACEc,eAAeA,CAACC,eAAe,EAAE;IAC/B,MAAMC,oBAAoB,GAAGD,eAAe,IAAIA,eAAe,EAAEE,MAAM,GAAG,CAAC;IAC3E,MAAMC,MAAM,GAAGF,oBAAoB,GAAG,MAAM,GAAG,KAAK;IACpD,MAAMG,KAAK,GAAG,IAAI,CAACC,QAAQ,CAACxB,cAAc,EAAEsB,MAAM,CAAC;IAEnD,OAAO;MACLC,KAAK;MACLD;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMR,eAAe,GAAGO,KAAK,CAACE,kBAAkB,CAAC,CAAC;IAClD,MAAMC,MAAM,GAAG,IAAI,CAACX,eAAe,CAAEC,eAAe,CAAC;IACrD,MAAMW,gBAAgB,GAAG,IAAIhC,gBAAgB,CAAC;MAACM,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErEa,gBAAgB,CAACC,QAAQ,CAACF,MAAM,CAACN,KAAK,CAAC;IACvCO,gBAAgB,CAACE,SAAS,CAACH,MAAM,CAACP,MAAM,CAAC;IAEzC,OAAOQ,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,YAAYA,CAACP,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -21,7 +21,7 @@ export default class SentenceBeginningsAssessment extends Assessment {
21
21
  id: SENTENCE_BEGINNINGS_ID,
22
22
  priority: 'medium',
23
23
  ctaType: 'fix',
24
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-beginnings',
24
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#sentence-beginnings',
25
25
  fixPosition: 'description',
26
26
  title: 'Sentence beginnings',
27
27
  content: {
@@ -1 +1 @@
1
- {"version":3,"file":"SentenceBeginningsAssessment.js","names":["merge","partition","sortBy","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","SENTENCE_BEGINNINGS_ID","maximumConsecutiveDuplicates","SentenceBeginningsAssessment","constructor","config","defaultConfig","id","priority","ctaType","docUrl","fixPosition","title","content","improve","bad","good","identifier","_config","groupSentenceBeginnings","sentenceBeginnings","tooOften","word","count","length","total","sortedCounts","lowestCount","calculateSentenceBeginningsResult","groupedSentenceBeginnings","status","score","getScore","getResult","paper","researcher","getResearch","sentenceBeginningsErrors","filter","sentenceBeginning","calculatedResult","assessmentResult","setData","setScore","setStatus","isApplicable","hasEnoughContentForAssessment","hasResearch"],"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,SAAQA,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAO,QAAQ;AAC/C,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,mBAAmB,EAAEC,sBAAsB;AAEnD,MAAMC,4BAA4B,GAAG,CAAC;;AAEtC;AACA;AACA;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BeginningsAssessment.js","names":["merge","partition","sortBy","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","SENTENCE_BEGINNINGS_ID","maximumConsecutiveDuplicates","SentenceBeginningsAssessment","constructor","config","defaultConfig","id","priority","ctaType","docUrl","fixPosition","title","content","improve","bad","good","identifier","_config","groupSentenceBeginnings","sentenceBeginnings","tooOften","word","count","length","total","sortedCounts","lowestCount","calculateSentenceBeginningsResult","groupedSentenceBeginnings","status","score","getScore","getResult","paper","researcher","getResearch","sentenceBeginningsErrors","filter","sentenceBeginning","calculatedResult","assessmentResult","setData","setScore","setStatus","isApplicable","hasEnoughContentForAssessment","hasResearch"],"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-on-page-audit/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,SAAQA,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAO,QAAQ;AAC/C,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,mBAA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,WAAW,CAAC,uBAAuB,CAAC;EAEhG;AACF","ignoreList":[]}
@@ -20,7 +20,7 @@ class SentenceLengthInTextAssessment extends Assessment {
20
20
  const defaultConfig = {
21
21
  id: TEXT_SENTENCE_LENGTH_ID,
22
22
  priority: 'high',
23
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#sentence-length',
23
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#sentence-length-off-target',
24
24
  ctaType: 'fix',
25
25
  fixPosition: 'sentenceLength',
26
26
  recommendedLength: 20,
@@ -1 +1 @@
1
- {"version":3,"file":"SentenceLengthInTextAssessment.js","names":["merge","Assessment","getTooLongSentences","formatNumber","AssessmentResult","MAIN_CONTENT_POINTS","TEXT_SENTENCE_LENGTH_ID","SentenceLengthInTextAssessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","fixPosition","recommendedLength","slightlyTooMany","farTooMany","title","content","improve","bad","good","_config","identifier","getResult","paper","researcher","sentences","getResearch","hasDescription","getConfig","getLanguageSpecificConfig","percentage","calculatePercentage","result","calculateResult","assessmentResult","setScore","score","setStatus","status","isApplicable","currentConfig","languageSpecificConfig","hasOwnProperty","length","tooLongTotal","countTooLongSentences","parseInt","getScore"],"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\n if (hasDescription && percentage <= this._config.slightlyTooMany) {\n status = 'good';\n }\n return {\n score: parseInt(this.getScore(MAIN_CONTENT_POINTS, status)) || 0,\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,mBAAmB;AAC1B,OAAOC,YAAY;AACnB,OAAOC,gBAAgB;AACvB,SAAQC,mBAAmB,EAAEC,uBAAuB;;AAEpD;AACA;AACA;AACA,MAAMC,8BAA8B,SAASN,UAAU,CAAC;EACtD;AACF;AACA;AACA;AACA;AACA;EAEEO,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,uBAAuB;MAC3BM,QAAQ,EAAE,MAAM;MAChBC,MAAM,EACJ,6FAA6F;MAC/FC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE,EAAE;M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8B","ignoreList":[]}
1
+ {"version":3,"file":"SentenceLengthInTextAssessment.js","names":["merge","Assessment","getTooLongSentences","formatNumber","AssessmentResult","MAIN_CONTENT_POINTS","TEXT_SENTENCE_LENGTH_ID","SentenceLengthInTextAssessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","fixPosition","recommendedLength","slightlyTooMany","farTooMany","title","content","improve","bad","good","_config","identifier","getResult","paper","researcher","sentences","getResearch","hasDescription","getConfig","getLanguageSpecificConfig","percentage","calculatePercentage","result","calculateResult","assessmentResult","setScore","score","setStatus","status","isApplicable","currentConfig","languageSpecificConfig","hasOwnProperty","length","tooLongTotal","countTooLongSentences","parseInt","getScore"],"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-on-page-audit/checklist#sentence-length-off-target',\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\n if (hasDescription && percentage <= this._config.slightlyTooMany) {\n status = 'good';\n }\n return {\n score: parseInt(this.getScore(MAIN_CONTENT_POINTS, status)) || 0,\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,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,UAAU;AACjB,OAAOC,mBAAmB;AAC1B,OAAOC,YAAY;AACnB,OAAOC,gBAAgB;AACvB,SAAQC,mBAAmB,EAAEC,uBAAuB;;AAEpD;AACA;AACA;AACA,MAAMC,8BAA8B,SAASN,UAAU,CAAC;EACtD;AACF;AACA;AACA;AACA;AACA;EAEEO,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,uBAAuB;MAC3BM,QAAQ,EAAE,MAAM;MAChBC,MAAM,EACJ,oGAAoG;MACtGC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE,EAAE;MACnBC,UAAU,EAAE,EAAE;MACdC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,GAAG,EACD,6FAA6F;QAC/FC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,OAAO,GAAGxB,KAAK,CAACU,aAAa,EAAED,MAAM,CAAC;IAC3C,IAAI,CAACgB,UAAU,GAAGnB,uBAAuB;EAC3C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEoB,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,C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EAAE;MAC1B,MAAMC,YAAY,GAAG,IAAI,CAACC,qBAAqB,CAACpB,SAAS,CAAC;MAC1DK,UAAU,GAAG/B,YAAY,CAAE6C,YAAY,GAAGnB,SAAS,CAACkB,MAAM,GAAI,GAAG,CAAC;IACpE;IAEA,OAAOb,UAAU;EACnB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,eAAeA,CAACH,UAAU,EAAEH,cAAc,EAAE;IAC1C,IAAIW,MAAM,GAAG,KAAK;IAElB,IAAIX,cAAc,IAAIG,UAAU,IAAI,IAAI,CAACV,OAAO,CAACP,eAAe,EAAE;MAChEyB,MAAM,GAAG,MAAM;IACjB;IACA,OAAO;MACLF,KAAK,EAAEU,QAAQ,CAAC,IAAI,CAACC,QAAQ,CAAC9C,mBAAmB,EAAEqC,MAAM,CAAC,CAAC,IAAI,CAAC;MAChEA;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACExC,mBAAmBA,CAAC2B,SAAS,EAAE;IAC7B,OAAO3B,mBAAmB,CAAC2B,SAAS,EAAE,IAAI,CAACL,OAAO,CAACR,iBAAiB,CAAC;EACvE;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEiC,qBAAqBA,CAACpB,SAAS,EAAE;IAC/B,OAAO,IAAI,CAAC3B,mBAAmB,CAAC2B,SAAS,CAAC,CAACkB,MAAM;EACnD;AACF;AAEA,eAAexC,8BAA8B","ignoreList":[]}
@@ -25,7 +25,7 @@ export default class TransitionWordsAssessment extends Assessment {
25
25
  id: TEXT_TRANSITION_WORDS_ID,
26
26
  fixPosition: 'longestParagraph',
27
27
  ctaType: 'fix',
28
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#use-of-transition-words',
28
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#use-of-transition-words',
29
29
  priority: 'low',
30
30
  applicableIfTextLongerThan: 200,
31
31
  title: 'Use of transition words',
@@ -1 +1 @@
1
- {"version":3,"file":"TransitionWordsAssessment.js","names":["merge","formatNumber","inRangeStartInclusive","inRange","AssessmentResult","Assessment","removeHtmlBlocks","getWords","filterShortcodesFromHTML","MAIN_CONTENT_POINTS","TEXT_TRANSITION_WORDS_ID","TransitionWordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","applicableIfTextLongerThan","title","content","good","bad","improve","identifier","_config","calculateTransitionWordPercentage","sentences","transitionWordSentences","totalSentences","calculateScoreFromPercentage","percentage","calculateTransitionWordResult","score","status","customScore","getScore","getResult","paper","researcher","getResearch","transitionWordResult","assessmentResult","setScore","setStatus","isApplicable","customCountLength","getHelper","customApplicabilityConfig","getConfig","transitionWords","text","getText","_attributes","shortcodes","textLength","length","hasResearch"],"sources":["../../../../../src/scoring/assessments/readability/TransitionWordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport formatNumber from '../../../helpers/formatNumber';\nimport {inRangeStartInclusive as inRange} from '../../helpers/assessments/inRange';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport removeHtmlBlocks from '@axyseo/languageProcessing/helpers/html/htmlParser';\nimport getWords from '@axyseo/languageProcessing/helpers/word/getWords';\nimport {filterShortcodesFromHTML} from '@axyseo/languageProcessing/helpers';\nimport {MAIN_CONTENT_POINTS, TEXT_TRANSITION_WORDS_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class TransitionWordsAssessment 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: TEXT_TRANSITION_WORDS_ID,\n fixPosition: 'longestParagraph',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#use-of-transition-words',\n priority: 'low',\n applicableIfTextLongerThan: 200,\n title: 'Use of transition words',\n content: {\n good: 'Transition words are used effectively.',\n bad:\n 'Lack of transition words. Improve readability and flow by adding words like \"however,\" \"also,\" etc.',\n improve: ''\n }\n };\n\n this.identifier = TEXT_TRANSITION_WORDS_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Calculates the actual percentage of transition words in the sentences.\n *\n * @param {object} sentences The object containing the total number of sentences and the number of sentences containing\n * a transition word.\n *\n * @returns {number} The percentage of sentences containing a transition word.\n */\n calculateTransitionWordPercentage(sentences) {\n if (sentences.transitionWordSentences === 0 || sentences.totalSentences === 0) {\n return 0;\n }\n\n return formatNumber((sentences.transitionWordSentences / sentences.totalSentences) * 100);\n }\n\n /**\n * Calculates the score for the assessment based on the percentage of sentences containing transition words.\n *\n * @param {number} percentage The percentage of sentences containing transition words.\n *\n * @returns {number} The score.\n */\n calculateScoreFromPercentage(percentage) {\n if (percentage < 10) {\n // Red indicator.\n return 3;\n }\n\n if (inRange(percentage, 10, 20)) {\n // Orange indicator.\n return 6;\n }\n\n // Green indicator.\n return 9;\n }\n\n /**\n *\n * @param transitionWordSentences\n * @returns {{score: number, status: string}}\n */\n calculateTransitionWordResult(transitionWordSentences) {\n const percentage = this.calculateTransitionWordPercentage(transitionWordSentences);\n const score = this.calculateScoreFromPercentage(percentage);\n\n let status = 'good';\n if (score < 6 || percentage === 0) {\n status = 'bad';\n }\n\n const customScore = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score: customScore,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const transitionWordSentences = researcher.getResearch('findTransitionWords');\n const transitionWordResult = this.calculateTransitionWordResult(transitionWordSentences);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(transitionWordResult.score);\n assessmentResult.setStatus(transitionWordResult.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 const customCountLength = researcher.getHelper('customCountLength');\n const customApplicabilityConfig = researcher.getConfig('assessmentApplicability')\n .transitionWords;\n if (customApplicabilityConfig) {\n this._config.applicableIfTextLongerThan = customApplicabilityConfig;\n }\n let text = paper.getText();\n text = removeHtmlBlocks(text);\n text = filterShortcodesFromHTML(text, paper._attributes && paper._attributes.shortcodes);\n const textLength = customCountLength ? customCountLength(text) : getWords(text).length;\n\n // Do not use hasEnoughContent in this assessment as it is mostly redundant with `textLength >= this._config.applicableIfTextLongerThan`\n return (\n textLength >= this._config.applicableIfTextLongerThan &&\n researcher.hasResearch('findTransitionWords')\n );\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,YAAY;AACnB,SAAQC,qBAAqB,IAAIC,OAAO;AACxC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,OAAOC,QAAQ;AACf,SAAQC,wBAAwB;AAChC,SAAQC,mBAAmB,EAAEC,wBAAwB;;AAErD;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASN,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEO,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,wBAAwB;MAC5BM,WAAW,EAAE,kBAAkB;MAC/BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,qGAAqG;MACvGC,QAAQ,EAAE,KAAK;MACfC,0BAA0B,EAAE,GAAG;MAC/BC,KAAK,EAAE,yBAAyB;MAChCC,OAAO,EAAE;QACPC,IAAI,EAAE,wCAAwC;QAC9CC,GAAG,EACD,qGAAqG;QACvGC,OAAO,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Assessment.js","names":["merge","formatNumber","inRangeStartInclusive","inRange","AssessmentResult","Assessment","removeHtmlBlocks","getWords","filterShortcodesFromHTML","MAIN_CONTENT_POINTS","TEXT_TRANSITION_WORDS_ID","TransitionWordsAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","applicableIfTextLongerThan","title","content","good","bad","improve","identifier","_config","calculateTransitionWordPercentage","sentences","transitionWordSentences","totalSentences","calculateScoreFromPercentage","percentage","calculateTransitionWordResult","score","status","customScore","getScore","getResult","paper","researcher","getResearch","transitionWordResult","assessmentResult","setScore","setStatus","isApplicable","customCountLength","getHelper","customApplicabilityConfig","getConfig","transitionWords","text","getText","_attributes","shortcodes","textLength","length","hasResearch"],"sources":["../../../../../src/scoring/assessments/readability/TransitionWordsAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport formatNumber from '../../../helpers/formatNumber';\nimport {inRangeStartInclusive as inRange} from '../../helpers/assessments/inRange';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport removeHtmlBlocks from '@axyseo/languageProcessing/helpers/html/htmlParser';\nimport getWords from '@axyseo/languageProcessing/helpers/word/getWords';\nimport {filterShortcodesFromHTML} from '@axyseo/languageProcessing/helpers';\nimport {MAIN_CONTENT_POINTS, TEXT_TRANSITION_WORDS_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class TransitionWordsAssessment 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: TEXT_TRANSITION_WORDS_ID,\n fixPosition: 'longestParagraph',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#use-of-transition-words',\n priority: 'low',\n applicableIfTextLongerThan: 200,\n title: 'Use of transition words',\n content: {\n good: 'Transition words are used effectively.',\n bad:\n 'Lack of transition words. Improve readability and flow by adding words like \"however,\" \"also,\" etc.',\n improve: ''\n }\n };\n\n this.identifier = TEXT_TRANSITION_WORDS_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Calculates the actual percentage of transition words in the sentences.\n *\n * @param {object} sentences The object containing the total number of sentences and the number of sentences containing\n * a transition word.\n *\n * @returns {number} The percentage of sentences containing a transition word.\n */\n calculateTransitionWordPercentage(sentences) {\n if (sentences.transitionWordSentences === 0 || sentences.totalSentences === 0) {\n return 0;\n }\n\n return formatNumber((sentences.transitionWordSentences / sentences.totalSentences) * 100);\n }\n\n /**\n * Calculates the score for the assessment based on the percentage of sentences containing transition words.\n *\n * @param {number} percentage The percentage of sentences containing transition words.\n *\n * @returns {number} The score.\n */\n calculateScoreFromPercentage(percentage) {\n if (percentage < 10) {\n // Red indicator.\n return 3;\n }\n\n if (inRange(percentage, 10, 20)) {\n // Orange indicator.\n return 6;\n }\n\n // Green indicator.\n return 9;\n }\n\n /**\n *\n * @param transitionWordSentences\n * @returns {{score: number, status: string}}\n */\n calculateTransitionWordResult(transitionWordSentences) {\n const percentage = this.calculateTransitionWordPercentage(transitionWordSentences);\n const score = this.calculateScoreFromPercentage(percentage);\n\n let status = 'good';\n if (score < 6 || percentage === 0) {\n status = 'bad';\n }\n\n const customScore = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score: customScore,\n status\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const transitionWordSentences = researcher.getResearch('findTransitionWords');\n const transitionWordResult = this.calculateTransitionWordResult(transitionWordSentences);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(transitionWordResult.score);\n assessmentResult.setStatus(transitionWordResult.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 const customCountLength = researcher.getHelper('customCountLength');\n const customApplicabilityConfig = researcher.getConfig('assessmentApplicability')\n .transitionWords;\n if (customApplicabilityConfig) {\n this._config.applicableIfTextLongerThan = customApplicabilityConfig;\n }\n let text = paper.getText();\n text = removeHtmlBlocks(text);\n text = filterShortcodesFromHTML(text, paper._attributes && paper._attributes.shortcodes);\n const textLength = customCountLength ? customCountLength(text) : getWords(text).length;\n\n // Do not use hasEnoughContent in this assessment as it is mostly redundant with `textLength >= this._config.applicableIfTextLongerThan`\n return (\n textLength >= this._config.applicableIfTextLongerThan &&\n researcher.hasResearch('findTransitionWords')\n );\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,YAAY;AACnB,SAAQC,qBAAqB,IAAIC,OAAO;AACxC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,OAAOC,QAAQ;AACf,SAAQC,wBAAwB;AAChC,SAAQC,mBAAmB,EAAEC,wBAAwB;;AAErD;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASN,UAAU,CAAC;EAChE;AACF;AACA;AACA;AACA;AACA;AACA;EACEO,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,wBAAwB;MAC5BM,WAAW,EAAE,kBAAkB;MAC/BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,iGAAiG;MACnGC,QAAQ,EAAE,KAAK;MACfC,0BAA0B,EAAE,GAAG;MAC/BC,KAAK,EAAE,yBAAyB;MAChCC,OAAO,EAAE;QACPC,IAAI,EAAE,wCAAwC;QAC9CC,GAAG,EACD,qGAAqG;QACvGC,OAAO,EAAE;MACX;IACF,CA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19
19
  super();
20
20
  const defaultConfig = {
21
21
  id: MEDIA_ID,
22
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#images-and-videos',
22
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#images-and-videos',
23
23
  priority: 'high',
24
24
  fixPosition: 'description',
25
25
  title: 'Media',
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCountAssessment.js","names":["merge","Assessment","AssessmentResult","FAQS_POINTS","MEDIA_ID","TextImagesAssessment","constructor","config","countVideos","defaultConfig","id","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","_countVideos","getResult","paper","researcher","imageCount","getResearch","videoCount","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","mediaCount","getScore"],"sources":["../../../../../src/scoring/assessments/seo/ImageCountAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {FAQS_POINTS, 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 * @returns {AssessmentResult} The result of the assessment, containing both a score and a descriptive text.\n */\n getResult({paper, researcher}) {\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();\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.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 *\n * @returns {{score: number, status: string}}\n */\n calculateResult() {\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 = 'good';\n // No images.\n if (mediaCount === 0) {\n status = 'bad';\n }\n\n const score = this.getScore(FAQS_POINTS, 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,WAAW,EAAEC,QAAQ;;AAE7B;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASJ,UAAU,CAAC;EAC3D;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAEC,WAAW,GAAG,IAAI,EAAE;IAC3C,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEN,QAAQ;MACZO,MAAM,EACJ,+FAA+F;MACjGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,aAAa;MAC1BC,KAAK,EAAE,OAAO;MACdC,OAAO,EAAE;QACPC,IAAI,EAAE,6BAA6B;QACnCC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,QAAQ;IAC1B,IAAI,CAACgB,OAAO,GAAGpB,KAAK,CAACS,aAAa,EAAEF,MAAM,CAAC;IAC3C,IAAI,CAACc,YAAY,GAAGb,WAAW;EACjC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,IAAI,CAACC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,YAAY,CAAC;IACtD,IAAI,CAACC,UAAU,GAAGH,UAAU,CAACE,WAAW,CAAC,YAAY,CAAC;IAEtD,MAAME,gBAAgB,GAAG,IAAI1B,gBAAgB,CAAC;MAACK,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMS,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAAC,CAAC;IAE/CF,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;AACA;EACEO,YAAYA,CAACZ,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEO,eAAeA,CAAA,EAAG;IAChB;IACA,MAAMM,UAAU,GAAG,IAAI,CAACf,YAAY,GAAG,IAAI,CAACI,UAAU,GAAG,IAAI,CAACE,UAAU,GAAG,IAAI,CAACF,UAAU;IAE1F,IAAIS,MAAM,GAAG,MAAM;IACnB;IACA,IAAIE,UAAU,KAAK,CAAC,EAAE;MACpBF,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAAClC,WAAW,EAAE+B,MAAM,CAAC;IAEhD,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ImageCountAssessment.js","names":["merge","Assessment","AssessmentResult","FAQS_POINTS","MEDIA_ID","TextImagesAssessment","constructor","config","countVideos","defaultConfig","id","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","_countVideos","getResult","paper","researcher","imageCount","getResearch","videoCount","assessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","isApplicable","mediaCount","getScore"],"sources":["../../../../../src/scoring/assessments/seo/ImageCountAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {FAQS_POINTS, 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-on-page-audit/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 * @returns {AssessmentResult} The result of the assessment, containing both a score and a descriptive text.\n */\n getResult({paper, researcher}) {\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();\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.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 *\n * @returns {{score: number, status: string}}\n */\n calculateResult() {\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 = 'good';\n // No images.\n if (mediaCount === 0) {\n status = 'bad';\n }\n\n const score = this.getScore(FAQS_POINTS, 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,WAAW,EAAEC,QAAQ;;AAE7B;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASJ,UAAU,CAAC;EAC3D;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAEC,WAAW,GAAG,IAAI,EAAE;IAC3C,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEN,QAAQ;MACZO,MAAM,EACJ,2FAA2F;MAC7FC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,aAAa;MAC1BC,KAAK,EAAE,OAAO;MACdC,OAAO,EAAE;QACPC,IAAI,EAAE,6BAA6B;QACnCC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,QAAQ;IAC1B,IAAI,CAACgB,OAAO,GAAGpB,KAAK,CAACS,aAAa,EAAEF,MAAM,CAAC;IAC3C,IAAI,CAACc,YAAY,GAAGb,WAAW;EACjC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEc,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,IAAI,CAACC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,YAAY,CAAC;IACtD,IAAI,CAACC,UAAU,GAAGH,UAAU,CAACE,WAAW,CAAC,YAAY,CAAC;IAEtD,MAAME,gBAAgB,GAAG,IAAI1B,gBAAgB,CAAC;MAACK,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErE,MAAMS,gBAAgB,GAAG,IAAI,CAACC,eAAe,CAAC,CAAC;IAE/CF,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;AACA;EACEO,YAAYA,CAACZ,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEO,eAAeA,CAAA,EAAG;IAChB;IACA,MAAMM,UAAU,GAAG,IAAI,CAACf,YAAY,GAAG,IAAI,CAACI,UAAU,GAAG,IAAI,CAACE,UAAU,GAAG,IAAI,CAACF,UAAU;IAE1F,IAAIS,MAAM,GAAG,MAAM;IACnB;IACA,IAAIE,UAAU,KAAK,CAAC,EAAE;MACpBF,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACK,QAAQ,CAAClC,WAAW,EAAE+B,MAAM,CAAC;IAEhD,OAAO;MACLF,KAAK;MACLE;IACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -25,7 +25,7 @@ class InternalLinksAssessment extends Assessment {
25
25
  const defaultConfig = {
26
26
  id: INTERNAL_LINKS_ID,
27
27
  fixPosition: '',
28
- docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',
28
+ docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-on-page-audit/checklist#missing-internal-links',
29
29
  priority: 'high',
30
30
  title: 'Internal links',
31
31
  content: {