Plugin Directory

Changeset 3262957


Ignore:
Timestamp:
03/27/2025 03:28:19 PM (10 months ago)
Author:
apos37
Message:

2.0.1

  • Update: Changed author name from Apos37 to WordPress Enhanced, new Author URI
  • Tweak: Optimization of main file
  • Fix: Remove error count if just cleared
  • Fix: Mispelling on WPCONFIG tab
  • Fix: Count on tab not using updated debug log path
Location:
dev-debug-tools
Files:
140 added
9 edited

Legend:

Unmodified
Added
Removed
  • dev-debug-tools/trunk/dev-debug-tools.php

    r3230781 r3262957  
    44 * Plugin URI:          https://github.com/apos37/dev-debug-tools
    55 * Description:         WordPress debugging and testing tools for developers
    6  * Version:             2.0.0.3
    7  * Requires at least:   5.9.0
    8  * Tested up to:        6.7.1
     6 * Version:             2.0.1
     7 * Requires at least:   5.9
     8 * Tested up to:        6.7
    99 * Requires PHP:        7.4
    10  * Author:              Apos37
    11  * Author URI:          https://apos37.com/
     10 * Author:              WordPress Enhanced
     11 * Author URI:          https://wordpressenhanced.com/
     12 * Support URI:         https://discord.gg/3HnzNEJVnR
    1213 * Text Domain:         dev-debug-tools
    1314 * License:             GPLv2 or later
    1415 * License URI:         http://www.gnu.org/licenses/gpl-2.0.txt
    15  */
    16 
    17 // Exit if accessed directly.
    18 if ( !defined( 'ABSPATH' ) ) {
    19     exit;
    20 }
     16 * Created on:          May 13, 2022
     17 */
     18
     19
     20/**
     21 * Exit if accessed directly.
     22 */
     23if ( !defined( 'ABSPATH' ) ) exit;
    2124
    2225
     
    2427 * Defines
    2528 */
     29$plugin_data = get_file_data( __FILE__, [
     30    'name'         => 'Plugin Name',
     31    'description'  => 'Description',
     32    'version'      => 'Version',
     33    'plugin_uri'   => 'Plugin URI',
     34    'requires_php' => 'Requires PHP',
     35    'textdomain'   => 'Text Domain',
     36    'author'       => 'Author',
     37    'author_uri'   => 'Author URI',
     38    'support_uri'  => 'Support URI',
     39] );
     40
     41
     42/**
     43 * Defines
     44 */
    2645
    2746// Versions
    28 define( 'DDTT_VERSION', '2.0.0.3' );
    29 define( 'DDTT_BETA', false ); // TODO:
    30 define( 'DDTT_MIN_PHP_VERSION', '7.4' );
     47define( 'DDTT_VERSION', $plugin_data[ 'version' ] );
     48define( 'DDTT_BETA', false );
     49define( 'DDTT_MIN_PHP_VERSION', $plugin_data[ 'requires_php' ] );
    3150
    3251// Prevent loading the plugin if PHP version is not minimum
     
    5170
    5271// Names
    53 define( 'DDTT_NAME', 'Developer Debug Tools' );
    54 define( 'DDTT_TEXTDOMAIN', 'dev-debug-tools' );
    55 define( 'DDTT_AUTHOR', 'Apos37' );
     72define( 'DDTT_NAME', $plugin_data[ 'name' ] );
     73define( 'DDTT_TEXTDOMAIN', $plugin_data[ 'textdomain' ] );
     74define( 'DDTT_AUTHOR', $plugin_data[ 'author' ] );
    5675define( 'DDTT_AUTHOR_EMAIL', '[email protected]' );
    57 define( 'DDTT_AUTHOR_URL', 'https://apos37.com/' );
    58 define( 'DDTT_DISCORD_SUPPORT_URL', 'https://discord.gg/3HnzNEJVnR' );
     76define( 'DDTT_AUTHOR_URL', $plugin_data[ 'author_uri' ] );
     77define( 'DDTT_DISCORD_SUPPORT_URL', $plugin_data[ 'support_uri' ] );
    5978
    6079// Fetch site url only once
  • dev-debug-tools/trunk/includes/admin/admin-area.php

    r3230637 r3262957  
    9797            if ( !get_option( DDTT_GO_PF.'hide_plugin' ) ) {
    9898                $row_meta = [
    99                     'docs' => '<a href="'.esc_url( DDTT_AUTHOR_URL.'wordpress-developer-debug-tools/' ).'" target="_blank" aria-label="'.esc_attr__( 'Plugin Website Link', 'dev-debug-tools' ).'">'.esc_html__( 'Website', 'dev-debug-tools' ).'</a>',
     99                    // 'docs' => '<a href="'.esc_url( DDTT_AUTHOR_URL.'wordpress-developer-debug-tools/' ).'" target="_blank" aria-label="'.esc_attr__( 'Plugin Website Link', 'dev-debug-tools' ).'">'.esc_html__( 'Website', 'dev-debug-tools' ).'</a>',
    100100                    'discord' => '<a href="'.esc_url( DDTT_DISCORD_SUPPORT_URL ).'" target="_blank" aria-label="'.esc_attr__( 'Plugin Support on Discord', 'dev-debug-tools' ).'">'.esc_html__( 'Discord Support', 'dev-debug-tools' ).'</a>'
    101101                ];
  • dev-debug-tools/trunk/includes/admin/functions.php

    r3230748 r3262957  
    769769
    770770    // Define log paths and initial counts
    771     $log_files = [
    772         'debug'       => WP_DEBUG_LOG && WP_DEBUG_LOG !== true ? WP_DEBUG_LOG : DDTT_CONTENT_URL.'/debug.log',
    773         'error'       => get_option( DDTT_GO_PF.'error_log_path' ) ?: 'error_log',
    774         'admin_error' => get_option( DDTT_GO_PF.'admin_error_log_path' ) ?: DDTT_ADMIN_URL.'/error_log'
    775     ];
     771    if ( WP_DEBUG_LOG && WP_DEBUG_LOG !== true ) {
     772        $debug_loc = WP_DEBUG_LOG;
     773    } else {
     774        $debug_log_path = get_option( DDTT_GO_PF.'debug_log_path' );
     775        if ( $debug_log_path && $debug_log_path != '' ) {
     776            $debug_loc = sanitize_text_field( $debug_log_path );
     777            if ( str_starts_with( $debug_loc, 'wp-content/' ) ) {
     778                $debug_loc = get_home_path().$debug_loc;
     779            }
     780        } elseif ( WP_DEBUG_LOG && WP_DEBUG_LOG !== true ) {
     781            $debug_loc = WP_DEBUG_LOG;
     782        } else {
     783            $debug_loc =  DDTT_CONTENT_URL.'/debug.log';
     784        }
     785    }
     786
     787    $log_files = [];
     788    if ( !isset( $_GET[ 'clear_debug_log' ] ) ) {
     789        $log_files[ 'debug' ] = $debug_loc;
     790    }
     791    if ( !isset( $_GET['clear_error_log'] ) ) {
     792        $log_files[ 'error' ] = get_option( DDTT_GO_PF . 'error_log_path' ) ?: 'error_log';
     793    }
     794    if ( !isset( $_GET['clear_admin_error_log'] ) ) {
     795        $log_files[ 'admin_error' ] = get_option( DDTT_GO_PF . 'admin_error_log_path' ) ?: DDTT_ADMIN_URL . '/error_log';
     796    }
    776797
    777798    // Store the total count
     
    19011922 * @return string
    19021923 */
    1903 function ddtt_view_activity_file_contents( $path, $highlight_args ) {
     1924function ddtt_view_activity_file_contents( $path, $highlight_args, $ip_address_link = 'https://www.criminalip.io/asset/report/{ip}' ) {
    19041925    // Initialize the WP_Filesystem
    19051926    if ( !function_exists( 'WP_Filesystem' ) ) {
     
    20422063
    20432064                        // Extract user info (e.g., Socrates ([email protected] - ID: 2))
    2044                         preg_match( '/^(.*?) \((.*?) - ID: (\d+)\)/', $user_info, $matches );
     2065                        preg_match( '/^(.*?) \((.*?) - ID: (\d+)\)(?: (.*?))?$/', $user_info, $matches );
    20452066                        $display_name = isset( $matches[1] ) ? $matches[1] : '';
    20462067                        if ( $display_name ) {
     
    20562077                        if ( $user_id ) {
    20572078                            $display_user[] = 'User ID: ' . $user_id;
     2079                        }
     2080
     2081                        $ip_address = isset( $matches[4] ) ? $matches[4] : '';
     2082                        if ( $ip_address ) {
     2083                            $ip_url = str_replace( '{ip}', $ip_address, $ip_address_link );
     2084                            $ip_link = '<a href="' . $ip_url . '" target="_blank">' . $ip_address . '</a>';
     2085                            $display_user[] = 'IP: ' . $ip_link;
    20582086                        }
    20592087
  • dev-debug-tools/trunk/includes/admin/option-about.php

    r3128387 r3262957  
    5151.plugin-card, .plugin-card-bottom {
    5252    background-color: #2D2D2D;
     53    color: #F6F7F7 !important;
     54}
     55.plugin-card .desc p {
     56    color: #F6F7F7 !important;
    5357}
    5458body #wpbody-content .plugin-card .plugin-action-buttons a.button.install-now[aria-disabled="true"] {
    5559    color: #2D2D2D !important;
     60}
     61#the-list {
     62    display: flex;
     63    flex-flow: wrap;
     64}
     65.plugin-card {
     66    display: flex;
     67    flex-direction: column;
     68    margin-left: 0 !important;
     69}
     70.plugin-card .plugin-card-top {
     71    flex: 1;
     72}
     73.plugin-card .plugin-card-bottom {
     74    margin-top: auto;
     75}
     76.plugin-card .ws_stars {
     77    display: inline-block;
     78}
     79.php-incompatible {
     80    padding: 12px 20px;
     81    background-color: #D1231B;
     82    color: #FFFFFF;
     83    border-top: 1px solid #dcdcde;
     84    overflow: hidden;
     85}
     86#wpbody-content .plugin-card .plugin-action-buttons a.install-now[aria-disabled="true"] {
     87    /* color: #CBB8AD !important; */
     88    border-color: #CBB8AD !important;
     89}
     90.plugin-action-buttons {
     91    list-style: none !important;   
    5692}
    5793</style>
     
    100136<?php if ( ddtt_get_domain() != 'playground.wordpress.net' ) { ?>
    101137    <br><br>
    102     <h3>Try My Other Plugins</h3>
    103     <?php ddtt_plugin_card( 'admin-help-docs' ); ?>
    104     <?php ddtt_plugin_card( 'gf-discord' ); ?>
    105     <?php ddtt_plugin_card( 'gf-msteams' ); ?>
    106     <?php ddtt_plugin_card( 'broken-link-notifier' ); ?>
     138    <h2><?php echo esc_html__( 'Try My Other Plugins', 'admin-help-docs' ); ?></h2>
     139    <div class="wp-list-table widefat plugin-install">
     140        <div id="the-list">
     141            <?php ddtt_plugin_card( 'admin-help-docs' ); ?>
     142            <?php ddtt_plugin_card( 'clear-cache-everywhere' ); ?>
     143            <?php ddtt_plugin_card( 'broken-link-notifier' ); ?>
     144            <?php ddtt_plugin_card( 'eri-file-library' ); ?>
     145            <?php if ( is_plugin_active( 'gravityforms/gravityforms.php' ) ) { ?>
     146                <?php ddtt_plugin_card( 'gf-tools' ); ?>
     147                <?php ddtt_plugin_card( 'gf-discord' ); ?>
     148                <?php ddtt_plugin_card( 'gf-msteams' ); ?>
     149                <?php ddtt_plugin_card( 'gravity-zwr' ); ?>
     150            <?php } ?>
     151        </div>
     152    </div>
    107153<?php } ?>
  • dev-debug-tools/trunk/includes/admin/option-logs.php

    r3230637 r3262957  
    2727// Replace the files if query string exists
    2828if ( ddtt_get( 'clear_error_log', '==', 'true' ) ) {
     29    ddtt_remove_qs_without_refresh( [ 'clear_error_log' ] );
    2930    $DDTT_LOGS->replace_file( get_home_path().'error_log', 'error_log', true );
    3031}
     
    3435}
    3536if ( ddtt_get( 'clear_admin_error_log', '==', 'true' ) ) {
     37    ddtt_remove_qs_without_refresh( [ 'clear_admin_error_log' ] );
    3638    $DDTT_LOGS->replace_file( get_home_path().DDTT_ADMIN_URL.'/error_log', 'error_log', true );
    3739}
  • dev-debug-tools/trunk/includes/classes/class-activity.php

    r3230637 r3262957  
    11951195        if ( $action_label = $this->get_action_label( __FUNCTION__ ) ) {
    11961196
     1197            $ip = get_current_user_id() ? sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] ) : '';
     1198
    11971199            // Prepare log message
    11981200            $log_message = sprintf(
     
    12061208
    12071209            // Write to the log
    1208             if ( !$this->write_to_log( $this->current_user_log_message( $action_label ) . ' | ' . $log_message ) ) {
     1210            if ( !$this->write_to_log( $this->current_user_log_message( $action_label, null, $ip ) . ' | ' . $log_message ) ) {
    12091211                ddtt_write_log( 'Failed to write to activity log during post visit.' );
    12101212            }
     
    12481250        // Get action label
    12491251        if ( $action_label = $this->get_action_label( __FUNCTION__ ) ) {
     1252
     1253            $ip = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] );
    12501254
    12511255            // Prepare log message
     
    12621266            );
    12631267
    1264             $ip = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] );
    1265             $ip_link = '<a href="https://www.criminalip.io/asset/report/' . $ip . '" target="_blank">' . $ip . '</a>';
    1266 
    12671268            // Write to the log
    1268             if ( !$this->write_to_log( $this->current_user_log_message( $action_label, null, 'IP: ' . $ip_link ) . ' | ' . $log_message ) ) {
     1269            if ( !$this->write_to_log( $this->current_user_log_message( $action_label, null, $ip ) . ' | ' . $log_message ) ) {
    12691270                ddtt_write_log( 'Failed to write to activity log during post visit.' );
    12701271            }
  • dev-debug-tools/trunk/includes/classes/class-logs.php

    r3230637 r3262957  
    9494        $replacement_filename = $path_parts[ 'basename' ];
    9595        $replacement_dir = $path_parts[ 'dirname' ];
    96 
     96       
    9797        // Define the temporary path for the copied file
    9898        $temp_file_path = $replacement_dir . '/' . $replacement_filename;
  • dev-debug-tools/trunk/includes/classes/class-wpconfig.php

    r3173761 r3262957  
    205205            ],
    206206            'force_ssl_admin' => [
    207                 'label' => 'Ensure Sensetive Admin-area Info is Encrypted when Transmitting to Server',
     207                'label' => 'Ensure Sensitive Admin-area Info is Encrypted when Transmitting to Server',
    208208                'lines' => [
    209209                    [
  • dev-debug-tools/trunk/readme.txt

    r3230781 r3262957  
    22Contributors: apos37, venutius
    33Tags: debug, developer, testing, wp-config, htaccess
    4 Requires at least: 5.9.0
    5 Tested up to: 6.7.1
     4Requires at least: 5.9
     5Tested up to: 6.7
    66Requires PHP: 7.4
    7 Stable tag: 2.0.0.3
     7Stable tag: 2.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    5757Yes, but you should always make a backup of your site before using functionality that makes changes to your core files or database.
    5858
    59 = My site broke when updating my wp-config.php or .htaccess. How do I revert back to my original?
    60 The originals are stored in your root folder and renamed with the date and time from which they were replaced. For example, the wp-config.php file will have been renamed to wp-config-2022-08-22-15-25-46.php and replaced with a new file. Simply log into your FTP or File Manager (from your host), rename the current file to something else such as wp-config-BROKEN.php (just in case you need it), and then rename the version you want to revert back to as wp-config.php. If everything looks good, then you can either delete this file or send a copy of it to me so I can figure out what went wrong. You can do so in the Discord server mentioned below.
     59= My site broke when updating my wp-config.php or .htaccess. How do I revert back to my original? =
     60The originals are stored in your root folder and renamed with the date and time from which they were replaced. For example, the `wp-config.php` file will have been renamed to `wp-config-2022-08-22-15-25-46.php` and replaced with a new file. Simply log into your FTP or File Manager (from your host), rename the current file to something else such as `wp-config-BROKEN.php` (just in case you need it), and then rename the version you want to revert back to as `wp-config.php`. If everything looks good, then you can either delete this file or send a copy of it to me so I can figure out what went wrong. You can do so in the Discord server mentioned below.
    6161
    6262= Why can't I edit a username for a user? =
     
    6464
    6565= Where is the centering tool? =
    66 Viewable only on the front-end, there is a link on the admin bar that shows +Off. Click on it and it will add a transparent bar with lines on it at the top of the page underneath the admin bar. If you click on the centering bar it will expand all the way down the page. Click on it again and it will minimize back to the top. You can click on the +On link from the admin bar to make it go away.
     66Viewable only on the front-end, there is a link on the admin bar that shows `+Off`. Click on it and it will add a transparent bar with lines on it at the top of the page underneath the admin bar. If you click on the centering bar it will expand all the way down the page. Click on it again and it will minimize back to the top. You can click on the `+On` link from the admin bar to make it go away.
    6767
    6868= Where are the quick debug links? =
     
    8888
    8989== Changelog ==
     90= 2.0.1 =
     91* Update: Changed author name from Apos37 to WordPress Enhanced, new Author URI
     92* Tweak: Optimization of main file
     93* Fix: Remove error count if just cleared
     94* Fix: Mispelling on WPCONFIG tab
     95* Fix: Count on tab not using updated debug log path
     96
    9097= 2.0.0.3 =
    91 * Fix: CPU showing overload on shell with Managed WordPress hosting plans
     98* Fix: CPU showing overload when using shell
    9299
    93100= 2.0.0.2 =
Note: See TracChangeset for help on using the changeset viewer.