Skip to content

Commit

Permalink
API endpoints: some API endpoints were failing. (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
javiercasares authored Oct 4, 2024
2 parents 5ea2c8a + e791f0a commit 7ea4970
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 39 deletions.
19 changes: 19 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
== Changelog ==

= [4.0.1] - 2024-10-?? =

**Fixed**

* API endpoints: some API endpoints were failing.

**Compatibility**

* WordPress: 4.1 - 6.7
* PHP: 5.6 - 8.4
* WP-CLI: 2.3.0 - 2.11.0

**Tests**

* PHP Coding Standards: 3.10.3
* WordPress Coding Standards: 3.1.0
* Plugin Check (PCP): 1.1.0
* SonarCloud Code Review

= [4.0.0] - 2024-10-01 =

**Added**
Expand Down
57 changes: 22 additions & 35 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: javiercasares, davidperez, lbonomo, alexclassroom
Tags: security, vulnerability, site-health
Requires at least: 4.1
Tested up to: 6.7
Stable tag: 4.0.0
Stable tag: 4.0.1
Requires PHP: 5.6
Version: 4.0.0
Version: 4.0.1
License: GPL-2.0-or-later
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html

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

== Changelog ==

= [4.0.1] - 2024-10-?? =

**Fixed**

* API endpoints: some API endpoints were failing.

**Compatibility**

* WordPress: 4.1 - 6.7
* PHP: 5.6 - 8.4
* WP-CLI: 2.3.0 - 2.11.0

**Tests**

* PHP Coding Standards: 3.10.3
* WordPress Coding Standards: 3.1.0
* Plugin Check (PCP): 1.1.0
* SonarCloud Code Review

= [4.0.0] - 2024-10-01 =

**Added**
Expand Down Expand Up @@ -199,38 +218,6 @@ First of all, peace of mind. Investigate what the vulnerability is and, above al
* Plugin Check (PCP): 1.0.2
* SonarCloud Code Review

= [3.4.0] - 2024-08-16 =

**Added**

* New checks for MariaDB vulnerabilities.
* New checks for MySQL vulnerabilities.
* WPVulnerability statistics in the configuration page.
* WPVulnerability contributors in the configuration page.

**Changed**

* Code improvement.
* Better UI for the configuration page.
* Web server version detection improved.

**Fixed**

* Get the statistics information the right way.

**Compatibility**

* WordPress: 4.1 - 6.7
* PHP: 5.6 - 8.3
* WP-CLI: 2.3.0 - 2.11.0

**Tests**

* PHP Coding Standards: 3.10.2
* WordPress Coding Standards: 3.1.0
* Plugin Check (PCP): 1.0.2
* SonarCloud Code Review

= Previous versions =

If you want to see the full changelog, visit the [changelog.txt](https://plugins.trac.wordpress.org/browser/wpvulnerability/trunk/changelog.txt) file.
Expand All @@ -252,7 +239,7 @@ This plugin adheres to the following security measures and review protocols for

== Vulnerabilities ==

* No vulnerabilities have been published up to version 4.0.0.
* No vulnerabilities have been published up to version 4.0.1.

Found a security vulnerability? Please report it to us privately at the [WPVulnerability GitHub repository](https://github.com/javiercasares/wpvulnerability/security/advisories/new).

Expand Down
6 changes: 3 additions & 3 deletions wpvulnerability-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,17 @@ function wpvulnerability_rest_software_vulnerabilities( $software_type ) {
case 'memcached':
case 'redis':
case 'sqlite':
$vulnerabilities = wpvulnerability_get_vulnerabilities( $software_type );
$vulnerabilities = wpvulnerability_get_vulnerabilities( $software_type, wpvulnerability_get_software_version( $software_type ) );
break;
default:
WP_REST_Response( array(), 400 ); // Invalid software type.
}

$complete_vulnerabilities = array();

if ( isset( $vulnerabilities['vulnerabilities'] ) ) {
if ( isset( $vulnerabilities ) && is_array( $vulnerabilities ) ) {
// Process each vulnerability.
foreach ( $vulnerabilities['vulnerabilities'] as $vulnerability ) {
foreach ( $vulnerabilities as $vulnerability ) {
$temp = array();

$temp['version'] = trim( html_entity_decode( wp_kses( (string) $vulnerability['version'], 'strip' ) ) );
Expand Down
2 changes: 1 addition & 1 deletion wpvulnerability.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Receive information about possible vulnerabilities in your WordPress from WordPress Vulnerability Database API.
* Requires at least: 4.1
* Requires PHP: 5.6
* Version: 4.0.0
* Version: 4.0.1
* Author: Javier Casares
* Author URI: https://www.javiercasares.com/
* License: GPL-2.0-or-later
Expand Down

0 comments on commit 7ea4970

Please sign in to comment.