Home

Awesome

SXA.HealthCheck

SXA.HealthCheck is a Power Shell script used to determine health status of SXA site.

It consists of validation steps. Each step checks different thing in SXA solution and provides possible solution

Usage

Executing

  1. Open the latest version of main.ps1
  2. Copy content to a clipboard
  3. Open PowerShell ISE (http://domain/sitecore/shell/Applications/PowerShell/PowerShellIse?sc_bw=1)
  4. Paste content from a clipboard
  5. Set Context item to your site (for example /sitecore/content/F/Validation/V). If you are not familiar you can read more here
  6. Execute script

Steps will be executed one by one and you will see continuous results on the console.

console

Once the whole procedure is done you will see List View with validation results

list-view

Executing - remote script

If you want to automate validation process and get the most recent version simply invoke this expression

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
$response = Invoke-WebRequest -Uri "https://raw.githubusercontent.com/alan-null/SXA.HealthCheck/master/main.ps1" -UseBasicParsing
if($response.StatusCode -eq 200){
    Invoke-Expression $response.Content
}

It will fetch the latest version of main.ps1 script and let you invoke it inside ISE.

Reading results

There are 3 possible results of validation:

For Error and Warning you will see message in the 4th column. It describes the problem and suggests what you could do to solve it

Validation steps

TitleDescriptionFromTo
Error Handling - 404Checks whether current site has 404 page configured1000*
Error Handling - 500Checks whether current site has 500 page configured1000*
Field 'AdditionalChildren'Checks whether 'AdditionalChildren' field contains proper reference to a tenant shared media library folder and there are no broken links1000*
Field 'Scripts Optimizing Enabled'Checks 'Scripts Optimizing Enabled' field to determine if scripts optimization is disabled1000*
Field 'Styles Optimizing Enabled'Checks 'Styles Optimizing Enabled' field to determine if styles optimization is disabled1000*
Maps Provider keyIf there is any use of Maps rendering, it checks whether maps provider key has been configured1000*
Site nameValidates site name. Site names cannot contain control characters, spaces (' ') semicolons, or commas1000*
SXA Best practices - custom items under SXA nodesChecks whether there are additional or modified files under SXA nodes1000*
SXA Best practices - limit the number of renderings on a pageChecks whether there are pages with more than 30 renderings1000*
SXA Best practices - media under virtual media folderChecks whether there are media items stored directly under virtual media folder1000*
Theme and Compatible Themes field consistencyChecks whether themes used in Theme-to-Device mapping are compatible with current site1000*
Theme for Default deviceChecks whether any theme is assigned to a default device1000*
Field 'SiteMediaLibrary'Checks whether 'SiteMediaLibrary' field contains proper reference to a site specific media library item1400*
Field 'ThemesFolder'Checks whether 'ThemesFolder' field contains proper reference to a site specific themes folder item1400*
Site definitions conflictsChecks whether current site definitions have any conflicts with other sites1500*
SXA Best practices - unused data sourcesChecks whether there are unused data sources present in your site1800*