Changeset 2315761
- Timestamp:
- 06/01/2020 10:47:09 AM (6 years ago)
- Location:
- mailpress/trunk
- Files:
-
- 8 edited
-
MailPress.php (modified) (14 diffs)
-
mp-admin/view_logs.php (modified) (2 diffs)
-
mp-content/add-ons/MailPress_mailinglist.php (modified) (2 diffs)
-
mp-includes/class/MP_Mail.class.php (modified) (1 diff)
-
mp-includes/class/MP_Themes.class.php (modified) (2 diffs)
-
mp-includes/class/options/dashboard/widgets/_right_now.php (modified) (1 diff)
-
mp-load.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mailpress/trunk/MailPress.php
r2302714 r2315761 51 51 /** for mysql */ 52 52 global $wpdb; 53 $wpdb->mp_mails = $wpdb->prefix . 'mailpress_mails';54 $wpdb->mp_mailmeta = $wpdb->prefix . 'mailpress_mailmeta';55 $wpdb->mp_users = $wpdb->prefix . 'mailpress_users';56 $wpdb->mp_usermeta = $wpdb->prefix . 'mailpress_usermeta';57 $wpdb->mp_stats = $wpdb->prefix . 'mailpress_stats';53 $wpdb->mp_mails = $wpdb->prefix . 'mailpress_mails'; 54 $wpdb->mp_mailmeta = $wpdb->prefix . 'mailpress_mailmeta'; 55 $wpdb->mp_users = $wpdb->prefix . 'mailpress_users'; 56 $wpdb->mp_usermeta = $wpdb->prefix . 'mailpress_usermeta'; 57 $wpdb->mp_stats = $wpdb->prefix . 'mailpress_stats'; 58 58 59 59 class MailPress 60 60 { 61 61 const option_name_general = 'MailPress_general'; 62 const option_name_test = 'MailPress_test';63 const option_name_logs = 'MailPress_logs';64 const option_name_subscriptions = 'MailPress_subscriptions';65 const option_name_smtp = 'MailPress_smtp_config';62 const option_name_test = 'MailPress_test'; 63 const option_name_logs = 'MailPress_logs'; 64 const option_name_subscriptions = 'MailPress_subscriptions'; 65 const option_name_smtp = 'MailPress_smtp_config'; 66 66 const option_name_sendmail = 'MailPress_connection_sendmail'; 67 67 // php mail() not supported since swiftmailer 6.x … … 75 75 require_once( 'mp-load.php' ); 76 76 77 spl_autoload_register( array( __CLASS__, 'autoload' ) ); // for class loader77 spl_autoload_register( array( __CLASS__, 'autoload' ) ); // for class loader 78 78 79 79 if ( defined( 'MP_DEBUG_LOG' ) ) … … 86 86 87 87 add_action( 'plugins_loaded', array( __CLASS__, 'plugins_loaded' ) ); // for add-ons & gettext 88 add_action( 'init', array( __CLASS__, 'init' ) );// for init89 add_action( 'widgets_init', array( __CLASS__, 'widgets_init' ) ); // for widget88 add_action( 'init', array( __CLASS__, 'init' ) ); // for init 89 add_action( 'widgets_init', array( __CLASS__, 'widgets_init' ) ); // for widget 90 90 add_action( 'shutdown', array( __CLASS__, 'shutdown' ), 999 ); // for shutdown 91 add_action( 'mp_process_send_draft', array( __CLASS__, 'process' ) ); // for scheduled draft92 93 add_action( 'wp_ajax_mp_ajax', array( __CLASS__, 'wp_ajax_mp_ajax' ) ); // for ajax91 add_action( 'mp_process_send_draft', array( __CLASS__, 'process' ) ); // for scheduled draft 92 93 add_action( 'wp_ajax_mp_ajax', array( __CLASS__, 'wp_ajax_mp_ajax' ) ); // for ajax 94 94 add_action( 'wp_ajax_mp_mlinks', array( __CLASS__, 'mail_link' ) ); 95 add_action( 'wp_ajax_nopriv_mp_mlinks', array( __CLASS__, 'mail_link' ) );95 add_action( 'wp_ajax_nopriv_mp_mlinks', array( __CLASS__, 'mail_link' ) ); 96 96 97 97 add_action( 'wp_ajax_mp_cron', array( __CLASS__, 'mp_cron' ) ); … … 100 100 if ( is_admin() ) 101 101 { 102 register_activation_hook( plugin_basename( __FILE__ ), array( __CLASS__, 'install' ) ); // for install103 104 add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );// for admin css105 add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );// for menu106 107 $in_plugin_update_message = 'in_plugin_update_message-' . MP_FOLDER . '/' . __FILE__; // for plugin108 add_action($in_plugin_update_message, array( __CLASS__, 'in_plugin_update_message' ) ); //* update message109 add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 ); //* page links110 } 111 112 add_shortcode( 'mailpress', array( __CLASS__, 'shortcode' ) ); // for shortcode102 register_activation_hook( plugin_basename( __FILE__ ), array( __CLASS__, 'install' ) ); // for install 103 104 add_action( 'admin_init', array( __CLASS__, 'admin_init' ) ); // for admin css 105 add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); // for menu 106 107 $in_plugin_update_message = 'in_plugin_update_message-' . MP_FOLDER . '/' . __FILE__; // for plugin 108 add_action($in_plugin_update_message, array( __CLASS__, 'in_plugin_update_message' ) ); // * update message 109 add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 ); // * page links 110 } 111 112 add_shortcode( 'mailpress', array( __CLASS__, 'shortcode' ) ); // for shortcode 113 113 114 114 do_action( 'MailPress_init' ); … … 160 160 } 161 161 162 public static function capabilities() // for roles & capabilities162 public static function capabilities() // for roles & capabilities 163 163 { 164 164 include ( MP_ABSPATH . 'mp-admin/includes/capabilities/capabilities.php' ); … … 172 172 } 173 173 174 public static function widgets_init() // for widget174 public static function widgets_init() // for widget 175 175 { 176 176 register_widget( 'MP_Widget' ); … … 191 191 } 192 192 193 //// ADMIN////193 //// ADMIN //// 194 194 195 195 static function heartbeat_settings( $settings ) … … 201 201 static function is_bot( $HTTP_USER_AGENT = NULL ) 202 202 { 203 $bots_useragent = array( 'googlebot', 'google', 'bingbot', 'DotBot', '/bot.html', 'msnbot', 'RU_Bot', 'ia_archiver', 'lycos', 'jeeves', 'scooter', 'fast-webcrawler', 'slurp@inktomi', 'turnitinbot', 'technorati', 'yahoo', 'findexa', 'findlinks', 'gaisbo', 'zyborg', 'surveybot', 'bloglines', 'blogsearch', 'ubsub', 'syndic8', 'userland', 'gigabot', 'become.com' );203 $bots_useragent = array( 'googlebot', 'google', 'bingbot', 'DotBot', '/bot.html', 'msnbot', 'RU_Bot', 'ia_archiver', 'lycos', 'jeeves', 'scooter', 'fast-webcrawler', 'slurp@inktomi', 'turnitinbot', 'technorati', 'yahoo', 'findexa', 'findlinks', 'gaisbo', 'zyborg', 'surveybot', 'bloglines', 'blogsearch', 'ubsub', 'syndic8', 'userland', 'gigabot', 'become.com' ); 204 204 $HTTP_USER_AGENT = $HTTP_USER_AGENT ?? filter_input( INPUT_SERVER, 'HTTP_USER_AGENT' ); 205 205 foreach ( $bots_useragent as $bot ) if ( stristr( $HTTP_USER_AGENT, $bot ) !== false ) return true; … … 211 211 public static function install() 212 212 { 213 $min_ver_wp = '5.4';213 $min_ver_wp = '5.4'; 214 214 include ( MP_ABSPATH . 'mp-admin/includes/install/mailpress.php' ); 215 215 } … … 220 220 { 221 221 // for global css 222 $pathcss = MP_ABSPATH . 'mp-admin/css/colors_' . get_user_option( 'admin_color' ) . '.css';223 $css_url = '/' . MP_PATH . 'mp-admin/css/colors_' . get_user_option( 'admin_color' ) . '.css';224 $css_url_default = '/' . MP_PATH . 'mp-admin/css/colors_fresh.css';225 $css_url = ( is_file( $pathcss ) ) ? $css_url : $css_url_default;222 $pathcss = MP_ABSPATH . 'mp-admin/css/colors_' . get_user_option( 'admin_color' ) . '.css'; 223 $css_url = '/' . MP_PATH . 'mp-admin/css/colors_' . get_user_option( 'admin_color' ) . '.css'; 224 $css_url_default = '/' . MP_PATH . 'mp-admin/css/colors_fresh.css'; 225 $css_url = ( is_file( $pathcss ) ) ? $css_url : $css_url_default; 226 226 wp_register_style( 'mailPress_colors', $css_url ); 227 wp_enqueue_style ('mailPress_colors' );227 wp_enqueue_style( 'mailPress_colors' ); 228 228 229 229 // for dashboard … … 270 270 271 271 $hub = array ( MailPress_page_mails => 'mails', 272 MailPress_page_write => 'write',273 MailPress_page_edit => 'write',274 MailPress_page_revision => 'revision',275 MailPress_page_themes => 'themes',276 MailPress_page_settings => 'settings',277 MailPress_page_users => 'users',278 MailPress_page_user => 'user',279 MailPress_page_addons => 'addons'272 MailPress_page_write => 'write', 273 MailPress_page_edit => 'write', 274 MailPress_page_revision => 'revision', 275 MailPress_page_themes => 'themes', 276 MailPress_page_settings => 'settings', 277 MailPress_page_users => 'users', 278 MailPress_page_user => 'user', 279 MailPress_page_addons => 'addons' 280 280 ); 281 $hub = apply_filters( 'MailPress_load_admin_page', $hub );281 $hub = apply_filters( 'MailPress_load_admin_page', $hub ); 282 282 if ( !isset( $hub[$admin_page] ) ) 283 283 { … … 349 349 { 350 350 static $_widget_id = 0; 351 $options['widget_id'] = ( isset( $options['widget_id'] ) ) ? $options['widget_id'] . '_' . $_widget_id : 'mf_' . $_widget_id;351 $options['widget_id'] = ( isset( $options['widget_id'] ) ) ? $options['widget_id'] . '_' . $_widget_id : 'mf_' . $_widget_id; 352 352 MP_Widget::widget_form( $options ); 353 353 $_widget_id++; … … 380 380 { 381 381 self::$validator = new MP_Swift_EmailValidator(); 382 383 382 return ( self::$validator->isValid( $email ) ) ? $email : false; 384 383 } … … 389 388 return $x->send( $args ); 390 389 } 391 390 392 391 public static function mail_link() //links in mail 393 392 { 394 393 include ( MP_ABSPATH . 'mp-includes/html/mail_link.php' ); 395 394 } 396 395 397 396 public static function mp_cron() //wp_cron 398 397 { -
mailpress/trunk/mp-admin/view_logs.php
r2054596 r2315761 126 126 while ( ( $file = readdir( $l ) ) !== false ) 127 127 { 128 switch ( true )128 switch ( true ) 129 129 { 130 130 case ( $file[0] == '.' ) : … … 132 132 case ( strstr( $file, $ftmplt ) ) : 133 133 $all++; 134 if ( isset( $url_parms['s'] ) && ( !strstr( $file, $url_parms['s'] ) ) ) continue;134 if ( isset( $url_parms['s'] ) && ( !strstr( $file, $url_parms['s'] ) ) ) break; 135 135 $logs[filemtime( "$path/$file" ) . $file] = $file; 136 136 break; -
mailpress/trunk/mp-content/add-ons/MailPress_mailinglist.php
r2270989 r2315761 155 155 $_type = ( isset( $mp_subscriptions['display_mailinglists'][$k] ) ) ? 'checkbox' : ''; 156 156 157 if ( empty( $_type ) && empty( $checked ) ) continue;157 if ( empty( $_type ) && empty( $checked ) ) break; 158 158 if ( empty( $_type ) ) 159 159 { … … 170 170 break; 171 171 case 'select' : 172 if ( !isset( $mp_subscriptions['display_mailinglists'][$k] ) ) continue;172 if ( !isset( $mp_subscriptions['display_mailinglists'][$k] ) ) break; 173 173 174 174 if ( $show_option_all ) -
mailpress/trunk/mp-includes/class/MP_Mail.class.php
r2302714 r2315761 782 782 case 'bcc' : 783 783 case 'reply_to' : 784 if ( !isset( $hfunc[$k] ) ) continue;784 if ( !isset( $hfunc[$k] ) ) break; 785 785 $func = $hfunc[$k]; 786 786 foreach( $v as $toemail => $toname ) -
mailpress/trunk/mp-includes/class/MP_Themes.class.php
r2001492 r2315761 413 413 while ( ( $theme_dir = readdir( $themes_dir ) ) !== false ) { 414 414 if ( is_dir( $theme_root . '/' . $theme_dir ) && is_readable( $theme_root . '/' . $theme_dir ) ) { 415 if ( $theme_dir{0}== '.' || $theme_dir == 'CVS' )415 if ( substr( $theme_dir, 0, 1 ) == '.' || $theme_dir == 'CVS' ) 416 416 continue; 417 417 … … 436 436 while ( ( $theme_subdir = readdir( $theme_subdirs ) ) !== false ) { 437 437 if ( is_dir( $subdir . '/' . $theme_dir ) && is_readable( $subdir . '/' . $theme_dir ) ) { 438 if ( $theme_dir{0}== '.' || $theme_dir == 'CVS' )438 if ( substr( $theme_dir, 0, 1 ) == '.' || $theme_dir == 'CVS' ) 439 439 continue; 440 440 -
mailpress/trunk/mp-includes/class/options/dashboard/widgets/_right_now.php
r2047720 r2315761 78 78 </table> 79 79 </div> 80 <?php $this->add_ons(); ?> 80 81 </div> 81 82 </div> 82 83 <?php 83 84 } 85 86 function add_ons() 87 { 88 $addons = MP_Addons::get_all(); 89 $out = array(); 90 foreach( $addons as $addon ) 91 { 92 if ( !$addon['active'] ) continue; 93 94 $haystack = $addon['Name']; 95 $needle = 'MailPress_'; 96 if ( strpos( $haystack, $needle ) === 0 ) 97 { 98 $haystack = substr( $haystack, strlen( $needle ) ); 99 $haystack = ucfirst( $haystack ); 100 $out[] = $haystack; 101 } 102 } 103 if ( !empty( $out ) ) 104 { 105 echo '<div id="add-ons"><br /><hr />' . __( 'With following add-ons :', 'MailPress' ) . '<br />' . implode( ', ', $out ) . '</div>'; 106 } 107 } 84 108 } 85 109 new MP_Dashboard__right_now( __( "MailPress - 'Right Now'", 'MailPress' ) ); -
mailpress/trunk/mp-load.php
r2001482 r2315761 64 64 define ( 'MP_UPL_ABSPATH', untrailingslashit( $ubd ) . '/mailpress/' ); 65 65 define ( 'MP_UPL_URL', untrailingslashit( $ubu ) . '/mailpress/' ); 66 define ( 'MP_UPL_PATH', str_replace( trailingslashit( get_option( 'siteurl' ) ), '', MP_UPL_URL ) ); 67 //$paths = array('MP_ABSPATH' =>MP_ABSPATH,'MP_FOLDER' =>MP_FOLDER,'MP_PATH' =>MP_PATH,'MP_CONTENT_FOLDER' =>MP_CONTENT_FOLDER,'MP_CONTENT_DIR' =>MP_CONTENT_DIR,'MP_PATH_CONTENT' =>MP_PATH_CONTENT,'MP_UPL_ABSPATH' =>MP_UPL_ABSPATH,'MP_UPL_PATH' =>MP_UPL_PATH,'MP_UPL_URL' =>MP_UPL_URL,);print_r($paths); 66 define ( 'MP_UPL_PATH', str_replace( trailingslashit( get_option( 'siteurl' ) ), '', MP_UPL_URL ) ); 68 67 69 68 // 2. -
mailpress/trunk/uninstall.php
r2001482 r2315761 22 22 foreach( $taxonomies as $taxonomy ) 23 23 { 24 $queries[] = "DELETE FROM $wpdb->terms WHERE term_id IN ( SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy' );";24 $queries[] = "DELETE FROM $wpdb->terms WHERE term_id IN ( SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy' );"; 25 25 $queries[] = "DELETE FROM $wpdb->term_relationships WHERE term_taxonomy_id IN ( SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy' );"; 26 26 $queries[] = "DELETE FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy';";
Note: See TracChangeset
for help on using the changeset viewer.