documentation
documentation copied to clipboard
CMS-890: Adds tab for the wp pantheon cache commands.
Closes https://getpantheon.atlassian.net/browse/CMS-890
Summary
Pantheon WP-CLI Commands - Adds documentation about commands added by the Pantheon mu-plugin to control caching on WP sites via the WP-CLI.
Release:
- [X] When ready
- [ ] After date: $DATE
Post Launch
Do not remove - To be completed by the docs team upon merge:
- [ ] Redirect
/docs/old-path/
=>/docs/new-path/
(if applicable) - [ ] Include/exclude pages ^ respectively within docs search service provider (if applicable)
- [ ] For Heroes - add a props post to the discussion board.
- [ ] Remove from the project board
@jazzsequence Hrmm, running terminus wp -- jrw-wp-test.dev pantheon cache
produces only the set-maintenance-mode subcommand, which is the one documented. Running terminus wp -- jrw-wp-test.dev pantheon session
produces an error that there is no such command. This is on a brand new site using the standard WP upstream. Is there something I'm missing?
@rwagner00 You're missing the Native PHP Sessions plugin. I think the other caching functions are coming from Pantheon Advanced Page Cache.
~I'm missing the maintenance mode plugin, and so I'm wondering what I'm missing in my environment but IIRC (and since your site doesn't have any other Pantheon plugins installed) that should be in the mu-plugin. If you've cloned your site locally, does it have a wp-content/mu-plugins/pantheon/cli.php
file?~ Figured out my issue, it was totally a PEBKAC problem.
@jazzsequence Neither the Native PHP nor the Advanced Page Cache plugins are included by default, per their own README files and a review of my stock site, which is why I didn't have those commands. ~~With that in mind, I think the sections for those belong in their own tabs. Does that make sense to you?~~
Pushed changes which include the other commands
@jazzsequence I believe I've resolved the feedback and issues, let me know if there's anything else I need to take care of!
@rwagner00 @jspellman814 before I move this to a copy review, I'm getting some errors in testing - set-maintenance-mode everyone
worked (tested after the cache clearing command), but the cache commands are giving me this:
Error: 'purge-all' is not a registered subcommand of 'pantheon cache'. See 'wp help pantheon cache' for available subcommands.
[notice] Command: $SITE.dev -- wp help pantheon cache purge-all [Exit: 1]
for good measure, here's the help output
╰─❯ terminus wp -- $SITE.dev help pantheon cache
[warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
NAME
wp pantheon cache
SYNOPSIS
wp pantheon cache <command>
SUBCOMMANDS
set-maintenance-mode Sets maintenance mode status.
GLOBAL PARAMETERS
--path=<path>
Path to the WordPress files.
--url=<url>
Pretend request came from given URL. In multisite, this argument is how
the target site is specified.
--ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>]
Perform operation against a remote server over SSH (or a container using
scheme of "docker", "docker-compose", "vagrant").
--http=<http>
Perform operation against a remote WordPress installation over HTTP.
--user=<id|login|email>
Set the WordPress user.
--skip-plugins[=<plugins>]
Skip loading all plugins, or a comma-separated list of plugins. Note:
mu-plugins are still loaded.
--skip-themes[=<themes>]
Skip loading all themes, or a comma-separated list of themes.
--skip-packages
Skip loading all installed packages.
--require=<path>
Load PHP file before running the command (may be used more than once).
--exec=<php-code>
Execute PHP code before running the command (may be used more than once).
--context=<context>
Load WordPress in a given context.
--[no-]color
Whether to colorize the output.
--debug[=<group>]
Show all PHP errors and add verbosity to WP-CLI output. Built-in groups
include: bootstrap, commandfactory, and help.
--prompt[=<assoc>]
Prompt the user to enter values for all command arguments, or a subset
specified as comma-separated values.
--quiet
Suppress informational messages.
[notice] Command: $SITE.dev -- wp help pantheon cache [Exit: 0]
I'll take a look.
@EdwardAngert The pantheon-advanced-page-cache plugin is inactive by default, even though it is also included in the composer file. If you activate the plugin, the commands appear. Opinions on if we should note this in the doc, or enable it by default?
@rwagner00 thanks! I was able to activate it and/but I'm torn about how much users want things active by default, and as far as documenting it goes, I added a few command examples in the latest commit that I hope will help folks run them
re: pantheon session list
I'm not sure how to give folks instructions to delete a session (because I'm not sure how to trigger a session), so it's a little incomplete for now (L72)
╰─❯ terminus wp $SITE.$ENV -- pantheon session list
+------------+---------+----------+------------+------+
| session_id | user_id | datetime | ip_address | data |
+------------+---------+----------+------------+------+
+------------+---------+----------+------------+------+
[notice] Command: $SITE.$ENV -- wp pantheon session list [Exit: 0]
other than that, if it looks ready to y'all, I'll pass it on to the rest of the Docs team for a copy review
@EdwardAngert I don't actually know anything more about the PHP Session module than you do, so I'm useless there. The rest looks good to me!
@pantheon-systems/docs-admins when you merge, please use the Squash and merge option
LGTM