axyseo 2.0.0-alpha.0.0.25 → 2.0.0-alpha.0.0.26

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 (55) hide show
  1. package/build/scoring/assessments/assessment.js +3 -0
  2. package/build/scoring/assessments/assessment.js.map +1 -1
  3. package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js +1 -1
  4. package/build/scoring/assessments/readability/ParagraphTooLongAssessment.js.map +1 -1
  5. package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js +4 -3
  6. package/build/scoring/assessments/readability/SentenceBeginningsAssessment.js.map +1 -1
  7. package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js +1 -2
  8. package/build/scoring/assessments/readability/SentenceLengthInTextAssessment.js.map +1 -1
  9. package/build/scoring/assessments/readability/TransitionWordsAssessment.js +1 -1
  10. package/build/scoring/assessments/readability/TransitionWordsAssessment.js.map +1 -1
  11. package/build/scoring/assessments/seo/ImageCountAssessment.js +1 -1
  12. package/build/scoring/assessments/seo/ImageCountAssessment.js.map +1 -1
  13. package/build/scoring/assessments/seo/InternalLinksAssessment.js +1 -1
  14. package/build/scoring/assessments/seo/InternalLinksAssessment.js.map +1 -1
  15. package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js +3 -3
  16. package/build/scoring/assessments/seo/IntroductionKeywordAssessment.js.map +1 -1
  17. package/build/scoring/assessments/seo/KeyphraseAssessment.js +1 -1
  18. package/build/scoring/assessments/seo/KeyphraseAssessment.js.map +1 -1
  19. package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js +1 -1
  20. package/build/scoring/assessments/seo/KeyphraseLengthAssessment.js.map +1 -1
  21. package/build/scoring/assessments/seo/KeywordDensityAssessment.js +2 -1
  22. package/build/scoring/assessments/seo/KeywordDensityAssessment.js.map +1 -1
  23. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js +1 -2
  24. package/build/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js.map +1 -1
  25. package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js +1 -1
  26. package/build/scoring/assessments/seo/MetaDescriptionLengthAssessment.js.map +1 -1
  27. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js +1 -1
  28. package/build/scoring/assessments/seo/MetaTitleKeywordAssessment.js.map +1 -1
  29. package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js +1 -1
  30. package/build/scoring/assessments/seo/NumberInMetaTitleAssessment.js.map +1 -1
  31. package/build/scoring/assessments/seo/OutboundLinksAssessment.js +1 -1
  32. package/build/scoring/assessments/seo/OutboundLinksAssessment.js.map +1 -1
  33. package/build/scoring/assessments/seo/PageTitleWidthAssessment.js +1 -1
  34. package/build/scoring/assessments/seo/PageTitleWidthAssessment.js.map +1 -1
  35. package/build/scoring/assessments/seo/SchemaAssessment.js +4 -3
  36. package/build/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
  37. package/build/scoring/assessments/seo/SingleH1Assessment.js +1 -1
  38. package/build/scoring/assessments/seo/SingleH1Assessment.js.map +1 -1
  39. package/build/scoring/assessments/seo/SingleTitleAssessment.js +1 -1
  40. package/build/scoring/assessments/seo/SingleTitleAssessment.js.map +1 -1
  41. package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js +1 -2
  42. package/build/scoring/assessments/seo/SubHeadingsKeywordAssessment.js.map +1 -1
  43. package/build/scoring/assessments/seo/TextImagesAssessment.js +1 -1
  44. package/build/scoring/assessments/seo/TextImagesAssessment.js.map +1 -1
  45. package/build/scoring/assessments/seo/TextLengthAssessment.js +1 -1
  46. package/build/scoring/assessments/seo/TextLengthAssessment.js.map +1 -1
  47. package/build/scoring/assessments/seo/UrlKeywordAssessment.js +1 -1
  48. package/build/scoring/assessments/seo/UrlKeywordAssessment.js.map +1 -1
  49. package/build/scoring/assessments/seo/UrlLengthAssessment.js +1 -1
  50. package/build/scoring/assessments/seo/UrlLengthAssessment.js.map +1 -1
  51. package/build/scoring/assessors/assessor.js +26 -5
  52. package/build/scoring/assessors/assessor.js.map +1 -1
  53. package/build/values/Paper.js +9 -0
  54. package/build/values/Paper.js.map +1 -1
  55. package/package.json +1 -1
@@ -28,6 +28,7 @@ class KeyphraseDensityAssessment extends _assessment.default {
28
28
  docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',
29
29
  ctaType: 'fix',
30
30
  priority: 'high',
31
+ title: 'Main keyword density',
31
32
  content: {
32
33
  good: 'Keyword density is optimized, between 1 - 1.5%.',
33
34
  bad: 'Keep keyword density from 1% - 1.5%.',
@@ -93,7 +94,7 @@ class KeyphraseDensityAssessment extends _assessment.default {
93
94
  href: this._config.docUrl,
94
95
  target: "_blank",
95
96
  rel: "noreferrer"
96
- }, "Learn more"))
97
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
97
98
  };
98
99
  }
99
100
 
