Custom Site Checks

With YourSites 1.9 you set up your own:
  • 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

Custom config checks

You can now add your own custom file checks

Custom file check

You can now select your own custom php checks

Custom script driven check

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.

We love every single one of our users, without you YourSites simply couldn't happen! So we would love a review at the Joomla! JED so we can let others know about us too, please take a minute to write a review:

https://extensions.joomla.org/extension/yoursites-manager/

If you feel you have something negative to say, we would implore you to speak to us first, as we really really don't want anyone to be unhappy!

STAY CONNECTED