You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
The first level Keys in array issues are audit type (seo, security, performance and etc.). The second level array keys areAudit classes e.g.Wizardstool\SeoAudit\Audits\TitleAudit and its keys are comes from\Wizardstool\SeoAudit\AuditIssues.For example 4 is from const\Wizardstool\SeoAudit\AuditIssues::TITLE_TOO_SHORT.So you can handle too short title like this:
$result =$audit->getAuditResult();$titleTooShortResult =$result->getIssues()['seo'][TitleAudit::class][AuditIssues::TITLE_TOO_SHORT];if (isset($titleTooShortResult['length'])) {echosprintf('Title "%s" is too short, its length %d. It should be atleast %d characters.',$result->getTitle(),$titleTooShortResult['length'], (newTitleAudit())->getTitleMinLength());}
Output:
Title"This is title" is too short, its length 13. It should be atleast 50 characters.
Customize audit
$titleAudit =newTitleAudit();// setup custom title limits$titleAudit->setTitleMinLength(45);$titleAudit->setTitleMaxLength(70);$subAudits = [$titleAudit,newDescriptionAudit(),newCanonicalUrlAudit(),];