@@ -1 +1 @@
1
- {"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_helpers","_keyphraseLengthFactor","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","setTitle","title","density","getScore","toFixed","createElement","Text","as","href","target","rel","isApplicable","hasText","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\nimport {calculateKeywordDensity} from '../../../helpers';\nimport keyphraseLengthFactor from '../../../scoring/helpers/assessments/keyphraseLengthFactor';\n\n/**\n * Represents the assessment that will look if the keyphrase density is within the recommended range.\n */\nclass KeyphraseDensityAssessment extends Assessment {\n /**\n *\n * @param config\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'keyphraseDensity',\n fixPosition: 'highlightKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',\n ctaType: 'fix',\n priority: 'high',\n content: {\n good: 'Keyword density is optimized, between 1 - 1.5%.',\n bad: 'Keep keyword density from 1% - 1.5%.',\n improve: ''\n }\n };\n\n this.identifier = 'keyphraseDensity';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the keyphrase density module, based on this returns an assessment\n * result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher, i18n}) {\n this._keyphraseCount = researcher.getResearch('getKeyphraseCount');\n const keyphraseLength = this._keyphraseCount.keyphraseLength;\n\n this._keyphraseDensity = researcher.getResearch('getKeyphraseDensity');\n this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor(keyphraseLength);\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n * Returns the score for the keyphrase density.\n *\n * @returns {Object} The object with calculated score and resultText.\n */\n calculateResult(paper, i18n) {\n const density = this._keyphraseDensity;\n let status = '';\n if (density < 1 || density > 1.5) {\n status = 'bad';\n }\n if (density >= 1 && density <= 1.5) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n title: (this._config.title || 'Main keyword density') + ': ' + density.toFixed(2) + '%',\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text of the minimum required length and a keyphrase is set. Language-specific length requirements and methods\n * of counting text length may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum\n * required length higher).\n *\n * @param {Paper} \t\tpaper \t\tThe paper to use for the assessment.\n * @param {Researcher} researcher The paper to use for the assessment.\n *\n * @returns {boolean} True if applicable.\n */\n isApplicable(paper, researcher) {\n return paper.hasText() && paper.hasKeyword();\n }\n}\n\nexport default KeyphraseDensityAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA+F,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/F;AACA;AACA;AACA,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EAClD;AACF;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,kBAAkB;MACtBC,WAAW,EAAE,kBAAkB;MAC/BC,MAAM,EACJ,kGAAkG;MACpGC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,IAAI,EAAE,iDAAiD;QACvDC,GAAG,EAAE,sCAAsC;QAC3CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CA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I,CAAC,IAAIA,OAAO,IAAI,GAAG,EAAE;MAClCL,MAAM,GAAG,MAAM;IACjB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACQ,QAAQ,CAAC,IAAI,CAACxB,OAAO,CAACN,QAAQ,EAAEwB,MAAM,CAAC;IAE1D,OAAO;MACLI,KAAK,EAAE,CAAC,IAAI,CAACtB,OAAO,CAACsB,KAAK,IAAI,sBAAsB,IAAI,IAAI,GAAGC,OAAO,CAACE,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG;MACvFT,KAAK;MACLE,MAAM;MACNE,IAAI,eACF7C,MAAA,CAAAS,OAAA,CAAA0C,aAAA,CAACjD,QAAA,CAAAkD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC5B,OAAO,CAACL,OAAO,CAACuB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAAClB,OAAO,CAACR,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAA0C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC7B,OAAO,CAACR,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC7B,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAAC8B,OAAO,CAAC,CAAC,IAAI9B,KAAK,CAAC+B,UAAU,CAAC,CAAC;EAC9C;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApD,OAAA,GAEcC,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"KeywordDensityAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_helpers","_keyphraseLengthFactor","e","__esModule","default","KeyphraseDensityAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_keyphraseCount","getResearch","keyphraseLength","_keyphraseDensity","keyphraseLengthFactor","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","setTitle","density","getScore","toFixed","createElement","Text","as","href","target","rel","translate","isApplicable","hasText","hasKeyword","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/KeywordDensityAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\nimport {calculateKeywordDensity} from '../../../helpers';\nimport keyphraseLengthFactor from '../../../scoring/helpers/assessments/keyphraseLengthFactor';\n\n/**\n * Represents the assessment that will look if the keyphrase density is within the recommended range.\n */\nclass KeyphraseDensityAssessment extends Assessment {\n /**\n *\n * @param config\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'keyphraseDensity',\n fixPosition: 'highlightKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#main-keyword-density',\n ctaType: 'fix',\n priority: 'high',\n title: 'Main keyword density',\n content: {\n good: 'Keyword density is optimized, between 1 - 1.5%.',\n bad: 'Keep keyword density from 1% - 1.5%.',\n improve: ''\n }\n };\n\n this.identifier = 'keyphraseDensity';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the keyphrase density module, based on this returns an assessment\n * result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n *\n * @param i18n\n * @returns {AssessmentResult} The result of the assessment.\n */\n getResult({paper, researcher, i18n}) {\n this._keyphraseCount = researcher.getResearch('getKeyphraseCount');\n const keyphraseLength = this._keyphraseCount.keyphraseLength;\n\n this._keyphraseDensity = researcher.getResearch('getKeyphraseDensity');\n this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor(keyphraseLength);\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n assessmentResult.setTitle(calculatedResult.title);\n return assessmentResult;\n }\n\n /**\n * Returns the score for the keyphrase density.\n *\n * @returns {Object} The object with calculated score and resultText.\n */\n calculateResult(paper, i18n) {\n const density = this._keyphraseDensity;\n let status = '';\n if (density < 1 || density > 1.5) {\n status = 'bad';\n }\n if (density >= 1 && density <= 1.5) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n title: (this._config.title || 'Main keyword density') + ': ' + density.toFixed(2) + '%',\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text of the minimum required length and a keyphrase is set. Language-specific length requirements and methods\n * of counting text length may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum\n * required length higher).\n *\n * @param {Paper} \t\tpaper \t\tThe paper to use for the assessment.\n * @param {Researcher} researcher The paper to use for the assessment.\n *\n * @returns {boolean} True if applicable.\n */\n isApplicable(paper, researcher) {\n return paper.hasText() && paper.hasKeyword();\n }\n}\n\nexport default KeyphraseDensityAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA+F,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IA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,GAC3DzB,IAAI,GAAGA,IAAI,CAAC0B,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC7B,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAOD,KAAK,CAAC8B,OAAO,CAAC,CAAC,IAAI9B,KAAK,CAAC+B,UAAU,CAAC,CAAC;EAC9C;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEcC,0BAA0B","ignoreList":[]}
@@ -10,7 +10,6 @@ var _lodash = require("lodash");
10
10
  var _assessment = _interopRequireDefault(require("../assessment"));
11
11
  var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
12
12
  var _polarisIcons = require("@shopify/polaris-icons");
13
- var _helpers = require("../../../helpers");
14
13
  var _matchTextWithWord = _interopRequireDefault(require("../../../languageProcessing/helpers/match/matchTextWithWord"));
15
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
15
  /**
@@ -99,7 +98,7 @@ class MetaDescriptionKeywordAssessment extends _assessment.default {
99
98
  href: this._config.docUrl,
100
99
  target: "_blank",
101
100
  rel: "noreferrer"
102
- }, "Learn more"))
101
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
103
102
  };
104
103
  }
105
104
 
@@ -1 +1 @@
1
- {"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_polarisIcons","_helpers","_matchTextWithWord","e","__esModule","default","MetaDescriptionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","KeyIcon","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","description","getDescription","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","hasDescription","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport {isIncludes} from '../../../helpers';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta description.\n */\nclass MetaDescriptionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionKeyword',\n priority: 'high',\n fixPosition: 'meta description',\n ctaType: 'fix',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n icon: KeyIcon,\n title: 'Meta description keyword',\n content: {\n bad: 'No keywords found in meta description. Add at least one to improve keyword rank.',\n good: 'Keywords are included meta description.',\n improve: ''\n }\n };\n\n this.identifier = 'metaDescriptionKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const description = paper.getDescription();\n const {count} = matchTextWithWord(description, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword() && paper.hasDescription();\n }\n}\n\nexport default MetaDescriptionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACA,MAAMG,gCAAgC,SAASC,mBAAU,CAAC;EACxD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC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,WAAW,EAAEF,OAAO,EAAEb,KAAK,CAACmB,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;IAEhF,IAAIT,MAAM,GAAG,EAAE;IACf,IAAI,IAAAU,gBAAQ,EAACH,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;MAChCP,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACa,QAAQ,CAAC,IAAI,CAACxB,OAAO,CAACZ,QAAQ,EAAEyB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF9C,MAAA,CAAAY,OAAA,CAAA4C,aAAA,CAACrD,QAAA,CAAAsD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC3B,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBtB,MAAA,CAAAY,OAAA,CAAA4C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC5B,OAAO,CAACT,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC5B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC6B,UAAU,CAAC,CAAC,IAAI7B,KAAK,CAAC8B,cAAc,CAAC,CAAC;EACrD;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAEcC,gCAAgC","ignoreList":[]}
1
+ {"version":3,"file":"MetaDescriptionKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_polarisIcons","_matchTextWithWord","e","__esModule","default","MetaDescriptionKeywordAssessment","Assessment","constructor","config","defaultConfig","id","priority","fixPosition","ctaType","docUrl","icon","KeyIcon","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","description","getDescription","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasKeyword","hasDescription","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {KeyIcon} from '@shopify/polaris-icons';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta description.\n */\nclass MetaDescriptionKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionKeyword',\n priority: 'high',\n fixPosition: 'meta description',\n ctaType: 'fix',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n icon: KeyIcon,\n title: 'Meta description keyword',\n content: {\n bad: 'No keywords found in meta description. Add at least one to improve keyword rank.',\n good: 'Keywords are included meta description.',\n improve: ''\n }\n };\n\n this.identifier = 'metaDescriptionKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const description = paper.getDescription();\n const {count} = matchTextWithWord(description, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword() && paper.hasDescription();\n }\n}\n\nexport default MetaDescriptionKeywordAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;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 +92,7 @@ class MetaDescriptionLengthAssessment extends _assessment.default {
92
92
  href: this._config.docUrl,
93
93
  target: "_blank",
94
94
  rel: "noreferrer"
95
- }, "Learn more"))
95
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
96
96
  };
