At present, if a user has their WP_ENVIRONMENT_TYPE set to local or anything other than the default "Production" value in their configuration file, which can be the case if they migrated a site from a local environment, Site Kit will not place any of the snippets on a users site. The issue here is that many users are not aware that their environment type is set to local, and not aware that their snippets are not placed. Site Kit states the snippets are placed by default.
To improve users awareness, consider one of the following:
A pre-flight warning to inform users that their environment is set to local (and therefore snippets will not be placed). There is no pre flight check for this at present.
A notice within the module settings (similar to what is described in #1292)
A notice when connecting any of the modules
A comment added in place of the snippet (ie. "Snippet not placed due to local environment configuration"
Set up a site using Local by Flywheel, all default configurations (this will include WP_ENVIRONMENT_TYPE’, ‘local defined within wp-config.php)
Migrate this site using Duplicator
Set up Site Kit with Analytics
Check and ensure that the snippets are not placed
Remove the WP_ENVIRONMENT_TYPE’, ‘local reference
The snippets are placed
Alternatively, as opposed to the above, simply defining WP_ENVIRONMENT_TYPE’, ‘local on an existing site within a wp-config.php file may also result in the snippets not being placed
Screenshots
Additional Context
PHP Version:
OS: [e.g. iOS]
Browser: [e.g. chrome, safari]
Plugin Version: [e.g. 22]
Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Bug Description
At present, if a user has their
WP_ENVIRONMENT_TYPE
set tolocal
or anything other than the default "Production" value in their configuration file, which can be the case if they migrated a site from a local environment, Site Kit will not place any of the snippets on a users site. The issue here is that many users are not aware that their environment type is set to local, and not aware that their snippets are not placed. Site Kit states the snippets are placed by default.To improve users awareness, consider one of the following:
Below you'll see a recording of the experience whereby Site Kit will only place the snippet once
WP_ENVIRONMENT_TYPE’, ‘local
has been removed https://www.loom.com/share/a24625a64c83454c9037d60d3bcb886dImpacted support topics
Steps to reproduce
WP_ENVIRONMENT_TYPE’, ‘local
defined within wp-config.php)WP_ENVIRONMENT_TYPE’, ‘local
referenceAlternatively, as opposed to the above, simply defining
WP_ENVIRONMENT_TYPE’, ‘local
on an existing site within a wp-config.php file may also result in the snippets not being placedScreenshots
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Test Coverage
QA Brief
Changelog entry