Plugin Directory

Changeset 3461944


Ignore:
Timestamp:
02/15/2026 04:49:28 PM (6 weeks ago)
Author:
lumiblog
Message:

This update fixes several bugs including inactive plugins showing as enabled, broken Edit and Cancel buttons on the settings page, and improves compatibility with PHP 8.5.

Location:
lumiblog-debug-log-inspector
Files:
23 added
5 edited

Legend:

Unmodified
Added
Removed
  • lumiblog-debug-log-inspector/trunk/includes/class-admin-bar.php

    r3448600 r3461944  
    6565            'id'    => $menu_id,
    6666            'title' => __( 'LOG INSPECTOR', 'lumiblog-debug-log-inspector' ),
    67             'href'  => admin_url( 'options-general.php?page=debug-log-inspector' ),
     67            'href'  => admin_url( 'options-general.php?page=lumiblog-debug-log-inspector' ),
    6868            'meta'  => array( 'class' => $css_class ),
    6969        ) );
     
    112112            'title'  => __( '⚙️ Settings', 'lumiblog-debug-log-inspector' ),
    113113            'id'     => 'dli-settings-link',
    114             'href'   => admin_url( 'options-general.php?page=debug-log-inspector' ),
     114            'href'   => admin_url( 'options-general.php?page=lumiblog-debug-log-inspector' ),
    115115            'meta'   => array( 'class' => 'dli-admin-settings-link' ),
    116116        ) );
  • lumiblog-debug-log-inspector/trunk/includes/class-settings.php

    r3448600 r3461944  
    2121        add_action( 'admin_init', array( $this, 'handle_form_submission' ) );
    2222        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
     23        add_action( 'current_screen', array( $this, 'register_footer_hooks' ) );
     24    }
     25
     26    /**
     27     * Register admin footer hooks only on the plugin's settings page
     28     */
     29    public function register_footer_hooks() {
     30        $screen = get_current_screen();
     31        if ( ! $screen || 'settings_page_lumiblog-debug-log-inspector' !== $screen->id ) {
     32            return;
     33        }
     34        add_filter( 'admin_footer_text', array( $this, 'custom_footer_text' ) );
     35        add_filter( 'update_footer', array( $this, 'custom_footer_version' ), 11 );
     36    }
     37
     38    /**
     39     * Custom footer left text — rating prompt
     40     *
     41     * @return string
     42     */
     43    public function custom_footer_text() {
     44        return sprintf(
     45            /* translators: %s: WordPress.org review URL */
     46            __( 'If you like <strong>Lumiblog Debug Log Inspector</strong>, please leave us a <a href="%s" target="_blank" rel="noopener noreferrer">★★★★★</a> rating. Thank you so much in advance!', 'lumiblog-debug-log-inspector' ),
     47            'https://wordpress.org/support/plugin/lumiblog-debug-log-inspector/reviews/#new-post'
     48        );
     49    }
     50
     51    /**
     52     * Custom footer right text — plugin version
     53     *
     54     * @return string
     55     */
     56    public function custom_footer_version() {
     57        return sprintf(
     58            /* translators: %s: plugin version number */
     59            __( 'Version %s', 'lumiblog-debug-log-inspector' ),
     60            DEBUG_LOG_INSPECTOR_VERSION
     61        );
    2362    }
    2463
     
    186225            update_option( 'debug_log_inspector_plugins', $plugins );
    187226            $this->add_admin_notice( 'success', __( 'Plugin updated successfully!', 'lumiblog-debug-log-inspector' ) );
     227            wp_safe_redirect( admin_url( 'options-general.php?page=lumiblog-debug-log-inspector' ) );
     228            exit;
    188229        }
    189230    }
  • lumiblog-debug-log-inspector/trunk/lumiblog-debug-log-inspector.php

    r3448600 r3461944  
    44 * Plugin URI:        https://wordpress.org/plugins/lumiblog-debug-log-inspector/
    55 * Description:       Monitor debug logs for any WordPress plugin errors and display real-time status in the admin bar
    6  * Version:           1.0.0
     6 * Version:           1.1.0
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.0
    99 * Author:            Patrick Lumumba
    10  * Author URI:        https://lumumbas.blog
     10 * Author URI:        https://lumumbas-blog.co.ke
    1111 * License:           GPL v2 or later
    1212 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    2020
    2121// Define plugin constants
    22 define( 'DEBUG_LOG_INSPECTOR_VERSION', '2.0.0' );
     22define( 'DEBUG_LOG_INSPECTOR_VERSION', '1.1.0' );
    2323define( 'DEBUG_LOG_INSPECTOR_PATH', plugin_dir_path( __FILE__ ) );
    2424define( 'DEBUG_LOG_INSPECTOR_URL', plugin_dir_url( __FILE__ ) );
  • lumiblog-debug-log-inspector/trunk/readme.txt

    r3448600 r3461944  
    11=== Lumiblog Debug Log Inspector ===
    22Contributors: lumiblog
    3 Donate link: https://lumumbas.blog/support-wp-plugins
     3Donate link: https://lumumbas-blog.co.ke/support-wp-plugins
    44Tags: debug, log, monitor, testing, error tracking
    55Requires at least: 5.0
    66Tested up to: 6.9
    7 Stable tag: 1.0.0
     7Stable tag: 1.1.0
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    163163**Step 3: Generate a Test Error**
    164164
    165 Option A - Using a Test Plugin File:
    166 
    167 1. Create a simple test plugin in `wp-content/plugins/test-error/test-error.php`:
    168 
    169 `
    170 <?php
     165Note: Ensure that the test site is running on PHP 8.4+
     166
     1671. Add this code snippet inside of any active plugin's main file:
     168
     169`
    171170/**
    172  * Plugin Name: Test Error Generator
     171 * DEBUG LOG INSPECTOR DEMO - PHP 8.4 Warning Trigger
     172 * REMOVE AFTER DEMO/TESTING!
    173173 */
    174 if ( isset( $_GET['trigger_test_error'] ) ) {
    175     trigger_error( 'This is a test error from WooCommerce integration', E_USER_WARNING );
    176 }
    177 `
    178 
    179 2. Activate the test plugin
    180 3. Visit: `yoursite.com/wp-admin/?trigger_test_error=1`
    181 4. Check your admin bar - it should turn RED
    182 
    183 Option B - Trigger a Real Error:
    184 
    185 1. Temporarily add this line to any active plugin's main file:
    186 `trigger_error( 'woocommerce test error for debugging', E_USER_WARNING );`
    187 
    188 2. Reload any page in your WordPress admin
    189 3. Remove the line immediately after testing
    190 
    191 **Step 4: Check the Results**
    192 
    193 1. Look at the admin bar - "LOG INSPECTOR" should now be RED
    194 2. Click on "LOG INSPECTOR" to see:
    195    - WooCommerce: ERROR!
    196    - Last Error: [Your test error message]
    197 3. Go to Settings > Log Inspector to manage monitored plugins
    198 
    199 **Step 5: View the Debug Log (Optional)**
     174add_action( 'load-index.php', function() {
     175    if ( version_compare( PHP_VERSION, '8.4.0', '>=' ) ) {
     176        $test_array = array( 'name' => 'Debug Log Inspector' );
     177        $undefined_value = $test_array['email']; // Triggers warning
     178        error_log( '[DLI-DEMO-PHP84] PHP 8.4 warning triggered!' );
     179    }
     180});
     181`
     182
     1832. Reload the site's admin dashboard to trigger the error
     1843. Check your admin bar - it should turn RED
     185
     186**Step 4: View the Debug Log (Optional)**
    200187
    201188Navigate to `wp-content/debug.log` to see the actual error entries that were logged.
     
    229216= Contributing =
    230217
    231 Contributions are welcome! Please visit the plugin's WordPress.org page for more information.
     218Contributions are welcome! Please visit the plugin's [Github Repo](https://github.com/lumumbapl/lumiblog-debug-log-inspector) for more information.
    232219
    233220== Screenshots ==
    234221
    2352221. Settings page - Add new plugins to monitor
    236 2. Monitored plugins list with enable/disable toggles
    237 3. Admin bar showing green status (no errors)
     2232. Admin bar showing green status (no errors)
     2243. Monitored plugins list with enable/disable toggles
    2382254. Admin bar showing red status with error details
    2392265. General settings configuration
    240 6. Add plugin form with field descriptions
    241 7. Edit plugin interface
     2276. Edit plugin interface
    242228
    243229== Changelog ==
     230
     231= 1.1.0 [February 15, 2026] =
     232* Fixed: Minor issues across the plugin [[Issue #1]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/1)
     233* Enhanced: Compatibility with PHP 8.5 [[Issue #2]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/2)
     234* Fixed: Inactive plugins incorrectly shown as enabled when "Only monitor active plugins" is turned on [[Issue #3]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/3)
     235* Fixed: Edit button for monitored plugins not working due to incorrect page slug [[Issue #4]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/4)
     236* Fixed: Edit form not reset to "Add New Plugin" after a successful update [[Issue #5]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/5)
     237* Fixed: Cancel button on the Edit Plugin page not working due to incorrect page slug [[Issue #6]](https://github.com/lumumbapl/lumiblog-debug-log-inspector/issues/6)
    244238
    245239= 1.0.0 =
     
    248242== Upgrade Notice ==
    249243
    250 = 2.0.0 =
    251 Minor fixes
    252 
    253 
     244= 1.1.0 =
     245This update fixes several bugs including inactive plugins showing as enabled, broken Edit and Cancel buttons on the settings page, and improves compatibility with PHP 8.5.
  • lumiblog-debug-log-inspector/trunk/templates/settings-page.php

    r3448600 r3461944  
    7676                    </button>
    7777                    <?php if ( $edit_plugin ) : ?>
    78                         <a href="<?php echo esc_url( admin_url( 'options-general.php?page=debug-log-inspector' ) ); ?>" class="button">
     78                        <a href="<?php echo esc_url( admin_url( 'options-general.php?page=lumiblog-debug-log-inspector' ) ); ?>" class="button">
    7979                            <?php esc_html_e( 'Cancel', 'lumiblog-debug-log-inspector' ); ?>
    8080                        </a>
     
    107107                        foreach ( $plugins as $dli_plugin_index => $plugin ) :
    108108                            $dli_plugin_is_enabled = isset( $plugin['enabled'] ) ? $plugin['enabled'] : true;
    109                             $dli_plugin_is_active = ! empty( $plugin['file_path'] ) ? Debug_Log_Inspector::is_plugin_active( $plugin['file_path'] ) : false;
     109                            $dli_plugin_is_active  = ! empty( $plugin['file_path'] ) ? Debug_Log_Inspector::is_plugin_active( $plugin['file_path'] ) : false;
     110
     111                            // When "Only monitor active plugins" is on and the WP plugin is inactive,
     112                            // monitoring is effectively disabled regardless of the plugin's own enabled flag.
     113                            $dli_auto_enable_overrides = $settings['auto_enable'] && ! empty( $plugin['file_path'] ) && ! $dli_plugin_is_active;
     114                            $dli_effectively_enabled   = $dli_plugin_is_enabled && ! $dli_auto_enable_overrides;
    110115                            ?>
    111                             <tr class="<?php echo $dli_plugin_is_enabled ? '' : 'dli-disabled-row'; ?>">
     116                            <tr class="<?php echo $dli_effectively_enabled ? '' : 'dli-disabled-row'; ?>">
    112117                                <td>
    113118                                    <form method="post" action="" style="display: inline;">
     
    115120                                        <input type="hidden" name="debug_log_inspector_action" value="toggle_plugin">
    116121                                        <input type="hidden" name="plugin_index" value="<?php echo esc_attr( $dli_plugin_index ); ?>">
    117                                         <button type="submit" class="button-link dli-toggle-btn" title="<?php echo $dli_plugin_is_enabled ? esc_attr__( 'Disable', 'lumiblog-debug-log-inspector' ) : esc_attr__( 'Enable', 'lumiblog-debug-log-inspector' ); ?>">
    118                                             <span class="dashicons dashicons-<?php echo $dli_plugin_is_enabled ? 'yes-alt' : 'dismiss'; ?>" style="color: <?php echo $dli_plugin_is_enabled ? '#46b450' : '#dc3232'; ?>;"></span>
     122                                        <button type="submit" class="button-link dli-toggle-btn"
     123                                            <?php if ( $dli_auto_enable_overrides ) : ?>
     124                                                disabled
     125                                                title="<?php esc_attr_e( 'Inactive – enable the plugin in WordPress or turn off "Only monitor active plugins"', 'lumiblog-debug-log-inspector' ); ?>"
     126                                            <?php else : ?>
     127                                                title="<?php echo $dli_plugin_is_enabled ? esc_attr__( 'Disable', 'lumiblog-debug-log-inspector' ) : esc_attr__( 'Enable', 'lumiblog-debug-log-inspector' ); ?>"
     128                                            <?php endif; ?>
     129                                        >
     130                                            <span class="dashicons dashicons-<?php echo $dli_effectively_enabled ? 'yes-alt' : 'dismiss'; ?>" style="color: <?php echo $dli_effectively_enabled ? '#46b450' : '#dc3232'; ?>;"></span>
    119131                                        </button>
    120132                                    </form>
     
    131143                                </td>
    132144                                <td>
    133                                     <a href="<?php echo esc_url( admin_url( 'options-general.php?page=debug-log-inspector&edit=' . $dli_plugin_index ) ); ?>" class="button button-small">
     145                                    <a href="<?php echo esc_url( admin_url( 'options-general.php?page=lumiblog-debug-log-inspector&edit=' . $dli_plugin_index ) ); ?>" class="button button-small">
    134146                                        <?php esc_html_e( 'Edit', 'lumiblog-debug-log-inspector' ); ?>
    135147                                    </a>
Note: See TracChangeset for help on using the changeset viewer.