fix: budget check strict comparison bug — 0 !== 0.0 in PHP (v4.4.2)

is_budget_exceeded() used `0 === $budget` but floatval() returns float,
so 0 (int) === 0.0 (float) is always false. This caused unlimited
budget ($0) to be treated as exceeded, blocking all AI generation.

Same bug existed in the admin display (showed "$0.00" instead of
"Unlimited" for budget remaining).

This was a P1 bug that prevented ALL AI content generation since v4.3.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-14 01:27:02 +07:00
parent 74301682fe
commit 52a83439b1
3 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
* Plugin Name: Peptide Search AI
* Plugin URI: https://example.com/peptide-search-ai
* Description: Searchable peptide database with AI-powered auto-population and browsable directory.
* Version: 4.4.1
* Version: 4.4.2
* Author: Terence
* License: GPL v2 or later
* Text Domain: peptide-search-ai
@@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'PSA_VERSION', '4.4.1' );
define( 'PSA_VERSION', '4.4.2' );
define( 'PSA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'PSA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'PSA_PLUGIN_FILE', __FILE__ );