Changeset 3061369
- Timestamp:
- 03/29/2024 10:39:25 PM (2 years ago)
- Location:
- sackson-web-data/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
includes/class-sacksonweb-data-helper.php (modified) (2 diffs)
-
includes/class-sacksonweb-data-settings.php (modified) (5 diffs)
-
includes/class-sacksonweb-data.php (modified) (2 diffs)
-
sacksonweb-data.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sackson-web-data/trunk/README.txt
r3027196 r3061369 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.0 7 Stable tag: 1. 2.97 Stable tag: 1.3.0 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 50 50 51 51 == Changelog == 52 53 = 1.3.0 = 54 * Gives an option to disable various email types like for plugin auto updates, theme auto updates, core auto updates 55 * Gather email log data so we can alert you to any email errors your site is having. 52 56 53 57 = 1.2.9 = -
sackson-web-data/trunk/includes/class-sacksonweb-data-helper.php
r3012275 r3061369 152 152 $this->getSiteCoreData(); 153 153 $this->getFileSystemItems (); 154 $this->getWPSMTPLogData(); 154 155 $this->getSimpleHistoryLastLoginData(); 155 156 $this->getUserData(); 156 157 $this->getPluginUpdateData(); 157 158 158 } 159 159 … … 545 545 * Get user log in data - wp_mail_smtp 546 546 */ 547 function getWPSMTPData( ) 548 { 549 // // If WP SMTP isn't active don't return any data. 550 // if ( isset($this->collected_data['active_plugins']) && !$this->isWPSMTPPluginActive() ) 551 // { 552 // return; 553 // } 554 555 // global $wpdb; 556 557 // $smtp_table = $wpdb->prefix . 'simple_history'; 558 559 // //SELECT * FROM `wp_kwyg9knqba_simple_history` ORDER BY `id` DESC 560 561 547 function getWPSMTPLogData( ) 548 { 549 // If WP SMTP isn't active don't return any data. 550 if ( isset($this->collected_data['active_plugins']) && !$this->isWPSMTPPluginActive() ) 551 { 552 return; 553 } 554 555 global $wpdb; 556 557 $smtp_table = $wpdb->prefix . 'wpmailsmtp_debug_events'; 558 559 $q = 'SELECT * FROM `' . $smtp_table . '` ORDER BY `created_at` DESC LIMIT 5;'; 560 $rows = $wpdb->get_results($q); 561 foreach ($rows as $row) 562 { 563 $last_smtp_logs[] = array($row->content, $row->initiator); 564 } 565 566 $this->collected_data['wpsmtp_log_data'] = json_encode($last_smtp_logs); 562 567 } 563 568 -
sackson-web-data/trunk/includes/class-sacksonweb-data-settings.php
r2802983 r3061369 41 41 42 42 public function sacksonweb_premium_settings_create_admin_page() { 43 // Sample sacksonweb_premium_settings_option_name - a:3:{s:7:"email_0";s:0:"";s:15:"refresh_every_0";s:1:"1";s:7:"allow_1";s:3:"Yes";} 43 44 $this->sacksonweb_premium_settings_options = get_option( 'sacksonweb_premium_settings_option_name' ); ?> 44 45 … … 120 121 121 122 add_settings_field( 123 'suppress_successful_email_updates', // id 124 'Suppress Emails', // title 125 array( $this, 'suppress_emails_list_field' ), // callback 126 'sackson-web-premium-settings-admin', // page 127 'sacksonweb_premium_settings_setting_section' // section 128 ); 129 // Add Field for selecting countries for which you wanna ban ads 130 //add_settings_field( 'aicp_country_list', __( 'Select the countries', 'aicp' ), 'country_list_field', 'aicp_settings', 'aicp_section' ); // id, title, display cb, page, section 131 132 // Register Settings 133 // register_setting( 'aicp_settings', 'aicp_settings_options', array( $this, 'validate_options' ) ); 134 135 136 137 add_settings_field( 122 138 'email_0', // id 123 139 'Email', // title … … 135 151 ); 136 152 153 154 137 155 138 156 } … … 151 169 if ( isset( $input['allow_1'] ) ) { 152 170 $sanitary_values['allow_1'] = $input['allow_1']; 171 } 172 173 if ( isset( $input['email_suppress_list'] ) ) { 174 $sanitary_values['email_suppress_list'] = $input['email_suppress_list']; 153 175 } 154 176 … … 180 202 <label for="allow_1-1"><input type="radio" name="sacksonweb_premium_settings_option_name[allow_1]" id="allow_1-1" value="No" <?php echo esc_attr($checked); ?>> No</label></fieldset> <?php 181 203 } 204 205 // now comes the section for checkbox 206 public function suppress_emails_list_field() { 207 208 $value = array(); 209 210 if (isset($this->sacksonweb_premium_settings_options['email_suppress_list']) && ! empty($this->sacksonweb_premium_settings_options['email_suppress_list'])) { 211 $value = $this->sacksonweb_premium_settings_options['email_suppress_list']; 212 } 213 214 $checked = in_array('theme_plugin_update_success', $value) ? 'checked' : '' ; 215 echo '<input type="checkbox" name="sacksonweb_premium_settings_option_name[email_suppress_list][]" value="theme_plugin_update_success"' . $checked . '/> Supress Successful Theme and Plugin Update Emails <br />'; 216 217 $checked = in_array('theme_plugin_update_failed', $value) ? 'checked' : '' ; 218 echo '<input type="checkbox" name="sacksonweb_premium_settings_option_name[email_suppress_list][]" value="theme_plugin_update_failed"' . $checked . '/> Supress Failed Theme and Plugin Update Emails (not recommended)<br />'; 219 220 } 221 222 182 223 183 224 } -
sackson-web-data/trunk/includes/class-sacksonweb-data.php
r3027196 r3061369 87 87 88 88 // Disable WordPress Administration email verification prompt 89 add_filter( 'admin_email_check_interval', '__return_false');90 89 $this->disableAdminVerificationPrompts(); 90 91 91 // Disable email notification for automatic plugin updates 92 // I'm not sure if this disables failed plugin updates or not. Let's test it out! 93 add_filter( 'auto_plugin_update_send_email', '__return_false' ); 92 add_filter( 'auto_plugin_theme_update_email', 'myplugin_auto_plugin_theme_update_email', 10, 4 ); 94 93 95 94 // Hiding WordPress version: … … 102 101 } 103 102 103 104 /** 105 * method - myplugin_auto_plugin_theme_update_email 106 * Description - too many emails about successful plugin udpates? If the SW setting for the site is set, then this will disable successful plugin update emails. 107 */ 108 function myplugin_auto_plugin_theme_update_email( $email, $type, $successful_updates, $failed_updates ) { 109 110 $sacksonweb_premium_settings_options = get_option( 'sacksonweb_premium_settings_option_name' ); 111 if (isset($sacksonweb_premium_settings_options['email_suppress_list']) && ! empty($sacksonweb_premium_settings_options['email_suppress_list'])) { 112 $email_suppress_list = $sacksonweb_premium_settings_options['email_suppress_list']; 113 } 114 115 // First let's check our plugin settings to see if this website even wants to to make any changes 116 if ( in_array( ['theme_plugin_update_failed'], $email_suppress_list) ) 117 { 118 if ( 'fail' === $type ) { 119 // Change the email subject when updates failed 120 $email['subject'] = __( 'ATTN: IT Department – SOME AUTO-UPDATES WENT WRONG!', 'my-plugin' ); 121 122 // Change the email recipient. 123 $email['to'] = 'eric@homesnaps.com'; 124 } 125 else { 126 $email['to'] = 'auto_delete_email_rule@homesnaps.com'; 127 } 128 129 return $email; 130 } 131 } 132 133 134 135 136 137 /** 138 * 139 */ 140 public function disableAdminVerificationPrompts () 141 { 142 add_filter( 'admin_email_check_interval', '__return_false' ); 143 } 144 104 145 /** 105 146 * Load the required dependencies for this plugin. -
sackson-web-data/trunk/sacksonweb-data.php
r3027196 r3061369 10 10 * 11 11 * @link http://data.sacksonweb.com/author 12 * @since 1. 2.912 * @since 1.3.0 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.919 * Version: 1.3.0 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.9' );37 define( 'SACKSONWEB_DATA_VERSION', '1.3.0' ); 38 38 39 39 /**
Note: See TracChangeset
for help on using the changeset viewer.