97
97
  }
98
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","MetaDescriptionLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getDescription","getScore","createElement","Text","as","href","target","rel","isApplicable","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Assessment for calculating the length of the meta description.\n */\nexport default class MetaDescriptionLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#meta-description',\n priority: 'high',\n fixPosition: 'meta description',\n title: 'Meta description length',\n content: {\n good: 'Meta description is optimized, less than 160 characters.',\n improve: 'Write a unique and compelling description of 150-160 characters.',\n bad:\n 'Missing meta description. Write a unique and compelling description under 160 characters.'\n }\n };\n\n this.identifier = 'metaDescriptionLength';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionLength module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getDescription().length;\n\n let status = '';\n\n if (length === 0) {\n status = 'bad';\n }\n if (length > 0 && (length < 150 || length > 160)) {\n status = 'improve';\n }\n\n if (length <= 160 && length >= 150) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns true\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,+BAA+B,SAASC,mBAAU,CAAC;EACtE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KA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,GAAG,IAAIA,MAAM,GAAG,GAAG,CAAC,EAAE;MAChDH,MAAM,GAAG,SAAS;IACpB;IAEA,IAAIG,MAAM,IAAI,GAAG,IAAIA,MAAM,IAAI,GAAG,EAAE;MAClCH,MAAM,GAAG,MAAM;IACjB;IACA,MAAMF,KAAK,GAAG,IAAI,CAACO,QAAQ,CAAC,IAAI,CAAClB,OAAO,CAACR,QAAQ,EAAEqB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACFzC,MAAA,CAAAS,OAAA,CAAAoC,aAAA,CAAC1C,QAAA,CAAA2C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACrB,OAAO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACtB,OAAO,CAACT,MAAO;QAACgC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACtB,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAACuB,OAAA,CAAA3C,OAAA,GAAAC,+BAAA","ignoreList":[]}
1
+ {"version":3,"file":"MetaDescriptionLengthAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","MetaDescriptionLengthAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getDescription","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaDescriptionLengthAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Assessment for calculating the length of the meta description.\n */\nexport default class MetaDescriptionLengthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'metaDescriptionLength',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#meta-description',\n priority: 'high',\n fixPosition: 'meta description',\n title: 'Meta description length',\n content: {\n good: 'Meta description is optimized, less than 160 characters.',\n improve: 'Write a unique and compelling description of 150-160 characters.',\n bad:\n 'Missing meta description. Write a unique and compelling description under 160 characters.'\n }\n };\n\n this.identifier = 'metaDescriptionLength';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionLength module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getDescription().length;\n\n let status = '';\n\n if (length === 0) {\n status = 'bad';\n }\n if (length > 0 && (length < 150 || length > 160)) {\n status = 'improve';\n }\n\n if (length <= 160 && length >= 150) {\n status = 'good';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns true\n */\n isApplicable(paper) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,+BAA+B,SAASC,mBAAU,CAAC;EACtE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,uBAAuB;MAC3BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,8FAA8F;MAChGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,kBAAkB;MAC/BC,KAAK,EAAE,yBAAyB;MAChCC,OAAO,EAAE;QACPC,IAAI,EAAE,0DAA0D;QAChEC,OAAO,EAAE,kEAAkE;QAC3EC,GAAG,EACD;MACJ;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,uBAAuB;IACzC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EA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AAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACtB,OAAO,CAACT,MAAO;QAACgC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DnB,IAAI,GAAGA,IAAI,CAACoB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACvB,KAAK,EAAE;IAClB,OAAO,IAAI;EACb;AACF;AAACwB,OAAA,CAAA5C,OAAA,GAAAC,+BAAA","ignoreList":[]}
@@ -96,7 +96,7 @@ class MetaTitleKeywordAssessment extends _assessment.default {
96
96
  href: this._config.docUrl,
97
97
  target: "_blank",
98
98
  rel: "noreferrer"
99
- }, "Learn more"))
99
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
100
100
  };
101
101
  }
102
102
 
@@ -1 +1 @@
1
- {"version":3,"file":"MetaTitleKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_matchTextWithWord","e","__esModule","default","MetaTitleKeywordAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","getTitle","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta title.\n */\nexport default class MetaTitleKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-title',\n fixPosition: 'meta title',\n ctaType: 'fix',\n priority: 'high',\n title: 'Keyword in meta title',\n content: {\n bad:\n 'No keywords found in meta title. Add one to improve keyword rank and click through rate.',\n good: 'Keyword is included in meta title.',\n improve: ''\n }\n };\n\n this.identifier = 'titleKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const title = paper.getTitle();\n const {count} = matchTextWithWord(title, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACe,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EACjE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,cAAc;MAClBC,MAAM,EACJ,8FAA8F;MAChGC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,GAAG,EACD,0FAA0F;QAC5FC,IAAI,EAAE,oCAAoC;QAC1CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,cAAc;IAChC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAAS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,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACV,MAAM,iBAClBjB,MAAA,CAAAU,OAAA,CAAAyC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC3B,OAAO,CAACV,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC3B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC4B,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAAjD,OAAA,GAAAC,0BAAA","ignoreList":[]}
1
+ {"version":3,"file":"MetaTitleKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_matchTextWithWord","e","__esModule","default","MetaTitleKeywordAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","bad","good","improve","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","keyword","getKeyword","getTitle","count","matchTextWithWord","getLocale","isNumber","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/MetaTitleKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isNumber, merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport matchTextWithWord from '@axyseo/languageProcessing/helpers/match/matchTextWithWord';\n\n/**\n * Assessment for checking the keyword matches in the meta title.\n */\nexport default class MetaTitleKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n * @param {number} [config.parameters.recommendedMinimum] The recommended minimum of keyword occurrences in the meta description.\n * @param {number} [config.scores.good] The score to return if there are enough keyword occurrences in the meta description.\n * @param {number} [config.scores.bad] The score to return if there aren't enough keyword occurrences in the meta description.\n * @param {string} [config.url] The URL to the relevant article on Yoast.com.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleKeyword',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-title',\n fixPosition: 'meta title',\n ctaType: 'fix',\n priority: 'high',\n title: 'Keyword in meta title',\n content: {\n bad:\n 'No keywords found in meta title. Add one to improve keyword rank and click through rate.',\n good: 'Keyword is included in meta title.',\n improve: ''\n }\n };\n\n this.identifier = 'titleKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the metaDescriptionKeyword researcher and based on this, returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Returns the result object based on the number of keyword matches in the meta description.\n *\n * @returns {Object} Result object with score and text.\n */\n calculateResult(paper, i18n) {\n const keyword = paper.getKeyword();\n const title = paper.getTitle();\n const {count} = matchTextWithWord(title, keyword, paper.getLocale(), null);\n\n let status = '';\n if (isNumber(count) && count > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a keyword and a meta description.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True if the paper has a keyword and a meta description.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3F;AACA;AACA;AACe,MAAMG,0BAA0B,SAASC,mBAAU,CAAC;EACjE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,cAAc;MAClBC,MAAM,EACJ,8FAA8F;MAChGC,WAAW,EAAE,YAAY;MACzBC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,GAAG,EACD,0FAA0F;QAC5FC,IAAI,EAAE,oCAAoC;QAC1CC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,cAAc;IAChC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAMC,gBAAgB,GAAG,IAAIC,yBA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OAAA,CAAAyC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC3B,OAAO,CAACV,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DxB,IAAI,GAAGA,IAAI,CAACyB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC5B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC6B,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAAlD,OAAA,GAAAC,0BAAA","ignoreList":[]}
@@ -89,7 +89,7 @@ class NumberInMetaTitleAssessment extends _assessment.default {
89
89
  href: this._config.docUrl,
90
90
  target: "_blank",
91
91
  rel: "noreferrer"
92
- }, "Learn more"))
92
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
93
93
  };
