diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a0f54..607fea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to PRAutoBlogger will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project uses [Semantic Versioning](https://semver.org/). +## [0.13.9] - 2026-04-26 + +### Fixed +- Model picker sort by price now works correctly for image models — previously + \`applySort\` always read \`input_price_per_m\` (undefined on image models), + so every image had an effective price of 0 and price sort was a no-op. + Fix: detect image models via \`cost_per_image\` and use that field instead. + ## [0.13.8] - 2026-04-26 ### Added diff --git a/assets/js/model-picker.js b/assets/js/model-picker.js index abf38dd..33ef463 100644 --- a/assets/js/model-picker.js +++ b/assets/js/model-picker.js @@ -101,8 +101,9 @@ var valA, valB; if ( col === 'price' ) { - valA = a.input_price_per_m || 0; - valB = b.input_price_per_m || 0; + // Image models use cost_per_image; text models use input_price_per_m. + valA = ( a.cost_per_image !== undefined ) ? a.cost_per_image : ( a.input_price_per_m || 0 ); + valB = ( b.cost_per_image !== undefined ) ? b.cost_per_image : ( b.input_price_per_m || 0 ); } else if ( col === 'context' ) { valA = a.context_length || 0; valB = b.context_length || 0; diff --git a/prautoblogger.php b/prautoblogger.php index 0647c1e..ce1c90f 100644 --- a/prautoblogger.php +++ b/prautoblogger.php @@ -9,7 +9,7 @@ * Plugin Name: PRAutoBlogger * Plugin URI: https://peptiderepo.com/prautoblogger * Description: Monitors social media for trending topics, generates SEO-friendly blog posts using AI, and publishes them on a daily schedule with full cost tracking and self-improvement metrics. - * Version: 0.13.8 + * Version: 0.13.9 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: PeptideRepo @@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) { | Defined here so every file in the plugin can reference paths, versions, | and limits without magic strings. */ -define( 'PRAUTOBLOGGER_VERSION', '0.13.8' ); +define( 'PRAUTOBLOGGER_VERSION', '0.13.9' ); define( 'PRAUTOBLOGGER_DB_VERSION', '1.1.0' ); define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ ); define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );