Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

joshuaabenazer
Copy link

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:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@darylldoyle
Copy link
Contributor

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

@claytoncollie
Copy link
Contributor

@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' );

Copy link
Contributor

@darylldoyle darylldoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuaabenazer nice work here!

Can we please update the UI when the values are set via constants? Currently when I set SUPPORT_MONITOR_ENABLE to yes in the cost, it still shows as No in the UI.

image

The same goes for the API Key and URL, the API key can be masked, but it'd be nice to show that there's a value set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define Support Monitor options with constants inside wp-config
3 participants