94
94
  }
95
95
 
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInMetaTitleAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","NumberInMetaTitleAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","setBody","body","getTitle","test","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class NumberInMetaTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'numberTitle',\n ctaType: 'fix',\n status: 'good',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#using-number-in-title',\n priority: 'high',\n fixPosition: 'meta title',\n title: 'Number in meta title',\n content: {\n good: 'Number is used effectively in the title tag.',\n improve: '',\n bad: 'No number found in title tag. Consider adding a number to make it more engaging.'\n }\n };\n\n this.identifier = 'numberTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const title = paper.getTitle();\n\n let status = '';\n if (!/\\d/.test(title)) {\n status = 'bad';\n }\n\n if (!title || /\\d/.test(title)) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,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DgB,gBAAgB,CAACO,OAAO,CAACL,gBAAgB,CAACM,IAAI,CAAC;IAE/C,OAAOR,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,eAAeA,CAACN,KAAK,EAAEE,IAAI,EAAE;IAC3B,MAAMX,KAAK,GAAGS,KAAK,CAACY,QAAQ,CAAC,CAAC;IAE9B,IAAIzB,MAAM,GAAG,EAAE;IACf,IAAI,CAAC,IAAI,CAAC0B,IAAI,CAACtB,KAAK,CAAC,EAAE;MACrBJ,MAAM,GAAG,KAAK;IAChB;IAEA,IAAI,CAACI,KAAK,IAAI,IAAI,CAACsB,IAAI,CAACtB,KAAK,CAAC,EAAE;MAC9BJ,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMqB,KAAK,GAAG,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACjB,OAAO,CAACR,QAAQ,EAAEF,MAAM,CAAC;IAE1D,OAAO;MACLqB,KAAK;MACLrB,MAAM;MACNwB,IAAI,eACFtC,MAAA,CAAAM,OAAA,CAAAoC,aAAA,CAAC3C,QAAA,CAAA4C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACpB,OAAO,CAACL,OAAO,CAACL,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACU,OAAO,CAACT,MAAM,iBAClBf,MAAA,CAAAM,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACrB,OAAO,CAACT,MAAO;QAAC+B,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACrB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACsB,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA5C,OAAA,GAAAC,2BAAA","ignoreList":[]}
1
+ {"version":3,"file":"NumberInMetaTitleAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","NumberInMetaTitleAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","status","docUrl","priority","fixPosition","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","setBody","body","getTitle","test","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/NumberInMetaTitleAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class NumberInMetaTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'numberTitle',\n ctaType: 'fix',\n status: 'good',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#using-number-in-title',\n priority: 'high',\n fixPosition: 'meta title',\n title: 'Number in meta title',\n content: {\n good: 'Number is used effectively in the title tag.',\n improve: '',\n bad: 'No number found in title tag. Consider adding a number to make it more engaging.'\n }\n };\n\n this.identifier = 'numberTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const title = paper.getTitle();\n\n let status = '';\n if (!/\\d/.test(title)) {\n status = 'bad';\n }\n\n if (!title || /\\d/.test(title)) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,2BAA2B,SAASC,mBAAU,CAAC;EAClE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,aAAa;MACjBC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,MAAM;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,sBAAsB;MAC7BC,OAAO,EAAE;QACPC,IAAI,EAA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AAAM,OAAA,CAAAoC,aAAA,CAAC3C,QAAA,CAAA4C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACpB,OAAO,CAACL,OAAO,CAACL,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACU,OAAO,CAACT,MAAM,iBAClBf,MAAA,CAAAM,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACrB,OAAO,CAACT,MAAO;QAAC+B,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DlB,IAAI,GAAGA,IAAI,CAACmB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACtB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACuB,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA7C,OAAA,GAAAC,2BAAA","ignoreList":[]}
@@ -106,7 +106,7 @@ class OutboundLinksAssessment extends _assessment.default {
106
106
  href: this._config.docUrl,
107
107
  target: "_blank",
108
108
  rel: "noreferrer"
109
- }, "Learn more"))
109
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
110
110
  };
111
111
  }
