-
Notifications
You must be signed in to change notification settings - Fork 86
Add option to list recently active plugins #383
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e6164f6
Add option to list recently active plugins
thrijith 0512b73
Fix liniting issues
thrijith baf1b22
Fix liniting issues
thrijith 5db1c39
Change plugin to use in tests
thrijith 42cee3a
Change plugin to use in tests
thrijith c9f932d
Update tests
thrijith 805760d
Add mu site tests, update how recently active plugin info is fetched
thrijith 52d77b3
Merge branch 'main' into feature/add-recently-active-option
thrijith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,205 @@ | ||
| Feature: List Recently Active WordPress plugins | ||
|
|
||
| @require-php-7.0 @require-wp-5.0 | ||
| Scenario: Verify plugin installation, activation, deactivation and confirm listing recently active plugins list is correct | ||
| Given a WP install | ||
| When I run `wp plugin install bbpress buddypress gutenberg --activate` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Activating 'buddypress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Activating 'gutenberg'... | ||
| """ | ||
|
|
||
| When I run `wp plugin activate akismet` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'akismet' activated. | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' deactivated. | ||
| Plugin 'buddypress' deactivated. | ||
| Success: Deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| ["bbpress","buddypress"] | ||
| """ | ||
|
|
||
| @require-wp-5.0 | ||
| Scenario: Re confirm recently active list before and after deactivation | ||
| Given a WP install | ||
| When I run `wp plugin install bbpress buddypress --activate` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Activating 'buddypress'... | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| [] | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' deactivated. | ||
| Plugin 'buddypress' deactivated. | ||
| Success: Deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| ["bbpress","buddypress"] | ||
| """ | ||
|
|
||
| @require-wp-5.0 | ||
| Scenario: Use recently active plugin to activate plugins | ||
| Given a WP install | ||
| When I run `wp plugin install bbpress buddypress --activate` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Activating 'buddypress'... | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' deactivated. | ||
| Plugin 'buddypress' deactivated. | ||
| Success: Deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin activate $(wp plugin list --recently-active --field=name)` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' activated. | ||
| Plugin 'buddypress' activated. | ||
| """ | ||
|
|
||
| @require-php-7.0 @require-wp-5.0 | ||
| Scenario: For a MU site, verify plugin installation, activation, deactivation and confirm listing recently active plugins list is correct | ||
| Given a WP multisite install | ||
| When I run `wp plugin install bbpress buddypress gutenberg --activate-network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Network-activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Network-activating 'buddypress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Network-activating 'gutenberg'... | ||
| """ | ||
|
|
||
| When I run `wp plugin activate akismet --network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'akismet' network activated. | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress --network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' network deactivated. | ||
| Plugin 'buddypress' network deactivated. | ||
| Success: Network deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| ["bbpress","buddypress"] | ||
| """ | ||
|
|
||
| @require-wp-5.0 | ||
| Scenario: For a MU site, re-confirm recently active list before and after deactivation | ||
| Given a WP install | ||
| When I run `wp plugin install bbpress buddypress --activate-network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Network-activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Network-activating 'buddypress'... | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| [] | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress --network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' network deactivated. | ||
| Plugin 'buddypress' network deactivated. | ||
| Success: Network deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin list --recently-active --field=name --format=json` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| ["bbpress","buddypress"] | ||
| """ | ||
|
|
||
| @require-wp-5.0 | ||
| Scenario: For a MU site, use recently active plugin to activate plugins | ||
| Given a WP install | ||
| When I run `wp plugin install bbpress buddypress --activate-network` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Network-activating 'bbpress'... | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Network-activating 'buddypress'... | ||
| """ | ||
|
|
||
| When I run `wp plugin deactivate bbpress buddypress` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' network deactivated. | ||
| Plugin 'buddypress' network deactivated. | ||
| Success: Network deactivated 2 of 2 plugins. | ||
| """ | ||
|
|
||
| When I run `wp plugin activate $(wp plugin list --recently-active --field=name) --network` | ||
| Then STDOUT should not be empty | ||
| And STDOUT should contain: | ||
| """ | ||
| Plugin 'bbpress' network deactivated. | ||
| Plugin 'buddypress' network deactivated. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document how the behavior changes for multisite too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbachhuber sorry, didn't get what needs to be done here.