ePages 6.12.0 - DE_EPAGES/SEO/API/SEO.pm

Package DE_EPAGES::SEO::API::SEO

API functions for SEO check on content objects

@EXPORT_OK
GetSEOCheckValues
CalculateSEOQuality
GetSEOQualityClass
AddCategoryImageSEOCheckValues
AddCategoryDepthSEOCheckValues
GetWordCount

Functions

AddCategoryDepthSEOCheckValues
AddCategoryImageSEOCheckValues
CalculateSEOQuality
GetSEOCheckValues
GetSEOQualityClass
GetWordCount

AddCategoryDepthSEOCheckValues

Extends hValues with SEO check for the category hierarchy depth.

Syntax
AddCategoryDepthSEOCheckValues($Object, $Shop, $hValues)
Input
$Object (object)
content object
$Shop (object)
shop object
$hValues (ref.hash)
values and ratings for SEO check

AddCategoryImageSEOCheckValues

Extends hValues with SEO check for the category image.

Syntax
AddCategoryImageSEOCheckValues($Object, $Shop, $hValues)
Input
$Object (object)
content object
$Shop (object)
shop object
$hValues (ref.hash)
values and ratings for SEO check

CalculateSEOQuality

Calculates a rating factor which determindes the SEO quality based on the given values in $hValues.

Syntax
$Rating = CalculateSEOQuality($hValues, $Object)
Input
$hValues (ref.hash)
values and ratings for SEO check
$Object (object)
content object
Return
$Rating (integer)
SEO quality from 0 .. 100

GetSEOCheckValues

Calculates various SEO relevant ratings and values for ContentObject SEO checks. Values specific to derived classes can be added/changed unsing a hook.

Syntax
$hValues = GetSEOCheckValues(Shop, $Object, $LanguageID);
Input
$Shop (object)
shop
$Object (object)
content object
$LanguageID (integer)
language id for localized attributes
Return
$hValues (ref.hash)
values and ratings for SEO check, can be extended via hooks
  • Name - object name - string

    • Title
    • Value - text of the title tag - string
    • Rating - SEO rating for the title tag - integer
    • RatingClass - CSS class name depending on Rating - string
    • Characters - Number of characters in the title tag - integer
    • Words - Number of words in the title tag - integer
    • Percentage - weighting for the SEO rating for the title tag - float

    • Url ...
    - canonical URL data (similar to Title)
    • Description ...
    - description meta tag data (similar to Title)
    • AdvDescription ...
    - long description data (similar to Title)
  • ...

GetSEOQualityClass

Returns the CSS class string depending on the SEO quality value.

Syntax
$QualityClass'} = GetSEOQualityClass($Quality);
Input
$Quality (integer)
SEO quality 0 .. 100
Return
$Class (string)
css class string

GetWordCount

Returns the number of words found in a given string.

Syntax
$Count = GetWordCount($String)
Input
$String (string)
text string
Return
$Count (integer)
number of words