-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add the vip feature flag, analytics flag and bump plugin version #732
Conversation
…res and analytics flags
common/php/class-module.php
Outdated
return defined( 'WPCOM_IS_VIP_ENV' ) && constant( 'WPCOM_IS_VIP_ENV' ) === true | ||
&& defined( 'WPCOM_SANDBOXED' ) && constant( 'WPCOM_SANDBOXED' ) === false | ||
&& defined( 'FILES_CLIENT_SITE_ID' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ingeniumed I noticed in vip dev-env
that WPCOM_IS_VIP_ENV
is false
, it seems like it's only set to true
on production sites. Can we change this to use the presence of VIP_GO_ENV
instead? The valid values for this seem to be "production"
and "local"
, but I think just checking that it exists will do the trick:
return defined( 'WPCOM_IS_VIP_ENV' ) && constant( 'WPCOM_IS_VIP_ENV' ) === true | |
&& defined( 'WPCOM_SANDBOXED' ) && constant( 'WPCOM_SANDBOXED' ) === false | |
&& defined( 'FILES_CLIENT_SITE_ID' ); | |
return defined( 'VIP_GO_ENV' ) | |
&& defined( 'WPCOM_SANDBOXED' ) && constant( 'WPCOM_SANDBOXED' ) === false | |
&& defined( 'FILES_CLIENT_SITE_ID' ); |
Note that this is different than the logic we used in the block data API, and that's mostly because we didn't want to send analytics locally. However, I think we should have the "Turn on WordPress VIP features" default to true on vip dev-env
.
That probably means we'll want two VIP-related checks, one for analytics (exclude local environments), and one for VIP features (local environments are fine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, corrected this in this commit by allowing for a flag to be passed in that will ensure only production sites are considered wpvip sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one small comment about VIP detection for vip dev-env
, and I also see there are some PHPCS errors from the tests. Other than that, looks good to me! Glad we're getting a lot of the PHPCS formatting out of the way, because it's a lot to review and GitHub's diffing is not equipped to review this many file changes.
I ended up disabling that script for now. I figured once we lint the entire codebase we can renable it just so we don't keep getting failures. It makes sense it would fail though because linting custom status causes aboutg 1500 lines to change and that can be pushed off to another PR |
Description
timesince
because it's not used and it's not really do proper GMT calculations. The old code that it used to be used for has been replaced by human_time which is way simpler. Didn't really think marking this as deprecated and pointing to that is better. We will encounter more cases like this and we can make a call case by case.Steps to Test