array('code' => 200), 'body' => json_encode(array( 'success' => true, 'data' => array( 'consumer_key' => substr($key, 0, 8), 'consumer_email' => $email, 'secret_key' => hash('crc32', $email) ) )) ); } if (strpos($url, 'api.wp-rocket.me/stat/1.0/wp-rocket/user.php') !== false) { return array( 'response' => array('code' => 200), 'body' => json_encode(array( 'licence_account' => -1, 'licence_expiration' => time() + (50 * YEAR_IN_SECONDS), 'licence' => array('name' => 'Infinite'), 'status' => 'valid', 'has_auto_renew' => true, 'date_created' => time() - (30 * DAY_IN_SECONDS) )) ); } if (strpos($url, 'api.wp-rocket.me/check_update.php') !== false || strpos($url, 'wp-rocket.me/check_update.php') !== false) { return array( 'response' => array('code' => 200), 'body' => json_encode(array( 'version' => WP_ROCKET_VERSION, 'details_url' => '', 'download_url' => '' )) ); } if (strpos($url, 'saas.gpltimes.com/rucss-job') !== false) { return array( 'response' => array('code' => 200), 'body' => json_encode(array( 'status' => 'ok', 'code' => 200 )) ); } return $response; }, 10, 3); add_action('init', function() { $key = 'B5E0B5F8DD8689E6ACA49DD6E6E1A930'; $email = 'noreply@gmail.com'; $options = get_transient('wp_rocket_settings'); if ($options && isset($options['license']) && '1' === $options['license']) { $options['license'] = time(); $options['ignore'] = true; set_transient('wp_rocket_settings', $options, YEAR_IN_SECONDS); } if (!$options || empty($options['secret_key'])) { $options = array( 'consumer_key' => substr($key, 0, 8), 'consumer_email' => $email, 'secret_key' => hash('crc32', $email), 'license' => time(), 'ignore' => true ); set_transient('wp_rocket_settings', $options, YEAR_IN_SECONDS); } update_option('wp_rocket_no_licence', 0); $customer_data = (object) array( 'licence_account' => -1, 'licence_expiration' => time() + (50 * YEAR_IN_SECONDS), 'licence' => (object) array('name' => 'Infinite'), 'status' => 'valid', 'has_auto_renew' => true, 'date_created' => time() - (30 * DAY_IN_SECONDS), 'performance_monitoring' => (object) array( 'expiration' => time() + (50 * YEAR_IN_SECONDS), 'cancelled_at' => null, 'manage_url' => null, 'active_sku' => 'perf-monitor-advanced', 'plans' => array( (object) array( 'sku' => 'perf-monitor-advanced', 'price' => '8.99', 'limit' => '10', 'title' => 'Advanced', 'subtitle' => 'See how your top pages perform and quickly spot and optimize what slows your site down.', 'description' => 'Up to 10 pages • Weekly updates', 'billing' => '* Billed monthly. You can cancel at any time, each month started is due.', 'highlights' => array( 'Up to 10 pages tracked', 'Automatic performance monitoring', 'Unlimited on-demand tests', 'Full GTmetrix performance reports' ), 'status' => 'active', 'button' => (object) array( 'label' => 'Your plan', 'action' => 'none', 'url' => null ) ) ) ) ); set_transient('wp_rocket_customer_data', $customer_data, DAY_IN_SECONDS); }); /** * We use is_readable() with @ silencing as WP_Filesystem() can use different methods to access the filesystem. * * This is more performant and more compatible. It allows us to work around file permissions and missing credentials. */ if ( @is_readable( WP_ROCKET_PATH . 'licence-data.php' ) ) { //phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged @include WP_ROCKET_PATH . 'licence-data.php'; //phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged } require WP_ROCKET_INC_PATH . 'compat.php'; require WP_ROCKET_INC_PATH . 'classes/class-wp-rocket-requirements-check.php'; /** * Loads WP Rocket translations * * @since 3.0 * @author Remy Perona * * @return void */ function rocket_load_textdomain() { load_plugin_textdomain( 'rocket', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } add_action( 'init', 'rocket_load_textdomain' ); $wp_rocket_requirement_checks = new WP_Rocket_Requirements_Check( [ 'plugin_name' => 'WP Rocket', 'plugin_file' => WP_ROCKET_FILE, 'plugin_version' => WP_ROCKET_VERSION, 'plugin_last_version' => WP_ROCKET_LASTVERSION, 'wp_version' => WP_ROCKET_WP_VERSION, 'php_version' => WP_ROCKET_PHP_VERSION, ] ); if ( $wp_rocket_requirement_checks->check() ) { require WP_ROCKET_INC_PATH . 'main.php'; } unset( $wp_rocket_requirement_checks );