Plugin Directory

Changeset 3378902


Ignore:
Timestamp:
10/15/2025 01:03:35 PM (5 months ago)
Author:
awesomefootnotes
Message:

Adding the first version of my plugin

Location:
0-day-analytics
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • 0-day-analytics/tags/3.7.6/advanced-analytics.php

    r3377720 r3378902  
    1111 * Plugin Name:     0 Day Analytics
    1212 * Description:     Take full control of error log, crons, transients, plugins, requests, mails and DB tables.
    13  * Version:         3.7.5
     13 * Version:         3.7.6
    1414 * Author:          Stoil Dobrev
    1515 * Author URI:      https://github.com/sdobreff/
     
    3737// Constants.
    3838if ( ! defined( 'ADVAN_VERSION' ) ) {
    39     define( 'ADVAN_VERSION', '3.7.5' );
     39    define( 'ADVAN_VERSION', '3.7.6' );
    4040    define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' );
    4141    define( 'ADVAN_NAME', '0 Day Analytics' );
  • 0-day-analytics/tags/3.7.6/classes/vendor/lists/class-crons-list.php

    r3375318 r3378902  
    636636                ?>
    637637                <script>
    638                     window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     638                    window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    639639                </script>
    640640                <?php
     
    674674                ?>
    675675                <script>
    676                     window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     676                    window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    677677                </script>
    678678                <?php
  • 0-day-analytics/tags/3.7.6/classes/vendor/lists/class-wp-mail-list.php

    r3375967 r3378902  
    10091009                    ?>
    10101010                    <script>
    1011                         window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     1011                        window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    10121012                    </script>
    10131013                    <?php
  • 0-day-analytics/tags/3.7.6/classes/vendor/lists/entity/class-common-table.php

    r3377720 r3378902  
    477477         *
    478478         * @return int bool
    479          * 
     479         *
    480480         * @since latest
    481481         */
     
    603603
    604604            return $array;
    605 
    606             // return array_combine( $array, $array );
    607605        }
    608606
     
    884882
    885883                $wpdb->suppress_errors( true );
    886                 $results = $wpdb->get_var( $sql );
     884                $results = $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    887885
    888886                if ( '' !== $wpdb->last_error || null === $results ) {
     
    920918                $wpdb->suppress_errors( true );
    921919
    922                 $results = $wpdb->get_results( $sql, \ARRAY_A );
     920                $results = $wpdb->get_results( $sql, \ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    923921
    924922                if ( '' !== $wpdb->last_error || null === $results ) {
     
    992990
    993991            $query = $wpdb->prepare(
    994                 'SELECT * FROM `' . self::get_name() . '` WHERE `' . self::get_real_id_name() . '` = %s;',
     992                'SELECT * FROM `' . self::get_name() . '` WHERE `' . self::get_real_id_name() . '` = %s;', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    995993                $id
    996994            );
     
    998996            $wpdb->suppress_errors( true );
    999997
    1000             $results = $wpdb->get_results( $query, \ARRAY_A );
     998            $results = $wpdb->get_results( $query, \ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    1001999
    10021000            if ( '' !== $wpdb->last_error || null === $results ) {
     
    10321030                    <tr>
    10331031                        <td width="40%"><strong><?php echo \esc_html( $key ); ?></strong></td>
    1034                         <td><?php echo \esc_html( $value ); ?></td>
     1032                        <td><?php echo ( self::format_value_for_html( $value ) );  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
    10351033                    </tr>
    10361034                    <?php
     
    10581056            }
    10591057        }
     1058
     1059        /**
     1060         * Formats the value for HTML output
     1061         *
     1062         * @param mixed $value - The value to be formatted.
     1063         *
     1064         * @return string
     1065         *
     1066         * @since latest
     1067         */
     1068        private static function format_value_for_html( $value ) {
     1069            // Try to decode JSON if it's a string.
     1070            if ( is_string( $value ) ) {
     1071                $decoded = json_decode( $value, true );
     1072
     1073                // Handle valid JSON (objects or arrays).
     1074                if ( json_last_error() === JSON_ERROR_NONE ) {
     1075                    $value = $decoded;
     1076                }
     1077
     1078                // Try unserialize if not valid JSON but looks like serialized PHP.
     1079                elseif ( preg_match( '/^[aOs]:[0-9]+:/', $value ) ) {
     1080                    $unserialized = @unserialize( $value );
     1081                    if ( false !== $unserialized || 'b:0;' === $value ) {
     1082                        $value = $unserialized;
     1083                    }
     1084                }
     1085            }
     1086
     1087            // Format by type.
     1088            if ( is_array( $value ) ) {
     1089                // Pretty print arrays or objects.
     1090                $formatted = '<pre>' . \esc_html( print_r( $value, true ) ) . '</pre>';
     1091            } elseif ( is_object( $value ) ) {
     1092                $formatted = '<pre>' . \esc_html( print_r( $value, true ) ) . '</pre>';
     1093            } elseif ( is_bool( $value ) ) {
     1094                $formatted = $value ? 'true' : 'false';
     1095            } elseif ( is_null( $value ) ) {
     1096                $formatted = '<em>null</em>';
     1097            } elseif ( is_numeric( $value ) ) {
     1098                $formatted = esc_html( (string) $value );
     1099            } else {
     1100                // Fallback to escaped plain string.
     1101                $formatted = esc_html( (string) $value );
     1102            }
     1103
     1104            return $formatted;
     1105        }
    10601106    }
    10611107}
  • 0-day-analytics/tags/3.7.6/css/admin/style.css

    r3356328 r3378902  
    27462746html.aadvana-darkskin #wpfooter {
    27472747  color: #c3c4da !important;
     2748}
     2749
     2750html.aadvana-darkskin .wp-list-table .toggle-row::before {
     2751  color: #b0bbc6 !important;
    27482752}
    27492753
  • 0-day-analytics/tags/3.7.6/readme.txt

    r3377720 r3378902  
    44Tested up to: 6.8
    55Requires PHP: 7.4
    6 Stable tag: 3.7.5
     6Stable tag: 3.7.6
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    113113== Changelog ==
    114114
     115= 3.7.6 =
     116Resolved bug with bulk actions thanks to @lucianwpwhite . UI improvements for mobile, implemented formatting in table view, based on the typo of the value.
     117
    115118= 3.7.5 =
    116119Added logic to open records from tables without primary key - keep in mind that this is not universal and if 2 or more records are with the same data, there is no way to guess which one is actually being used. In general such tables should not exist as this shows serious lack of basic knowledge.
  • 0-day-analytics/trunk/advanced-analytics.php

    r3377720 r3378902  
    1111 * Plugin Name:     0 Day Analytics
    1212 * Description:     Take full control of error log, crons, transients, plugins, requests, mails and DB tables.
    13  * Version:         3.7.5
     13 * Version:         3.7.6
    1414 * Author:          Stoil Dobrev
    1515 * Author URI:      https://github.com/sdobreff/
     
    3737// Constants.
    3838if ( ! defined( 'ADVAN_VERSION' ) ) {
    39     define( 'ADVAN_VERSION', '3.7.5' );
     39    define( 'ADVAN_VERSION', '3.7.6' );
    4040    define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' );
    4141    define( 'ADVAN_NAME', '0 Day Analytics' );
  • 0-day-analytics/trunk/classes/vendor/lists/class-crons-list.php

    r3375318 r3378902  
    636636                ?>
    637637                <script>
    638                     window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     638                    window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    639639                </script>
    640640                <?php
     
    674674                ?>
    675675                <script>
    676                     window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     676                    window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    677677                </script>
    678678                <?php
  • 0-day-analytics/trunk/classes/vendor/lists/class-wp-mail-list.php

    r3375967 r3378902  
    10091009                    ?>
    10101010                    <script>
    1011                         window.location.href = '<?php echo \esc_url( $redirect ); ?>';
     1011                        window.location.href = '<?php echo \esc_url_raw( $redirect ); ?>';
    10121012                    </script>
    10131013                    <?php
  • 0-day-analytics/trunk/classes/vendor/lists/entity/class-common-table.php

    r3377720 r3378902  
    477477         *
    478478         * @return int bool
    479          * 
     479         *
    480480         * @since latest
    481481         */
     
    603603
    604604            return $array;
    605 
    606             // return array_combine( $array, $array );
    607605        }
    608606
     
    884882
    885883                $wpdb->suppress_errors( true );
    886                 $results = $wpdb->get_var( $sql );
     884                $results = $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    887885
    888886                if ( '' !== $wpdb->last_error || null === $results ) {
     
    920918                $wpdb->suppress_errors( true );
    921919
    922                 $results = $wpdb->get_results( $sql, \ARRAY_A );
     920                $results = $wpdb->get_results( $sql, \ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    923921
    924922                if ( '' !== $wpdb->last_error || null === $results ) {
     
    992990
    993991            $query = $wpdb->prepare(
    994                 'SELECT * FROM `' . self::get_name() . '` WHERE `' . self::get_real_id_name() . '` = %s;',
     992                'SELECT * FROM `' . self::get_name() . '` WHERE `' . self::get_real_id_name() . '` = %s;', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    995993                $id
    996994            );
     
    998996            $wpdb->suppress_errors( true );
    999997
    1000             $results = $wpdb->get_results( $query, \ARRAY_A );
     998            $results = $wpdb->get_results( $query, \ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    1001999
    10021000            if ( '' !== $wpdb->last_error || null === $results ) {
     
    10321030                    <tr>
    10331031                        <td width="40%"><strong><?php echo \esc_html( $key ); ?></strong></td>
    1034                         <td><?php echo \esc_html( $value ); ?></td>
     1032                        <td><?php echo ( self::format_value_for_html( $value ) );  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
    10351033                    </tr>
    10361034                    <?php
     
    10581056            }
    10591057        }
     1058
     1059        /**
     1060         * Formats the value for HTML output
     1061         *
     1062         * @param mixed $value - The value to be formatted.
     1063         *
     1064         * @return string
     1065         *
     1066         * @since latest
     1067         */
     1068        private static function format_value_for_html( $value ) {
     1069            // Try to decode JSON if it's a string.
     1070            if ( is_string( $value ) ) {
     1071                $decoded = json_decode( $value, true );
     1072
     1073                // Handle valid JSON (objects or arrays).
     1074                if ( json_last_error() === JSON_ERROR_NONE ) {
     1075                    $value = $decoded;
     1076                }
     1077
     1078                // Try unserialize if not valid JSON but looks like serialized PHP.
     1079                elseif ( preg_match( '/^[aOs]:[0-9]+:/', $value ) ) {
     1080                    $unserialized = @unserialize( $value );
     1081                    if ( false !== $unserialized || 'b:0;' === $value ) {
     1082                        $value = $unserialized;
     1083                    }
     1084                }
     1085            }
     1086
     1087            // Format by type.
     1088            if ( is_array( $value ) ) {
     1089                // Pretty print arrays or objects.
     1090                $formatted = '<pre>' . \esc_html( print_r( $value, true ) ) . '</pre>';
     1091            } elseif ( is_object( $value ) ) {
     1092                $formatted = '<pre>' . \esc_html( print_r( $value, true ) ) . '</pre>';
     1093            } elseif ( is_bool( $value ) ) {
     1094                $formatted = $value ? 'true' : 'false';
     1095            } elseif ( is_null( $value ) ) {
     1096                $formatted = '<em>null</em>';
     1097            } elseif ( is_numeric( $value ) ) {
     1098                $formatted = esc_html( (string) $value );
     1099            } else {
     1100                // Fallback to escaped plain string.
     1101                $formatted = esc_html( (string) $value );
     1102            }
     1103
     1104            return $formatted;
     1105        }
    10601106    }
    10611107}
  • 0-day-analytics/trunk/css/admin/style.css

    r3356328 r3378902  
    27462746html.aadvana-darkskin #wpfooter {
    27472747  color: #c3c4da !important;
     2748}
     2749
     2750html.aadvana-darkskin .wp-list-table .toggle-row::before {
     2751  color: #b0bbc6 !important;
    27482752}
    27492753
  • 0-day-analytics/trunk/readme.txt

    r3377720 r3378902  
    44Tested up to: 6.8
    55Requires PHP: 7.4
    6 Stable tag: 3.7.5
     6Stable tag: 3.7.6
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    113113== Changelog ==
    114114
     115= 3.7.6 =
     116Resolved bug with bulk actions thanks to @lucianwpwhite . UI improvements for mobile, implemented formatting in table view, based on the typo of the value.
     117
    115118= 3.7.5 =
    116119Added logic to open records from tables without primary key - keep in mind that this is not universal and if 2 or more records are with the same data, there is no way to guess which one is actually being used. In general such tables should not exist as this shows serious lack of basic knowledge.
Note: See TracChangeset for help on using the changeset viewer.