112
112
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_polarisIcons","e","__esModule","default","OutboundLinksAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","icon","ExternalIcon","title","priority","content","improve","good","bad","identifier","_config","merge","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isEmpty","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","externalTotal","externalNofollow","externalDofollow","getScore","createElement","Text","as","href","target","rel","exports"],"sources":["../../../../src/scoring/assessments/seo/OutboundLinksAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {ExternalIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment for calculating the outbound links in the text.\n */\nexport default class OutboundLinksAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'externalLinks',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',\n fixPosition: 'description',\n icon: ExternalIcon,\n title: 'External links',\n priority: 'high',\n content: {\n improve: '',\n good: 'External links are used effectively.',\n bad: 'No external links found. Add relevant links to be more authoritative and informative.'\n }\n };\n\n this.identifier = 'externalLinks';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the getLinkStatistics module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(linkStatistics, i18n);\n\n if (!isEmpty(linkStatistics)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n return assessmentResult;\n }\n\n /**\n * Checks whether paper has text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n\n /**\n *\n * @param linkStatistics\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(linkStatistics, i18n) {\n let status = '';\n if (linkStatistics.externalTotal === 0) {\n status = 'bad';\n } else if (linkStatistics.externalNofollow === linkStatistics.externalTotal) {\n status = 'bad';\n } else if (linkStatistics.externalDofollow < linkStatistics.externalTotal) {\n status = 'good';\n } else if (linkStatistics.externalDofollow === linkStatistics.externalTotal) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAoD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpD;AACA;AACA;AACe,MAAMG,uBAAuB,SAASC,mBAAU,CAAC;EAC9D;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,eAAe;MACnBC,MAAM,EACJ,2GAA2G;MAC7GC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAEC,0BAAY;MAClBC,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,IAAI,EAAE,sCAAsC;QAC5CC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,eAAe;IACjC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAA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AC3EL,MAAM,GAAG,MAAM;IACjB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACU,QAAQ,CAAC,IAAI,CAACxB,OAAO,CAACN,QAAQ,EAAEsB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF5C,MAAA,CAAAQ,OAAA,CAAA2C,aAAA,CAACjD,QAAA,CAAAkD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC3B,OAAO,CAACL,OAAO,CAACqB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAAChB,OAAO,CAACX,MAAM,iBAClBf,MAAA,CAAAQ,OAAA,CAAA2C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC5B,OAAO,CAACX,MAAO;QAACwC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;AACF;AAACC,OAAA,CAAAjD,OAAA,GAAAC,uBAAA","ignoreList":[]}
1
+ {"version":3,"file":"OutboundLinksAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_assessment","_AssessmentResult","_polarisIcons","e","__esModule","default","OutboundLinksAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","icon","ExternalIcon","title","priority","content","improve","good","bad","identifier","_config","merge","getResult","paper","researcher","i18n","linkStatistics","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isEmpty","setScore","score","setStatus","status","setBody","body","isApplicable","hasText","externalTotal","externalNofollow","externalDofollow","getScore","createElement","Text","as","href","target","rel","translate","exports"],"sources":["../../../../src/scoring/assessments/seo/OutboundLinksAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {ExternalIcon} from '@shopify/polaris-icons';\n\n/**\n * Assessment for calculating the outbound links in the text.\n */\nexport default class OutboundLinksAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'externalLinks',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#internal-links-outbound-links',\n fixPosition: 'description',\n icon: ExternalIcon,\n title: 'External links',\n priority: 'high',\n content: {\n improve: '',\n good: 'External links are used effectively.',\n bad: 'No external links found. Add relevant links to be more authoritative and informative.'\n }\n };\n\n this.identifier = 'externalLinks';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the getLinkStatistics module, based on this returns an assessment result with score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling research.\n *\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const linkStatistics = researcher.getResearch('getLinkStatistics');\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(linkStatistics, i18n);\n\n if (!isEmpty(linkStatistics)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n return assessmentResult;\n }\n\n /**\n * Checks whether paper has text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n\n /**\n *\n * @param linkStatistics\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(linkStatistics, i18n) {\n let status = '';\n if (linkStatistics.externalTotal === 0) {\n status = 'bad';\n } else if (linkStatistics.externalNofollow === linkStatistics.externalTotal) {\n status = 'bad';\n } else if (linkStatistics.externalDofollow < linkStatistics.externalTotal) {\n status = 'good';\n } else if (linkStatistics.externalDofollow === linkStatistics.externalTotal) {\n status = 'good';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAoD,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpD;AACA;AACA;AACe,MAAMG,uBAAuB,SAASC,mBAAU,CAAC;EAC9D;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,eAAe;MACnBC,MAAM,EACJ,2GAA2G;MAC7GC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAEC,0BAAY;MAClBC,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,IAAI,EAAE,sCAAsC;QAC5CC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,eAAe;IACjC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAM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OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF5C,MAAA,CAAAQ,OAAA,CAAA2C,aAAA,CAACjD,QAAA,CAAAkD,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAAC3B,OAAO,CAACL,OAAO,CAACqB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAAChB,OAAO,CAACX,MAAM,iBAClBf,MAAA,CAAAQ,OAAA,CAAA2C,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC5B,OAAO,CAACX,MAAO;QAACwC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DzB,IAAI,GAAGA,IAAI,CAAC0B,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;AACF;AAACC,OAAA,CAAAlD,OAAA,GAAAC,uBAAA","ignoreList":[]}
@@ -87,7 +87,7 @@ class PageTitleWidthAssessment extends _assessment.default {
87
87
  href: this._config.docUrl,
88
88
  target: "_blank",
89
89
  rel: "noreferrer"
90
- }, "Learn more"))
90
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
91
91
  };
92
92
  }
93
93
 
@@ -1 +1 @@
1
- {"version":3,"file":"PageTitleWidthAssessment.js","names":["_lodash","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","PageTitleWidthAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getTitle","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/PageTitleWidthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class PageTitleWidthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleWidth',\n fixPosition: 'meta title',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#title-width',\n ctaType: 'fix',\n priority: 'high',\n title: 'Meta title width',\n content: {\n good: 'Title width is optimized, between 50 - 70 characters.',\n improve: '',\n bad:\n 'Title too long or too short. Aim for 50-70 characters for best display in search results.'\n }\n };\n\n this.identifier = 'titleWidth';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getTitle().length;\n\n let status = '';\n if (length <= 70 && length >= 50) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}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","require","_polaris","_react","_interopRequireDefault","_assessment","_AssessmentResult","e","__esModule","default","PageTitleWidthAssessment","Assessment","constructor","config","defaultConfig","id","fixPosition","docUrl","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","length","getTitle","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasTitle","exports"],"sources":["../../../../src/scoring/assessments/seo/PageTitleWidthAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport {Text} from '@shopify/polaris';\nimport React from 'react';\n\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that assesses the SEO title width and gives the feedback accordingly.\n */\nexport default class PageTitleWidthAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} [config] The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'titleWidth',\n fixPosition: 'meta title',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#title-width',\n ctaType: 'fix',\n priority: 'high',\n title: 'Meta title width',\n content: {\n good: 'Title width is optimized, between 50 - 70 characters.',\n improve: '',\n bad:\n 'Title too long or too short. Aim for 50-70 characters for best display in search results.'\n }\n };\n\n this.identifier = 'titleWidth';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n const length = paper.getTitle().length;\n\n let status = '';\n if (length <= 70 && length >= 50) {\n status = 'good';\n } else {\n status = 'bad';\n }\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAgE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,wBAAwB,SAASC,mBAAU,CAAC;EAC/D;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,YAAY;MAChBC,WAAW,EAAE,YAAY;MACzBC,MAAM,EACJ,yFAAyF;MAC3FC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,kBAAkB;MACzBC,OAAO,EAAE;QACPC,IAAI,EAAE,uDAAuD;QAC7DC,OAAO,EAAE,EAAE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AO,CAACL,OAAO,CAACkB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACb,OAAO,CAACT,MAAM,iBAClBd,MAAA,CAAAM,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACtB,OAAO,CAACT,MAAO;QAACgC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DnB,IAAI,GAAGA,IAAI,CAACoB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACvB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACwB,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA7C,OAAA,GAAAC,wBAAA","ignoreList":[]}
@@ -42,9 +42,10 @@ class SchemaAssessment extends _assessment.default {
42
42
  /**
43
43
  *
44
44
  * @param paper
45
+ * @param i18n
45
46
  * @returns {{score: number, body: React.JSX.Element, status: string}}
46
47
  */
47
- calculateResult(paper) {
48
+ calculateResult(paper, i18n) {
48
49
  let status = '';
49
50
  const url = paper.getSlug();
50
51
  const shopSettings = paper.getShopSettings();
@@ -72,7 +73,7 @@ class SchemaAssessment extends _assessment.default {
72
73
  href: this._config.docUrl,
73
74
  target: "_blank",
74
75
  rel: "noreferrer"
75
- }, "Learn more"))
76
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
76
77
  };
77
78
  }
