Hubertusanton\SilverStripeSeo\SeoObjectExtension
SeoObjectExtension extends SiteTree with functionality for helping content authors to write good content for search engines, it uses the added var SEOPageSubject around which the SEO score for the page is determined
Synopsis
class SeoObjectExtension
extends DataExtension
{
- // members
- private static array $excluded_page_types = ;
- private static array $og_types = ;
- private static boolean $use_webmaster_tag = true;
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- public array $score_criteria = ;
- public integer $seo_score = 0;
- public string $seo_score_tips = '';
- // methods
- public array getSEOScoreTips()
- public none updateCMSFields()
- public String getHTMLStars()
- public string getSEOSocialTitle()
- public string getSEOSocialLocale()
- public Image getSEOPreferedSocialImage()
- public null MetaTags()
- public string SeoBreadcrumbs()
- public String getHTMLSimplePageSubjectTest()
- public none getSEOScoreCalculation()
- public none setSEOScoreTipsUL()
- private DOMDocument createDOMDocumentFromHTML()
- public boolean checkPageSubjectInImageAltTags()
- private boolean checkImageAltTags()
- private boolean checkImageTitleTags()
- private boolean checkPageSubjectDefined()
- public boolean checkPageSubjectInTitle()
- public boolean checkPageSubjectInContent()
- public boolean checkPageSubjectInFirstParagraph()
- public boolean checkPageSubjectInUrl()
- public boolean checkPageSubjectInMetaDescription()
- private boolean checkNumWordsContent()
- private boolean checkPageTitleLength()
- private boolean checkContentHasLinks()
- private boolean checkPageHasImages()
- private boolean checkContentHasSubtitles()
- public Integer getNumWordsContent()
- public Integer getNumCharsTitle()
- public void getPageContent()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $casting
- $db
- $excluded_page_types
—
array
Specify page types that will not include the SEO tab - $has_one
- $og_types
—
array
Return an array of Facebook Open Graph Types used in Meta tags - $use_webmaster_tag
—
boolean
Let the webmaster tag be edited by the CMS admin
public
- $score_criteria
- $seo_score
- $seo_score_tips
Methods
private
- checkContentHasLinks() — checkContentHasLinks.
- checkContentHasSubtitles() — checkContentHasSubtitles.
- checkImageAltTags() — checkImageAltTags.
- checkImageTitleTags() — checkImageTitleTags.
- checkNumWordsContent() — checkNumWordsContent.
- checkPageHasImages() — checkPageHasImages.
- checkPageSubjectDefined() — checkPageSubjectDefined.
- checkPageTitleLength() — checkPageTitleLength.
- createDOMDocumentFromHTML() — checkContentHasSubtitles.
public
- MetaTags() — Hooks into MetaTags SiteTree method and adds additional meta data for Sharing of this page on Social Media
- SeoBreadcrumbs() — Return a breadcrumb trail to this page. Excludes "hidden" pages (with ShowInMenus=0). Adds extra microdata compared to
- checkPageSubjectInContent() — checkPageSubjectInContent.
- checkPageSubjectInFirstParagraph() — checkPageSubjectInFirstParagraph.
- checkPageSubjectInImageAltTags() — checkPageSubjectInImageAlt.
- checkPageSubjectInMetaDescription() — checkPageSubjectInMetaDescription.
- checkPageSubjectInTitle() — checkPageSubjectInTitle.
- checkPageSubjectInUrl() — checkPageSubjectInUrl.
- getHTMLSimplePageSubjectTest() — getHTMLSimplePageSubjectTest.
- getHTMLStars() — getHTMLStars.
- getNumCharsTitle() — getNumCharsTitle.
- getNumWordsContent() — getNumWordsContent.
- getPageContent() — getPageContent function to get html content of page which SEO score is based on (we use the same info as gets back from $Layout in template)
- getSEOPreferedSocialImage() — Attempt to find a suitable social image to use if one is not set.
- getSEOScoreCalculation() — getSEOScoreCalculation.
- getSEOScoreTips() — getSEOScoreTips.
- getSEOSocialLocale() — Get the current site locale.
- getSEOSocialTitle() — Get the current title for this page (to load into social tags) First try to get the MetaTitle (if the field is available), if not, fall back to title
- setSEOScoreTipsUL() — setSEOScoreTipsUL.
- updateCMSFields() — updateCMSFields.