Plugin Directory

Changeset 3173088


Ignore:
Timestamp:
10/21/2024 05:07:24 PM (18 months ago)
Author:
vincent06
Message:

Tested Up To WordPress 6.7 and some code improvements.

Location:
kolorweb-log-manager/trunk
Files:
7 added
8 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • kolorweb-log-manager/trunk/libs/class-ajax.php

    r2693368 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    194193            array(
    195194                'truncated' => $truncated,
     195                // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
    196196                // 'entries'   => $truncated ? $log->get_recent_entries() : $log->get_entries()
    197197                'entries'   => $log->get_entries(),
     
    236236            )
    237237        );
    238 
    239238    }
    240239
     
    358357            )
    359358        );
    360 
    361     }
    362 
     359    }
    363360}
  • kolorweb-log-manager/trunk/libs/class-config.php

    r2692326 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    135134
    136135        return $this->file_exists() && $this->is_wp_config_writable();
    137 
    138136    }
    139137
     
    185183
    186184        return $this->update_debug_status( $status );
    187 
    188185    }
    189186
     
    236233
    237234        return $new_status;
    238 
    239235    }
    240236}
  • kolorweb-log-manager/trunk/libs/class-helper.php

    r2692326 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
  • kolorweb-log-manager/trunk/libs/class-log.php

    r2693368 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    191190                if ( count( $content ) > $check_log_limit ) {
    192191                    $content = array_slice( $content, ( count( $content ) - $check_log_limit ) - 1 );
    193                     file_put_contents( $this->log_file, $content );
    194                     touch( $this->log_file, $last_modified );
     192                    file_put_contents( $this->log_file, $content );  // phpcs:ignore
     193                    touch( $this->log_file, $last_modified ); // phpcs:ignore
    195194                }
    196195            }
    197196
    198             $fp = @fopen( $this->log_file, 'r' );
     197            $fp = @fopen( $this->log_file, 'r' ); // phpcs:ignore
    199198
    200199            if ( $fp ) {
    201200
    202                 while ( false !== ( $line = @fgets( $fp ) ) ) {
     201                while ( false !== ( $line = @fgets( $fp ) ) ) { // phpcs:ignore
    203202
    204203                    $line  = preg_replace( '/^\[([0-9a-zA-Z-]+) ([0-9:]+) ([a-zA-Z_\/]+)\] (.*)$/i', '$1' . $sep . '$2' . $sep . '$3' . $sep . '$4', $line );
     
    208207
    209208                        $entries[] = array(
     209                            // phpcs:ignore
    210210                            // 'date'   => strtotime($parts[0] . ' ' . $parts[1] . ' ' . $parts[2]),
    211211                            'date'     => gmdate( 'Y-m-d', strtotime( $parts[0] ) ),
     
    218218                }
    219219
    220                 @fclose( $fp );
     220                @fclose( $fp ); // phpcs:ignore
    221221
    222222            }
    223223        } else {
    224224
    225             touch( $this->log_file );
     225            touch( $this->log_file ); // phpcs:ignore
    226226
    227227        }
     
    235235
    236236        return array_reverse( $entries );
    237 
    238237    }
    239238
     
    248247    public function get_contents() {
    249248        if ( $this->file_exists() ) {
    250             return file_get_contents( $this->log_file );
     249            return file_get_contents( $this->log_file ); // phpcs:ignore
    251250        }
    252251
     
    277276    public function clear() {
    278277
    279         $fp = @fopen( $this->log_file, 'r+' );
    280         return @ftruncate( $fp, 0 );
    281 
     278        $fp = @fopen( $this->log_file, 'r+' ); // phpcs:ignore
     279        return @ftruncate( $fp, 0 ); // phpcs:ignore
    282280    }
    283281
     
    291289     */
    292290    public function delete() {
    293         return true === unlink( $this->log_file ) ? true : false;
    294     }
    295 
     291        return true === unlink( $this->log_file ) ? true : false; // phpcs:ignore
     292    }
    296293}
  • kolorweb-log-manager/trunk/libs/class-plugin.php

    r3153225 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    8281        $config = Config::get_instance();
    8382        $config->enable_debugging();
    84 
    8583    }
    8684
     
    9492        $config = Config::get_instance();
    9593        $config->disable_debugging();
    96 
    9794    }
    9895
     
    105102
    106103        $path   = dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/';
    107         $result = load_plugin_textdomain( 'kwlm', false, $path );
    108 
     104        $result = load_plugin_textdomain( 'kolorweb-log-manager', false, $path );
    109105    }
    110106
     
    119115    }
    120116
     117    /**
     118     * Check if in customize preview mode.
     119     */
     120    public function check_if_is_customize_preview() {
     121        if ( function_exists( 'is_customize_preview' ) ) {
     122            return is_customize_preview();
     123        } else {
     124            // Fallback for WordPress < 4.0 version.
     125            global $wp_customize;
     126            return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
     127        }
     128    }
    121129
    122130    /**
     
    150158            );
    151159
    152             // Stylesheet files.
    153             wp_enqueue_style( 'kwlogmanager-css', KWLOGMANAGER_URL . 'assets/css/main.' . KWLOGMANAGER_VERSION . '.min.css', array(), KWLOGMANAGER_VERSION );
    154 
    155             // Javascript files.
    156             wp_enqueue_script( 'kwlogmanager-react-js', KWLOGMANAGER_URL . 'assets/js/react-framework.min.js', false, KWLOGMANAGER_VERSION, true );
    157 
    158             wp_enqueue_script( 'kwlogmanager-js', KWLOGMANAGER_URL . 'assets/js/main.' . KWLOGMANAGER_VERSION . '.min.js', array( 'kwlogmanager-react-js' ), KWLOGMANAGER_VERSION, true );
    159 
    160             // Localize variables.
    161             wp_localize_script( 'kwlogmanager-js', 'KWLOGMANAGER', $localized );
     160            // In Customizer preview mode we do not need to enqueue CSS and JS files.
     161            if ( ! $this->check_if_is_customize_preview() ) {
     162                // Stylesheet files.
     163                wp_enqueue_style( 'kwlogmanager-css', KWLOGMANAGER_URL . 'assets/css/main.' . KWLOGMANAGER_VERSION . '.min.css', array(), KWLOGMANAGER_VERSION );
     164
     165                // Javascript files.
     166                wp_enqueue_script( 'kwlogmanager-react-js', KWLOGMANAGER_URL . 'assets/js/react-framework.min.js', false, KWLOGMANAGER_VERSION, true );
     167
     168                wp_enqueue_script( 'kwlogmanager-js', KWLOGMANAGER_URL . 'assets/js/main.' . KWLOGMANAGER_VERSION . '.min.js', array( 'kwlogmanager-react-js' ), KWLOGMANAGER_VERSION, true );
     169
     170                // Localize variables.
     171                wp_localize_script( 'kwlogmanager-js', 'KWLOGMANAGER', $localized );
     172            }
    162173        }
    163174    }
     
    304315        // Lang Array Data.
    305316        $lang = array(
    306             'loadEntries'  => __( 'Loading entries ...', 'kwlm' ),
    307             'enabled'      => __( 'Enabled', 'kwlm' ),
    308             'disabled'     => __( 'Disabled', 'kwlm' ),
    309             'goToDebug'    => __( 'Go to Log Viewer', 'kwlm' ),
    310             'simulating'   => __( 'Simulating', 'kwlm' ),
    311             'notFound'     => __( 'No entries found.', 'kwlm' ),
    312             'back'         => __( 'Back', 'kwlm' ),
    313             'close'        => __( 'Close', 'kwlm' ),
    314             'save'         => __( 'Save', 'kwlm' ),
    315             'update'       => __( 'Update', 'kwlm' ),
    316             'edit'         => __( 'Edit', 'kwlm' ),
    317             'delete'       => __( 'Delete', 'kwlm' ),
    318             'cancel'       => __( 'Cancel', 'kwlm' ),
    319             'disable'      => __( 'Disable', 'kwlm' ),
    320             'currentDate'  => __( 'Today', 'kwlm' ),
    321             'type'         => __( 'Type:', 'kwlm' ),
    322             'line'         => __( 'Line:', 'kwlm' ),
    323             'hideDetails'  => __( 'Hide details', 'kwlm' ),
    324             'moreDetails'  => __( 'More details', 'kwlm' ),
    325             'searchFor'    => __( 'Search for ...', 'kwlm' ),
    326             'searchingFor' => __( 'Searching for', 'kwlm' ),
    327             'seeHelp'      => __( 'See help', 'kwlm' ),
    328             'lastModified' => __( 'Last Modified', 'kwlm' ),
    329             'fileSize'     => __( 'Filesize', 'kwlm' ),
    330             'legend'       => __( 'Legend', 'kwlm' ),
    331             'legendInfo'   => __( 'Filter Errors by click on this labels...', 'kwlm' ),
    332             'othersErrors' => __( 'Other', 'kwlm' ),
    333             'loadWidget'   => __( 'Loading Widget Data ...', 'kwlm' ),
     317            'loadEntries'  => __( 'Loading entries ...', 'kolorweb-log-manager' ),
     318            'enabled'      => __( 'Enabled', 'kolorweb-log-manager' ),
     319            'disabled'     => __( 'Disabled', 'kolorweb-log-manager' ),
     320            'goToDebug'    => __( 'Go to Log Viewer', 'kolorweb-log-manager' ),
     321            'simulating'   => __( 'Simulating', 'kolorweb-log-manager' ),
     322            'notFound'     => __( 'No entries found.', 'kolorweb-log-manager' ),
     323            'back'         => __( 'Back', 'kolorweb-log-manager' ),
     324            'close'        => __( 'Close', 'kolorweb-log-manager' ),
     325            'save'         => __( 'Save', 'kolorweb-log-manager' ),
     326            'update'       => __( 'Update', 'kolorweb-log-manager' ),
     327            'edit'         => __( 'Edit', 'kolorweb-log-manager' ),
     328            'delete'       => __( 'Delete', 'kolorweb-log-manager' ),
     329            'cancel'       => __( 'Cancel', 'kolorweb-log-manager' ),
     330            'disable'      => __( 'Disable', 'kolorweb-log-manager' ),
     331            'currentDate'  => __( 'Today', 'kolorweb-log-manager' ),
     332            'type'         => __( 'Type:', 'kolorweb-log-manager' ),
     333            'line'         => __( 'Line:', 'kolorweb-log-manager' ),
     334            'hideDetails'  => __( 'Hide details', 'kolorweb-log-manager' ),
     335            'moreDetails'  => __( 'More details', 'kolorweb-log-manager' ),
     336            'searchFor'    => __( 'Search for ...', 'kolorweb-log-manager' ),
     337            'searchingFor' => __( 'Searching for', 'kolorweb-log-manager' ),
     338            'seeHelp'      => __( 'See help', 'kolorweb-log-manager' ),
     339            'lastModified' => __( 'Last Modified', 'kolorweb-log-manager' ),
     340            'fileSize'     => __( 'Filesize', 'kolorweb-log-manager' ),
     341            'legend'       => __( 'Legend', 'kolorweb-log-manager' ),
     342            'legendInfo'   => __( 'Filter Errors by click on this labels...', 'kolorweb-log-manager' ),
     343            'othersErrors' => __( 'Other', 'kolorweb-log-manager' ),
     344            'loadWidget'   => __( 'Loading Widget Data ...', 'kolorweb-log-manager' ),
    334345            'addCustomErr' => array(
    335                 'name'    => __( 'Add Custom Error', 'kwlm' ),
    336                 'label'   => __( 'Label', 'kwlm' ),
    337                 'key'     => __( 'Error Key', 'kwlm' ),
    338                 'color'   => __( 'Color', 'kwlm' ),
    339                 'bgcolor' => __( 'Background', 'kwlm' ),
    340                 'noErr'   => __( 'No custom error messages defined.', 'kwlm' ),
    341                 'addNew'  => __( 'Add new', 'kwlm' ),
    342                 'config'  => __( 'Feature must be configured.', 'kwlm' ),
     346                'name'    => __( 'Add Custom Error', 'kolorweb-log-manager' ),
     347                'label'   => __( 'Label', 'kolorweb-log-manager' ),
     348                'key'     => __( 'Error Key', 'kolorweb-log-manager' ),
     349                'color'   => __( 'Color', 'kolorweb-log-manager' ),
     350                'bgcolor' => __( 'Background', 'kolorweb-log-manager' ),
     351                'noErr'   => __( 'No custom error messages defined.', 'kolorweb-log-manager' ),
     352                'addNew'  => __( 'Add new', 'kolorweb-log-manager' ),
     353                'config'  => __( 'Feature must be configured.', 'kolorweb-log-manager' ),
    343354            ),
    344355            'updCustomErr' => array(
    345                 'name' => __( 'Edit Custom Error', 'kwlm' ),
     356                'name' => __( 'Edit Custom Error', 'kolorweb-log-manager' ),
    346357            ),
    347358            'actions'      => array(
    348                 'name'    => __( 'Actions', 'kwlm' ),
     359                'name'    => __( 'Actions', 'kolorweb-log-manager' ),
    349360                'options' => array(
    350                     'refresh'  => __( 'Refresh', 'kwlm' ),
    351                     'clearLog' => __( 'Clear Log', 'kwlm' ),
    352                     'download' => __( 'Download', 'kwlm' ),
     361                    'refresh'  => __( 'Refresh', 'kolorweb-log-manager' ),
     362                    'clearLog' => __( 'Clear Log', 'kolorweb-log-manager' ),
     363                    'download' => __( 'Download', 'kolorweb-log-manager' ),
    353364                ),
    354365            ),
    355366            'sort'         => array(
    356                 'name'    => __( 'Sort', 'kwlm' ),
     367                'name'    => __( 'Sort', 'kolorweb-log-manager' ),
    357368                'options' => array(
    358                     'newest' => __( 'By Newest', 'kwlm' ),
    359                     'oldest' => __( 'By Oldest', 'kwlm' ),
     369                    'newest' => __( 'By Newest', 'kolorweb-log-manager' ),
     370                    'oldest' => __( 'By Oldest', 'kolorweb-log-manager' ),
    360371                ),
    361372            ),
    362373            'view'         => array(
    363                 'name'    => __( 'View as', 'kwlm' ),
     374                'name'    => __( 'View as', 'kolorweb-log-manager' ),
    364375                'options' => array(
    365                     'group' => __( 'Group', 'kwlm' ),
    366                     'list'  => __( 'List', 'kwlm' ),
     376                    'group' => __( 'Group', 'kolorweb-log-manager' ),
     377                    'list'  => __( 'List', 'kolorweb-log-manager' ),
    367378                ),
    368379            ),
    369380            'notify'       => array(
    370                 'notLoaded'      => __( 'Plugin could not be loaded.  Please try again.', 'kwlm' ),
    371                 'debugStatus'    => __( 'Debbugging has been', 'kwlm' ),
    372                 'logCleared'     => __( 'Log file successfully cleared', 'kwlm' ),
    373                 'logClearedFail' => __( 'Failed to clear log file.  You might not have write permission', 'kwlm' ),
    374                 'viewerUpdate'   => __( 'Viewer updated with new entries', 'kwlm' ),
    375                 'noEntries'      => __( 'No new entries found', 'kwlm' ),
    376                 'checkError'     => __( 'Checking for updates failed.', 'kwlm' ),
    377                 'debugFileWarn'  => __( 'Debugging is enabled. However, the debug.log file does not exist or was not found.', 'kwlm' ),
    378                 'debugDisabled'  => __( 'Debugging is currently disabled.', 'kwlm' ),
    379                 'isDebug'        => __( 'Sorry, we could not detect if debugging is enabled or disabled.', 'kwlm' ),
    380                 'howToDebug'     => __( 'How to Enable Debugging?', 'kwlm' ),
    381                 'customErrorAdd' => __( 'Custom error successfully added', 'kwlm' ),
    382                 'customErrorErr' => __( 'Please complete all required fields', 'kwlm' ),
    383                 'customErrorUpd' => __( 'Custom error successfully updated', 'kwlm' ),
    384                 'customErrorAsk' => __( 'Are you sure you want to delete', 'kwlm' ),
    385                 'customErrorDel' => __( 'Custom error successfully deleted', 'kwlm' ),
    386                 'customErrorDie' => __( 'Custom error could not be deleted', 'kwlm' ),
    387                 'logLimitErr'    => __( 'Please insert only integer numbers values.', 'kwlm' ),
    388                 'logLimitUpd'    => __( 'Log Limit was updated', 'kwlm' ),
     381                'notLoaded'      => __( 'Plugin could not be loaded.  Please try again.', 'kolorweb-log-manager' ),
     382                'debugStatus'    => __( 'Debbugging has been', 'kolorweb-log-manager' ),
     383                'logCleared'     => __( 'Log file successfully cleared', 'kolorweb-log-manager' ),
     384                'logClearedFail' => __( 'Failed to clear log file.  You might not have write permission', 'kolorweb-log-manager' ),
     385                'viewerUpdate'   => __( 'Viewer updated with new entries', 'kolorweb-log-manager' ),
     386                'noEntries'      => __( 'No new entries found', 'kolorweb-log-manager' ),
     387                'checkError'     => __( 'Checking for updates failed.', 'kolorweb-log-manager' ),
     388                'debugFileWarn'  => __( 'Debugging is enabled. However, the debug.log file does not exist or was not found.', 'kolorweb-log-manager' ),
     389                'debugDisabled'  => __( 'Debugging is currently disabled.', 'kolorweb-log-manager' ),
     390                'isDebug'        => __( 'Sorry, we could not detect if debugging is enabled or disabled.', 'kolorweb-log-manager' ),
     391                'howToDebug'     => __( 'How to Enable Debugging?', 'kolorweb-log-manager' ),
     392                'customErrorAdd' => __( 'Custom error successfully added', 'kolorweb-log-manager' ),
     393                'customErrorErr' => __( 'Please complete all required fields', 'kolorweb-log-manager' ),
     394                'customErrorUpd' => __( 'Custom error successfully updated', 'kolorweb-log-manager' ),
     395                'customErrorAsk' => __( 'Are you sure you want to delete', 'kolorweb-log-manager' ),
     396                'customErrorDel' => __( 'Custom error successfully deleted', 'kolorweb-log-manager' ),
     397                'customErrorDie' => __( 'Custom error could not be deleted', 'kolorweb-log-manager' ),
     398                'logLimitErr'    => __( 'Please insert only integer numbers values.', 'kolorweb-log-manager' ),
     399                'logLimitUpd'    => __( 'Log Limit was updated', 'kolorweb-log-manager' ),
    389400            ),
    390401            'debugHelp'    => array(
    391                 'intro'    => __( 'To turn on debugging, add the following to your wp-config.php file.', 'kwlm' ),
    392                 'moreInfo' => __( 'For more information visit', 'kwlm' ),
    393             ),
    394             'entry'        => __( 'entry', 'kwlm' ),
    395             'entries'      => __( 'entries', 'kwlm' ),
    396             'logEntries'   => __( 'Log Entries', 'kwlm' ),
     402                'intro'    => __( 'To turn on debugging, add the following to your wp-config.php file.', 'kolorweb-log-manager' ),
     403                'moreInfo' => __( 'For more information visit', 'kolorweb-log-manager' ),
     404            ),
     405            'entry'        => __( 'entry', 'kolorweb-log-manager' ),
     406            'entries'      => __( 'entries', 'kolorweb-log-manager' ),
     407            'logEntries'   => __( 'Log Entries', 'kolorweb-log-manager' ),
    397408            'settings'     => array(
    398                 'name'        => __( 'Settings', 'kwlm' ),
    399                 'enableDebug' => __( 'Enable Debug?', 'kwlm' ),
    400                 'logLimit'    => __( 'Sets the maximum number of lines in the debug.log file to consider. Leave the value at zero to get them all.', 'kwlm' ),
    401                 'fold'        => __( 'Fold sidebar to increase viewing area?', 'kwlm' ),
    402                 'general'     => __( 'General', 'kwlm' ),
    403                 'customError' => __( 'Custom Errors', 'kwlm' ),
     409                'name'        => __( 'Settings', 'kolorweb-log-manager' ),
     410                'enableDebug' => __( 'Enable Debug?', 'kolorweb-log-manager' ),
     411                'logLimit'    => __( 'Sets the maximum number of lines in the debug.log file to consider. Leave the value at zero to get them all.', 'kolorweb-log-manager' ),
     412                'fold'        => __( 'Fold sidebar to increase viewing area?', 'kolorweb-log-manager' ),
     413                'general'     => __( 'General', 'kolorweb-log-manager' ),
     414                'customError' => __( 'Custom Errors', 'kolorweb-log-manager' ),
    404415            ),
    405416            'help'         => array(
    406                 'name'      => __( 'Help', 'kwlm' ),
    407                 'action'    => __( 'Action', 'kwlm' ),
    408                 'learnMore' => __( 'Learn more here...', 'kwlm' ),
    409                 'step'      => __( 'Step', 'kwlm' ),
     417                'name'      => __( 'Help', 'kolorweb-log-manager' ),
     418                'action'    => __( 'Action', 'kolorweb-log-manager' ),
     419                'learnMore' => __( 'Learn more here...', 'kolorweb-log-manager' ),
     420                'step'      => __( 'Step', 'kolorweb-log-manager' ),
    410421                'sections'  => array(
    411422                    'toggleDebugging' => array(
    412                         'question'     => __( 'How to toggle debugging status?', 'kwlm' ),
    413                         'title'        => __( 'Toggle Debugging', 'kwlm' ),
    414                         'p1'           => __( 'When configured, you can enable/disable WP_DEBUG with just one click.', 'kwlm' ),
    415                         'action_li_01' => __( 'In the sidebar, click on "Settings", then click on the slider to enable/disable debugging', 'kwlm' ),
    416                         'p2'           => __( 'If you do not see the debug toggle button, it means that the automatic WordPress debug activation procedure included in this Plugin has not been successful and you will have to proceed manually to edit the wp-config.php', 'kwlm' ),
     423                        'question'     => __( 'How to toggle debugging status?', 'kolorweb-log-manager' ),
     424                        'title'        => __( 'Toggle Debugging', 'kolorweb-log-manager' ),
     425                        'p1'           => __( 'When configured, you can enable/disable WP_DEBUG with just one click.', 'kolorweb-log-manager' ),
     426                        'action_li_01' => __( 'In the sidebar, click on "Settings", then click on the slider to enable/disable debugging', 'kolorweb-log-manager' ),
     427                        'p2'           => __( 'If you do not see the debug toggle button, it means that the automatic WordPress debug activation procedure included in this Plugin has not been successful and you will have to proceed manually to edit the wp-config.php', 'kolorweb-log-manager' ),
    417428                    ),
    418429                    'debugToggling'   => array(
    419                         'question' => __( 'How to configure debug toggling?', 'kwlm' ),
    420                         'title'    => __( 'Configure Debug Toggling', 'kwlm' ),
    421                         'p1'       => __( 'When the plugin is activated, the system tries to automatically set all the DEBUG constants in your wp-config.php', 'kwlm' ),
    422                         'p2'       => __( 'If toggle button does not appear in the settings means that your wp-config.php is not writable or not found in the default WordPress configuration path.', 'kwlm' ),
    423                         'p3'       => __( 'If wp-config is not writable, you will have to manually set the values for DEBUG constants and you will not be able to use the one-click debug toggle function. The plugin will continue to work without problems, but without the magic of this feature.', 'kwlm' ),
    424                         'step1_1'  => __( 'To manually enable WordPress debugging you can paste these lines of code into the wp-config.php file', 'kwlm' ),
    425                         'step1_2'  => __( 'To manually disable WordPress debugging you can paste these lines of code into the wp-config.php file', 'kwlm' ),
    426                         'step2_1'  => __( 'Refresh the page in the browser (reload page)', 'kwlm' ),
     430                        'question' => __( 'How to configure debug toggling?', 'kolorweb-log-manager' ),
     431                        'title'    => __( 'Configure Debug Toggling', 'kolorweb-log-manager' ),
     432                        'p1'       => __( 'When the plugin is activated, the system tries to automatically set all the DEBUG constants in your wp-config.php', 'kolorweb-log-manager' ),
     433                        'p2'       => __( 'If toggle button does not appear in the settings means that your wp-config.php is not writable or not found in the default WordPress configuration path.', 'kolorweb-log-manager' ),
     434                        'p3'       => __( 'If wp-config is not writable, you will have to manually set the values for DEBUG constants and you will not be able to use the one-click debug toggle function. The plugin will continue to work without problems, but without the magic of this feature.', 'kolorweb-log-manager' ),
     435                        'step1_1'  => __( 'To manually enable WordPress debugging you can paste these lines of code into the wp-config.php file', 'kolorweb-log-manager' ),
     436                        'step1_2'  => __( 'To manually disable WordPress debugging you can paste these lines of code into the wp-config.php file', 'kolorweb-log-manager' ),
     437                        'step2_1'  => __( 'Refresh the page in the browser (reload page)', 'kolorweb-log-manager' ),
    427438                    ),
    428439                    'foldSidebar'     => array(
    429                         'question'     => __( 'How to fold sidebar to increase viewing space?', 'kwlm' ),
    430                         'title'        => __( 'Fold Sidebar', 'kwlm' ),
    431                         'p1'           => __( 'By default the sidebar will be folded when the log viewer is active. To disable, or toggle this behavior:', 'kwlm' ),
    432                         'action_li_01' => __( 'In the sidebar, click on "Settings", then click on the slider to enable/disable sidebar folding', 'kwlm' ),
     440                        'question'     => __( 'How to fold sidebar to increase viewing space?', 'kolorweb-log-manager' ),
     441                        'title'        => __( 'Fold Sidebar', 'kolorweb-log-manager' ),
     442                        'p1'           => __( 'By default the sidebar will be folded when the log viewer is active. To disable, or toggle this behavior:', 'kolorweb-log-manager' ),
     443                        'action_li_01' => __( 'In the sidebar, click on "Settings", then click on the slider to enable/disable sidebar folding', 'kolorweb-log-manager' ),
    433444                    ),
    434445                    'addCustomErrors' => array(
    435                         'question'     => __( 'How to add custom errors?', 'kwlm' ),
    436                         'title'        => __( 'Manage Custom Errors', 'kwlm' ),
    437                         'p1'           => __( 'Custom error messages allow you to create custom errors when testing, color code those errors in the viewer and filter the entries by those errors.', 'kwlm' ),
    438                         'action_li_01' => __( 'To add, edit or remove custom errors go to the "Settings" pane and click on the "Custom Errors" tab', 'kwlm' ),
     446                        'question'     => __( 'How to add custom errors?', 'kolorweb-log-manager' ),
     447                        'title'        => __( 'Manage Custom Errors', 'kolorweb-log-manager' ),
     448                        'p1'           => __( 'Custom error messages allow you to create custom errors when testing, color code those errors in the viewer and filter the entries by those errors.', 'kolorweb-log-manager' ),
     449                        'action_li_01' => __( 'To add, edit or remove custom errors go to the "Settings" pane and click on the "Custom Errors" tab', 'kolorweb-log-manager' ),
    439450
    440451                    ),
    441452                    'useCustomErrors' => array(
    442                         'question' => __( 'How to use custom errors?', 'kwlm' ),
    443                         'title'    => __( 'How to Use Custom Errors', 'kwlm' ),
    444                         'p1_1'     => __( 'When you write an error to the log, you have to start the error message with a', 'kwlm' ),
    445                         'p1_2'     => __( 'and the custom error key followed by a', 'kwlm' ),
    446                         'p2'       => __( 'Example: If you defined a custom error with a key: my-custom-error', 'kwlm' ),
    447                         'p3'       => __( 'In your code:', 'kwlm' ),
     453                        'question' => __( 'How to use custom errors?', 'kolorweb-log-manager' ),
     454                        'title'    => __( 'How to Use Custom Errors', 'kolorweb-log-manager' ),
     455                        'p1_1'     => __( 'When you write an error to the log, you have to start the error message with a', 'kolorweb-log-manager' ),
     456                        'p1_2'     => __( 'and the custom error key followed by a', 'kolorweb-log-manager' ),
     457                        'p2'       => __( 'Example: If you defined a custom error with a key: my-custom-error', 'kolorweb-log-manager' ),
     458                        'p3'       => __( 'In your code:', 'kolorweb-log-manager' ),
    448459                    ),
    449460                    'sortEntries'     => array(
    450                         'question'     => __( 'How to sort log entries?', 'kwlm' ),
    451                         'title'        => __( 'Sort Entries', 'kwlm' ),
    452                         'p1'           => __( 'Log entries can be sorted in descending or ascending order.', 'kwlm' ),
    453                         'action_li_01' => __( 'In the sidebar, click on the A-Z icon.', 'kwlm' ),
    454                         'action_li_02' => __( 'In the sidebar, click on the Z-A icon.', 'kwlm' ),
     461                        'question'     => __( 'How to sort log entries?', 'kolorweb-log-manager' ),
     462                        'title'        => __( 'Sort Entries', 'kolorweb-log-manager' ),
     463                        'p1'           => __( 'Log entries can be sorted in descending or ascending order.', 'kolorweb-log-manager' ),
     464                        'action_li_01' => __( 'In the sidebar, click on the A-Z icon.', 'kolorweb-log-manager' ),
     465                        'action_li_02' => __( 'In the sidebar, click on the Z-A icon.', 'kolorweb-log-manager' ),
    455466                    ),
    456467                    'helpView'        => array(
    457                         'question'     => __( 'How to switch between group and list views?', 'kwlm' ),
    458                         'title'        => __( 'Switch Between Group and List Views', 'kwlm' ),
    459                         'p1'           => __( 'You can switch between Group and List views.', 'kwlm' ),
    460                         'p2_h'         => __( 'Group View', 'kwlm' ),
    461                         'p2'           => __( 'This view groups all similar entries and shows you just one entry with the latest timestamp for each error. It makes it much easier to analyze the log entries.', 'kwlm' ),
    462                         'p3_h'         => __( 'List View', 'kwlm' ),
    463                         'p3'           => __( 'This view lists every log entry which is similar to the standard log view.', 'kwlm' ),
    464                         'action_li_01' => __( 'In the sidebar, click on the group icon.', 'kwlm' ),
    465                         'action_li_02' => __( 'In the sidebar, click on the list icon.', 'kwlm' ),
     468                        'question'     => __( 'How to switch between group and list views?', 'kolorweb-log-manager' ),
     469                        'title'        => __( 'Switch Between Group and List Views', 'kolorweb-log-manager' ),
     470                        'p1'           => __( 'You can switch between Group and List views.', 'kolorweb-log-manager' ),
     471                        'p2_h'         => __( 'Group View', 'kolorweb-log-manager' ),
     472                        'p2'           => __( 'This view groups all similar entries and shows you just one entry with the latest timestamp for each error. It makes it much easier to analyze the log entries.', 'kolorweb-log-manager' ),
     473                        'p3_h'         => __( 'List View', 'kolorweb-log-manager' ),
     474                        'p3'           => __( 'This view lists every log entry which is similar to the standard log view.', 'kolorweb-log-manager' ),
     475                        'action_li_01' => __( 'In the sidebar, click on the group icon.', 'kolorweb-log-manager' ),
     476                        'action_li_02' => __( 'In the sidebar, click on the list icon.', 'kolorweb-log-manager' ),
    466477                    ),
    467478                    'newLog'          => array(
    468                         'question'     => __( 'How to check for new log entries?', 'kwlm' ),
    469                         'title'        => __( 'Check For New Errors', 'kwlm' ),
    470                         'p1_1'         => __( 'The plugin automatically check for new log errors every', 'kwlm' ),
    471                         'p1_2'         => __( 'seconds and will update the view when new errors are found. There is no need to refresh the page.', 'kwlm' ),
    472                         'p2'           => __( 'If you still want to manually check for new errors:', 'kwlm' ),
    473                         'action_li_01' => __( 'In the sidebar, click on the refresh icon under "actions".', 'kwlm' ),
     479                        'question'     => __( 'How to check for new log entries?', 'kolorweb-log-manager' ),
     480                        'title'        => __( 'Check For New Errors', 'kolorweb-log-manager' ),
     481                        'p1_1'         => __( 'The plugin automatically check for new log errors every', 'kolorweb-log-manager' ),
     482                        'p1_2'         => __( 'seconds and will update the view when new errors are found. There is no need to refresh the page.', 'kolorweb-log-manager' ),
     483                        'p2'           => __( 'If you still want to manually check for new errors:', 'kolorweb-log-manager' ),
     484                        'action_li_01' => __( 'In the sidebar, click on the refresh icon under "actions".', 'kolorweb-log-manager' ),
    474485                    ),
    475486                    'clearLog'        => array(
    476                         'question'     => __( 'How to clear the log file?', 'kwlm' ),
    477                         'title'        => __( 'Clear Log', 'kwlm' ),
    478                         'p1'           => __( 'If file permissions allow, the debug.log file will be truncated. If that fails, the file will be deleted. If the file cannot be truncated or deleted, an error will be displayed.', 'kwlm' ),
    479                         'action_li_01' => __( 'In the sidebar, click on the clear icon under "actions".', 'kwlm' ),
     487                        'question'     => __( 'How to clear the log file?', 'kolorweb-log-manager' ),
     488                        'title'        => __( 'Clear Log', 'kolorweb-log-manager' ),
     489                        'p1'           => __( 'If file permissions allow, the debug.log file will be truncated. If that fails, the file will be deleted. If the file cannot be truncated or deleted, an error will be displayed.', 'kolorweb-log-manager' ),
     490                        'action_li_01' => __( 'In the sidebar, click on the clear icon under "actions".', 'kolorweb-log-manager' ),
    480491                    ),
    481492                    'downloadLog'     => array(
    482                         'question'     => __( 'How to download the log file?', 'kwlm' ),
    483                         'title'        => __( 'Download Log', 'kwlm' ),
    484                         'p1'           => __( 'When you click to download the log view, a smart log will be downloaded.  The smart log contains a unique entry for each error with the latest timestamp.  This helps make it much easier to review and can considerably reduce filesize.', 'kwlm' ),
    485                         'action_li_01' => __( 'In the sidebar, click on the download icon under "actions".', 'kwlm' ),
     493                        'question'     => __( 'How to download the log file?', 'kolorweb-log-manager' ),
     494                        'title'        => __( 'Download Log', 'kolorweb-log-manager' ),
     495                        'p1'           => __( 'When you click to download the log view, a smart log will be downloaded.  The smart log contains a unique entry for each error with the latest timestamp.  This helps make it much easier to review and can considerably reduce filesize.', 'kolorweb-log-manager' ),
     496                        'action_li_01' => __( 'In the sidebar, click on the download icon under "actions".', 'kolorweb-log-manager' ),
    486497                    ),
    487498
     
    491502
    492503        return $lang;
    493 
    494504    }
    495505}
  • kolorweb-log-manager/trunk/libs/class-settings.php

    r2693368 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    135134
    136135        return empty( $settings ) ? false : $settings;
    137 
    138136    }
    139137
     
    202200
    203201        return $new;
    204 
    205     }
    206 
     202    }
    207203}
  • kolorweb-log-manager/trunk/readme.txt

    r3153225 r3173088  
    33License: GPLv3 or later
    44License URI: http://www.gnu.org/licenses/gpl.html
    5 Tags: debug, wp_debug, error log, log, debug tool, debugger, debugging, error, development, display errors, error logging, free debugging, plugin testing, react, react plugin, search log, sort errors, sort log, test, testing, widget error, wordpress error log, wp error, wp error log, wp log viewer
     5Tags: wp log viewer, log, error, debug, error log
    66Requires at least: 3.9
    7 Tested up to: 6.6.2
    8 Stable tag: 1.1.4
     7Tested up to: 6.7
     8Stable tag: 1.1.5
    99
    1010Really one click enable/disable debugging, clear debug.log, search, sort, and filter errors. See new errors automatically without refreshing.
     
    225225All notable changes will be tracked in this change log.
    226226
     227= 1.1.5 =
     228
     229* Tested Up to WordPress 6.7
     230* Unload unnecessary CSS and JS in Customizer Preview Mode.
     231* Some readme.txt adjustments
     232* Plugin Check (PCP) test passed.
     233
    227234= 1.1.4 =
    228235
  • kolorweb-log-manager/trunk/uninstall.php

    r2692326 r3173088  
    66 * @author    Vincenzo Casu <vincenzo.casu@gmail.com>
    77 * @link      https://kolorweb.it
    8  * @copyright MIT License
    98 */
    109
     
    1514
    1615if ( ! defined( 'KWLOGMANAGER_BASE' ) ) {
    17     define( 'KWLOGMANAGER_BASE', dirname( __FILE__ ) . '/' );
     16    define( 'KWLOGMANAGER_BASE', __DIR__ . '/' );
    1817}
    1918
     
    3029     */
    3130    function kw_log_manager_plugin_deactivate() {
    32 
    3331        $config = Config::get_instance();
    3432        $config->disable_debugging();
    35 
    3633    }
    3734}
     
    5754            \delete_metadata( 'user', 0, $meta, '', true );
    5855        }
    59 
    60         $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "%_kwlm_%"' );
    61 
     56        $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "%_kwlm_%"' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching
    6257    }
    6358}
Note: See TracChangeset for help on using the changeset viewer.