78
79
 
@@ -89,7 +90,7 @@ class SchemaAssessment extends _assessment.default {
89
90
  researcher,
90
91
  i18n
91
92
  }) {
92
- const calculatedResult = this.calculateResult(paper);
93
+ const calculatedResult = this.calculateResult(paper, i18n);
93
94
  const assessmentResult = new _AssessmentResult.default({
94
95
  config: this._config
95
96
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_AssessmentResult","_assessment","e","__esModule","default","SchemaAssessment","Assessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","status","url","getSlug","shopSettings","getShopSettings","includes","hasProductSchema","blogPostsAndArticle","score","getScore","body","createElement","Text","as","href","target","rel","getResult","researcher","i18n","calculatedResult","assessmentResult","AssessmentResult","setStatus","setBody","isApplicable","hasShopSettings","hasSlug","exports"],"sources":["../../../../src/scoring/assessments/seo/SchemaAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks shop has schema.\n */\nexport default class SchemaAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'schema',\n priority: 'high',\n docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#schema',\n ctaType: 'contactUs',\n title: 'Schema',\n content: {\n good: 'Schema markup is applied effectively.',\n improve: '',\n bad: 'No schema markup applied. Add schema to optimize visibility for search engines.'\n }\n };\n\n this.identifier = 'schema';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param paper\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper) {\n let status = '';\n const url = paper.getSlug();\n const shopSettings = paper.getShopSettings();\n if (url.includes('product') || url.includes('collection')) {\n if (paper.hasProductSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n if (url.includes('blogs')) {\n if (shopSettings?.blogPostsAndArticle?.status) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param config\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const calculatedResult = this.calculateResult(paper);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the sentence beginnings assessment is applicable to the paper.\n *\n * @param {Object} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n * @returns {boolean} Returns true if the language is available and the paper is not empty.\n */\n isApplicable(paper, researcher) {\n return paper.hasShopSettings() && paper.hasSlug();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvC;AACA;AACA;AACe,MAAMG,gBAAgB,SAASC,mBAAU,CAAC;EACvD;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,QAAQ;MACZC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE,oFAAoF;MAC5FC,OAAO,EAAE,WAAW;MACpBC,KAAK,EAAE,QAAQ;MACfC,OAAO,EAAE;QACPC,IAAI,EAAE,uCAAuC;QAC7CC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,QAAQ;IA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ACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,SAASA,CAAC;IAAClB,KAAK;IAAEmB,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,MAAMC,gBAAgB,GAAG,IAAI,CAACtB,eAAe,CAACC,KAAK,CAAC;IACpD,MAAMsB,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAACtC,MAAM,EAAE,IAAI,CAACY;IAAO,CAAC,CAAC;IAErEyB,gBAAgB,CAACE,SAAS,CAACH,gBAAgB,CAACpB,MAAM,CAAC;IACnDqB,gBAAgB,CAACE,SAAS,CAACH,gBAAgB,CAACpB,MAAM,CAAC;IACnDqB,gBAAgB,CAACG,OAAO,CAACJ,gBAAgB,CAACV,IAAI,CAAC;IAE/C,OAAOW,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAAC1B,KAAK,EAAEmB,UAAU,EAAE;IAC9B,OAAOnB,KAAK,CAAC2B,eAAe,CAAC,CAAC,IAAI3B,KAAK,CAAC4B,OAAO,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAAhD,OAAA,GAAAC,gBAAA","ignoreList":[]}
1
+ {"version":3,"file":"SchemaAssessment.js","names":["_lodash","require","_react","_interopRequireDefault","_polaris","_AssessmentResult","_assessment","e","__esModule","default","SchemaAssessment","Assessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","merge","calculateResult","paper","i18n","status","url","getSlug","shopSettings","getShopSettings","includes","hasProductSchema","blogPostsAndArticle","score","getScore","body","createElement","Text","as","href","target","rel","translate","getResult","researcher","calculatedResult","assessmentResult","AssessmentResult","setStatus","setBody","isApplicable","hasShopSettings","hasSlug","exports"],"sources":["../../../../src/scoring/assessments/seo/SchemaAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks shop has schema.\n */\nexport default class SchemaAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'schema',\n priority: 'high',\n docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#schema',\n ctaType: 'contactUs',\n title: 'Schema',\n content: {\n good: 'Schema markup is applied effectively.',\n improve: '',\n bad: 'No schema markup applied. Add schema to optimize visibility for search engines.'\n }\n };\n\n this.identifier = 'schema';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n const url = paper.getSlug();\n const shopSettings = paper.getShopSettings();\n if (url.includes('product') || url.includes('collection')) {\n if (paper.hasProductSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n if (url.includes('blogs')) {\n if (shopSettings?.blogPostsAndArticle?.status) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param config\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const calculatedResult = this.calculateResult(paper, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the sentence beginnings assessment is applicable to the paper.\n *\n * @param {Object} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n * @returns {boolean} Returns true if the language is available and the paper is not empty.\n */\n isApplicable(paper, researcher) {\n return paper.hasShopSettings() && paper.hasSlug();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvC;AACA;AACA;AACe,MAAMG,gBAAgB,SAASC,mBAAU,CAAC;EACvD;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,QAAQ;MACZC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE,oFAAoF;MAC5FC,OAAO,EAAE,WAAW;MACpBC,KAAK,EAAE,QAAQ;MACfC,OAAO,EAAE;QACPC,IAAI,EAAE,uCAAuC;QAC7CC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,QAAQ;IAC1B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACZ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEc,eAAeA,CAACC,KAAK,EAAEC,IAAI,EAAE;IAC3B,IAAIC,MAAM,GAAG,EAAE;IACf,MAAMC,GAAG,GAAGH,KAAK,CAACI,OAAO,CAAC,CAAC;IAC3B,MAAMC,YAAY,GAAGL,KAAK,CAACM,eAAe,CAAC,CAAC;IAC5C,IAAIH,GAAG,CAACI,QA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vC,MAAM,EAAE,IAAI,CAACY;IAAO,CAAC,CAAC;IAErE0B,gBAAgB,CAACE,SAAS,CAACH,gBAAgB,CAACpB,MAAM,CAAC;IACnDqB,gBAAgB,CAACE,SAAS,CAACH,gBAAgB,CAACpB,MAAM,CAAC;IACnDqB,gBAAgB,CAACG,OAAO,CAACJ,gBAAgB,CAACV,IAAI,CAAC;IAE/C,OAAOW,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAAC3B,KAAK,EAAEqB,UAAU,EAAE;IAC9B,OAAOrB,KAAK,CAAC4B,eAAe,CAAC,CAAC,IAAI5B,KAAK,CAAC6B,OAAO,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAAjD,OAAA,GAAAC,gBAAA","ignoreList":[]}
@@ -95,7 +95,7 @@ class SingleH1Assessment extends _assessment.default {
95
95
  href: this._config.docUrl,
96
96
  target: "_blank",
97
97
  rel: "noreferrer"
98
- }, "Learn more"))
98
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
99
99
  };
100
100
  }
