Changeset 3377720
- Timestamp:
- 10/13/2025 07:41:09 PM (5 months ago)
- Location:
- 0-day-analytics
- Files:
-
- 16 edited
- 1 copied
-
tags/3.7.5 (copied) (copied from 0-day-analytics/trunk)
-
tags/3.7.5/advanced-analytics.php (modified) (3 diffs)
-
tags/3.7.5/classes/vendor/controllers/class-endpoints.php (modified) (2 diffs)
-
tags/3.7.5/classes/vendor/helpers/class-ajax-helper.php (modified) (2 diffs)
-
tags/3.7.5/classes/vendor/lists/class-logs-list.php (modified) (1 diff)
-
tags/3.7.5/classes/vendor/lists/class-table-list.php (modified) (1 diff)
-
tags/3.7.5/classes/vendor/lists/entity/class-common-table.php (modified) (8 diffs)
-
tags/3.7.5/classes/vendor/lists/views/class-table-view.php (modified) (1 diff)
-
tags/3.7.5/readme.txt (modified) (2 diffs)
-
trunk/advanced-analytics.php (modified) (3 diffs)
-
trunk/classes/vendor/controllers/class-endpoints.php (modified) (2 diffs)
-
trunk/classes/vendor/helpers/class-ajax-helper.php (modified) (2 diffs)
-
trunk/classes/vendor/lists/class-logs-list.php (modified) (1 diff)
-
trunk/classes/vendor/lists/class-table-list.php (modified) (1 diff)
-
trunk/classes/vendor/lists/entity/class-common-table.php (modified) (8 diffs)
-
trunk/classes/vendor/lists/views/class-table-view.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
0-day-analytics/tags/3.7.5/advanced-analytics.php
r3375967 r3377720 11 11 * Plugin Name: 0 Day Analytics 12 12 * Description: Take full control of error log, crons, transients, plugins, requests, mails and DB tables. 13 * Version: 3.7. 413 * Version: 3.7.5 14 14 * Author: Stoil Dobrev 15 15 * Author URI: https://github.com/sdobreff/ … … 37 37 // Constants. 38 38 if ( ! defined( 'ADVAN_VERSION' ) ) { 39 define( 'ADVAN_VERSION', '3.7. 4' );39 define( 'ADVAN_VERSION', '3.7.5' ); 40 40 define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' ); 41 41 define( 'ADVAN_NAME', '0 Day Analytics' ); … … 247 247 } 248 248 249 require_once ADVAN_PLUGIN_ROOT . 'classes' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'functions.php'; 249 // Offer our own error logging if there is no way to enable WP_DEBUG and nothing else works. 250 if ( Settings::get_option( 'plugin_debug_enable' ) ) { 251 if ( function_exists( 'error_reporting' ) ) { 252 error_reporting( E_ALL ); 253 } 254 255 ini_set( 'display_errors', 0 ); 256 257 $log_path = WP_CONTENT_DIR . '/debug.log'; 258 259 if ( $log_path ) { 260 ini_set( 'log_errors', 1 ); 261 ini_set( 'error_log', $log_path ); 262 } 263 } 264 -
0-day-analytics/tags/3.7.5/classes/vendor/controllers/class-endpoints.php
r3375967 r3377720 225 225 'endpoints' => array( 226 226 array( 227 '(?P<table_name>\w+)/(?P<id> \w+)/' => array(227 '(?P<table_name>\w+)/(?P<id>.+)/' => array( 228 228 'methods' => array( 229 229 'method' => \WP_REST_Server::READABLE, … … 240 240 'required' => true, 241 241 'type' => 'string', 242 'pattern' => ' \w+',242 'pattern' => '.+', 243 243 'description' => 'ID of the table record which row needs to be shown', 244 244 ), -
0-day-analytics/tags/3.7.5/classes/vendor/helpers/class-ajax-helper.php
r3375318 r3377720 139 139 140 140 \add_action( 'wp_ajax_' . ADVAN_PREFIX . 'send_test_email', array( __CLASS__, 'send_test_email' ) ); 141 142 \add_action( 'wp_ajax_advana_error_log_filtering_dismiss_notice', array( __CLASS__, 'error_log_filtering_dismiss_notice' ) ); 141 143 } 142 144 } … … 635 637 } 636 638 } 639 640 /** 641 * Dismisses the error filtering notice for the given user 642 * 643 * @return void 644 * 645 * @since latest 646 */ 647 public static function error_log_filtering_dismiss_notice() { 648 $user_id = \get_current_user_id(); 649 \update_user_meta( $user_id, '_aadvana_filter_error_log_notice_dismissed', 1 ); 650 \wp_die(); 651 } 637 652 } 638 653 } -
0-day-analytics/tags/3.7.5/classes/vendor/lists/class-logs-list.php
r3374674 r3377720 1345 1345 </select> 1346 1346 </div> 1347 <p> 1348 <?php \esc_html_e( 'Note: Filtering is expensive (in terms of resources) operation, so use it with care. Important info to keep in mind - if you don\'t use only ONE severity for filtering, you will see more severities, outside selected ones for filtering, because error log may contain all kinds of errors and it is impossible for any software to have\'em all, because there are no strict standards. It is implemented this way because during few severities filtering there may be more important ones (errors in log) which are not covered from the plugin, and it is best not to miss them.', '0-day-analytics' ); ?> 1349 </p> 1347 <?php 1348 $dismissed = \get_user_meta( \get_current_user_id(), '_aadvana_filter_error_log_notice_dismissed', true ); 1349 1350 if ( ! $dismissed ) { 1351 ?> 1352 1353 <div id="advaa-filtering-notice" class="notice notice-info is-dismissible"> 1354 <p> 1355 <?php \esc_html_e( 'Note: Filtering error log is expensive (in terms of resources) operation, so use it with care. Important info to keep in mind - if you don\'t use only ONE severity for filtering, you will see more severities, outside selected ones for filtering, because error log may contain all kinds of errors and it is impossible for any software to have\'em all, because there are no strict standards. It is implemented this way because during few severities filtering there may be more important ones (errors in log) which are not covered from the plugin, and it is best not to miss them.', '0-day-analytics' ); ?> 1356 </p> 1357 </div> 1358 <script> 1359 jQuery(document).on('click', '#advaa-filtering-notice .notice-dismiss', function(){ 1360 jQuery.ajax({ 1361 url: ajaxurl, 1362 type: 'GET', 1363 data: { 1364 action: 'advana_error_log_filtering_dismiss_notice' 1365 } 1366 }); 1367 }); 1368 </script> 1369 <?php 1370 } 1371 ?> 1350 1372 <script> 1373 1351 1374 let severities = document.getElementsByClassName("severity-filter"); 1352 1375 -
0-day-analytics/tags/3.7.5/classes/vendor/lists/class-table-list.php
r3375967 r3377720 281 281 $query_results = $wpdb->get_results( $query, ARRAY_A ); 282 282 283 $this->count = $wpdb->get_var( 'SELECT COUNT(' . self::$table::get_real_id_name() . ') FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql );283 $this->count = (int) $wpdb->get_var( 'SELECT COUNT(' . self::$table::get_real_id_name() . ') FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql ); 284 284 285 285 // return result array to prepare_items. -
0-day-analytics/tags/3.7.5/classes/vendor/lists/entity/class-common-table.php
r3375967 r3377720 369 369 if ( \is_array( $result ) && ! empty( $result ) && isset( $result[0]['Column_name'] ) ) { 370 370 static::$real_id = $result[0]['Column_name']; 371 } else { 372 $columns = self::get_column_names(); 373 static::$real_id = reset( $columns ); 371 374 } 372 375 } … … 448 451 */ 449 452 public static function get_columns_info(): array { 450 global $wpdb; 451 452 $query = $wpdb->prepare( 453 'SHOW TABLES LIKE %s', 454 $wpdb->esc_like( self::get_name() ) 455 ); 456 457 if ( $wpdb->get_var( $query ) == self::get_name() ) { 458 static::$columns_info = $wpdb->get_results( 459 'DESC ' . 460 self::get_name(), 461 ARRAY_A 462 ); 453 if ( empty( static::$columns_info ) ) { 454 global $wpdb; 455 456 $query = $wpdb->prepare( 457 'SHOW TABLES LIKE %s', 458 $wpdb->esc_like( self::get_name() ) 459 ); 460 461 if ( $wpdb->get_var( $query ) == self::get_name() ) { 462 static::$columns_info = $wpdb->get_results( 463 'DESC ' . 464 self::get_name(), 465 ARRAY_A 466 ); 467 } 463 468 } 464 469 … … 472 477 * 473 478 * @return int bool 479 * 480 * @since latest 474 481 */ 475 482 public static function find( array $data ) { … … 593 600 */ 594 601 public static function get_column_names(): array { 595 $array = array_column( self::get_columns_info(), 'Field' ); 596 return array_combine( $array, $array ); 602 $array = array_column( self::get_columns_info(), 'Field', 'Field' ); 603 604 return $array; 605 606 // return array_combine( $array, $array ); 597 607 } 598 608 … … 756 766 */ 757 767 public static function get_column_names_admin(): array { 758 return self::get_column_names(); 768 $clmns = self::get_columns_info(); 769 770 $array_clmns = array(); 771 772 foreach ( $clmns as $column ) { 773 $array_clmns[ $column['Field'] ] = $column['Field'] . '<br>' . $column['Type']; 774 } 775 776 return $array_clmns; 759 777 } 760 778 … … 770 788 public static function manage_columns( $columns ): array { 771 789 if ( empty( self::$admin_columns ) ) { 772 $screen_options = self::get_column_names ();790 $screen_options = self::get_column_names_admin(); 773 791 774 792 $table_columns = array( … … 996 1014 <table class="widefat striped table-view-list" style="max-width:100%;table-layout: fixed;"> 997 1015 <col width="20%" /> 998 <col width="80%" />1016 <col width="80%" /> 999 1017 <thead> 1000 1018 <tr> … … 1026 1044 return rest_ensure_response( 1027 1045 array( 1028 'success' => true,1029 'mail_body' => $message,1046 'success' => true, 1047 'mail_body' => $message, 1030 1048 'table_name' => $table_name, 1031 1049 ) -
0-day-analytics/tags/3.7.5/classes/vendor/lists/views/class-table-view.php
r3375967 r3377720 241 241 let id = jQuery( this ).data( 'details-id' ); 242 242 let that = this; 243 var encodedValue = jQuery('<div />').text(id).html(); 243 244 try { 244 245 attResp = wp.apiFetch({ -
0-day-analytics/tags/3.7.5/readme.txt
r3375967 r3377720 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 3.7. 46 Stable tag: 3.7.5 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 113 113 == Changelog == 114 114 115 = 3.7.5 = 116 Added 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. 117 115 118 = 3.7.4 = 116 119 Uninstall script introduced, bug fixes. -
0-day-analytics/trunk/advanced-analytics.php
r3375967 r3377720 11 11 * Plugin Name: 0 Day Analytics 12 12 * Description: Take full control of error log, crons, transients, plugins, requests, mails and DB tables. 13 * Version: 3.7. 413 * Version: 3.7.5 14 14 * Author: Stoil Dobrev 15 15 * Author URI: https://github.com/sdobreff/ … … 37 37 // Constants. 38 38 if ( ! defined( 'ADVAN_VERSION' ) ) { 39 define( 'ADVAN_VERSION', '3.7. 4' );39 define( 'ADVAN_VERSION', '3.7.5' ); 40 40 define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' ); 41 41 define( 'ADVAN_NAME', '0 Day Analytics' ); … … 247 247 } 248 248 249 require_once ADVAN_PLUGIN_ROOT . 'classes' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'functions.php'; 249 // Offer our own error logging if there is no way to enable WP_DEBUG and nothing else works. 250 if ( Settings::get_option( 'plugin_debug_enable' ) ) { 251 if ( function_exists( 'error_reporting' ) ) { 252 error_reporting( E_ALL ); 253 } 254 255 ini_set( 'display_errors', 0 ); 256 257 $log_path = WP_CONTENT_DIR . '/debug.log'; 258 259 if ( $log_path ) { 260 ini_set( 'log_errors', 1 ); 261 ini_set( 'error_log', $log_path ); 262 } 263 } 264 -
0-day-analytics/trunk/classes/vendor/controllers/class-endpoints.php
r3375967 r3377720 225 225 'endpoints' => array( 226 226 array( 227 '(?P<table_name>\w+)/(?P<id> \w+)/' => array(227 '(?P<table_name>\w+)/(?P<id>.+)/' => array( 228 228 'methods' => array( 229 229 'method' => \WP_REST_Server::READABLE, … … 240 240 'required' => true, 241 241 'type' => 'string', 242 'pattern' => ' \w+',242 'pattern' => '.+', 243 243 'description' => 'ID of the table record which row needs to be shown', 244 244 ), -
0-day-analytics/trunk/classes/vendor/helpers/class-ajax-helper.php
r3375318 r3377720 139 139 140 140 \add_action( 'wp_ajax_' . ADVAN_PREFIX . 'send_test_email', array( __CLASS__, 'send_test_email' ) ); 141 142 \add_action( 'wp_ajax_advana_error_log_filtering_dismiss_notice', array( __CLASS__, 'error_log_filtering_dismiss_notice' ) ); 141 143 } 142 144 } … … 635 637 } 636 638 } 639 640 /** 641 * Dismisses the error filtering notice for the given user 642 * 643 * @return void 644 * 645 * @since latest 646 */ 647 public static function error_log_filtering_dismiss_notice() { 648 $user_id = \get_current_user_id(); 649 \update_user_meta( $user_id, '_aadvana_filter_error_log_notice_dismissed', 1 ); 650 \wp_die(); 651 } 637 652 } 638 653 } -
0-day-analytics/trunk/classes/vendor/lists/class-logs-list.php
r3374674 r3377720 1345 1345 </select> 1346 1346 </div> 1347 <p> 1348 <?php \esc_html_e( 'Note: Filtering is expensive (in terms of resources) operation, so use it with care. Important info to keep in mind - if you don\'t use only ONE severity for filtering, you will see more severities, outside selected ones for filtering, because error log may contain all kinds of errors and it is impossible for any software to have\'em all, because there are no strict standards. It is implemented this way because during few severities filtering there may be more important ones (errors in log) which are not covered from the plugin, and it is best not to miss them.', '0-day-analytics' ); ?> 1349 </p> 1347 <?php 1348 $dismissed = \get_user_meta( \get_current_user_id(), '_aadvana_filter_error_log_notice_dismissed', true ); 1349 1350 if ( ! $dismissed ) { 1351 ?> 1352 1353 <div id="advaa-filtering-notice" class="notice notice-info is-dismissible"> 1354 <p> 1355 <?php \esc_html_e( 'Note: Filtering error log is expensive (in terms of resources) operation, so use it with care. Important info to keep in mind - if you don\'t use only ONE severity for filtering, you will see more severities, outside selected ones for filtering, because error log may contain all kinds of errors and it is impossible for any software to have\'em all, because there are no strict standards. It is implemented this way because during few severities filtering there may be more important ones (errors in log) which are not covered from the plugin, and it is best not to miss them.', '0-day-analytics' ); ?> 1356 </p> 1357 </div> 1358 <script> 1359 jQuery(document).on('click', '#advaa-filtering-notice .notice-dismiss', function(){ 1360 jQuery.ajax({ 1361 url: ajaxurl, 1362 type: 'GET', 1363 data: { 1364 action: 'advana_error_log_filtering_dismiss_notice' 1365 } 1366 }); 1367 }); 1368 </script> 1369 <?php 1370 } 1371 ?> 1350 1372 <script> 1373 1351 1374 let severities = document.getElementsByClassName("severity-filter"); 1352 1375 -
0-day-analytics/trunk/classes/vendor/lists/class-table-list.php
r3375967 r3377720 281 281 $query_results = $wpdb->get_results( $query, ARRAY_A ); 282 282 283 $this->count = $wpdb->get_var( 'SELECT COUNT(' . self::$table::get_real_id_name() . ') FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql );283 $this->count = (int) $wpdb->get_var( 'SELECT COUNT(' . self::$table::get_real_id_name() . ') FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql ); 284 284 285 285 // return result array to prepare_items. -
0-day-analytics/trunk/classes/vendor/lists/entity/class-common-table.php
r3375967 r3377720 369 369 if ( \is_array( $result ) && ! empty( $result ) && isset( $result[0]['Column_name'] ) ) { 370 370 static::$real_id = $result[0]['Column_name']; 371 } else { 372 $columns = self::get_column_names(); 373 static::$real_id = reset( $columns ); 371 374 } 372 375 } … … 448 451 */ 449 452 public static function get_columns_info(): array { 450 global $wpdb; 451 452 $query = $wpdb->prepare( 453 'SHOW TABLES LIKE %s', 454 $wpdb->esc_like( self::get_name() ) 455 ); 456 457 if ( $wpdb->get_var( $query ) == self::get_name() ) { 458 static::$columns_info = $wpdb->get_results( 459 'DESC ' . 460 self::get_name(), 461 ARRAY_A 462 ); 453 if ( empty( static::$columns_info ) ) { 454 global $wpdb; 455 456 $query = $wpdb->prepare( 457 'SHOW TABLES LIKE %s', 458 $wpdb->esc_like( self::get_name() ) 459 ); 460 461 if ( $wpdb->get_var( $query ) == self::get_name() ) { 462 static::$columns_info = $wpdb->get_results( 463 'DESC ' . 464 self::get_name(), 465 ARRAY_A 466 ); 467 } 463 468 } 464 469 … … 472 477 * 473 478 * @return int bool 479 * 480 * @since latest 474 481 */ 475 482 public static function find( array $data ) { … … 593 600 */ 594 601 public static function get_column_names(): array { 595 $array = array_column( self::get_columns_info(), 'Field' ); 596 return array_combine( $array, $array ); 602 $array = array_column( self::get_columns_info(), 'Field', 'Field' ); 603 604 return $array; 605 606 // return array_combine( $array, $array ); 597 607 } 598 608 … … 756 766 */ 757 767 public static function get_column_names_admin(): array { 758 return self::get_column_names(); 768 $clmns = self::get_columns_info(); 769 770 $array_clmns = array(); 771 772 foreach ( $clmns as $column ) { 773 $array_clmns[ $column['Field'] ] = $column['Field'] . '<br>' . $column['Type']; 774 } 775 776 return $array_clmns; 759 777 } 760 778 … … 770 788 public static function manage_columns( $columns ): array { 771 789 if ( empty( self::$admin_columns ) ) { 772 $screen_options = self::get_column_names ();790 $screen_options = self::get_column_names_admin(); 773 791 774 792 $table_columns = array( … … 996 1014 <table class="widefat striped table-view-list" style="max-width:100%;table-layout: fixed;"> 997 1015 <col width="20%" /> 998 <col width="80%" />1016 <col width="80%" /> 999 1017 <thead> 1000 1018 <tr> … … 1026 1044 return rest_ensure_response( 1027 1045 array( 1028 'success' => true,1029 'mail_body' => $message,1046 'success' => true, 1047 'mail_body' => $message, 1030 1048 'table_name' => $table_name, 1031 1049 ) -
0-day-analytics/trunk/classes/vendor/lists/views/class-table-view.php
r3375967 r3377720 241 241 let id = jQuery( this ).data( 'details-id' ); 242 242 let that = this; 243 var encodedValue = jQuery('<div />').text(id).html(); 243 244 try { 244 245 attResp = wp.apiFetch({ -
0-day-analytics/trunk/readme.txt
r3375967 r3377720 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 3.7. 46 Stable tag: 3.7.5 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 113 113 == Changelog == 114 114 115 = 3.7.5 = 116 Added 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. 117 115 118 = 3.7.4 = 116 119 Uninstall script introduced, bug fixes.
Note: See TracChangeset
for help on using the changeset viewer.