Plugin Directory

Changeset 3443609


Ignore:
Timestamp:
01/20/2026 10:46:16 PM (2 months ago)
Author:
bsolveit
Message:

Version 1.6.0 - Improved settings UX with AJAX auto-populate

Location:
365i-queue-optimizer/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 365i-queue-optimizer/trunk/365i-queue-optimizer.php

    r3436746 r3443609  
    44 * Plugin URI: https://www.365i.co.uk/blog/2025/04/20/fix-wordpress-6-8-slow-image-uploads-with-365i-queue-optimizer/
    55 * Description: A lightweight WordPress plugin to optimize ActionScheduler queue processing for faster image optimization and background tasks.
    6  * Version: 1.5.0
     6 * Version: 1.6.0
    77 * Author: 365i
    88 * Author URI: https://www.mcneece.com/author/mark-mcneece/
     
    2222
    2323// Define plugin constants.
    24 define( 'QUEUE_OPTIMIZER_VERSION', '1.5.0' );
     24define( 'QUEUE_OPTIMIZER_VERSION', '1.6.0' );
    2525define( 'QUEUE_OPTIMIZER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2626define( 'QUEUE_OPTIMIZER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • 365i-queue-optimizer/trunk/CHANGELOG.md

    r3421676 r3443609  
    22
    33All notable changes to this project will be documented in this file.
     4
     5### [1.6.0] - 2025-01-20
     6
     7#### Improved
     8- Settings UX: Server type dropdown now auto-populates recommended settings instantly via AJAX
     9- No longer need to save before applying recommendations - select server type and settings update immediately
     10- Streamlined workflow: select server type, adjust if needed, save once
     11
     12### [1.5.0] - 2025-01-10
     13
     14#### Fixed
     15- Server detection being too optimistic (shared hosting incorrectly detected as dedicated)
     16- Default fallback changed from VPS to Shared for unknown environments
     17
     18#### Added
     19- Manual server type override setting (Shared/VPS/Dedicated dropdown)
     20- More conservative auto-detection thresholds (1GB+ for dedicated, 512MB+ for VPS)
     21
     22#### Changed
     23- Lowered recommended settings to safer defaults:
     24  - Shared: 30s time limit, 1 batch, 25 actions, 3 days retention
     25  - VPS: 45s time limit, 2 batches, 35 actions, 5 days retention
     26  - Dedicated: 60s time limit, 4 batches, 50 actions, 7 days retention
     27
     28### [1.4.2] - 2025-01-10
     29
     30#### Added
     31- Save notification that appears when settings are saved and auto-dismisses after 3 seconds
     32
     33### [1.4.1] - 2025-01-10
     34
     35#### Added
     36- WordPress Playground blueprint.json for Live Preview support
     37
     38#### Fixed
     39- Contributors field to use valid WordPress.org username
     40
     41### [1.4.0] - 2025-01-10
     42
     43#### Added
     44- Dashboard widget showing queue health, pending/running/failed counts
     45- Server environment detection (Shared, VPS, Dedicated hosting)
     46- Recommended settings based on detected server type
     47- "Apply Recommended Settings" one-click optimization button
     48- "Run Queue Now" button on both settings page and dashboard widget
     49- Batch size setting (25-200 actions per batch)
     50- Data retention setting (1-30 days for completed action logs)
     51- Queue status display with breakdown by action hook type
     52- Server environment info panel (PHP, WordPress, memory, image libraries)
     53- Image processing capabilities display (WebP, AVIF support)
     54
     55#### Changed
     56- Enhanced settings page with two-column layout
     57- Improved current settings display with recommended value indicators
     58- Updated admin styling for better visual hierarchy
     59
     60#### Fixed
     61- Plugin Check compliance (translators comments, variable prefixes, output escaping)
     62- Removed deprecated load_plugin_textdomain() call (handled by WordPress 4.6+)
    463
    564### [1.3.1] - 2025-12-17
  • 365i-queue-optimizer/trunk/admin/class-settings-page.php

    r3436746 r3443609  
    195195
    196196        wp_localize_script( 'queue-optimizer-admin', 'queueOptimizerAdmin', array(
    197             'ajaxUrl'     => admin_url( 'admin-ajax.php' ),
    198             'nonce'       => wp_create_nonce( 'qo_admin_nonce' ),
    199             'recommended' => Queue_Optimizer_Main::get_recommended_settings(),
    200             'i18n'        => array(
    201                 'running'    => __( 'Processing...', '365i-queue-optimizer' ),
    202                 'runQueue'   => __( 'Run Queue Now', '365i-queue-optimizer' ),
     197            'ajaxUrl'            => admin_url( 'admin-ajax.php' ),
     198            'nonce'              => wp_create_nonce( 'qo_admin_nonce' ),
     199            'recommended'        => Queue_Optimizer_Main::get_recommended_settings(),
     200            'allRecommendations' => Queue_Optimizer_Main::get_all_recommendations(),
     201            'i18n'               => array(
     202                'running'           => __( 'Processing...', '365i-queue-optimizer' ),
     203                'runQueue'          => __( 'Run Queue Now', '365i-queue-optimizer' ),
    203204                /* translators: %d: number of actions processed */
    204                 'processed'  => __( 'Processed %d actions', '365i-queue-optimizer' ),
    205                 'noActions'  => __( 'No pending actions to process', '365i-queue-optimizer' ),
    206                 'error'      => __( 'Error running queue', '365i-queue-optimizer' ),
     205                'processed'         => __( 'Processed %d actions', '365i-queue-optimizer' ),
     206                'noActions'         => __( 'No pending actions to process', '365i-queue-optimizer' ),
     207                'error'             => __( 'Error running queue', '365i-queue-optimizer' ),
     208                'recommendedApplied' => __( 'Recommended settings applied for this server type.', '365i-queue-optimizer' ),
    207209            ),
    208210        ) );
  • 365i-queue-optimizer/trunk/assets/js/admin.js

    r3436746 r3443609  
    1414    function initAdmin() {
    1515        validateNumericInputs();
     16        initServerTypeChange();
    1617        initApplyRecommended();
    1718        initRunQueue();
     
    4748
    4849    /**
    49      * Handle "Apply Recommended Settings" button
    50      */
    51     function initApplyRecommended() {
    52         $('#qo-apply-recommended').on('click', function(e) {
    53             e.preventDefault();
    54 
    55             if (typeof queueOptimizerAdmin === 'undefined' || !queueOptimizerAdmin.recommended) {
    56                 return;
    57             }
    58 
    59             var rec = queueOptimizerAdmin.recommended;
    60 
    61             // Apply recommended values to form fields
    62             $('#queue_optimizer_time_limit').val(rec.time_limit).removeClass('error');
    63             $('#queue_optimizer_concurrent_batches').val(rec.concurrent_batches).removeClass('error');
    64             $('#queue_optimizer_batch_size').val(rec.batch_size).removeClass('error');
    65             $('#queue_optimizer_retention_days').val(rec.retention_days).removeClass('error');
    66 
    67             // Highlight changed fields briefly
    68             var fields = [
    69                 '#queue_optimizer_time_limit',
    70                 '#queue_optimizer_concurrent_batches',
    71                 '#queue_optimizer_batch_size',
    72                 '#queue_optimizer_retention_days'
    73             ];
    74 
    75             fields.forEach(function(selector) {
    76                 $(selector).addClass('qo-highlight');
    77                 setTimeout(function() {
    78                     $(selector).removeClass('qo-highlight');
    79                 }, 1500);
    80             });
    81 
    82             // Show notice
     50     * Apply recommended settings to form fields
     51     *
     52     * @param {Object} rec Recommended settings object
     53     * @param {boolean} showNotice Whether to show the notification
     54     */
     55    function applyRecommendedSettings(rec, showNotice) {
     56        if (!rec) {
     57            return;
     58        }
     59
     60        // Apply recommended values to form fields
     61        $('#queue_optimizer_time_limit').val(rec.time_limit).removeClass('error');
     62        $('#queue_optimizer_concurrent_batches').val(rec.concurrent_batches).removeClass('error');
     63        $('#queue_optimizer_batch_size').val(rec.batch_size).removeClass('error');
     64        $('#queue_optimizer_retention_days').val(rec.retention_days).removeClass('error');
     65
     66        // Highlight changed fields briefly
     67        var fields = [
     68            '#queue_optimizer_time_limit',
     69            '#queue_optimizer_concurrent_batches',
     70            '#queue_optimizer_batch_size',
     71            '#queue_optimizer_retention_days'
     72        ];
     73
     74        fields.forEach(function(selector) {
     75            $(selector).addClass('qo-highlight');
     76            setTimeout(function() {
     77                $(selector).removeClass('qo-highlight');
     78            }, 1500);
     79        });
     80
     81        // Show notice if requested
     82        if (showNotice) {
     83            var message = queueOptimizerAdmin.i18n.recommendedApplied ||
     84                'Recommended settings applied. Click "Save Changes" to save.';
     85
    8386            var $notice = $('<div class="notice notice-info is-dismissible qo-applied-notice"><p>' +
    84                 'Recommended settings applied. Click "Save Changes" to save.</p></div>');
     87                message + '</p></div>');
    8588
    8689            $('.qo-applied-notice').remove();
     
    9396                });
    9497            }, 5000);
     98        }
     99    }
     100
     101    /**
     102     * Handle server type dropdown change - auto-populate recommended settings
     103     */
     104    function initServerTypeChange() {
     105        $('#queue_optimizer_server_type_override').on('change', function() {
     106            if (typeof queueOptimizerAdmin === 'undefined' || !queueOptimizerAdmin.allRecommendations) {
     107                return;
     108            }
     109
     110            var selectedType = $(this).val();
     111            var rec;
     112
     113            if (selectedType && queueOptimizerAdmin.allRecommendations[selectedType]) {
     114                // User selected a specific server type
     115                rec = queueOptimizerAdmin.allRecommendations[selectedType];
     116            } else {
     117                // Auto-detect selected - use the current recommended settings
     118                rec = queueOptimizerAdmin.recommended;
     119            }
     120
     121            applyRecommendedSettings(rec, true);
     122        });
     123    }
     124
     125    /**
     126     * Handle "Apply Recommended Settings" button
     127     */
     128    function initApplyRecommended() {
     129        $('#qo-apply-recommended').on('click', function(e) {
     130            e.preventDefault();
     131
     132            if (typeof queueOptimizerAdmin === 'undefined') {
     133                return;
     134            }
     135
     136            var selectedType = $('#queue_optimizer_server_type_override').val();
     137            var rec;
     138
     139            if (selectedType && queueOptimizerAdmin.allRecommendations && queueOptimizerAdmin.allRecommendations[selectedType]) {
     140                rec = queueOptimizerAdmin.allRecommendations[selectedType];
     141            } else {
     142                rec = queueOptimizerAdmin.recommended;
     143            }
     144
     145            applyRecommendedSettings(rec, true);
    95146        });
    96147    }
  • 365i-queue-optimizer/trunk/readme.txt

    r3436755 r3443609  
    44Requires at least: 5.8
    55Tested up to: 6.9
    6 Stable tag: 1.5.0
     6Stable tag: 1.6.0
    77Requires PHP: 8.0
    88License: GPLv2 or later
     
    191191
    192192== Changelog ==
     193
     194= 1.6.0 - 2025-01-20 =
     195
     196**Improved Settings UX**
     197
     198* Server type dropdown now auto-populates recommended settings immediately when changed
     199* No need to save first before applying recommendations - settings update instantly via AJAX
     200* "Apply Recommended Settings" button still works as a shortcut
     201* Streamlined workflow: select server type, adjust if needed, save once
    193202
    194203= 1.5.0 - 2025-01-10 =
  • 365i-queue-optimizer/trunk/src/class-queue-optimizer-main.php

    r3436746 r3443609  
    306306
    307307    /**
    308      * Get recommended settings based on server environment.
    309      *
    310      * @since 1.4.0
    311      * @since 1.5.0 More conservative default values.
    312      * @return array Recommended settings.
    313      */
    314     public static function get_recommended_settings() {
    315         $server_type = self::detect_server_type();
    316 
    317         // Conservative recommendations to prevent failures on shared resources.
    318         $recommendations = array(
     308     * Get all recommendations for all server types.
     309     *
     310     * @since 1.6.0
     311     * @return array All server type recommendations.
     312     */
     313    public static function get_all_recommendations() {
     314        return array(
    319315            'shared' => array(
    320316                'time_limit'         => 30,
     
    336332            ),
    337333        );
     334    }
     335
     336    /**
     337     * Get recommended settings based on server environment.
     338     *
     339     * @since 1.4.0
     340     * @since 1.5.0 More conservative default values.
     341     * @return array Recommended settings.
     342     */
     343    public static function get_recommended_settings() {
     344        $server_type     = self::detect_server_type();
     345        $recommendations = self::get_all_recommendations();
    338346
    339347        return isset( $recommendations[ $server_type ] )
Note: See TracChangeset for help on using the changeset viewer.