101
101
 
@@ -1 +1 @@
1
- {"version":3,"file":"SingleH1Assessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleH1Assessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","_h1Count","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","htmlString","getText","desHasH1Tag","includes","getScore","createElement","Text","as","href","target","rel","isApplicable","hasText","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleH1Assessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleH1Assessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleH1',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n fixPosition: 'description',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'H1 tag',\n content: {\n good: 'H1 tag is optimized.',\n improve: 'You should use only one H1 tag',\n bad: 'Missing H1 tag. Add one H1 to clearly define your page`s topic.'\n }\n };\n\n this.identifier = 'singleH1';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._h1Count = researcher.getResearch('h1s');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const htmlString = paper.getText();\n const desHasH1Tag = htmlString.includes('<h1>');\n\n let status = '';\n if (this._h1Count === 1) {\n status = 'good';\n }\n\n if (this._h1Count === 0 && !desHasH1Tag) {\n status = 'good';\n }\n\n if (this._h1Count > 1) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n}\n\nexport default SingleH1Assessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE;AACA;AACA;AACA;AACA,MAAMG,kBAAkB,SAASC,mBAAU,CAAC;EAC1C;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,UAAU;MACdC,MAAM,EAAE,yCAAyC;MACjDC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,WAAW;MACpBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,QAAQ;MACfC,OAAO,EAAE;QACPC,IAAI,EAAE,sBAAsB;QAC5BC,OAAO,EAAE,gCAAgC;QACzCC,GAAG,EAAE;MACP;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,UAAU;IAC5B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAAEC,UAAU;IAAEC;EAAI,CAAC,EAAE;IACnC,IAAI,CAACC,QAAQ,GAAGF,UAAU,CAACG,WAAW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AACL,OAAO,CAACqB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAAChB,OAAO,CAACV,MAAM,iBAClBhB,MAAA,CAAAS,OAAA,CAAAyC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAAC3B,OAAO,CAACV,MAAO;QAACsC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC3B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC4B,OAAO,CAAC,CAAC;EACxB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEcC,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"SingleH1Assessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleH1Assessment","Assessment","constructor","config","defaultConfig","id","docUrl","fixPosition","ctaType","priority","title","content","good","improve","bad","identifier","_config","merge","getResult","paper","researcher","i18n","_h1Count","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","htmlString","getText","desHasH1Tag","includes","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasText","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleH1Assessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleH1Assessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleH1',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n fixPosition: 'description',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'H1 tag',\n content: {\n good: 'H1 tag is optimized.',\n improve: 'You should use only one H1 tag',\n bad: 'Missing H1 tag. Add one H1 to clearly define your page`s topic.'\n }\n };\n\n this.identifier = 'singleH1';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._h1Count = researcher.getResearch('h1s');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const htmlString = paper.getText();\n const desHasH1Tag = htmlString.includes('<h1>');\n\n let status = '';\n if (this._h1Count === 1) {\n status = 'good';\n }\n\n if (this._h1Count === 0 && !desHasH1Tag) {\n status = 'good';\n }\n\n if (this._h1Count > 1) {\n status = 'improve';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasText();\n }\n}\n\nexport default SingleH1Assessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAA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;QAACC,GAAG,EAAC;MAAY,GAC3DxB,IAAI,GAAGA,IAAI,CAACyB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAAC5B,KAAK,EAAE;IAClB,OAAOA,KAAK,CAAC6B,OAAO,CAAC,CAAC;EACxB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnD,OAAA,GAEcC,kBAAkB","ignoreList":[]}
@@ -88,7 +88,7 @@ class SingleTitleAssessment extends _assessment.default {
88
88
  href: this._config.docUrl,
89
89
  target: "_blank",
90
90
  rel: "noreferrer"
91
- }, "Learn more"))
91
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
92
92
  };
93
93
  }
94
94
 
@@ -1 +1 @@
1
- {"version":3,"file":"SingleTitleAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleTitleAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","ctaType","priority","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","count","getTitleCount","getScore","createElement","Text","as","href","target","rel","isApplicable","hasTitle","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleTitleAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleTitle',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'Duplicate title',\n content: {\n improve: '',\n bad: 'Found duplicate titles. Check your content and create unique titles.',\n good: 'No duplicate titles found.'\n }\n };\n\n this.identifier = 'singleTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const count = paper.getTitleCount();\n\n let status = '';\n if (count === 1) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n\nexport default SingleTitleAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,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AOV,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACEG,eAAeA,CAACN,KAAK,EAAEE,IAAI,EAAE;IAC3B,MAAMY,KAAK,GAAGd,KAAK,CAACe,aAAa,CAAC,CAAC;IAEnC,IAAIJ,MAAM,GAAG,EAAE;IACf,IAAIG,KAAK,KAAK,CAAC,EAAE;MACfH,MAAM,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACO,QAAQ,CAAC,IAAI,CAACnB,OAAO,CAACP,QAAQ,EAAEqB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACFzC,MAAA,CAAAS,OAAA,CAAAoC,aAAA,CAAC1C,QAAA,CAAA2C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACtB,OAAO,CAACL,OAAO,CAACmB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACd,OAAO,CAACT,MAAM,iBAClBhB,MAAA,CAAAS,OAAA,CAAAoC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACvB,OAAO,CAACT,MAAO;QAACiC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACvB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACwB,QAAQ,CAAC,CAAC;EACzB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAEcC,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"SingleTitleAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SingleTitleAssessment","Assessment","constructor","config","defaultConfig","id","docUrl","ctaType","priority","title","content","improve","bad","good","identifier","_config","merge","getResult","paper","researcher","i18n","assessmentResult","AssessmentResult","calculatedResult","calculateResult","isUndefined","setScore","score","setStatus","status","setBody","body","count","getTitleCount","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasTitle","_default","exports"],"sources":["../../../../src/scoring/assessments/seo/SingleTitleAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {isUndefined, merge} from 'lodash';\n\nimport Assessment from '../assessment.js';\nimport AssessmentResult from '../../../values/AssessmentResult.js';\n\n/**\n * Assessment to check whether the body of the text contains more than 1 H1s in the body.\n * This assessment doesn't penalize H1 that is not in the very beginning of the body.\n */\nclass SingleTitleAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {Object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'singleTitle',\n docUrl: 'https://help.seoon.io/seo/seo-checklist',\n ctaType: 'contactUs',\n priority: 'high',\n title: 'Duplicate title',\n content: {\n improve: '',\n bad: 'Found duplicate titles. Check your content and create unique titles.',\n good: 'No duplicate titles found.'\n }\n };\n\n this.identifier = 'singleTitle';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n if (!isUndefined(calculatedResult)) {\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n }\n\n return assessmentResult;\n }\n\n /**\n * Returns the score and the feedback string for the single H1 assessment.\n *\n * @returns {Object|null} The calculated score and the feedback string.\n */\n calculateResult(paper, i18n) {\n const count = paper.getTitleCount();\n\n let status = '';\n if (count === 1) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasTitle();\n }\n}\n\nexport default SingleTitleAssessment;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE;AACA;AACA;AACA;AACA,MAAMG,qBAAqB,SAASC,mBAAU,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,aAAa;MACjBC,MAAM,EAAE,yCAAyC;MACjDC,OAAO,EAAE,WAAW;MACpBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,iBAAiB;MACxBC,OAAO,EAAE;QACPC,OAAO,EAAE,EAAE;QACXC,GAAG,EAAE,sEAAsE;QAC3EC,IAAI,EAAE;MACR;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,aAAa;IAC/B,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACZ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AAC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AAE,IAAI,CAACvB,OAAO,CAACT,MAAO;QAACiC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DpB,IAAI,GAAGA,IAAI,CAACqB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACxB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACyB,QAAQ,CAAC,CAAC;EACzB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEcC,qBAAqB","ignoreList":[]}
@@ -9,7 +9,6 @@ var _polaris = require("@shopify/polaris");
9
9
  var _lodash = require("lodash");
10
10
  var _assessment = _interopRequireDefault(require("../assessment"));
11
11
  var _AssessmentResult = _interopRequireDefault(require("../../../values/AssessmentResult"));
12
- var _helpers = require("../../../helpers");
13
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
13
  /**
15
14
  * Represents the assessment that checks if the keyword is present in one of the subheadings.
@@ -88,7 +87,7 @@ class SubHeadingsKeywordAssessment extends _assessment.default {
88
87
  href: this._config.docUrl,
89
88
  target: "_blank",
90
89
  rel: "noreferrer"
91
- }, "Learn more"))
90
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
92
91
  };
93
92
  }
94
93
 
@@ -1 +1 @@
1
- {"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","_helpers","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport {containsKeywordInSubheadings} from '../../../helpers';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n if (this._subHeadings.match > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n Learn more\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA8D,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9D;AACA;AACA;AACe,MAAMG,4BAA4B,SAASC,mBAAU,CAAC;EACnE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,oBAAoB;MACxBC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,mGAAmG;MACrGC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,YAAY;MACzBC,KAAK,EAAE,uBAAuB;MAC9BC,OAAO,EAAE;QACPC,IAAI,EAAE,uCAAuC;QAC7CC,GAAG,EACD,6FAA6F;QAC/FC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAG,oBAAoB;IACtC,IAAI,CAACC,OAAO,GAAG,IAAAC,aAAK,EAACb,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEe,SAASA,CAAC;IAACC,KAAK;IAA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GAAC,YAE5D,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACvB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACwB,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAA7C,OAAA,GAAAC,4BAAA","ignoreList":[]}
1
+ {"version":3,"file":"SubHeadingsKeywordAssessment.js","names":["_react","_interopRequireDefault","require","_polaris","_lodash","_assessment","_AssessmentResult","e","__esModule","default","SubHeadingsKeywordAssessment","Assessment","constructor","config","defaultConfig","id","ctaType","docUrl","priority","fixPosition","title","content","good","bad","improve","identifier","_config","merge","getResult","paper","researcher","i18n","_subHeadings","getResearch","assessmentResult","AssessmentResult","calculatedResult","calculateResult","setScore","score","setStatus","status","setBody","body","match","getScore","createElement","Text","as","href","target","rel","translate","isApplicable","hasKeyword","exports"],"sources":["../../../../src/scoring/assessments/seo/SubHeadingsKeywordAssessment.js"],"sourcesContent":["import React from 'react';\nimport {Text} from '@shopify/polaris';\n\nimport {merge} from 'lodash';\nimport Assessment from '../assessment';\nimport AssessmentResult from '../../../values/AssessmentResult';\n\n/**\n * Represents the assessment that checks if the keyword is present in one of the subheadings.\n */\nexport default class SubHeadingsKeywordAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'subheadingsKeyword',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#keyword-in-subheading',\n priority: 'medium',\n fixPosition: 'subheading',\n title: 'Keyword in Subheading',\n content: {\n good: 'Keywords are included in subheadings.',\n bad:\n 'Keyword not found in any subheadings. Include it in at least one subheading (H2, H3, etc.).',\n improve: ''\n }\n };\n\n this.identifier = 'subheadingsKeyword';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n * Runs the h1 research and based on this returns an assessment result with a score.\n *\n * @param {Paper} paper The paper to use for the assessment.\n * @param {Researcher} researcher The researcher used for calling the research.\n * @param i18n\n * @returns {AssessmentResult} The assessment result.\n */\n getResult({paper, researcher, i18n}) {\n this._subHeadings = researcher.getResearch('matchKeywordInSubheadings');\n\n const assessmentResult = new AssessmentResult({config: this._config});\n\n const calculatedResult = this.calculateResult(paper, i18n);\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n if (this._subHeadings.match > 0) {\n status = 'good';\n } else {\n status = 'bad';\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n * Checks whether the paper has a text.\n *\n * @param {Paper} paper The paper to use for the assessment.\n *\n * @returns {boolean} True when there is text.\n */\n isApplicable(paper) {\n return paper.hasKeyword();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACe,MAAMG,4BAA4B,SAASC,mBAAU,CAAC;EACnE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,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,GAAG,MAAM;IACjB,CAAC,MAAM;MACLA,MAAM,GAAG,KAAK;IAChB;IAEA,MAAMF,KAAK,GAAG,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACnB,OAAO,CAACR,QAAQ,EAAEuB,MAAM,CAAC;IAE1D,OAAO;MACLF,KAAK;MACLE,MAAM;MACNE,IAAI,eACF3C,MAAA,CAAAS,OAAA,CAAAqC,aAAA,CAAC3C,QAAA,CAAA4C,IAAI;QAACC,EAAE,EAAE;MAAO,GACd,IAAI,CAACtB,OAAO,CAACL,OAAO,CAACoB,MAAM,CAAC,EAAE,GAAG,EACjC,IAAI,CAACf,OAAO,CAACT,MAAM,iBAClBjB,MAAA,CAAAS,OAAA,CAAAqC,aAAA;QAAGG,IAAI,EAAE,IAAI,CAACvB,OAAO,CAACT,MAAO;QAACiC,MAAM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3DpB,IAAI,GAAGA,IAAI,CAACqB,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,YAAYA,CAACxB,KAAK,EAAE;IAClB,OAAOA,KAAK,CAACyB,UAAU,CAAC,CAAC;EAC3B;AACF;AAACC,OAAA,CAAA9C,OAAA,GAAAC,4BAAA","ignoreList":[]}
@@ -92,7 +92,7 @@ class TextImagesAssessment extends _assessment.default {
92
92
  href: this._config.docUrl,
93
93
  target: "_blank",
94
94
  rel: "noreferrer"
95
- }, "Learn more"))
95
+ }, i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'))
96
96
  };
97
97
  }
98
98