Skip to content

Support Monitor: send environment type in the report - #240

Open
claytoncollie wants to merge 1 commit into
developfrom
feature/monitor-environment-type
Open

claytoncollie wants to merge 1 commit into
developfrom
feature/monitor-environment-type

Conversation

@claytoncollie

Copy link
Copy Markdown
Contributor

Description of the Change

Adds environmentType to the Support Monitor daily report body. The value comes from wp_get_environment_type().

The receiving service no longer has to guess the environment from the URL. Before this change, non-production hosts without common keywords in the URL were classed as production.

"environmentType": "staging"

wp_get_environment_type() returns production when WP_ENVIRONMENT_TYPE is not set. The receiver should treat production as unconfirmed. The code falls back to production if the function does not exist, which matches is_local_environment().

Closes #238

How to test the Change

  1. Set define( 'WP_ENVIRONMENT_TYPE', 'staging' ); in wp-config.php.
  2. Enable Support Monitor debug mode and send a report.
  3. Check that the request body has "environmentType": "staging".
  4. Remove the constant and send again. Check that the value is production.

Changelog Entry

Added - Support Monitor report now includes the WordPress environment type.

Checklist:

  • I agree to follow this project's Code of Conduct.
  • My code follows the code style of this project.

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.

Support Monitor: send WordPress environment type in the report

1 participant