Changeset 2983330
- Timestamp:
- 10/25/2023 12:48:00 AM (2 years ago)
- Location:
- sackson-web-data/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (2 diffs)
-
includes/class-sacksonweb-data-helper.php (modified) (14 diffs)
-
includes/class-sacksonweb-data.php (modified) (1 diff)
-
sacksonweb-data.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sackson-web-data/trunk/README.txt
r2902827 r2983330 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.0 7 Stable tag: 1.2. 17 Stable tag: 1.2.3 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 50 50 51 51 == Changelog == 52 53 = 1.2.3 = 54 * Adding support to check the WP SMTP mail plugin to make sure Google is authorized 55 * Confirmed user logins and user lists are functioning 56 57 = 1.2.2 = 58 * Adding FSDIRECT if not defined 59 * Fixing a bug related to accessing a value of type bool 52 60 53 61 = 1.2.1 = -
sackson-web-data/trunk/includes/class-sacksonweb-data-helper.php
r2902827 r2983330 70 70 if ( $force_collect || $this->is_time_to_collect_data() ) { 71 71 72 /* If the user has specified the settings to allow it, then also send_data to remote server. */ 72 /* If the user has specified the settings to allow it, then also send_data to remote server. */ 73 73 // $sw_option = get_option('sacksonweb_premium_settings_option_name'); 74 if ( null !== $sw_option && null !== $sw_option['allow_1'] && 'Yes' == $sw_option['allow_1'] )74 if ( null !== $sw_option && isset($sw_option['allow_1']) && null !== $sw_option['allow_1'] && 'Yes' == $sw_option['allow_1'] ) 75 75 { 76 76 $this->collect_data(); // Will populate $this->collected_data … … 124 124 * 125 125 */ 126 public function collect_data () { 127 126 public function collect_data () 127 { 128 // Core variables like version and site url 128 129 $this->collected_data['hs_ver'] = SACKSONWEB_DATA_VERSION; 129 130 $this->collected_data['site_url'] = get_site_url(); // get_site_url, i.e. https://mm.ericandtammy.com 130 131 $this->collected_data['web_key'] = Sacksonweb_Data_Misc::get_unique_url(); 131 132 133 // Server info 132 134 $this->collected_data['HTTP_REFERER'] = isset($_SERVER['HTTP_REFERER']) ? '' . Sacksonweb_Data_Misc::sacksonweb_sanitize_validate_escape($_SERVER['HTTP_REFERER'], 'sanitize') : ''; 133 135 $this->collected_data['HTTP_HOST'] = isset($_SERVER['HTTP_HOST']) ? '' . Sacksonweb_Data_Misc::sacksonweb_sanitize_validate_escape($_SERVER['HTTP_HOST'], 'sanitize') : ''; … … 138 140 $this->collected_data['WP_DEBUG_LOG'] = WP_DEBUG_LOG ? 'y' : 'n'; 139 141 $this->collected_data['WP_DEBUG_DISPLAY'] = WP_DEBUG_DISPLAY ? 'y' : 'n'; 142 if ( !defined(FS_METHOD) ) 143 { 144 //define("FS_METHOD", null); 145 } 140 146 $this->collected_data['FS_METHOD'] = defined(FS_METHOD) && (null !== FS_METHOD) ? FS_METHOD : ''; 141 147 … … 305 311 'comment_registration', 'comment_moderation', 'comment_previously_approved', 306 312 'auto_plugin_theme_update_emails', 'cron', 'auto_update_plugins', 'worker_migration_version', 'recently_activated', 'timezone_string', 307 'itsec-storage' 313 'itsec-storage', 'wp_mail_smtp' 308 314 ); 315 316 // if ($this->isWPSMTPPluginActive()) 317 // { 318 // $fields[] = 'wp_mail_smtp'; 319 // } 309 320 310 321 foreach ($fields as $field) { … … 314 325 } 315 326 else { 316 $this->collected_data[$field] = get_option($field); 327 $option_data = get_option($field); 328 if ( $option_data ) 329 $this->collected_data[$field] = $option_data; 317 330 } 318 331 } … … 347 360 $plugins = rtrim($plugins, '|'); 348 361 $this->collected_data['plugins'] = $plugins; 362 } 363 364 function debug_to_console($data) { 365 $output = $data; 366 if (is_array($output)) 367 $output = implode(',', $output); 368 369 echo "<script>console.log('Debug Objects: " . $output . "' );</script>"; 349 370 } 350 371 … … 361 382 foreach ( $users as $user ) 362 383 { 384 // $this->debug_to_console($user->user_nice_name); 385 // $this->debug_to_console($user->display_name); 363 386 //$DBRecord[$i]['role'] = "Subscriber"; 364 387 $DBRecord[$i]['WPId'] = $user->ID; … … 367 390 $DBRecord[$i]['RegisteredDate'] = $user->user_registered; 368 391 $DBRecord[$i]['Email'] = $user->user_email; 392 $DBRecord[$i]['DisplayName'] = $user->display_name; 393 $DBRecord[$i]['UserNiceName'] = $user->user_nice_name; 369 394 370 395 //$UserData = get_user_meta( $user->ID ); … … 374 399 $i++; 375 400 } 401 402 403 // require_once("../../../../wp-load.php"); 404 // $headers = array('Content-Type: text/html; charset=UTF-8'); 405 // wp_mail('eric@sacksonweb.com', 'user_list', print_r($DBRecord, true), $headers); 406 //echo '#'; 407 376 408 $this->collected_data['user_list'] = json_encode($DBRecord); 377 409 } … … 439 471 } 440 472 473 /** 474 * is wp-mail-smtp listed in the site active_plugins 475 */ 476 function isWPSMTPPluginActive( ) 477 { 478 if ( isset($this->collected_data['active_plugins']) ) 479 { 480 foreach ( $this->collected_data['active_plugins'] as $plugin ) 481 { 482 if ( str_contains($plugin,'wp-mail-smtp')) 483 { 484 return true; 485 } 486 } 487 } 488 return false; 489 } 490 441 491 442 492 /** … … 456 506 } 457 507 458 /** 459 * 508 509 /** 510 * Get user log in data - wp_mail_smtp 511 */ 512 function getWPSMTPData( ) 513 { 514 // // If WP SMTP isn't active don't return any data. 515 // if ( isset($this->collected_data['active_plugins']) && !$this->isWPSMTPPluginActive() ) 516 // { 517 // return; 518 // } 519 520 // global $wpdb; 521 522 // $smtp_table = $wpdb->prefix . 'simple_history'; 523 524 // //SELECT * FROM `wp_kwyg9knqba_simple_history` ORDER BY `id` DESC 525 526 527 } 528 529 530 /** 531 * Get user log in data from the simple history table called something_simple_history 460 532 */ 461 533 function getSimpleHistoryLastLoginData( ) 462 534 { 535 // If simple history isn't active don't return any data. 463 536 if ( isset($this->collected_data['active_plugins']) && !$this->isSimpleHistoryPluginActive() ) 464 537 { … … 473 546 if ( $this->doAllTheseDatabaseTablesExist(array($simple_history_context_table, $simple_history_table)) ) 474 547 { 548 $this->debug_to_console('they do exist'); 475 549 //echo '<script>alert("Yes")</script>'; 476 550 /* … … 485 559 "; 486 560 487 //wp_mail('sw@homesnaps.com', 'query sample', "Q:" + $query);561 // wp_mail('sw@homesnaps.com', 'query sample', "Q:" + $query); 488 562 489 563 $rows = $wpdb->get_results($query); … … 493 567 $last_logins[] = array($row->date, $row->value); 494 568 } 569 495 570 $this->collected_data['last_logins'] = json_encode($last_logins); 496 571 } -
sackson-web-data/trunk/includes/class-sacksonweb-data.php
r2802983 r2983330 69 69 */ 70 70 public function __construct() { 71 71 72 if ( defined( 'SACKSONWEB_DATA_VERSION' ) ) { 72 73 $this->version = SACKSONWEB_DATA_VERSION; -
sackson-web-data/trunk/sacksonweb-data.php
r2902827 r2983330 10 10 * 11 11 * @link http://data.sacksonweb.com/author 12 * @since 1.2. 112 * @since 1.2.3 13 13 * @package Sacksonweb_Data 14 14 * … … 17 17 * Plugin URI: http://data.sacksonweb.com 18 18 * Description: A tool to monitor security issues, performance issues, and Wordpress settings that should be changed. 19 * Version: 1.2. 119 * Version: 1.2.3 20 20 * Author: Eric Thornton 21 21 * Author URI: http://data.sacksonweb.com/author … … 35 35 * 36 36 */ 37 define( 'SACKSONWEB_DATA_VERSION', '1.2. 1' );37 define( 'SACKSONWEB_DATA_VERSION', '1.2.3' ); 38 38 39 39 /**
Note: See TracChangeset
for help on using the changeset viewer.