PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.8
Patchstack – WordPress & Plugins Security v2.2.8
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | patchstack.php +21 -8 2.2.72.2.8 View file →
@@ -3,9 +3,9 @@
3 3 * Plugin Name: Patchstack Security
4 4 * Plugin URI: https://patchstack.com/?utm_medium=wp&utm_source=dashboard&utm_campaign=patchstack%20plugin
5 5 * Author URI: https://patchstack.com/?utm_medium=wp&utm_source=dashboard&utm_campaign=patchstack%20plugin
6 6 * Description: Patchstack identifies security vulnerabilities in WordPress plugins, themes, and core.
7 - * Version: 2.2.7
7 + * Version: 2.2.8
8 8 * Author: Patchstack
9 9 * License: GPLv3
10 10 * Text Domain: patchstack
11 11 * Domain Path: /languages
@@ -58,9 +58,9 @@
58 58 * The plugin version.
59 59 *
60 60 * @var string
61 61 */
62 - const VERSION = '2.2.7';
62 + const VERSION = '2.2.8';
63 63
64 64 /**
65 65 * API URL of Patchstack to communicate with.
66 66 *
@@ -229,22 +229,35 @@
229 229 * Returns an error if the connection was not successful.
230 230 *
231 231 * ## OPTIONS
232 232 *
233 - * <id>
233 + * [<id>]
234 234 * : The API client id.
235 235 *
236 - * <secret>
236 + * [<secret>]
237 237 * : The API secret key.
238 - *
238 + *
239 + * <secret-id>
240 + * : The API client id and secret key merged together, found in the App. E.g. 2b072e8b60402e30d481df351fc08183906254e0-123456
241 + *
239 242 * ## EXAMPLES
240 - *
243 + *
241 244 * $ wp patchstack activate 123456 2b072e8b60402e30d481df351fc08183906254e0
242 245 * Success: The Patchstack plugin has been successfully connected.
246 + *
247 + * or
248 + *
249 + * $ wp patchstack activate 2b072e8b60402e30d481df351fc08183906254e0-123456
250 + * Success: The Patchstack plugin has been successfully connected.
243 251 */
244 252 public function cli_activate( $args ) {
245 - $id = isset( $args[0] ) ? trim( $args[0] ) : '';
246 - $secret = isset( $args[1] ) ? trim( $args[1] ) : '';
253 + // Handle both ways to activate the plugin.
254 + if ( count( $args ) === 1 && strpos( $args[0], '-' ) !== false ) {
255 + list( $secret, $id ) = explode( '-', $args[0] );
256 + } else {
257 + $id = isset( $args[0] ) ? trim( $args[0] ) : '';
258 + $secret = isset( $args[1] ) ? trim( $args[1] ) : '';
259 + }
247 260
248 261 $result = $this->activation->alter_license( $id, $secret, 'activate' );
249 262 if ( $result['result'] == 'error' ) {
250 263 \WP_CLI::error( 'The Patchstack plugin could not be connected. Make sure the id and secret key are valid and that api.patchstack.com is not blocked.' );