Welcome to Centmin Mod Community
Become a Member

Wordpress WP Super Cache CLI a WP-CLI Plugin !

Discussion in 'Blogs & CMS usage' started by eva2000, Dec 2, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    55,801
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    5:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Wow didn't realise this existed a WP-CLI plugin for controlling WP Super Cache via SSH command line wp-cli/wp-super-cache-cli · GitHub :cool:



     
  2. eva2000

    eva2000 Administrator Staff Member

    55,801
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    5:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    manual first ever attempt at install so not sure if 100% correct :)

    install
    Code:
    mkdir -p $HOME/.wp-cli/commands
    git clone https://github.com/wp-cli/wp-super-cache-cli.git $HOME/.wp-cli/commands/super-cache
    echo "require:" > $HOME/.wp-cli/config.yml
    echo "  - commands/super-cache/cli.php" >> $HOME/.wp-cli/config.yml
    
    contents of $HOME/.wp-cli/config.yml
    Code:
    require:
      - commands/super-cache/cli.php
    
    test command runs from wp install directory at /home/nginx/domains/domain1.com/public
    Code:
    wp super-cache --allow-root
    usage: wp super-cache disable
       or: wp super-cache enable
       or: wp super-cache flush [--post_id=<post-id>] [--permalink=<permalink>]
       or: wp super-cache preload [--status] [--cancel]
       or: wp super-cache stat 
    
    See 'wp help super-cache <command>' for more information on a specific command.
    
    enable WP Super Cache
    Code:
    wp super-cache enable --allow-root
    Success: The WP Super Cache is enabled.
    
    disable WP Super Cache
    Code:
    wp super-cache disable --allow-root
    Success: The WP Super Cache is disabled.
    
    wp super cache status after visiting index page to populate the cache
    Code:
    wp super-cache status --allow-root         
    Cache status: %rOff%n
    Cache content on Tue, 01 Dec 2015 17:02:29 +0000:
    
        WordPress cache:
            Cached: 1
            Expired: 0
    
        WP Super Cache:
            Cached: 1
            Expired: 0