Skip to content

Commit f2c15a1

Browse files
committed
Release 1.0.7
Fix WordPress 7.0 pre-release check: use is_wp_version_compatible( '7.0' ) so 7.0-RC2 and similar builds are not rejected (PHP version_compare alone treats them as below 7.0). Made-with: Cursor
1 parent 4260053 commit f2c15a1

4 files changed

Lines changed: 37 additions & 10 deletions

File tree

RELEASING.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Option A — WP-CLI (install package once):
4040
Option B — zip from the parent of the plugin folder (recommended):
4141

4242
cd /path/to/parent-of-bouncer
43-
zip -r bouncer-1.0.6.zip bouncer \
43+
zip -r bouncer-1.0.7.zip bouncer \
4444
-x "bouncer/.git/*" \
4545
-x "bouncer/.github/*" \
4646
-x "bouncer/.gitignore" \
@@ -67,10 +67,10 @@ Do **not** zip from inside the repo root with `zip ... .` — that produces a fl
6767

6868
Git tag
6969
-------
70-
git tag -a v1.0.6 -m "Bouncer 1.0.6"
71-
git push origin v1.0.6
70+
git tag -a v1.0.7 -m "Bouncer 1.0.7"
71+
git push origin v1.0.7
7272

7373
WordPress.org SVN (if applicable)
7474
---------------------------------
75-
* Copy plugin files into /trunk, sync tags/1.0.6 from that tree
75+
* Copy plugin files into /trunk, sync tags/1.0.7 from that tree
7676
* readme.txt Stable tag must match BOUNCER_VERSION

bouncer.php

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Bouncer
44
* Plugin URI: https://regionallyfamous.com/bouncer
55
* Description: A plugin behavior firewall for WordPress. Monitors what your plugins actually do — database queries, outbound HTTP, hook registrations, file changes — and uses AI to catch threats before they cause damage.
6-
* Version: 1.0.6
6+
* Version: 1.0.7
77
* Requires at least: 7.0
88
* Requires PHP: 8.1
99
* Author: Regionally Famous
@@ -29,8 +29,32 @@
2929
return;
3030
}
3131

32-
global $wp_version;
33-
if ( ! isset( $wp_version ) || version_compare( $wp_version, '7.0', '<' ) ) {
32+
/**
33+
* Whether the site meets Bouncer’s WordPress minimum (7.0), including 7.0 betas/RCs.
34+
*
35+
* Raw `version_compare( $wp_version, '7.0' )` treats `7.0-RC2` as below `7.0`; core’s
36+
* `is_wp_version_compatible()` handles pre-releases correctly.
37+
*
38+
* @return bool
39+
*/
40+
function bouncer_meets_minimum_wp(): bool {
41+
if ( function_exists( 'is_wp_version_compatible' ) ) {
42+
return is_wp_version_compatible( '7.0' );
43+
}
44+
45+
global $wp_version;
46+
if ( ! isset( $wp_version ) || ! is_string( $wp_version ) ) {
47+
return false;
48+
}
49+
50+
if ( ! preg_match( '/^(\d+\.\d+(?:\.\d+)?)/', $wp_version, $matches ) ) {
51+
return false;
52+
}
53+
54+
return version_compare( $matches[1], '7.0', '>=' );
55+
}
56+
57+
if ( ! bouncer_meets_minimum_wp() ) {
3458
if ( ! defined( 'BOUNCER_PLUGIN_FILE' ) ) {
3559
define( 'BOUNCER_PLUGIN_FILE', __FILE__ );
3660
}
@@ -40,7 +64,7 @@
4064
return;
4165
}
4266

43-
define( 'BOUNCER_VERSION', '1.0.6' );
67+
define( 'BOUNCER_VERSION', '1.0.7' );
4468
define( 'BOUNCER_PLUGIN_FILE', __FILE__ );
4569
define( 'BOUNCER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
4670
define( 'BOUNCER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Installed/removed automatically by the Bouncer plugin. Do not edit.
99
*
1010
* @package Bouncer
11-
* @version 1.0.6
11+
* @version 1.0.7
1212
*/
1313

1414
defined( 'ABSPATH' ) || exit;

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: security, firewall, plugin-monitor, ai-security, behavior-monitoring
44
Requires at least: 7.0
55
Tested up to: 7.0
66
Requires PHP: 8.1
7-
Stable tag: 1.0.6
7+
Stable tag: 1.0.7
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -111,6 +111,9 @@ In Monitor mode, Bouncer only observes and logs. It never blocks or modifies any
111111

112112
== Changelog ==
113113

114+
= 1.0.7 =
115+
* Fix: accept **WordPress 7.0 pre-releases** (beta, RC, etc.) as meeting the 7.0 requirement. Plain `version_compare( $wp_version, '7.0' )` treats `7.0-RC2` as older than `7.0`; Bouncer now uses `is_wp_version_compatible( '7.0' )` with a safe fallback.
116+
114117
= 1.0.6 =
115118
* Dev: satisfy ESLint `jsdoc/require-jsdoc` and `jsdoc/tag-lines` in `bouncer-admin.js` (CI `npm run lint:js`).
116119

0 commit comments

Comments
 (0)