10up / 10up-experience

The 10up Experience plugin configures WordPress to better protect and inform clients, aligned to 10up’s best practices.
GNU General Public License v2.0
129 stars 27 forks source link

#161 - Allow defining support monitor constants to override settings. #164

Open joshuaabenazer opened 1 month ago

joshuaabenazer commented 1 month ago

Description of the Change

Allow defining support monitor constants to override settings. Support has been added for both network activation and single-site activation. New constants that were introduced.

  1. SUPPORT_MONITOR_ENABLE
  2. SUPPORT_MONITOR_API_KEY
  3. SUPPORT_MONITOR_SERVER_URL

Closes #161

How to test the Change

  1. Test out the settings for support monitor settings as part of this plugin on both a network activated multisite installation and a single site installation.
  2. Check by defining various combinations of all or some of the constants in the wp-config.php and reviewing the Support Monitor Settings. They should replace the user saved values and also not be editable when it is defined.
  3. Removing all or any of the constants from the wp-config.php should preserve the prior user saved values for the settings.

Changelog Entry

Added - New Support Monitor settings constants - SUPPORT_MONITOR_ENABLE, SUPPORT_MONITOR_API_KEY, SUPPORT_MONITOR_SERVER_URL

Credits

Props @joshuaabenazer

Checklist:

darylldoyle commented 1 month ago

@claytoncollie not sure if you want to test this one out?

claytoncollie commented 1 month ago

@darylldoyle I pulled this branch into my project and it worked perfectly. Fields are being overwritten and set to disabled.

Thank you @joshuaabenazer for the effort here.

For reference, here are the definitions I used in my wp-config.php file.

define( 'SUPPORT_MONITOR_ENABLE', 'yes' );
define( 'SUPPORT_MONITOR_API_KEY', 'api key goes here' );
define( 'SUPPORT_MONITOR_SERVER_URL', 'https://google.com' );