Changeset 3367391
- Timestamp:
- 09/24/2025 07:40:39 PM (6 months ago)
- Location:
- 0-day-analytics
- Files:
-
- 3 deleted
- 22 edited
- 1 copied
-
tags/2.8.0 (deleted)
-
tags/3.0.0 (deleted)
-
tags/3.1.0 (deleted)
-
tags/3.7.0 (copied) (copied from 0-day-analytics/trunk)
-
tags/3.7.0/advanced-analytics.php (modified) (2 diffs)
-
tags/3.7.0/classes/controllers/class-requests-log.php (modified) (4 diffs)
-
tags/3.7.0/classes/entities/class-requests-log-entity.php (modified) (8 diffs)
-
tags/3.7.0/classes/entities/class-wp-mail-entity.php (modified) (2 diffs)
-
tags/3.7.0/classes/helpers/class-plugin-theme-helper.php (modified) (1 diff)
-
tags/3.7.0/classes/lists/class-logs-list.php (modified) (1 diff)
-
tags/3.7.0/classes/lists/class-requests-list.php (modified) (8 diffs)
-
tags/3.7.0/classes/lists/class-wp-mail-list.php (modified) (4 diffs)
-
tags/3.7.0/classes/lists/views/class-requests-view.php (modified) (1 diff)
-
tags/3.7.0/classes/migration/class-migration.php (modified) (2 diffs)
-
tags/3.7.0/readme.txt (modified) (2 diffs)
-
trunk/advanced-analytics.php (modified) (2 diffs)
-
trunk/classes/controllers/class-requests-log.php (modified) (4 diffs)
-
trunk/classes/entities/class-requests-log-entity.php (modified) (8 diffs)
-
trunk/classes/entities/class-wp-mail-entity.php (modified) (2 diffs)
-
trunk/classes/helpers/class-plugin-theme-helper.php (modified) (1 diff)
-
trunk/classes/lists/class-logs-list.php (modified) (1 diff)
-
trunk/classes/lists/class-requests-list.php (modified) (8 diffs)
-
trunk/classes/lists/class-wp-mail-list.php (modified) (4 diffs)
-
trunk/classes/lists/views/class-requests-view.php (modified) (1 diff)
-
trunk/classes/migration/class-migration.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
0-day-analytics/tags/3.7.0/advanced-analytics.php
r3366898 r3367391 13 13 * Plugin Name: WP Control 14 14 * Description: Take full control of error log, crons, transients, plugins, requests, mails and DB tables. 15 * Version: 3. 6.415 * Version: 3.7.0 16 16 * Author: Stoil Dobrev 17 17 * Author URI: https://github.com/sdobreff/ … … 39 39 // Constants. 40 40 if ( ! defined( 'ADVAN_VERSION' ) ) { 41 define( 'ADVAN_VERSION', '3. 6.4' );41 define( 'ADVAN_VERSION', '3.7.0' ); 42 42 define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' ); 43 43 define( 'ADVAN_NAME', 'WP Control' ); -
0-day-analytics/tags/3.7.0/classes/controllers/class-requests-log.php
r3343900 r3367391 14 14 use ADVAN\Helpers\Settings; 15 15 use ADVAN\Helpers\Context_Helper; 16 use ADVAN\Helpers\Plugin_Theme_Helper; 16 17 use ADVAN\Entities\Requests_Log_Entity; 17 18 … … 139 140 'requests' => self::$requests, 140 141 'trace' => self::get_trace(), 142 'plugin' => ( isset( \json_decode( self::$trace, true )[7] ) && isset( \json_decode( self::$trace, true )[7]['file'] ) ) ? self::add_plugin_info_to_collected_item( \json_decode( self::$trace, true )[7]['file'] ) : '', 141 143 ); 142 144 … … 326 328 'requests' => self::$requests, 327 329 'trace' => self::get_trace(), 330 'plugin' => ( isset( \json_decode( self::$trace, true )[7] ) && isset( \json_decode( self::$trace, true )[7]['file'] ) ) ? self::add_plugin_info_to_collected_item( \json_decode( self::$trace, true )[7]['file'] ) : '', 328 331 ); 329 332 … … 337 340 return $response; 338 341 } 342 343 /** 344 * Adds plugin info to the database using the file path collected from the trace. 345 * 346 * @param string $message - File path from the trace. 347 * 348 * @return string 349 * 350 * @since latest 351 */ 352 private static function add_plugin_info_to_collected_item( string $message ) { 353 354 $plugins_dir_basename = basename( \WP_PLUGIN_DIR ); 355 356 if ( false !== \mb_strpos( $message, $plugins_dir_basename . \DIRECTORY_SEPARATOR ) ) { 357 358 $split_plugin = explode( \DIRECTORY_SEPARATOR, $message ); 359 360 $next = false; 361 $plugin_base = ''; 362 foreach ( $split_plugin as $part ) { 363 if ( $next ) { 364 $plugin_base = $part; 365 break; 366 } 367 if ( $plugins_dir_basename === $part ) { 368 $next = true; 369 } 370 } 371 372 $plugin = Plugin_Theme_Helper::get_plugin_from_path( $plugin_base ); 373 if ( ! empty( $plugin ) ) { 374 375 return $plugin_base; 376 } 377 } 378 379 return ''; 380 } 339 381 } 340 382 } -
0-day-analytics/tags/3.7.0/classes/entities/class-requests-log-entity.php
r3334916 r3367391 12 12 namespace ADVAN\Entities; 13 13 14 use ADVAN\Helpers\Plugin_Theme_Helper; 15 14 16 // Exit if accessed directly. 15 17 if ( ! defined( 'ABSPATH' ) ) { … … 32 34 33 35 /** 36 * Inner class cache for rendered dorp down with of of the collected data from sites. 37 * 38 * @var string 39 * 40 * @since latest 41 */ 42 private static $drop_down_sites_rendered = false; 43 44 /** 34 45 * Keeps the info about the columns of the table - name, type. 35 46 * … … 41 52 'id' => 'int', 42 53 'type' => 'string', 54 'plugin' => 'string', 43 55 'url' => 'string', 44 56 'page_url' => 'string', … … 66 78 'id' => 0, 67 79 'type' => '', 80 'plugin' => '', 68 81 'url' => '', 69 82 'page_url' => '', … … 102 115 id BIGINT unsigned not null auto_increment, 103 116 type VARCHAR(20) NOT NULL DEFAULT "", 117 plugin VARCHAR(200) NOT NULL DEFAULT "", 104 118 url TEXT(2048), 105 119 page_url TEXT(2048), … … 124 138 125 139 /** 140 * Responsible for adding the plugin column to the table (version 3.7.0). 141 * 142 * @return array|bool 143 * 144 * @since 3.7.0 145 */ 146 public static function alter_table_370() { 147 $sql = 'ALTER TABLE `' . self::get_table_name() . '` ADD `plugin` TEXT DEFAULT "" AFTER `type`;'; 148 149 return Common_Table::execute_query( $sql ); 150 } 151 152 /** 126 153 * Returns the table CMS admin fields 127 154 * … … 134 161 'date_added' => __( 'Date', '0-day-analytics' ), 135 162 'type' => __( 'Type', '0-day-analytics' ), 163 'plugin' => __( 'Plugin Name', '0-day-analytics' ), 136 164 'request_status' => __( 'Status', '0-day-analytics' ), 137 165 'url' => __( 'URL', '0-day-analytics' ), … … 142 170 ); 143 171 } 172 173 /** 174 * Generates drop down with all the subsites that have mail logs. 175 * 176 * @param string $selected - The selected (if any) site ID. 177 * @param string $which - Indicates position of the dropdown (top or bottom). 178 * 179 * @return string 180 * 181 * @since 3.6.3 182 */ 183 public static function get_all_plugins_dropdown( $selected = '', $which = '' ): string { 184 185 if ( false === self::$drop_down_sites_rendered ) { 186 $sql = 'SELECT plugin FROM ' . self::get_table_name() . ' GROUP BY plugin ORDER BY plugin DESC'; 187 188 $results = self::get_results( $sql ); 189 $plugins = array(); 190 $output = ''; 191 192 if ( $results ) { 193 foreach ( $results as $result ) { 194 if ( ! isset( $result['plugin'] ) || empty( trim( (string) $result['plugin'] ) ) ) { 195 continue; 196 } 197 $details = Plugin_Theme_Helper::get_plugin_from_path( $result['plugin'] ); 198 $name = ( $details ) ? $details['Name'] : \sprintf( /* translators: %s: Site ID */ __( '%s', '0-day-analytics' ), (int) $result['plugin'] ); 199 $plugins[] = array( 200 'id' => $result['plugin'], 201 'name' => $name, 202 ); 203 } 204 } 205 206 if ( ! empty( $plugins ) ) { 207 208 $output = '<select class="plugin_filter" name="plugin_' . \esc_attr( $which ) . '" id="plugin_' . \esc_attr( $which ) . '">'; 209 $output .= '<option value="-1">' . __( 'All plugins', '0-day-analytics' ) . '</option>'; 210 foreach ( $plugins as $plugin_info ) { 211 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (string) $selected === (string) $plugin_info['id'] ) { 212 $output .= '<option value="' . \esc_attr( $plugin_info['id'] ) . '" selected>' . \esc_html( $plugin_info['name'] ) . '</option>'; 213 214 continue; 215 } 216 $output .= '<option value="' . \esc_attr( $plugin_info['id'] ) . '">' . \esc_html( $plugin_info['name'] ) . '</option>'; 217 } 218 219 $output .= '</select>'; 220 } 221 self::$drop_down_sites_rendered = $output; 222 } 223 224 return self::$drop_down_sites_rendered; 225 } 144 226 } 145 227 } -
0-day-analytics/tags/3.7.0/classes/entities/class-wp-mail-entity.php
r3366898 r3367391 32 32 */ 33 33 protected static $table = ADVAN_PREFIX . 'wp_mail_log'; 34 35 /** 36 * Inner class cache for rendered dorp down with of of the collected data from sites. 37 * 38 * @var string 39 * 40 * @since latest 41 */ 42 private static $drop_down_sites_rendered = false; 34 43 35 44 /** … … 182 191 */ 183 192 public static function get_all_sites_dropdown( $selected = '', $which = '' ): string { 184 $sql = 'SELECT blog_id FROM ' . self::get_table_name() . ' GROUP BY blog_id ORDER BY blog_id DESC'; 185 186 $results = self::get_results( $sql ); 187 $sites = array(); 188 $output = ''; 189 190 if ( $results ) { 191 foreach ( $results as $result ) { 192 $details = \get_blog_details( array( 'blog_id' => $result['blog_id'] ) ); 193 $name = ( $details ) ? $details->blogname : \sprintf( /* translators: %s: Site ID */ __( 'Site %s', '0-day-analytics' ), (int) $result['blog_id'] ); 194 $sites[] = array( 195 'id' => $result['blog_id'], 196 'name' => $name, 197 ); 193 194 if ( false === self::$drop_down_sites_rendered ) { 195 $sql = 'SELECT blog_id FROM ' . self::get_table_name() . ' GROUP BY blog_id ORDER BY blog_id DESC'; 196 197 $results = self::get_results( $sql ); 198 $sites = array(); 199 $output = ''; 200 201 if ( $results ) { 202 foreach ( $results as $result ) { 203 $details = \get_blog_details( array( 'blog_id' => $result['blog_id'] ) ); 204 $name = ( $details ) ? $details->blogname : \sprintf( /* translators: %s: Site ID */ __( 'Site %s', '0-day-analytics' ), (int) $result['blog_id'] ); 205 $sites[] = array( 206 'id' => $result['blog_id'], 207 'name' => $name, 208 ); 209 } 198 210 } 211 212 if ( ! empty( $sites ) ) { 213 214 $output = '<select class="site_id_filter" name="site_id_' . \esc_attr( $which ) . '" id="site_id_' . \esc_attr( $which ) . '">'; 215 $output .= '<option value="-1">' . __( 'All sites', '0-day-analytics' ) . '</option>'; 216 foreach ( $sites as $site_info ) { 217 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (int) $selected === (int) $site_info['id'] ) { 218 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '" selected>' . \esc_html( $site_info['name'] ) . '</option>'; 219 220 continue; 221 } 222 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '">' . \esc_html( $site_info['name'] ) . '</option>'; 223 } 224 225 $output .= '</select>'; 226 } 227 self::$drop_down_sites_rendered = $output; 199 228 } 200 229 201 if ( ! empty( $sites ) ) { 202 203 $output = '<select class="site_id_filter" name="site_id_' . \esc_attr( $which ) . '" id="site_id_' . \esc_attr( $which ) . '">'; 204 $output .= '<option value="-1">' . __( 'All sites', '0-day-analytics' ) . '</option>'; 205 foreach ( $sites as $site_info ) { 206 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (int) $selected === (int) $site_info['id'] ) { 207 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '" selected>' . \esc_html( $site_info['name'] ) . '</option>'; 208 209 continue; 210 } 211 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '">' . \esc_html( $site_info['name'] ) . '</option>'; 212 } 213 214 $output .= '</select>'; 215 } 216 217 return $output; 230 return self::$drop_down_sites_rendered; 218 231 } 219 232 } -
0-day-analytics/tags/3.7.0/classes/helpers/class-plugin-theme-helper.php
r3349349 r3367391 79 79 public static function get_plugins(): array { 80 80 if ( empty( self::$plugins ) ) { 81 if ( ! \function_exists( 'get_plugins' ) ) { 82 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 83 } 81 84 self::$plugins = \get_plugins(); 82 85 } -
0-day-analytics/tags/3.7.0/classes/lists/class-logs-list.php
r3363736 r3367391 1898 1898 $base .= 'code'; 1899 1899 1900 $data['body'] = $event['severity'] . ' ' . $event['message'];1900 $data['body'] = \esc_html( $event['severity'] ) . ' ' . \html_entity_decode( $event['message'] ); 1901 1901 $data['title'] = $in; 1902 1902 $data['icon'] = 'data:image/svg+xml;base64,' . $base( file_get_contents( \ADVAN_PLUGIN_ROOT . 'assets/icon.svg' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode, WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -
0-day-analytics/tags/3.7.0/classes/lists/class-requests-list.php
r3352278 r3367391 22 22 use ADVAN\ControllersApi\Endpoints; 23 23 use ADVAN\Lists\Views\Requests_View; 24 use ADVAN\Helpers\Plugin_Theme_Helper; 24 25 use ADVAN\Entities\Requests_Log_Entity; 25 26 … … 52 53 53 54 public const REQUESTS_MENU_SLUG = 'advan_requests'; 55 56 public const PLUGIN_FILTER_ACTION = 'filter_plugin'; 54 57 55 58 /** … … 123 126 public static function init() { 124 127 \add_filter( 'advan_cron_hooks', array( __CLASS__, 'add_cron_job' ) ); 128 \add_action( 'admin_post_' . self::PLUGIN_FILTER_ACTION, array( Requests_View::class, 'plugin_filter_action' ) ); 125 129 } 126 130 … … 297 301 $search_string = self::escaped_search_input(); 298 302 303 if ( isset( $_REQUEST['plugin'] ) && ! empty( $_REQUEST['plugin'] ) ) { 304 if ( -1 === (int) $_REQUEST['plugin'] ) { 305 $plugin = -1; 306 } else { 307 $plugin = \sanitize_text_field( \wp_unslash( $_REQUEST['plugin'] ) ); 308 } 309 } else { 310 $plugin = ''; 311 } 312 299 313 $search_sql = ''; 300 314 … … 305 319 } 306 320 $search_sql .= ') '; 321 } 322 323 if ( '' !== $plugin && -1 !== (int) $plugin ) { 324 $search_sql .= ' AND plugin = "' . (string) $plugin . '" '; 307 325 } 308 326 … … 524 542 $time, 525 543 ) . $this->row_actions( $actions ) . $data; 544 545 case 'plugin': 546 if ( ! empty( $item['plugin'] ) ) { 547 $plugin = Plugin_Theme_Helper::get_plugin_from_path( $item['plugin'] ); 548 if ( ! empty( $plugin ) ) { 549 550 return __( 'Plugin: ', '0-day-analytics' ) . '<b>' . \esc_html( $plugin['Name'] ) . '</b><br>' . \__( 'Current version: ' ) . \esc_html( $plugin['Version'] ); 551 } 552 } else { 553 return \esc_html__( 'Core or Unknown', '0-day-analytics' ); 554 } 526 555 } 527 556 } … … 706 735 */ 707 736 public function extra_tablenav( $which ) { 708 709 if ( 'top' === $which ) { 710 ?> 737 if ( isset( $_REQUEST['plugin'] ) && ! empty( $_REQUEST['plugin'] ) ) { 738 if ( -1 === (int) $_REQUEST['plugin'] ) { 739 $plugin = -1; 740 } else { 741 $plugin = \sanitize_text_field( \wp_unslash( $_REQUEST['plugin'] ) ); 742 } 743 } else { 744 $plugin = 0; 745 } 746 ?> 747 <div class="alignleft actions bulkactions"> 748 749 <?php echo Requests_Log_Entity::get_all_plugins_dropdown( $plugin, $which ); ?> 750 751 </div> 752 <script> 753 jQuery('form .plugin_filter').on('change', function(e) { 754 jQuery('form .plugin_filter').val(jQuery(this).val()); 755 jQuery( this ).closest( 'form' ).attr( 'action', '<?php echo \esc_url( \admin_url( 'admin-post.php' ) ); ?>').append('<input type="hidden" name="action" value="<?php echo \esc_attr( self::PLUGIN_FILTER_ACTION ); ?>">').append('<?php \wp_nonce_field( self::PLUGIN_FILTER_ACTION, self::PLUGIN_FILTER_ACTION . 'nonce' ); ?>').submit(); 756 }); 757 </script> 758 <?php 759 760 if ( 'top' === $which ) { 761 ?> 711 762 <style> 712 763 .flex { … … 1075 1126 if ( json_last_error() === JSON_ERROR_NONE ) { 1076 1127 1128 if ( ! is_array( $encoded ) ) { 1129 return $encoded; 1130 } 1131 1077 1132 foreach ( $encoded as $key => $value ) { 1078 1133 if ( ! empty( $value ) && is_string( $value ) && ! is_numeric( $value ) ) { -
0-day-analytics/tags/3.7.0/classes/lists/class-wp-mail-list.php
r3366898 r3367391 241 241 } else { 242 242 $site_id = ''; 243 } 244 245 if ( isset( $type ) && ! empty( $type ) ) { 246 $site_id = -1; 243 247 } 244 248 … … 352 356 ); 353 357 354 $per_page = $parsed_args['number'];355 $offset = $parsed_args['offset'];356 357 // $current_page = $this->get_pagenum();358 // if ( 1 < $current_page ) {359 // $offset = $per_page * ( $current_page - 1 );360 // } else {361 // $offset = 0;362 // }363 364 $search_string = $parsed_args['search'];365 $site_id = $parsed_args['site_id'];366 367 358 $search_sql = ''; 368 369 if ( '' !== $search_string ) {370 $search_sql = 'AND (id LIKE "%' . $wpdb->esc_like( $search_string ) . '%"';371 foreach ( array_keys( WP_Mail_Entity::get_column_names_admin() ) as $value ) {372 $search_sql .= ' OR ' . $value . ' LIKE "%' . esc_sql( $wpdb->esc_like( $search_string ) ) . '%" ';373 }374 $search_sql .= ') ';375 }376 377 if ( '' !== $site_id && -1 !== (int) $site_id ) {378 $search_sql .= ' AND blog_id = ' . (int) $site_id . ' ';379 } elseif ( ( '' === $site_id && -1 !== (int) $site_id ) && WP_Helper::is_multisite() && ! \is_main_site() ) {380 $search_sql .= ' AND blog_id = ' . (int) \get_current_blog_id() . ' ';381 }382 383 if ( ! empty( $parsed_args['type'] ) ) {384 if ( 'successful' === $parsed_args['type'] ) {385 $search_sql .= ' AND status = 1';386 }387 if ( 'unsuccessful' === $parsed_args['type'] ) {388 $search_sql .= ' AND status = 0';389 }390 if ( 'html' === $parsed_args['type'] ) {391 $search_sql .= ' AND is_html = 1';392 }393 if ( 'text' === $parsed_args['type'] ) {394 $search_sql .= ' AND is_html != 1';395 }396 if ( 'attachments' === $parsed_args['type'] ) {397 $search_sql .= ' AND attachments != "[]"';398 }399 }400 359 401 360 $orderby = $parsed_args['orderby']; … … 407 366 $wpdb_table = $this->get_table_name(); 408 367 409 $query = 'SELECT 368 if ( ! isset( $parsed_args['all'] ) ) { 369 370 $per_page = $parsed_args['number']; 371 $offset = $parsed_args['offset']; 372 373 // $current_page = $this->get_pagenum(); 374 // if ( 1 < $current_page ) { 375 // $offset = $per_page * ( $current_page - 1 ); 376 // } else { 377 // $offset = 0; 378 // } 379 380 $search_string = $parsed_args['search']; 381 $site_id = $parsed_args['site_id']; 382 383 if ( '' !== $search_string ) { 384 $search_sql = 'AND (id LIKE "%' . $wpdb->esc_like( $search_string ) . '%"'; 385 foreach ( array_keys( WP_Mail_Entity::get_column_names_admin() ) as $value ) { 386 $search_sql .= ' OR ' . $value . ' LIKE "%' . esc_sql( $wpdb->esc_like( $search_string ) ) . '%" '; 387 } 388 $search_sql .= ') '; 389 } 390 391 if ( '' !== $site_id && -1 !== (int) $site_id ) { 392 $search_sql .= ' AND blog_id = ' . (int) $site_id . ' '; 393 } elseif ( ( '' === $site_id && -1 !== (int) $site_id ) && WP_Helper::is_multisite() && ! \is_main_site() ) { 394 $search_sql .= ' AND blog_id = ' . (int) \get_current_blog_id() . ' '; 395 } 396 397 if ( ! empty( $parsed_args['type'] ) ) { 398 if ( 'successful' === $parsed_args['type'] ) { 399 $search_sql .= ' AND status = 1'; 400 } 401 if ( 'unsuccessful' === $parsed_args['type'] ) { 402 $search_sql .= ' AND status = 0'; 403 } 404 if ( 'html' === $parsed_args['type'] ) { 405 $search_sql .= ' AND is_html = 1'; 406 } 407 if ( 'text' === $parsed_args['type'] ) { 408 $search_sql .= ' AND is_html != 1'; 409 } 410 if ( 'attachments' === $parsed_args['type'] ) { 411 $search_sql .= ' AND attachments != "[]"'; 412 } 413 } 414 415 $query = 'SELECT 410 416 ' . implode( ', ', \array_keys( WP_Mail_Entity::get_fields() ) ) . ' 411 417 FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql . ' ORDER BY ' . $orderby . ' ' . $order; 412 418 413 if ( ! isset( $parsed_args['all'] ) ) { 414 $query .= $wpdb->prepare( ' LIMIT %d OFFSET %d;', $per_page, $offset ); 419 if ( ! isset( $parsed_args['all'] ) ) { 420 $query .= $wpdb->prepare( ' LIMIT %d OFFSET %d;', $per_page, $offset ); 421 } 422 } else { 423 424 $query = 'SELECT 425 ' . implode( ', ', \array_keys( WP_Mail_Entity::get_fields() ) ) . ' 426 FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql . ' ORDER BY ' . $orderby . ' ' . $order; 415 427 } 416 428 … … 1072 1084 } 1073 1085 } 1086 1087 $type = ! empty( $_GET['mail_type'] ) ? \sanitize_text_field( \wp_unslash( $_GET['mail_type'] ) ) : ''; 1088 1089 if ( isset( $type ) && ! empty( $type ) ) { 1090 $site_id = -1; 1091 } 1074 1092 ?> 1075 1093 <div class="alignleft actions bulkactions"> -
0-day-analytics/tags/3.7.0/classes/lists/views/class-requests-view.php
r3349349 r3367391 653 653 } 654 654 } 655 656 /** 657 * Responsible for filtering table by plugin. 658 * 659 * @return void 660 * 661 * @since latest 662 */ 663 public static function plugin_filter_action() { 664 665 if ( isset( $_REQUEST['plugin_top'] ) || isset( $_REQUEST['plugin_filter_bottom'] ) ) { 666 667 if ( \check_admin_referer( Requests_List::PLUGIN_FILTER_ACTION, Requests_List::PLUGIN_FILTER_ACTION . 'nonce' ) ) { 668 $id = $_REQUEST['plugin_top']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash 669 670 \wp_safe_redirect( 671 \remove_query_arg( 672 array( 'deleted' ), 673 \add_query_arg( 674 array( 675 'page' => Requests_List::REQUESTS_MENU_SLUG, 676 Requests_List::SEARCH_INPUT => Requests_List::escaped_search_input(), 677 'plugin' => rawurlencode( $id ), 678 ), 679 \admin_url( 'admin.php' ) 680 ) 681 ) 682 ); 683 exit; 684 } 685 } 686 } 655 687 } 656 688 } -
0-day-analytics/tags/3.7.0/classes/migration/class-migration.php
r3366891 r3367391 13 13 namespace ADVAN\Migration; 14 14 15 use ADVAN\Helpers\Settings; 15 16 use ADVAN\Entities\Common_Table; 16 use ADVAN\Helpers\Settings;17 17 use ADVAN\Entities\WP_Mail_Entity; 18 use ADVAN\Entities\Requests_Log_Entity; 18 19 use ADVAN\Migration\Abstract_Migration; 19 20 … … 197 198 } 198 199 } 200 /** 201 * Migrates the plugin up-to version 3.7.0 202 * 203 * @return void 204 * 205 * @since 3.7.0 206 */ 207 public static function migrate_up_to_370() { 208 if ( \class_exists( '\ADVAN\Entities\Requests_Log_Entity' ) ) { 209 if ( Common_Table::check_table_exists( Requests_Log_Entity::get_table_name() ) && ! Common_Table::check_column( 'plugin', 'text', Requests_Log_Entity::get_table_name() ) ) { 210 Requests_Log_Entity::alter_table_370(); 211 } 212 } 213 } 199 214 } 200 215 } -
0-day-analytics/tags/3.7.0/readme.txt
r3366898 r3367391 4 4 Tested up to: 6.8.2 5 5 Requires PHP: 7.4 6 Stable tag: 3. 6.46 Stable tag: 3.7.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 108 108 == Changelog == 109 109 110 = 3.7.0 = 111 Mail filtering fixes, added plugins filter to requests view, fixed HTML entities in the browser push notifications, bug fixes and improvements. 112 110 113 = 3.6.4 = 111 114 Fixed problem when there are no blog details (multisite), thanks to @lucianwpwhite . -
0-day-analytics/trunk/advanced-analytics.php
r3366898 r3367391 13 13 * Plugin Name: WP Control 14 14 * Description: Take full control of error log, crons, transients, plugins, requests, mails and DB tables. 15 * Version: 3. 6.415 * Version: 3.7.0 16 16 * Author: Stoil Dobrev 17 17 * Author URI: https://github.com/sdobreff/ … … 39 39 // Constants. 40 40 if ( ! defined( 'ADVAN_VERSION' ) ) { 41 define( 'ADVAN_VERSION', '3. 6.4' );41 define( 'ADVAN_VERSION', '3.7.0' ); 42 42 define( 'ADVAN_TEXTDOMAIN', '0-day-analytics' ); 43 43 define( 'ADVAN_NAME', 'WP Control' ); -
0-day-analytics/trunk/classes/controllers/class-requests-log.php
r3343900 r3367391 14 14 use ADVAN\Helpers\Settings; 15 15 use ADVAN\Helpers\Context_Helper; 16 use ADVAN\Helpers\Plugin_Theme_Helper; 16 17 use ADVAN\Entities\Requests_Log_Entity; 17 18 … … 139 140 'requests' => self::$requests, 140 141 'trace' => self::get_trace(), 142 'plugin' => ( isset( \json_decode( self::$trace, true )[7] ) && isset( \json_decode( self::$trace, true )[7]['file'] ) ) ? self::add_plugin_info_to_collected_item( \json_decode( self::$trace, true )[7]['file'] ) : '', 141 143 ); 142 144 … … 326 328 'requests' => self::$requests, 327 329 'trace' => self::get_trace(), 330 'plugin' => ( isset( \json_decode( self::$trace, true )[7] ) && isset( \json_decode( self::$trace, true )[7]['file'] ) ) ? self::add_plugin_info_to_collected_item( \json_decode( self::$trace, true )[7]['file'] ) : '', 328 331 ); 329 332 … … 337 340 return $response; 338 341 } 342 343 /** 344 * Adds plugin info to the database using the file path collected from the trace. 345 * 346 * @param string $message - File path from the trace. 347 * 348 * @return string 349 * 350 * @since latest 351 */ 352 private static function add_plugin_info_to_collected_item( string $message ) { 353 354 $plugins_dir_basename = basename( \WP_PLUGIN_DIR ); 355 356 if ( false !== \mb_strpos( $message, $plugins_dir_basename . \DIRECTORY_SEPARATOR ) ) { 357 358 $split_plugin = explode( \DIRECTORY_SEPARATOR, $message ); 359 360 $next = false; 361 $plugin_base = ''; 362 foreach ( $split_plugin as $part ) { 363 if ( $next ) { 364 $plugin_base = $part; 365 break; 366 } 367 if ( $plugins_dir_basename === $part ) { 368 $next = true; 369 } 370 } 371 372 $plugin = Plugin_Theme_Helper::get_plugin_from_path( $plugin_base ); 373 if ( ! empty( $plugin ) ) { 374 375 return $plugin_base; 376 } 377 } 378 379 return ''; 380 } 339 381 } 340 382 } -
0-day-analytics/trunk/classes/entities/class-requests-log-entity.php
r3334916 r3367391 12 12 namespace ADVAN\Entities; 13 13 14 use ADVAN\Helpers\Plugin_Theme_Helper; 15 14 16 // Exit if accessed directly. 15 17 if ( ! defined( 'ABSPATH' ) ) { … … 32 34 33 35 /** 36 * Inner class cache for rendered dorp down with of of the collected data from sites. 37 * 38 * @var string 39 * 40 * @since latest 41 */ 42 private static $drop_down_sites_rendered = false; 43 44 /** 34 45 * Keeps the info about the columns of the table - name, type. 35 46 * … … 41 52 'id' => 'int', 42 53 'type' => 'string', 54 'plugin' => 'string', 43 55 'url' => 'string', 44 56 'page_url' => 'string', … … 66 78 'id' => 0, 67 79 'type' => '', 80 'plugin' => '', 68 81 'url' => '', 69 82 'page_url' => '', … … 102 115 id BIGINT unsigned not null auto_increment, 103 116 type VARCHAR(20) NOT NULL DEFAULT "", 117 plugin VARCHAR(200) NOT NULL DEFAULT "", 104 118 url TEXT(2048), 105 119 page_url TEXT(2048), … … 124 138 125 139 /** 140 * Responsible for adding the plugin column to the table (version 3.7.0). 141 * 142 * @return array|bool 143 * 144 * @since 3.7.0 145 */ 146 public static function alter_table_370() { 147 $sql = 'ALTER TABLE `' . self::get_table_name() . '` ADD `plugin` TEXT DEFAULT "" AFTER `type`;'; 148 149 return Common_Table::execute_query( $sql ); 150 } 151 152 /** 126 153 * Returns the table CMS admin fields 127 154 * … … 134 161 'date_added' => __( 'Date', '0-day-analytics' ), 135 162 'type' => __( 'Type', '0-day-analytics' ), 163 'plugin' => __( 'Plugin Name', '0-day-analytics' ), 136 164 'request_status' => __( 'Status', '0-day-analytics' ), 137 165 'url' => __( 'URL', '0-day-analytics' ), … … 142 170 ); 143 171 } 172 173 /** 174 * Generates drop down with all the subsites that have mail logs. 175 * 176 * @param string $selected - The selected (if any) site ID. 177 * @param string $which - Indicates position of the dropdown (top or bottom). 178 * 179 * @return string 180 * 181 * @since 3.6.3 182 */ 183 public static function get_all_plugins_dropdown( $selected = '', $which = '' ): string { 184 185 if ( false === self::$drop_down_sites_rendered ) { 186 $sql = 'SELECT plugin FROM ' . self::get_table_name() . ' GROUP BY plugin ORDER BY plugin DESC'; 187 188 $results = self::get_results( $sql ); 189 $plugins = array(); 190 $output = ''; 191 192 if ( $results ) { 193 foreach ( $results as $result ) { 194 if ( ! isset( $result['plugin'] ) || empty( trim( (string) $result['plugin'] ) ) ) { 195 continue; 196 } 197 $details = Plugin_Theme_Helper::get_plugin_from_path( $result['plugin'] ); 198 $name = ( $details ) ? $details['Name'] : \sprintf( /* translators: %s: Site ID */ __( '%s', '0-day-analytics' ), (int) $result['plugin'] ); 199 $plugins[] = array( 200 'id' => $result['plugin'], 201 'name' => $name, 202 ); 203 } 204 } 205 206 if ( ! empty( $plugins ) ) { 207 208 $output = '<select class="plugin_filter" name="plugin_' . \esc_attr( $which ) . '" id="plugin_' . \esc_attr( $which ) . '">'; 209 $output .= '<option value="-1">' . __( 'All plugins', '0-day-analytics' ) . '</option>'; 210 foreach ( $plugins as $plugin_info ) { 211 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (string) $selected === (string) $plugin_info['id'] ) { 212 $output .= '<option value="' . \esc_attr( $plugin_info['id'] ) . '" selected>' . \esc_html( $plugin_info['name'] ) . '</option>'; 213 214 continue; 215 } 216 $output .= '<option value="' . \esc_attr( $plugin_info['id'] ) . '">' . \esc_html( $plugin_info['name'] ) . '</option>'; 217 } 218 219 $output .= '</select>'; 220 } 221 self::$drop_down_sites_rendered = $output; 222 } 223 224 return self::$drop_down_sites_rendered; 225 } 144 226 } 145 227 } -
0-day-analytics/trunk/classes/entities/class-wp-mail-entity.php
r3366898 r3367391 32 32 */ 33 33 protected static $table = ADVAN_PREFIX . 'wp_mail_log'; 34 35 /** 36 * Inner class cache for rendered dorp down with of of the collected data from sites. 37 * 38 * @var string 39 * 40 * @since latest 41 */ 42 private static $drop_down_sites_rendered = false; 34 43 35 44 /** … … 182 191 */ 183 192 public static function get_all_sites_dropdown( $selected = '', $which = '' ): string { 184 $sql = 'SELECT blog_id FROM ' . self::get_table_name() . ' GROUP BY blog_id ORDER BY blog_id DESC'; 185 186 $results = self::get_results( $sql ); 187 $sites = array(); 188 $output = ''; 189 190 if ( $results ) { 191 foreach ( $results as $result ) { 192 $details = \get_blog_details( array( 'blog_id' => $result['blog_id'] ) ); 193 $name = ( $details ) ? $details->blogname : \sprintf( /* translators: %s: Site ID */ __( 'Site %s', '0-day-analytics' ), (int) $result['blog_id'] ); 194 $sites[] = array( 195 'id' => $result['blog_id'], 196 'name' => $name, 197 ); 193 194 if ( false === self::$drop_down_sites_rendered ) { 195 $sql = 'SELECT blog_id FROM ' . self::get_table_name() . ' GROUP BY blog_id ORDER BY blog_id DESC'; 196 197 $results = self::get_results( $sql ); 198 $sites = array(); 199 $output = ''; 200 201 if ( $results ) { 202 foreach ( $results as $result ) { 203 $details = \get_blog_details( array( 'blog_id' => $result['blog_id'] ) ); 204 $name = ( $details ) ? $details->blogname : \sprintf( /* translators: %s: Site ID */ __( 'Site %s', '0-day-analytics' ), (int) $result['blog_id'] ); 205 $sites[] = array( 206 'id' => $result['blog_id'], 207 'name' => $name, 208 ); 209 } 198 210 } 211 212 if ( ! empty( $sites ) ) { 213 214 $output = '<select class="site_id_filter" name="site_id_' . \esc_attr( $which ) . '" id="site_id_' . \esc_attr( $which ) . '">'; 215 $output .= '<option value="-1">' . __( 'All sites', '0-day-analytics' ) . '</option>'; 216 foreach ( $sites as $site_info ) { 217 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (int) $selected === (int) $site_info['id'] ) { 218 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '" selected>' . \esc_html( $site_info['name'] ) . '</option>'; 219 220 continue; 221 } 222 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '">' . \esc_html( $site_info['name'] ) . '</option>'; 223 } 224 225 $output .= '</select>'; 226 } 227 self::$drop_down_sites_rendered = $output; 199 228 } 200 229 201 if ( ! empty( $sites ) ) { 202 203 $output = '<select class="site_id_filter" name="site_id_' . \esc_attr( $which ) . '" id="site_id_' . \esc_attr( $which ) . '">'; 204 $output .= '<option value="-1">' . __( 'All sites', '0-day-analytics' ) . '</option>'; 205 foreach ( $sites as $site_info ) { 206 if ( isset( $selected ) && ! empty( trim( (string) $selected ) ) && (int) $selected === (int) $site_info['id'] ) { 207 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '" selected>' . \esc_html( $site_info['name'] ) . '</option>'; 208 209 continue; 210 } 211 $output .= '<option value="' . \esc_attr( $site_info['id'] ) . '">' . \esc_html( $site_info['name'] ) . '</option>'; 212 } 213 214 $output .= '</select>'; 215 } 216 217 return $output; 230 return self::$drop_down_sites_rendered; 218 231 } 219 232 } -
0-day-analytics/trunk/classes/helpers/class-plugin-theme-helper.php
r3349349 r3367391 79 79 public static function get_plugins(): array { 80 80 if ( empty( self::$plugins ) ) { 81 if ( ! \function_exists( 'get_plugins' ) ) { 82 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 83 } 81 84 self::$plugins = \get_plugins(); 82 85 } -
0-day-analytics/trunk/classes/lists/class-logs-list.php
r3363736 r3367391 1898 1898 $base .= 'code'; 1899 1899 1900 $data['body'] = $event['severity'] . ' ' . $event['message'];1900 $data['body'] = \esc_html( $event['severity'] ) . ' ' . \html_entity_decode( $event['message'] ); 1901 1901 $data['title'] = $in; 1902 1902 $data['icon'] = 'data:image/svg+xml;base64,' . $base( file_get_contents( \ADVAN_PLUGIN_ROOT . 'assets/icon.svg' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode, WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -
0-day-analytics/trunk/classes/lists/class-requests-list.php
r3352278 r3367391 22 22 use ADVAN\ControllersApi\Endpoints; 23 23 use ADVAN\Lists\Views\Requests_View; 24 use ADVAN\Helpers\Plugin_Theme_Helper; 24 25 use ADVAN\Entities\Requests_Log_Entity; 25 26 … … 52 53 53 54 public const REQUESTS_MENU_SLUG = 'advan_requests'; 55 56 public const PLUGIN_FILTER_ACTION = 'filter_plugin'; 54 57 55 58 /** … … 123 126 public static function init() { 124 127 \add_filter( 'advan_cron_hooks', array( __CLASS__, 'add_cron_job' ) ); 128 \add_action( 'admin_post_' . self::PLUGIN_FILTER_ACTION, array( Requests_View::class, 'plugin_filter_action' ) ); 125 129 } 126 130 … … 297 301 $search_string = self::escaped_search_input(); 298 302 303 if ( isset( $_REQUEST['plugin'] ) && ! empty( $_REQUEST['plugin'] ) ) { 304 if ( -1 === (int) $_REQUEST['plugin'] ) { 305 $plugin = -1; 306 } else { 307 $plugin = \sanitize_text_field( \wp_unslash( $_REQUEST['plugin'] ) ); 308 } 309 } else { 310 $plugin = ''; 311 } 312 299 313 $search_sql = ''; 300 314 … … 305 319 } 306 320 $search_sql .= ') '; 321 } 322 323 if ( '' !== $plugin && -1 !== (int) $plugin ) { 324 $search_sql .= ' AND plugin = "' . (string) $plugin . '" '; 307 325 } 308 326 … … 524 542 $time, 525 543 ) . $this->row_actions( $actions ) . $data; 544 545 case 'plugin': 546 if ( ! empty( $item['plugin'] ) ) { 547 $plugin = Plugin_Theme_Helper::get_plugin_from_path( $item['plugin'] ); 548 if ( ! empty( $plugin ) ) { 549 550 return __( 'Plugin: ', '0-day-analytics' ) . '<b>' . \esc_html( $plugin['Name'] ) . '</b><br>' . \__( 'Current version: ' ) . \esc_html( $plugin['Version'] ); 551 } 552 } else { 553 return \esc_html__( 'Core or Unknown', '0-day-analytics' ); 554 } 526 555 } 527 556 } … … 706 735 */ 707 736 public function extra_tablenav( $which ) { 708 709 if ( 'top' === $which ) { 710 ?> 737 if ( isset( $_REQUEST['plugin'] ) && ! empty( $_REQUEST['plugin'] ) ) { 738 if ( -1 === (int) $_REQUEST['plugin'] ) { 739 $plugin = -1; 740 } else { 741 $plugin = \sanitize_text_field( \wp_unslash( $_REQUEST['plugin'] ) ); 742 } 743 } else { 744 $plugin = 0; 745 } 746 ?> 747 <div class="alignleft actions bulkactions"> 748 749 <?php echo Requests_Log_Entity::get_all_plugins_dropdown( $plugin, $which ); ?> 750 751 </div> 752 <script> 753 jQuery('form .plugin_filter').on('change', function(e) { 754 jQuery('form .plugin_filter').val(jQuery(this).val()); 755 jQuery( this ).closest( 'form' ).attr( 'action', '<?php echo \esc_url( \admin_url( 'admin-post.php' ) ); ?>').append('<input type="hidden" name="action" value="<?php echo \esc_attr( self::PLUGIN_FILTER_ACTION ); ?>">').append('<?php \wp_nonce_field( self::PLUGIN_FILTER_ACTION, self::PLUGIN_FILTER_ACTION . 'nonce' ); ?>').submit(); 756 }); 757 </script> 758 <?php 759 760 if ( 'top' === $which ) { 761 ?> 711 762 <style> 712 763 .flex { … … 1075 1126 if ( json_last_error() === JSON_ERROR_NONE ) { 1076 1127 1128 if ( ! is_array( $encoded ) ) { 1129 return $encoded; 1130 } 1131 1077 1132 foreach ( $encoded as $key => $value ) { 1078 1133 if ( ! empty( $value ) && is_string( $value ) && ! is_numeric( $value ) ) { -
0-day-analytics/trunk/classes/lists/class-wp-mail-list.php
r3366898 r3367391 241 241 } else { 242 242 $site_id = ''; 243 } 244 245 if ( isset( $type ) && ! empty( $type ) ) { 246 $site_id = -1; 243 247 } 244 248 … … 352 356 ); 353 357 354 $per_page = $parsed_args['number'];355 $offset = $parsed_args['offset'];356 357 // $current_page = $this->get_pagenum();358 // if ( 1 < $current_page ) {359 // $offset = $per_page * ( $current_page - 1 );360 // } else {361 // $offset = 0;362 // }363 364 $search_string = $parsed_args['search'];365 $site_id = $parsed_args['site_id'];366 367 358 $search_sql = ''; 368 369 if ( '' !== $search_string ) {370 $search_sql = 'AND (id LIKE "%' . $wpdb->esc_like( $search_string ) . '%"';371 foreach ( array_keys( WP_Mail_Entity::get_column_names_admin() ) as $value ) {372 $search_sql .= ' OR ' . $value . ' LIKE "%' . esc_sql( $wpdb->esc_like( $search_string ) ) . '%" ';373 }374 $search_sql .= ') ';375 }376 377 if ( '' !== $site_id && -1 !== (int) $site_id ) {378 $search_sql .= ' AND blog_id = ' . (int) $site_id . ' ';379 } elseif ( ( '' === $site_id && -1 !== (int) $site_id ) && WP_Helper::is_multisite() && ! \is_main_site() ) {380 $search_sql .= ' AND blog_id = ' . (int) \get_current_blog_id() . ' ';381 }382 383 if ( ! empty( $parsed_args['type'] ) ) {384 if ( 'successful' === $parsed_args['type'] ) {385 $search_sql .= ' AND status = 1';386 }387 if ( 'unsuccessful' === $parsed_args['type'] ) {388 $search_sql .= ' AND status = 0';389 }390 if ( 'html' === $parsed_args['type'] ) {391 $search_sql .= ' AND is_html = 1';392 }393 if ( 'text' === $parsed_args['type'] ) {394 $search_sql .= ' AND is_html != 1';395 }396 if ( 'attachments' === $parsed_args['type'] ) {397 $search_sql .= ' AND attachments != "[]"';398 }399 }400 359 401 360 $orderby = $parsed_args['orderby']; … … 407 366 $wpdb_table = $this->get_table_name(); 408 367 409 $query = 'SELECT 368 if ( ! isset( $parsed_args['all'] ) ) { 369 370 $per_page = $parsed_args['number']; 371 $offset = $parsed_args['offset']; 372 373 // $current_page = $this->get_pagenum(); 374 // if ( 1 < $current_page ) { 375 // $offset = $per_page * ( $current_page - 1 ); 376 // } else { 377 // $offset = 0; 378 // } 379 380 $search_string = $parsed_args['search']; 381 $site_id = $parsed_args['site_id']; 382 383 if ( '' !== $search_string ) { 384 $search_sql = 'AND (id LIKE "%' . $wpdb->esc_like( $search_string ) . '%"'; 385 foreach ( array_keys( WP_Mail_Entity::get_column_names_admin() ) as $value ) { 386 $search_sql .= ' OR ' . $value . ' LIKE "%' . esc_sql( $wpdb->esc_like( $search_string ) ) . '%" '; 387 } 388 $search_sql .= ') '; 389 } 390 391 if ( '' !== $site_id && -1 !== (int) $site_id ) { 392 $search_sql .= ' AND blog_id = ' . (int) $site_id . ' '; 393 } elseif ( ( '' === $site_id && -1 !== (int) $site_id ) && WP_Helper::is_multisite() && ! \is_main_site() ) { 394 $search_sql .= ' AND blog_id = ' . (int) \get_current_blog_id() . ' '; 395 } 396 397 if ( ! empty( $parsed_args['type'] ) ) { 398 if ( 'successful' === $parsed_args['type'] ) { 399 $search_sql .= ' AND status = 1'; 400 } 401 if ( 'unsuccessful' === $parsed_args['type'] ) { 402 $search_sql .= ' AND status = 0'; 403 } 404 if ( 'html' === $parsed_args['type'] ) { 405 $search_sql .= ' AND is_html = 1'; 406 } 407 if ( 'text' === $parsed_args['type'] ) { 408 $search_sql .= ' AND is_html != 1'; 409 } 410 if ( 'attachments' === $parsed_args['type'] ) { 411 $search_sql .= ' AND attachments != "[]"'; 412 } 413 } 414 415 $query = 'SELECT 410 416 ' . implode( ', ', \array_keys( WP_Mail_Entity::get_fields() ) ) . ' 411 417 FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql . ' ORDER BY ' . $orderby . ' ' . $order; 412 418 413 if ( ! isset( $parsed_args['all'] ) ) { 414 $query .= $wpdb->prepare( ' LIMIT %d OFFSET %d;', $per_page, $offset ); 419 if ( ! isset( $parsed_args['all'] ) ) { 420 $query .= $wpdb->prepare( ' LIMIT %d OFFSET %d;', $per_page, $offset ); 421 } 422 } else { 423 424 $query = 'SELECT 425 ' . implode( ', ', \array_keys( WP_Mail_Entity::get_fields() ) ) . ' 426 FROM ' . $wpdb_table . ' WHERE 1=1 ' . $search_sql . ' ORDER BY ' . $orderby . ' ' . $order; 415 427 } 416 428 … … 1072 1084 } 1073 1085 } 1086 1087 $type = ! empty( $_GET['mail_type'] ) ? \sanitize_text_field( \wp_unslash( $_GET['mail_type'] ) ) : ''; 1088 1089 if ( isset( $type ) && ! empty( $type ) ) { 1090 $site_id = -1; 1091 } 1074 1092 ?> 1075 1093 <div class="alignleft actions bulkactions"> -
0-day-analytics/trunk/classes/lists/views/class-requests-view.php
r3349349 r3367391 653 653 } 654 654 } 655 656 /** 657 * Responsible for filtering table by plugin. 658 * 659 * @return void 660 * 661 * @since latest 662 */ 663 public static function plugin_filter_action() { 664 665 if ( isset( $_REQUEST['plugin_top'] ) || isset( $_REQUEST['plugin_filter_bottom'] ) ) { 666 667 if ( \check_admin_referer( Requests_List::PLUGIN_FILTER_ACTION, Requests_List::PLUGIN_FILTER_ACTION . 'nonce' ) ) { 668 $id = $_REQUEST['plugin_top']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash 669 670 \wp_safe_redirect( 671 \remove_query_arg( 672 array( 'deleted' ), 673 \add_query_arg( 674 array( 675 'page' => Requests_List::REQUESTS_MENU_SLUG, 676 Requests_List::SEARCH_INPUT => Requests_List::escaped_search_input(), 677 'plugin' => rawurlencode( $id ), 678 ), 679 \admin_url( 'admin.php' ) 680 ) 681 ) 682 ); 683 exit; 684 } 685 } 686 } 655 687 } 656 688 } -
0-day-analytics/trunk/classes/migration/class-migration.php
r3366891 r3367391 13 13 namespace ADVAN\Migration; 14 14 15 use ADVAN\Helpers\Settings; 15 16 use ADVAN\Entities\Common_Table; 16 use ADVAN\Helpers\Settings;17 17 use ADVAN\Entities\WP_Mail_Entity; 18 use ADVAN\Entities\Requests_Log_Entity; 18 19 use ADVAN\Migration\Abstract_Migration; 19 20 … … 197 198 } 198 199 } 200 /** 201 * Migrates the plugin up-to version 3.7.0 202 * 203 * @return void 204 * 205 * @since 3.7.0 206 */ 207 public static function migrate_up_to_370() { 208 if ( \class_exists( '\ADVAN\Entities\Requests_Log_Entity' ) ) { 209 if ( Common_Table::check_table_exists( Requests_Log_Entity::get_table_name() ) && ! Common_Table::check_column( 'plugin', 'text', Requests_Log_Entity::get_table_name() ) ) { 210 Requests_Log_Entity::alter_table_370(); 211 } 212 } 213 } 199 214 } 200 215 } -
0-day-analytics/trunk/readme.txt
r3366898 r3367391 4 4 Tested up to: 6.8.2 5 5 Requires PHP: 7.4 6 Stable tag: 3. 6.46 Stable tag: 3.7.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 108 108 == Changelog == 109 109 110 = 3.7.0 = 111 Mail filtering fixes, added plugins filter to requests view, fixed HTML entities in the browser push notifications, bug fixes and improvements. 112 110 113 = 3.6.4 = 111 114 Fixed problem when there are no blog details (multisite), thanks to @lucianwpwhite .
Note: See TracChangeset
for help on using the changeset viewer.