Skip to content

Commit

Permalink
Merge pull request #16 from javiercasares/15-problem-with-wp_error
Browse files Browse the repository at this point in the history
1.2.3
  • Loading branch information
javiercasares authored Jan 30, 2023
2 parents 9689d58 + 300d5ee commit debf6c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions includes/helpers-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function wpvulnerability_get( $type, $slug = '' ) {
$url .= $slug . '/';
}
$response = wp_remote_get( $url, $args );
if ( 200 === $response->get_error_code() ) {
if ( !is_wp_error( $response ) ) {
$body = wp_remote_retrieve_body( $response );
set_transient( $key, $body, HOUR_IN_SECONDS * 4 );
}
Expand Down Expand Up @@ -187,7 +187,7 @@ function wpvulnerability_get_statistics() {
if ( ! $vulnerability ) {
$url = 'https://www.wpvulnerability.net/';
$response = wp_remote_get( $url );
if ( 200 === $response->get_error_code() ) {
if ( !is_wp_error( $response ) ) {
$body = wp_remote_retrieve_body( $response );
set_transient( $key, $body, HOUR_IN_SECONDS * 4 );
}
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: javiercasares, davidperez, lbonomo
Tags: security, vulnerability, site-health
Requires at least: 5.2
Tested up to: 6.1
Stable tag: 1.2.2
Version: 1.2.2
Stable tag: 1.2.3
Version: 1.2.3
License: EUPL v1.2
License URI: https://www.eupl.eu/1.2/en/

Expand Down Expand Up @@ -69,6 +69,9 @@ First of all, peace of mind. Investigate what the vulnerability is and, above al

== Changelog ==

= 1.2.3 =
* Fix WP_Error object.

= 1.2.2 =
* Fix WP_Error object.

Expand Down
4 changes: 2 additions & 2 deletions wpvulnerability.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Check the security of a WordPress site with information from the WordPress Vulnerability Database API. Scans Core, plugins, and theme vulnerabilities.
* Requires at least: 5.2
* Requires PHP: 7.2
* Version: 1.2.2
* Version: 1.2.3
* Author: Javier Casares
* Author URI: https://www.javiercasares.com/
* Text Domain: wpvulnerability
Expand All @@ -26,7 +26,7 @@
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );

define( 'WPVUL_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
define( 'WPVUL_PLUGIN_VERSION', '1.2.2' );
define( 'WPVUL_PLUGIN_VERSION', '1.2.3' );
define( 'WPVUL_PLUGIN_FILE', __FILE__ );
define( 'WPVUL_PLUGIN_BASE', plugin_basename( __FILE__ ) );
define( 'WPVUL_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Expand Down

0 comments on commit debf6c4

Please sign in to comment.