diff --git a/resources/lang/en.json b/resources/lang/en.json index b659679d..751d3be6 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -1,4 +1,28 @@ { + "All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.": "All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.", + "CSS files are not bigger than 15 KB because this will slow down the page load time.": "CSS files are not bigger than 15 KB because this will slow down the page load time.", + "Every image on the page should have an alt tag to describe the image.": "Every image on the page should have an alt tag to describe the image.", + "HTML is not larger than 100 KB because this will slow down the page load time.": "HTML is not larger than 100 KB because this will slow down the page load time.", + "Images are not larger than 1 MB because this will slow down the page load time.": "Images are not larger than 1 MB because this will slow down the page load time.", + "Javascript files are not bigger than 1 MB because this will slow down the page load time.": "Javascript files are not bigger than 1 MB because this will slow down the page load time.", + "The HTML of the page should be GZIP compressed to reduce the size of the response.": "The HTML of the page should be GZIP compressed to reduce the size of the response.", + "The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.": "The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.", + "The content should contain at least 30% transition words.": "The content should contain at least 30% transition words.", + "The content should not contain sentences with more than 20 words.": "The content should not contain sentences with more than 20 words.", + "The focus keyword should be in the first paragraph of the content because this is the most important part of the content.": "The focus keyword should be in the first paragraph of the content because this is the most important part of the content.", + "The focus keyword should be in the title of the page because the visitor will see this in the search results.": "The focus keyword should be in the title of the page because the visitor will see this in the search results.", + "The lang attribute should be set because this is used by search engines to determine the language of the page.": "The lang attribute should be set because this is used by search engines to determine the language of the page.", + "The length of the content should be at least 2100 characters.": "The length of the content should be at least 2100 characters.", + "The meta description is used by search engines to show a description of the page in the search results.": "The meta description is used by search engines to show a description of the page in the search results.", + "The page response should return a 200 status code because this means the page is available.": "The page response should return a 200 status code because this means the page is available.", + "The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.": "The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.", + "The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.": "The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.", + "The page should not contain any broken images because it is bad for the user experience.": "The page should not contain any broken images because it is bad for the user experience.", + "The page should not contain any broken links because it is bad for the user experience.": "The page should not contain any broken links because it is bad for the user experience.", + "The robots.txt file should allow indexing of the page.": "The robots.txt file should allow indexing of the page.", + "The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.": "The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.", + "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.": "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.", + "When the page has the 'noindex' tag or meta tag set, search engines will not index the page.": "When the page has the 'noindex' tag or meta tag set, search engines will not index the page.", "accordingly": "accordingly", "additionally": "additionally", "admittedly": "admittedly", diff --git a/resources/lang/nl.json b/resources/lang/nl.json index d2d7d570..7d34a546 100644 --- a/resources/lang/nl.json +++ b/resources/lang/nl.json @@ -1,4 +1,28 @@ { + "All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.": "Alle links op de pagina moeten doorverwijzen naar een URL met HTTPS in plaats van HTTP omdat dit veiliger is.", + "CSS files are not bigger than 15 KB because this will slow down the page load time.": "CSS-bestanden zijn niet groter dan 15 KB omdat dit de laadtijd van de pagina zal vertragen.", + "Every image on the page should have an alt tag to describe the image.": "Elke afbeelding op de pagina moet een alt-tag hebben om de afbeelding te beschrijven.", + "HTML is not larger than 100 KB because this will slow down the page load time.": "HTML is niet groter dan 100 KB omdat dit de laadtijd van de pagina zal vertragen.", + "Images are not larger than 1 MB because this will slow down the page load time.": "Afbeeldingen zijn niet groter dan 1 MB omdat dit de laadtijd van de pagina zal vertragen.", + "Javascript files are not bigger than 1 MB because this will slow down the page load time.": "Javascript-bestanden zijn niet groter dan 1 MB omdat dit de laadtijd van de pagina zal vertragen.", + "The HTML of the page should be GZIP compressed to reduce the size of the response.": "De HTML van de pagina moet GZIP-gecomprimeerd zijn om de grootte van de response te verkleinen.", + "The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.": "De Time To First Byte (TTFB) moet onder de 600 ms zijn, omdat dit de laadtijd van de pagina zal verbeteren.", + "The content should contain at least 30% transition words.": "De inhoud moet ten minste 30% overgangswoorden bevatten.", + "The content should not contain sentences with more than 20 words.": "De inhoud mag geen zinnen bevatten met meer dan 20 woorden.", + "The focus keyword should be in the first paragraph of the content because this is the most important part of the content.": "Het focus-trefwoord moet in de eerste alinea van de inhoud staan omdat dit het belangrijkste deel van de inhoud is.", + "The focus keyword should be in the title of the page because the visitor will see this in the search results.": "Het focus-trefwoord moet in de titel van de pagina staan omdat de bezoeker dit in de zoekresultaten zal zien.", + "The lang attribute should be set because this is used by search engines to determine the language of the page.": "Het lang-attribuut moet worden ingesteld omdat dit door zoekmachines wordt gebruikt om de taal van de pagina te bepalen.", + "The length of the content should be at least 2100 characters.": "De lengte van de inhoud moet ten minste 2100 tekens zijn.", + "The meta description is used by search engines to show a description of the page in the search results.": "De meta-beschrijving wordt door zoekmachines gebruikt om een beschrijving van de pagina in de zoekresultaten weer te geven.", + "The page response should return a 200 status code because this means the page is available.": "De pagina moet een 200 statuscode retourneren, omdat dit betekent dat de pagina beschikbaar is.", + "The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.": "De pagina moet een Open Graph-afbeelding hebben omdat dit de afbeelding is die wordt gebruikt wanneer de pagina wordt gedeeld op sociale media.", + "The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.": "De pagina moet slechts één H1-tag hebben omdat er slechts één hoofdonderwerp op de pagina moet zijn. De H1-tag moet worden gebruikt om het hoofdonderwerp van de pagina te beschrijven. De H1-tag wordt ook door zoekmachines gebruikt om het onderwerp van de pagina te bepalen.", + "The page should not contain any broken images because it is bad for the user experience.": "De pagina mag geen kapotte afbeeldingen bevatten omdat dit slecht is voor de gebruikerservaring.", + "The page should not contain any broken links because it is bad for the user experience.": "De pagina mag geen kapotte links bevatten omdat dit slecht is voor de gebruikerservaring.", + "The robots.txt file should allow indexing of the page.": "Het robots.txt-bestand moet indexering van de pagina toestaan.", + "The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.": "De titel van de pagina mag niet langer zijn dan 60 tekens omdat dit de maximale lengte is die in de zoekresultaten wordt weergegeven.", + "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.": "Wanneer de pagina de 'nofollow'-tag of meta-tag heeft, zullen zoekmachines de links op de pagina niet volgen.", + "When the page has the 'noindex' tag or meta tag set, search engines will not index the page.": "Wanneer de pagina de 'noindex'-tag of meta-tag heeft, zullen zoekmachines de pagina niet indexeren.", "accordingly": "overeenkomstig", "additionally": "daarnaast", "admittedly": "toegegeven", @@ -114,4 +138,4 @@ "while it is true": "terwijl het waar is", "without a doubt": "zonder twijfel", "yet": "toch" -} +} \ No newline at end of file diff --git a/src/Checks/Configuration/NoFollowCheck.php b/src/Checks/Configuration/NoFollowCheck.php index 5ba3d3f7..cdb9a2d0 100644 --- a/src/Checks/Configuration/NoFollowCheck.php +++ b/src/Checks/Configuration/NoFollowCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class NoFollowCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = "The page does not have 'nofollow' set"; + public string $description = "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page."; + public string $priority = 'low'; public int $timeToFix = 5; diff --git a/src/Checks/Configuration/NoIndexCheck.php b/src/Checks/Configuration/NoIndexCheck.php index d2250da3..741c13a2 100644 --- a/src/Checks/Configuration/NoIndexCheck.php +++ b/src/Checks/Configuration/NoIndexCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class NoIndexCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = "The page does not have 'noindex' set"; + public string $description = "When the page has the 'noindex' tag or meta tag set, search engines will not index the page."; + public string $priority = 'low'; public int $timeToFix = 5; diff --git a/src/Checks/Configuration/RobotsCheck.php b/src/Checks/Configuration/RobotsCheck.php index 5d52f0b6..3d96a2f1 100644 --- a/src/Checks/Configuration/RobotsCheck.php +++ b/src/Checks/Configuration/RobotsCheck.php @@ -7,13 +7,17 @@ use vipnytt\RobotsTxtParser\UriClient; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class RobotsCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Robots.txt allows indexing'; + public string $description = 'The robots.txt file should allow indexing of the page.'; + public string $priority = 'low'; public int $timeToFix = 5; diff --git a/src/Checks/Content/AltTagCheck.php b/src/Checks/Content/AltTagCheck.php index 4ea6bda2..d5248a2d 100644 --- a/src/Checks/Content/AltTagCheck.php +++ b/src/Checks/Content/AltTagCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class AltTagCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Every image has an alt tag'; + public string $description = 'Every image on the page should have an alt tag to describe the image.'; + public string $priority = 'low'; public int $timeToFix = 5; diff --git a/src/Checks/Content/BrokenImageCheck.php b/src/Checks/Content/BrokenImageCheck.php index 9f2d7b81..87d892f3 100644 --- a/src/Checks/Content/BrokenImageCheck.php +++ b/src/Checks/Content/BrokenImageCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class BrokenImageCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page contains no broken images'; + public string $description = 'The page should not contain any broken images because it is bad for the user experience.'; + public string $priority = 'medium'; public int $timeToFix = 10; diff --git a/src/Checks/Content/BrokenLinkCheck.php b/src/Checks/Content/BrokenLinkCheck.php index 7efd41f6..a3da9e70 100644 --- a/src/Checks/Content/BrokenLinkCheck.php +++ b/src/Checks/Content/BrokenLinkCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class BrokenLinkCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page contains no broken links'; + public string $description = 'The page should not contain any broken links because it is bad for the user experience.'; + public string $priority = 'medium'; public int $timeToFix = 10; diff --git a/src/Checks/Content/ContentLengthCheck.php b/src/Checks/Content/ContentLengthCheck.php index f8ddfc72..f5418c75 100644 --- a/src/Checks/Content/ContentLengthCheck.php +++ b/src/Checks/Content/ContentLengthCheck.php @@ -7,13 +7,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class ContentLengthCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Length of the content is at least 2100 characters'; + public string $description = 'The length of the content should be at least 2100 characters.'; + public string $priority = 'low'; public int $timeToFix = 30; diff --git a/src/Checks/Content/KeywordInFirstParagraphCheck.php b/src/Checks/Content/KeywordInFirstParagraphCheck.php index 0513b328..907b78b7 100644 --- a/src/Checks/Content/KeywordInFirstParagraphCheck.php +++ b/src/Checks/Content/KeywordInFirstParagraphCheck.php @@ -7,13 +7,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class KeywordInFirstParagraphCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page has the focus keyword in the first paragraph'; + public string $description = 'The focus keyword should be in the first paragraph of the content because this is the most important part of the content.'; + public string $priority = 'medium'; public int $timeToFix = 10; diff --git a/src/Checks/Content/KeywordInTitleCheck.php b/src/Checks/Content/KeywordInTitleCheck.php index 22b0fa24..252470f5 100644 --- a/src/Checks/Content/KeywordInTitleCheck.php +++ b/src/Checks/Content/KeywordInTitleCheck.php @@ -7,13 +7,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class KeywordInTitleCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page has the focus keyword in the title'; + public string $description = 'The focus keyword should be in the title of the page because the visitor will see this in the search results.'; + public string $priority = 'medium'; public int $timeToFix = 1; diff --git a/src/Checks/Content/MixedContentCheck.php b/src/Checks/Content/MixedContentCheck.php index 688cf796..117f8d62 100644 --- a/src/Checks/Content/MixedContentCheck.php +++ b/src/Checks/Content/MixedContentCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class MixedContentCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'All links redirect to an url using HTTPS'; + public string $description = 'All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.'; + public string $priority = 'high'; public int $timeToFix = 1; diff --git a/src/Checks/Content/MultipleHeadingCheck.php b/src/Checks/Content/MultipleHeadingCheck.php index 83f223ff..6d13399a 100644 --- a/src/Checks/Content/MultipleHeadingCheck.php +++ b/src/Checks/Content/MultipleHeadingCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class MultipleHeadingCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page has an H1 tag and if it is used only once per page'; + public string $description = 'The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.'; + public string $priority = 'low'; public int $timeToFix = 1; diff --git a/src/Checks/Content/TooLongSentenceCheck.php b/src/Checks/Content/TooLongSentenceCheck.php index e6372367..eed6f09c 100644 --- a/src/Checks/Content/TooLongSentenceCheck.php +++ b/src/Checks/Content/TooLongSentenceCheck.php @@ -7,14 +7,18 @@ use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\Actions; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class TooLongSentenceCheck implements Check { use Actions, - PerformCheck; + PerformCheck, + Translatable; public string $title = 'Too long sentence check'; + public string $description = 'The content should not contain sentences with more than 20 words.'; + public string $priority = 'medium'; public int $timeToFix = 30; diff --git a/src/Checks/Content/TransitionWordRatioCheck.php b/src/Checks/Content/TransitionWordRatioCheck.php index 327187fc..17ddf0da 100644 --- a/src/Checks/Content/TransitionWordRatioCheck.php +++ b/src/Checks/Content/TransitionWordRatioCheck.php @@ -8,14 +8,18 @@ use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\Actions; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class TransitionWordRatioCheck implements Check { use Actions, - PerformCheck; + PerformCheck, + Translatable; public string $title = 'Transition word ratio check'; + public string $description = 'The content should contain at least 30% transition words.'; + public string $priority = 'medium'; public int $timeToFix = 60; diff --git a/src/Checks/Meta/DescriptionCheck.php b/src/Checks/Meta/DescriptionCheck.php index 64c019fa..ac562e82 100644 --- a/src/Checks/Meta/DescriptionCheck.php +++ b/src/Checks/Meta/DescriptionCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class DescriptionCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page has a meta description'; + public string $description = 'The meta description is used by search engines to show a description of the page in the search results.'; + public string $priority = 'medium'; public int $timeToFix = 1; diff --git a/src/Checks/Meta/LangCheck.php b/src/Checks/Meta/LangCheck.php index 375d7914..da7a607d 100644 --- a/src/Checks/Meta/LangCheck.php +++ b/src/Checks/Meta/LangCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class LangCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The lang attribute is set on the html tag'; + public string $description = 'The lang attribute should be set because this is used by search engines to determine the language of the page.'; + public string $priority = 'medium'; public int $timeToFix = 1; diff --git a/src/Checks/Meta/OpenGraphImageCheck.php b/src/Checks/Meta/OpenGraphImageCheck.php index 9fb67473..65051414 100644 --- a/src/Checks/Meta/OpenGraphImageCheck.php +++ b/src/Checks/Meta/OpenGraphImageCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class OpenGraphImageCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page has an Open Graph image'; + public string $description = 'The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.'; + public string $priority = 'medium'; public int $timeToFix = 20; diff --git a/src/Checks/Meta/TitleLengthCheck.php b/src/Checks/Meta/TitleLengthCheck.php index 6cadca3d..cab514be 100644 --- a/src/Checks/Meta/TitleLengthCheck.php +++ b/src/Checks/Meta/TitleLengthCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class TitleLengthCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page title is not longer than 60 characters'; + public string $description = 'The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.'; + public string $priority = 'medium'; public int $timeToFix = 1; diff --git a/src/Checks/Performance/CompressionCheck.php b/src/Checks/Performance/CompressionCheck.php index 085cc743..bc833f61 100644 --- a/src/Checks/Performance/CompressionCheck.php +++ b/src/Checks/Performance/CompressionCheck.php @@ -7,13 +7,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class CompressionCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'HTML is GZIP compressed'; + public string $description = 'The HTML of the page should be GZIP compressed to reduce the size of the response.'; + public string $priority = 'high'; public int $timeToFix = 15; diff --git a/src/Checks/Performance/CssSizeCheck.php b/src/Checks/Performance/CssSizeCheck.php index 19c9933d..97694817 100644 --- a/src/Checks/Performance/CssSizeCheck.php +++ b/src/Checks/Performance/CssSizeCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class CssSizeCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'CSS files are not bigger than 15 KB'; + public string $description = 'CSS files are not bigger than 15 KB because this will slow down the page load time.'; + public string $priority = 'medium'; public int $timeToFix = 30; diff --git a/src/Checks/Performance/HtmlSizeCheck.php b/src/Checks/Performance/HtmlSizeCheck.php index b4eddeca..87882f28 100644 --- a/src/Checks/Performance/HtmlSizeCheck.php +++ b/src/Checks/Performance/HtmlSizeCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class HtmlSizeCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'HTML is not larger than 100 KB'; + public string $description = 'HTML is not larger than 100 KB because this will slow down the page load time.'; + public string $priority = 'medium'; public int $timeToFix = 60; diff --git a/src/Checks/Performance/ImageSizeCheck.php b/src/Checks/Performance/ImageSizeCheck.php index 7f1a1de8..8884f75f 100644 --- a/src/Checks/Performance/ImageSizeCheck.php +++ b/src/Checks/Performance/ImageSizeCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class ImageSizeCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Images are not larger than 1 MB'; + public string $description = 'Images are not larger than 1 MB because this will slow down the page load time.'; + public string $priority = 'high'; public int $timeToFix = 10; diff --git a/src/Checks/Performance/JavascriptSizeCheck.php b/src/Checks/Performance/JavascriptSizeCheck.php index 0403991e..4c53194e 100644 --- a/src/Checks/Performance/JavascriptSizeCheck.php +++ b/src/Checks/Performance/JavascriptSizeCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class JavascriptSizeCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Javascript files are not bigger than 1 MB'; + public string $description = 'Javascript files are not bigger than 1 MB because this will slow down the page load time.'; + public string $priority = 'medium'; public int $timeToFix = 60; diff --git a/src/Checks/Performance/ResponseCheck.php b/src/Checks/Performance/ResponseCheck.php index c7940d58..fe4ed84b 100644 --- a/src/Checks/Performance/ResponseCheck.php +++ b/src/Checks/Performance/ResponseCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class ResponseCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'The page response returns a 200 status code'; + public string $description = 'The page response should return a 200 status code because this means the page is available.'; + public string $priority = 'high'; public int $timeToFix = 10; diff --git a/src/Checks/Performance/TtfbCheck.php b/src/Checks/Performance/TtfbCheck.php index 3cdfa219..72c7b86f 100644 --- a/src/Checks/Performance/TtfbCheck.php +++ b/src/Checks/Performance/TtfbCheck.php @@ -6,13 +6,17 @@ use Symfony\Component\DomCrawler\Crawler; use Vormkracht10\Seo\Interfaces\Check; use Vormkracht10\Seo\Traits\PerformCheck; +use Vormkracht10\Seo\Traits\Translatable; class TtfbCheck implements Check { - use PerformCheck; + use PerformCheck, + Translatable; public string $title = 'Time To First Byte (TTFB) is below 600 ms'; + public string $description = 'The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.'; + public string $priority = 'high'; public int $timeToFix = 15; diff --git a/src/Interfaces/Check.php b/src/Interfaces/Check.php index c540c5e7..6a3b5353 100644 --- a/src/Interfaces/Check.php +++ b/src/Interfaces/Check.php @@ -8,6 +8,7 @@ /** * @property string $title + * @property string $description * @property string $priority * @property int $timeToFix * @property int $scoreWeight @@ -27,4 +28,6 @@ public function check(Response $response, Crawler $crawler): bool; public function __invoke(array $data, Closure $next); public function setResult(array $data, bool $result): array; + + public function getTranslatedDescription(): string; } diff --git a/src/Traits/Translatable.php b/src/Traits/Translatable.php new file mode 100644 index 00000000..8964d6b1 --- /dev/null +++ b/src/Traits/Translatable.php @@ -0,0 +1,11 @@ +description); + } +}