Skip to content

Commit

Permalink
update readme with notes for running the command on multisite
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Oct 19, 2023
1 parent 3e82edb commit e5557b3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 15 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e5557b3

Please sign in to comment.