diff --git a/README.md b/README.md index 8980134..891ccdb 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,21 @@ Added in 1.4.0. If you have run the `add-index` command and have verified that t Added in 1.4.0. If you have run the `add-index` command and something unexpected has occurred, just run the `primary-key-revert` command and the backup table will immediately be returned to being the active table. +### WordPress Multisite +As of 1.4.1 the `add-index`, `primary-key-add` and `primary-key-revert` commands only apply to a single site. This means that to run on a WordPress multisite, for sites beyond the main site, you would need to pass the `--url=` flag for each subsite. + +However, you can script this process in bash by getting a list of sites and looping over them: + +```bash +for site in $(wp site list --field=url); +then + wp pantheon session add-index +done +``` + +This can be applied to any of the other commands as needed to do them all in one go. We will be updating the command to iterate over all the sites in a multisite in a forthcoming release. + + ## Contributing ## See [CONTRIBUTING.md](https://github.com/pantheon-systems/wp-native-php-sessions/blob/main/CONTRIBUTING.md) for information on contributing. diff --git a/readme.txt b/readme.txt index 7acf585..18bb718 100644 --- a/readme.txt +++ b/readme.txt @@ -43,18 +43,30 @@ To override this use the `pantheon_session_expiration` filter before the WordPre == CLI Commands == -= `wp pantheon session add-index` = +**`wp pantheon session add-index`** Added in 1.4.0. This command should be run if your installation of the plugin occurred before the addition of the primary ID key to the session table in version 1.2.2. You will be automatically notified when you visit any admin page if this is the case. If there's no message, your version is good to go. Note that this command is non-destructive, a new table will be created and the existing one preserved in a backup state until you have verified that the upgrade is functioning as expected. -= `wp pantheon session primary-key-finalize` = +**`wp pantheon session primary-key-finalize`** Added in 1.4.0. If you have run the `add-index` command and have verified that the new table is functioning correctly, running the `primary-key-finalize` command will perform a database cleanup and remove the backup table. -= `wp pantheon session primary-key-revert` = +**`wp pantheon session primary-key-revert`** Added in 1.4.0. If you have run the `add-index` command and something unexpected has occurred, just run the `primary-key-revert` command and the backup table will immediately be returned to being the active table. += WordPress Multisite = +As of 1.4.1 the `add-index`, `primary-key-add` and `primary-key-revert` commands only apply to a single site. This means that to run on a WordPress multisite, for sites beyond the main site, you would need to pass the `--url=` flag for each subsite. + +However, you can script this process in bash by getting a list of sites and looping over them: + + for site in $(wp site list --field=url); + then + wp pantheon session add-index + done + +This can be applied to any of the other commands as needed to do them all in one go. We will be updating the command to iterate over all the sites in a multisite in a forthcoming release. + == Contributing == See [CONTRIBUTING.md](https://github.com/pantheon-systems/wp-native-php-sessions/blob/main/CONTRIBUTING.md) for information on contributing.