Skip to content

Commit 5cd922e

Browse files
authored
Merge pull request #280 from pantheon-systems/release_1.4.2
Release 1.4.2
2 parents e482b03 + 99a8cde commit 5cd922e

File tree

4 files changed

+306
-76
lines changed

4 files changed

+306
-76
lines changed

README.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Tags:** comments, sessions
44
**Requires at least:** 4.7
55
**Tested up to:** 6.3
6-
**Stable tag:** 1.4.1
6+
**Stable tag:** 1.4.2
77
**Requires PHP:** 5.4
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
@@ -57,17 +57,7 @@ Added in 1.4.0. If you have run the `add-index` command and have verified that t
5757
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.
5858

5959
### WordPress Multisite
60-
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.
61-
62-
However, you can script this process in bash by getting a list of sites and looping over them:
63-
64-
```bash
65-
for site in $(wp site list --field=url); do
66-
wp pantheon session add-index --url=$site
67-
done
68-
```
69-
70-
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.
60+
As of 1.4.2 the `add-index`, `primary-key-add` and `primary-key-revert` commands are fully multisite compatible.
7161

7262

7363
## Contributing ##
@@ -108,6 +98,11 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis
10898

10999
## Changelog ##
110100

101+
### 1.4.2 (November 8, 2023) ###
102+
* Fixed an issue with the `pantheon session add-index` PHP warning. [[#276](https://github.com/pantheon-systems/wp-native-php-sessions/pull/276/files)]
103+
* Fixed a syntax issue with the suggested WP CLI commands [[#278](https://github.com/pantheon-systems/wp-native-php-sessions/pull/278)]
104+
* Made `wp pantheon session add-index`, `wp pantheon session primary-key-finalize`, and `wp pantheon session primary-key-revert` fully multisite compatible. [[#275](https://github.com/pantheon-systems/wp-native-php-sessions/pull/275)]
105+
111106
### 1.4.1 (October 23, 2023) ###
112107
* Fixed an issue with the `pantheon session add-index` command not working properly on WP multisite [[#270](https://github.com/pantheon-systems/wp-native-php-sessions/pull/270)]
113108
* Made the notice added in 1.4.0 dismissable (stores in user meta) & hides for multisite (an update is coming to iterate through all sites on a network) [[#271](https://github.com/pantheon-systems/wp-native-php-sessions/pull/271)]

inc/class-cli-command.php

+11-8
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,32 @@ public function delete( $args, $assoc_args ) {
8484
*
8585
* @subcommand add-index
8686
*/
87-
public function add_index( $args, $assoc_arc ) {
87+
public function add_index( $args, $assoc_args ) {
8888
$pantheon_session = new \Pantheon_Sessions();
89-
$pantheon_session->add_index();
89+
$resume_point = isset( $assoc_args['start_point'] ) ? $assoc_args['start_point'] : 0;
90+
$pantheon_session->add_index( $resume_point );
9091
}
9192

9293
/**
9394
* Finalizes the creation of a primary key by deleting the old data.
9495
*
9596
* @subcommand primary-key-finalize
9697
*/
97-
public function primary_key_finalize() {
98-
$pan_session = new \Pantheon_Sessions();
99-
$pan_session->primary_key_finalize();
98+
public function primary_key_finalize( $args, $assoc_args ) {
99+
$pantheon_session = new \Pantheon_Sessions();
100+
$resume_point = isset( $assoc_args['start_point'] ) ? $assoc_args['start_point'] : 0;
101+
$pantheon_session->primary_key_finalize( $resume_point );
100102
}
101103

102104
/**
103105
* Reverts addition of primary key.
104106
*
105107
* @subcommand primary-key-revert
106108
*/
107-
public function primary_key_revert() {
108-
$pan_session = new \Pantheon_Sessions();
109-
$pan_session->primary_key_revert();
109+
public function primary_key_revert( $args, $assoc_args ) {
110+
$pantheon_session = new \Pantheon_Sessions();
111+
$resume_point = isset( $assoc_args['start_point'] ) ? $assoc_args['start_point'] : 0;
112+
$pantheon_session->primary_key_revert( $resume_point );
110113
}
111114
}
112115

0 commit comments

Comments
 (0)