diff --git a/code/SeoObjectExtension.php b/code/SeoObjectExtension.php index bfcc737..49d4638 100644 --- a/code/SeoObjectExtension.php +++ b/code/SeoObjectExtension.php @@ -164,14 +164,18 @@ public function updateCMSFields(FieldList $fields) { /** * getHTMLStars. - * Get html of stars rating in CMS + * Get html of stars rating in CMS, maximum score is 12 + * threshold 2 * * @param none * @return String $html */ public function getHTMLStars() { - $num_stars = intval(ceil($this->seo_score) / 2); + $treshold_score = $this->seo_score - 2 < 0 ? 0 : $this->seo_score - 2; + + $num_stars = intval(ceil($treshold_score) / 2); + $num_nostars = 5 - $num_stars; $html = '
'; @@ -179,7 +183,7 @@ public function getHTMLStars() { for ($i = 1; $i <= $num_stars; $i++) { $html .= '
'; } - if ($this->seo_score % 2) { + if ($treshold_score % 2) { $html .= '
'; $num_nostars--; } @@ -230,10 +234,10 @@ public function getHTMLSimplePageSubjectTest() { /** * getSEOScoreCalculation. - * Do SEO score calculation and set class Array score_criteria 10 corresponding assoc values - * Also set class Integer seo_score with score 0-10 based on values which are true in score_criteria array + * Do SEO score calculation and set class Array score_criteria 12 corresponding assoc values + * Also set class Integer seo_score with score 0-12 based on values which are true in score_criteria array * Do SEO score calculation and set class Array score_criteria 11 corresponding assoc values - * Also set class Integer seo_score with score 0-11 based on values which are true in score_criteria array + * Also set class Integer seo_score with score 0-12 based on values which are true in score_criteria array * * @param none * @return none, set class array score_criteria tips boolean diff --git a/lang/en.yml b/lang/en.yml index 9b8472b..a77e994 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -26,5 +26,7 @@ en: SEOSubjectCheckPageContent: 'Page content:' SEOSubjectCheckPageURL: 'Page URL:' SEOSubjectCheckPageMetaDescription: 'Page meta description:' + SEOSubjectCheckIntro: 'Your page subject is found in:' SEOGoogleWebmasterMetaTag: 'Google webmaster meta tag' - SEOGoogleWebmasterMetaTagRightTitle: 'Full Google webmaster meta tag For example <meta name="google-site-verification" content="hjhjhJHG12736JHGdfsdf" >' \ No newline at end of file + SEOGoogleWebmasterMetaTagRightTitle: 'Full Google webmaster meta tag For example <meta name="google-site-verification" content="hjhjhJHG12736JHGdfsdf" >' + SEOScoreTipImagesHaveTitleTags: 'All images on this page do not have title tags' \ No newline at end of file diff --git a/lang/nl.yml b/lang/nl.yml index 49ff2c9..06344e9 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -28,4 +28,5 @@ nl: SEOSubjectCheckPageMetaDescription: 'Pagina meta omschrijving:' SEOSubjectCheckIntro: 'Je pagina onderwerp is gevonden in:' SEOGoogleWebmasterMetaTag: 'Google webmaster meta tag' - SEOGoogleWebmasterMetaTagRightTitle: 'Full Google webmaster meta tag. Bijvoorbeeld <meta name="google-site-verification" content="hjhjhJHG12736JHGdfsdf" >' \ No newline at end of file + SEOGoogleWebmasterMetaTagRightTitle: 'Full Google webmaster meta tag. Bijvoorbeeld <meta name="google-site-verification" content="hjhjhJHG12736JHGdfsdf" >' + SEOScoreTipImagesHaveTitleTags: 'Alle afbeeldingen op deze pagina hebben geen title tags' \ No newline at end of file