Created
February 12, 2018 23:39
-
-
Save remyperona/45825c774dc21a719990b5ba6505c949 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; | |
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'WP-Rocket' ) === false ) { | |
if ( strpos( $_SERVER['HTTP_X_ROCKET'], 'WP-Rocket' ) === false ) { | |
die( 'BAD_UA_XR: ' . ( isset( $_SERVER['HTTP_USER_AGENT'] ) ? htmlspecialchars( $_SERVER['HTTP_USER_AGENT'] ) : 'not set' ) . ' & ' . ( isset( $_SERVER['HTTP_X_ROCKET'] ) ? htmlspecialchars( $_SERVER['HTTP_X_ROCKET'] ) : 'not set' ) ); | |
} | |
$user_agent = $_SERVER['HTTP_X_ROCKET']; | |
} | |
@list( $_version, $c_key, $c_mail, $_referer ) = array_slice( explode('|', strstr( $user_agent, 'WP-Rocket' ) ), 1, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. I see you're one of the WP Rocket developers.
I had problems updating on my local install of WordPress because of this licence check.
First I had queried the production server for the update URL:
wp plugin list --update=available --fields=update_package --format=csv | tail -n +2 | grep wp-rocket
Then locally, where the plugin was disabled:
WP_HOME="https://www.mydomain.com" wp plugin install --force https://wp-rocket.me/12345678/wp-rocket_3.14.2.1.zip
And the downloaded zip contained:
I see the header is updated in:
\WP_Rocket_Requirements_Check::add_own_ua()
to be:
WordPress/6.2.2; https://www.mydomain.com;WP-Rocket|3.13.1|12345678|[email protected]|https://www.mydomain.com|8.1;
So this worked to install the plugin locally:
WP_HOME="https://www.mydomain.com;WP-Rocket|3.13.1|12345678|[email protected]|https://www.mydomain.com|8.1;" wp plugin install --force https://wp-rocket.me/98426592/wp-rocket_3.14.2.1.zip