Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-743] Update the notice language and make it dismissable #271

Merged
merged 15 commits into from Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/lint.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,7 @@ Thumbs.db
wp-cli.local.yml
node_modules/
vendor/
# Managed by wpunit-helpers
bin/install-local-tests.sh
bin/install-wp-tests.sh
bin/phpunit-test.sh
17 changes: 17 additions & 0 deletions README.md
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 Expand Up @@ -95,6 +110,8 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis
## Changelog ##

### 1.4.1-dev ###
* 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)]
* 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)]

### 1.4.0 (October 17, 2023) ###
* Adds new CLI command to add a Primary Column (id) to the `pantheon_sessions` table for users who do not have one. [[#265](https://github.com/pantheon-systems/wp-native-php-sessions/pull/265)]
Expand Down
11 changes: 11 additions & 0 deletions assets/js/notices.js
@@ -0,0 +1,11 @@
jQuery(document).ready(function($) {
$(document).on('click', '.notice-dismiss', function() {
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'dismiss_notice'
}
});
});
});
61 changes: 0 additions & 61 deletions bin/install-local-tests.sh

This file was deleted.

151 changes: 0 additions & 151 deletions bin/install-wp-tests.sh

This file was deleted.

18 changes: 0 additions & 18 deletions bin/phpunit-test.sh

This file was deleted.

7 changes: 5 additions & 2 deletions composer.json
Expand Up @@ -16,6 +16,7 @@
"require-dev": {
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"pantheon-systems/wpunit-helpers": "^1.0",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^2.0"
},
Expand All @@ -34,7 +35,9 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
"dealerdirect/phpcodesniffer-composer-installer": true,
"pantheon-systems/wpunit-helpers": true
},
"sort-packages": true
}
}