- custom configuration checks e.g. check your client site SMTP server settings
- custom file and file content checks e.g. make sure your .htaccess file contains a certain settings
- create your own custom site checks via simple PHP file
In your overall YourSites configuration on the 'Site Advisory Scans' tab you can now add your own custom configuration checks
You can now add your own custom file checks
You can now select your own custom php checks
How to setup a custom PHP script check
YourSites 1.9 includes an example PHP driven script (sample.php) in the folder administrator/components/com_yoursites/assets/clientpackage/handler/customchecks/. When you update the YourSites plugin on your client sites php scripts in this folder are installed along with the core plugin files. The sameple file included in YourSites performs a simple check on the live_site global config setting.
- The name of your class in the the custom check file should mirror the file name e.g. YstsSampleCheck <=> sample.php.
- You can include a language file (which is used by the YourSites server to translate the messages from the client sites) - again follow the naming convention used by the sample that is included.
- The script needs to include a public static method called 'peformCheck'.
- The peformCheck' method sets the result status and messages the the $customresult class. You can add message via the $customresult->messages array
- If you want to pass data from the client to help understand what ius happening on the specific client site you can use $customresult->checkinfo. 'key' is the language file key, 'data' is the value you want to push into the translated key and status is the status of the specific check (which is used alongside the $customresult->warning value to indicate if there is a problem.