Skip to content

Instantly share code, notes, and snippets.

@mattbrailsford
Created October 29, 2011 16:42
Show Gist options
  • Save mattbrailsford/1324746 to your computer and use it in GitHub Desktop.
Save mattbrailsford/1324746 to your computer and use it in GitHub Desktop.
An example uGoLive check
namespace Our.Umbraco.uGoLive.Checks
{
[Check("8088E981-174C-4ABA-9867-AF219B4E0D9E", "Robots.txt", "Create a robots.txt file to block access to system folders", "SEO")]
public class RobotsTxtCheck : AbstractCheck
{
public override bool CanRectify
{
get { return false; }
}
public override CheckResult Check()
{
if(!File.Exists(HttpContext.Current.Server.MapPath("~/robots.txt")))
return new CheckResult { Status = CheckResultStatus.Failed, Message = "Robots.txt file not found." };
return new CheckResult { Status = CheckResultStatus.Passed, Message = "Robots.txt file found." };
}
public override RectifyResult Rectify()
{
throw new NotImplementedException();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment