\WPRocket_CLI

Manage Revisions

Summary

Methods
Properties
Constants
activate()
activate_cache()
deactivate()
deactivate_cache()
clean()
preload()
regenerate()
cdn()
export()
import()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
clean_wp_rocket_cache()
set_apache()
No private properties found
N/A

Methods

activate()

activate() : void

Backward compatibility method

activate_cache()

activate_cache(array  $args = array(), array  $assoc_args = array()) 

Set WP_CACHE constant in wp-config.php to true and update htaccess

OPTIONS

[--htaccess=] : Enable update of the htaccess file.

EXAMPLES

wp rocket activate-cache

Parameters

array $args
array $assoc_args

deactivate()

deactivate() : void

Backward compatibility method

deactivate_cache()

deactivate_cache(array  $args = array(), array  $assoc_args = array()) 

Set WP_CACHE constant in wp-config.php to false and update htaccess

OPTIONS

[--htaccess=] : Enable update of the htaccess file.

EXAMPLES

wp rocket deactivate-cache

Parameters

array $args
array $assoc_args

clean()

clean(array  $args = array(), array  $assoc_args = array()) 

Purge cache files

OPTIONS

[--post_id=] : List posts to purge cache files.

[--permalink=] : List permalinks to purge cache files. Trumps --post_id.

[--lang=] : List langs to purge cache files. Trumps --post_id & --permalink.

[--blog_id=] : List blogs to purge cache files. Trumps --post_id & --permalink & lang.

[--confirm] : Automatic 'yes' to any confirmation

EXAMPLES

wp rocket clean
wp rocket clean --post_id=2
wp rocket clean --post_id=2,4,6,8
wp rocket clean --permalink=http://example.com
wp rocket clean --permalink=http://example.com,http://example.com/category/(.*)
wp rocket clean --lang=fr
wp rocket clean --lang=fr,de,en,it
wp rocket clean --blog_id=2
wp rocket clean --blog_id=2,4,6,8

Parameters

array $args
array $assoc_args

preload()

preload(array  $args = array(), array  $assoc_args = array()) 

Run WP Rocket Bot for preload cache files

OPTIONS

[--sitemap] : Trigger sitemap-based preloading

EXAMPLES

wp rocket preload
wp rocket preload --sitemap

Parameters

array $args
array $assoc_args

regenerate()

regenerate(array  $args = array(), array  $assoc_args = array()) 

Regenerate file

OPTIONS

[--file=] : The file to regenerate. It could be:

  • htaccess
  • advanced-cache
  • config (It's the config file stored in the wp-rocket-config folder)

[--nginx=] : The command should run as if on nginx (setting the $is_nginx global to true)

EXAMPLES

wp rocket regenerate --file=htaccess
wp rocket regenerate --file=config --nginx=true

Parameters

array $args
array $assoc_args

cdn()

cdn(  $args = array(),   $assoc_args = array()) 

Enable / Disable CDN option and set the CDN URL.

OPTIONS

[--enable=] : Option to enable / disable = boolean.

[--host=] : CDN host.

[--zone=] : CDN zone -> [ all, images, css_and_js, js, css ]

EXAMPLES

wp rocket cdn --enable=false
wp rocket cdn --enable=true --host=http://cdn.example.com
wp rocket cdn --enable=true --host=http://cdn.example.com --zone=all

Parameters

$args
$assoc_args

export()

export(  $args = array(),   $assoc_args = array()) 

Export Settings.

EXAMPLES

wp rocket export

Parameters

$args
$assoc_args

import()

import(  $args = array(),   $assoc_args = array()) 

Import Settings JSON.

OPTIONS

[--file=] : The Json file to import. It could be:

EXAMPLES

wp rocket import --file=example.json
wp rocket import --file=https://example.com/example.json

Parameters

$args
$assoc_args

clean_wp_rocket_cache()

clean_wp_rocket_cache(boolean  $minify = false) : void

Clean WP Rocket domain and additional cache files.

Parameters

boolean $minify

Clean also minify cache files.

set_apache()

set_apache() : void

Set global Apache variable to true