Skip to content

Instantly share code, notes, and snippets.

@imranhoshain
Created July 20, 2020 15:12
Show Gist options
  • Select an option

  • Save imranhoshain/2c641d20d725aa8e4f309b0af9d73828 to your computer and use it in GitHub Desktop.

Select an option

Save imranhoshain/2c641d20d725aa8e4f309b0af9d73828 to your computer and use it in GitHub Desktop.
private function get_customer_data() {
$customer_key = defined( 'WP_ROCKET_KEY' ) ? WP_ROCKET_KEY : get_rocket_option( 'consumer_key', '' );
$customer_email = defined( 'WP_ROCKET_EMAIL' ) ? WP_ROCKET_EMAIL : get_rocket_option( 'consumer_email', '' );
$response = 200;
$customer_data = json_decode( wp_remote_retrieve_body( $response ) );
$customer_data->licence_account = 'Imran Hoshain';
$customer_data->class = time() < $customer_data->licence_expiration ? 'wpr-isValid' : 'wpr-isValid';
$customer_data->licence_expiration = date_i18n( get_option( 'date_format' ), (int) '1620042454' );
return $customer_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment