-
|
+
diff --git a/includes/class-cli-wpvulnerability.php b/includes/class-cli-wpvulnerability.php index c62b5b8..326fb3d 100644 --- a/includes/class-cli-wpvulnerability.php +++ b/includes/class-cli-wpvulnerability.php @@ -7,14 +7,13 @@ // Make sure the file is not directly accessible. if ( ! defined( 'ABSPATH' ) ) { - die( 'We\'re sorry, but you can not directly access this file.' ); + die( 'We\'re sorry, but you cannot directly access this file.' ); } /** * Class CLI commands. */ class CLI_WPVulnerability { - /** * CLI constructor. * @@ -23,13 +22,12 @@ class CLI_WPVulnerability { */ public function __construct( $plugins_wpvulnerability ) { $this->plugins = $plugins_wpvulnerability->get_installed_plugins(); - if ( class_exists( 'WP_CLI' ) ) { WP_CLI::add_command( 'wpvulnerability', array( $this, 'cli_command' ), array( - 'shortdesc' => 'Prints a vulnerability', + 'shortdesc' => 'Show the list of vulnerabilities detected in your site.', 'synopsis' => array( array( 'type' => 'positional', @@ -64,18 +62,17 @@ public function cli_command( $args ) { $this->themes_subcommand(); break; default: - WP_CLI::error( "'$args[0]' is not a registered subcommand of 'wpvulnerebality'.\nAvailable subcommands: core, plugins, themes" ); + WP_CLI::error( "'$args[0]' is not a registered subcommand of 'wpvulnerability'.\nAvailable subcommands: core, plugins, themes" ); break; } } - /** * Themes section. */ public function core_subcommand() { // TODO. - WP_CLI::error( 'Subcommand not implemented yet' ); + WP_CLI::error( 'Command not implemented yet' ); } /** @@ -101,7 +98,6 @@ public function plugins_subcommand() { ) ); } - WP_CLI\Utils\format_items( 'table', $vulnerabilities, @@ -117,6 +113,6 @@ public function plugins_subcommand() { */ public function themes_subcommand() { // TODO. - WP_CLI::error( 'Subcommand not implemented yet' ); + WP_CLI::error( 'Command not implemented yet' ); } } diff --git a/includes/class-health-wpvulnerability.php b/includes/class-health-wpvulnerability.php index 2719e10..c779ecc 100644 --- a/includes/class-health-wpvulnerability.php +++ b/includes/class-health-wpvulnerability.php @@ -14,7 +14,6 @@ * Class HealthCheck */ class Health_WPVulnerability { - /** * Construct Class for Health Kit */ @@ -30,17 +29,17 @@ public function __construct() { */ public function add_vulnerability_tests( $tests ) { $tests['direct']['wpvulnerability_core'] = array( - 'label' => __( 'WP Vulnerability Core', 'wpvulnerability' ), + 'label' => __( 'WPVulnerability Core', 'wpvulnerability' ), 'test' => array( $this, 'test_vulnerability_core' ), ); $tests['direct']['wpvulnerability_themes'] = array( - 'label' => __( 'WP Vulnerability Themes', 'wpvulnerability' ), + 'label' => __( 'WPVulnerability Themes', 'wpvulnerability' ), 'test' => array( $this, 'test_vulnerability_themes' ), ); $tests['direct']['wpvulnerability_plugins'] = array( - 'label' => __( 'WP Vulnerability Plugins', 'wpvulnerability' ), + 'label' => __( 'WPVulnerability Plugins', 'wpvulnerability' ), 'test' => array( $this, 'test_vulnerability_plugins' ), ); @@ -54,15 +53,15 @@ public function add_vulnerability_tests( $tests ) { */ public function test_vulnerability_core() { $result = array( - 'label' => __( 'There are no vulnerabilities in WordPress Core.', 'wpvulnerability' ), + 'label' => __( 'There aren\'t WordPress vulnerabilities', 'wpvulnerability' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Security', 'wpvulnerability' ), - 'color' => 'red', + 'color' => 'green', ), 'description' => sprintf( '
%s
', - __( 'You can see the vulnerabilities found in your WordPress installation.', 'wpvulnerability' ) + __( 'Shows possible vulnerabilities existing in the WordPress core.', 'wpvulnerability' ) ), 'actions' => '', 'test' => 'wpvulnerability_core', @@ -71,16 +70,17 @@ public function test_vulnerability_core() { $core_vulnerabilities = wpvulnerability_get_core(); if ( ! empty( $core_vulnerabilities ) ) { $result['status'] = 'critical'; - $result['label'] = __( 'There are vulnerabilities in WordPress Core.', 'wpvulnerability' ); + $result['label'] = __( 'There are WordPress Core vulnerabilities', 'wpvulnerability' ); + $result['badge']['color'] = 'red'; $result['description'] = sprintf( '%1$s
%2$s', - __( 'We have found vulnerabilities in WordPress Core.', 'wpvulnerability' ), + __( 'We\'ve detected potential vulnerabilities in this WordPress installation. Please check them and keep your installation updated.', 'wpvulnerability' ), wpvulnerability_get_html_vulnerabilities( $core_vulnerabilities ) ); $result['actions'] .= sprintf( '', esc_url( admin_url( 'update-core.php' ) ), - __( 'Update WordPress Core' ) + __( 'Update WordPress' ) ); } @@ -94,15 +94,15 @@ public function test_vulnerability_core() { */ public function test_vulnerability_themes() { $result = array( - 'label' => __( 'There are no vulnerabilities in Themes.', 'wpvulnerability' ), + 'label' => __( 'There aren\'t themes vulnerabilities', 'wpvulnerability' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Security', 'wpvulnerability' ), - 'color' => 'red', + 'color' => 'green', ), 'description' => sprintf( '%s
', - __( 'You can see the vulnerabilities found in your WordPress installation.', 'wpvulnerability' ) + __( 'Shows possible vulnerabilities that exist in installed themes.', 'wpvulnerability' ) ), 'actions' => '', 'test' => 'wpvulnerability_themes', @@ -112,16 +112,17 @@ public function test_vulnerability_themes() { if ( ! empty( $html_vuln ) ) { $result['status'] = 'critical'; - $result['label'] = __( 'There are vulnerabilities in Themes.', 'wpvulnerability' ); + $result['label'] = __( 'There are themes vulnerabilities', 'wpvulnerability' ); + $result['badge']['color'] = 'red'; $result['description'] = sprintf( '%1$s
%2$s', - __( 'We have found vulnerabilities in Themes.', 'wpvulnerability' ), + __( 'We\'ve detected potential vulnerabilities in installed themes. Please check them and keep them updated.', 'wpvulnerability' ), $html_vuln ); $result['actions'] .= sprintf( '', - esc_url( admin_url( 'update-core.php' ) ), - __( 'Update Themes' ) + esc_url( admin_url( 'themes.php' ) ), + __( 'Update themes' ) ); } @@ -135,15 +136,15 @@ public function test_vulnerability_themes() { */ public function test_vulnerability_plugins() { $result = array( - 'label' => __( 'There are no vulnerabilities in Plugins.', 'wpvulnerability' ), + 'label' => __( 'There aren\'t plugins vulnerabilities', 'wpvulnerability' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Security', 'wpvulnerability' ), - 'color' => 'red', + 'color' => 'green', ), 'description' => sprintf( '%s
', - __( 'You can see the vulnerabilities found in your WordPress installation.', 'wpvulnerability' ) + __( 'Shows possible vulnerabilities that exist in installed plugins.', 'wpvulnerability' ) ), 'actions' => '', 'test' => 'wpvulnerability_plugins', @@ -153,16 +154,17 @@ public function test_vulnerability_plugins() { if ( ! empty( $html_vuln ) ) { $result['status'] = 'critical'; - $result['label'] = __( 'There are vulnerabilities in Plugins.', 'wpvulnerability' ); + $result['label'] = __( 'There are plugins vulnerabilities', 'wpvulnerability' ); + $result['badge']['color'] = 'red'; $result['description'] = sprintf( '%1$s
%2$s', - __( 'We have found vulnerabilities in Plugins. You cand find below.', 'wpvulnerability' ), + __( 'We\'ve detected potential vulnerabilities in installed plugins. Please check them and keep them updated.', 'wpvulnerability' ), $html_vuln ); $result['actions'] .= sprintf( '', - esc_url( admin_url( 'update-core.php' ) ), - __( 'Update Plugins' ) + esc_url( admin_url( 'plugins.php' ) ), + __( 'Update plugins' ) ); } diff --git a/includes/class-plugins-wpvulnerability.php b/includes/class-plugins-wpvulnerability.php index b11e54d..bd4ad4c 100644 --- a/includes/class-plugins-wpvulnerability.php +++ b/includes/class-plugins-wpvulnerability.php @@ -259,7 +259,7 @@ public function after_row_text( $plugin_file, $plugin_data, $status ) { $message = sprintf( /* translators: 1: plugin name */ - __( '%1$s has a known vulnerability that may be affecting this version. Please update this plugin.', 'wpvulnerability' ), + __( '%1$s has a known vulnerability that may be affecting this version.', 'wpvulnerability' ), $plugin_data['Name'] ); @@ -271,10 +271,18 @@ public function after_row_text( $plugin_file, $plugin_data, $status ) { $vulnerabilities = $this->get_cached_plugin_vulnerabilities( $wpvulnerability_data[ $plugin_file ], $plugin_file ); foreach ( $vulnerabilities['vulnerabilities'] as $vulnerability ) { - $source = implode( ', ', array_column( $vulnerability['source'], 'name' ) ); + $source = implode( '%2$s
- |
-
-
|