WP Mail Bank: WordPress SMTP Plugin & Email Logs - Version 1.45

Version Description

  • Security Issue Fixed
  • Few Urgent Bugs Fixed
Download this release

Release Info

Developer contact-banker
Plugin Icon 128x128 WP Mail Bank: WordPress SMTP Plugin & Email Logs
Version 1.45
Comparing to
See all releases

Code changes from version 1.44 to 1.45

lib/add_mail_class_file.php CHANGED
@@ -37,25 +37,25 @@ else
37
  if(isset($_REQUEST["param"]))
38
  {
39
  global $wpdb;
40
- if($_REQUEST["param"] == "add_mail_detail")
41
  {
42
  $insert = new save_data();
43
  $email_setup = array();
44
- $email_setup["from_name"] = esc_html(html_entity_decode(base64_decode($_REQUEST["from_name"])));
45
- $email_setup["from_email"] = esc_attr($_REQUEST["ux_email_from_email"]);
46
- $email_setup["mailer_type"] = intval($_REQUEST["ux_rdl_ends"]);
47
  $email_setup["return_path"] = isset($_REQUEST["ux_chk_return_path"]) ? intval($_REQUEST["ux_chk_return_path"]) : 0;
48
- $email_setup["return_email"] = esc_attr($_REQUEST["ux_return_email"]);
49
- $email_setup["word_wrap"] = intval($_REQUEST["ux_word_wrap"]);
50
- $email_setup["smtp_host"] = esc_attr($_REQUEST["ux_smtp_host"]);
51
- $email_setup["smtp_port"] = esc_attr($_REQUEST["ux_smtp_port"]);
52
- $email_setup["encryption"] = intval($_REQUEST["ux_rdl_encrption"]);
53
- $email_setup["smtp_keep_alive"] = intval($_REQUEST["ux_rdl_smtp_alive"]);
54
- $email_setup["authentication"] = intval($_REQUEST["ux_rdl_authentication_bank"]);
55
- $email_setup["smtp_username"] = esc_attr($_REQUEST["ux_txt_username"]);
56
- $email_setup["smtp_password"] = htmlspecialchars_decode(esc_attr($_REQUEST["password"]));
57
- $ux_chk_email_from_name = isset($_REQUEST["ux_chk_email_from_name"]) ? $_REQUEST["ux_chk_email_from_name"] :"0";
58
- $ux_chk_from_email = isset($_REQUEST["ux_chk_from_email"]) ? $_REQUEST["ux_chk_from_email"] :"0";
59
  $count_direction = $wpdb->get_var
60
  (
61
  "SELECT count(id) FROM " .wp_mail_bank()
@@ -75,7 +75,7 @@ else
75
  die();
76
 
77
  }
78
- elseif($_REQUEST["param"] == "send_mail")
79
  {
80
  global $phpmailer;
81
  $logs = array();
@@ -88,9 +88,9 @@ else
88
  $phpmailer->SMTPDebug = true;
89
  ob_start();
90
 
91
- $to = esc_attr($_REQUEST["ux_email_to"]);
92
- $subject=esc_attr($_REQUEST["ux_email_subject"]);
93
- $message=stripslashes(($_REQUEST["message"]));
94
  $result = wp_mail($to, $subject, $message);
95
  if($phpmailer->Mailer == "smtp")
96
  {
@@ -102,11 +102,11 @@ else
102
  }
103
  die();
104
  }
105
- elseif($_REQUEST["param"] == "mail_bank_plugin_updates")
106
  {
107
- if(wp_verify_nonce( $_REQUEST["_wpnonce"], "update_plugin_nonce"))
108
  {
109
- $plugin_update = esc_attr($_REQUEST["mail_bank_updates"]);
110
  update_option("mail-bank-automatic-update",$plugin_update);
111
  die();
112
  }
37
  if(isset($_REQUEST["param"]))
38
  {
39
  global $wpdb;
40
+ if(esc_attr($_REQUEST["param"]) == "add_mail_detail")
41
  {
42
  $insert = new save_data();
43
  $email_setup = array();
44
+ $email_setup["from_name"] = isset($_REQUEST["from_name"]) ? esc_html(html_entity_decode(base64_decode($_REQUEST["from_name"]))) : "";
45
+ $email_setup["from_email"] = isset($_REQUEST["ux_email_from_email"]) ? esc_attr($_REQUEST["ux_email_from_email"]) : "";
46
+ $email_setup["mailer_type"] = isset($_REQUEST["ux_rdl_ends"]) ? intval($_REQUEST["ux_rdl_ends"]) : 0;
47
  $email_setup["return_path"] = isset($_REQUEST["ux_chk_return_path"]) ? intval($_REQUEST["ux_chk_return_path"]) : 0;
48
+ $email_setup["return_email"] = isset($_REQUEST["ux_return_email"]) ? esc_attr($_REQUEST["ux_return_email"]) : "";
49
+ $email_setup["word_wrap"] = isset($_REQUEST["ux_word_wrap"]) ? intval($_REQUEST["ux_word_wrap"]) : 0;
50
+ $email_setup["smtp_host"] = isset($_REQUEST["ux_smtp_host"]) ? esc_attr($_REQUEST["ux_smtp_host"]) : "";
51
+ $email_setup["smtp_port"] = isset($_REQUEST["ux_smtp_port"]) ? esc_attr($_REQUEST["ux_smtp_port"]) : "";
52
+ $email_setup["encryption"] = isset($_REQUEST["ux_rdl_encrption"]) ? intval($_REQUEST["ux_rdl_encrption"]) : 0;
53
+ $email_setup["smtp_keep_alive"] = isset($_REQUEST["ux_rdl_smtp_alive"]) ? intval($_REQUEST["ux_rdl_smtp_alive"]) : 0;
54
+ $email_setup["authentication"] = isset($_REQUEST["ux_rdl_authentication_bank"]) ? intval($_REQUEST["ux_rdl_authentication_bank"]) : 0;
55
+ $email_setup["smtp_username"] = isset($_REQUEST["ux_txt_username"]) ? esc_attr($_REQUEST["ux_txt_username"]) : "";
56
+ $email_setup["smtp_password"] = isset($_REQUEST["password"]) ? htmlspecialchars_decode(esc_attr($_REQUEST["password"])) : "";
57
+ $ux_chk_email_from_name = isset($_REQUEST["ux_chk_email_from_name"]) ? esc_attr($_REQUEST["ux_chk_email_from_name"]) :"0";
58
+ $ux_chk_from_email = isset($_REQUEST["ux_chk_from_email"]) ? esc_attr($_REQUEST["ux_chk_from_email"]) :"0";
59
  $count_direction = $wpdb->get_var
60
  (
61
  "SELECT count(id) FROM " .wp_mail_bank()
75
  die();
76
 
77
  }
78
+ elseif(esc_attr($_REQUEST["param"]) == "send_mail")
79
  {
80
  global $phpmailer;
81
  $logs = array();
88
  $phpmailer->SMTPDebug = true;
89
  ob_start();
90
 
91
+ $to = isset($_REQUEST["ux_email_to"]) ? esc_attr($_REQUEST["ux_email_to"]) : "";
92
+ $subject = isset($_REQUEST["ux_email_subject"]) ? esc_attr($_REQUEST["ux_email_subject"]) : "";
93
+ $message = isset($_REQUEST["message"]) ? stripslashes($_REQUEST["message"]) : "";
94
  $result = wp_mail($to, $subject, $message);
95
  if($phpmailer->Mailer == "smtp")
96
  {
102
  }
103
  die();
104
  }
105
+ elseif(esc_attr($_REQUEST["param"]) == "mail_bank_plugin_updates")
106
  {
107
+ if(wp_verify_nonce(esc_attr($_REQUEST["_wpnonce"]), "update_plugin_nonce"))
108
  {
109
+ $plugin_update = isset($_REQUEST["mail_bank_updates"]) ? esc_attr($_REQUEST["mail_bank_updates"]) : "";
110
  update_option("mail-bank-automatic-update",$plugin_update);
111
  die();
112
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP Mail Bank - Best PHPMailer & SMTP Mailer ===
2
  Contributors: contact-banker, Gallery-Bank
3
- Tags: admin, ajax, email, gmail, mail, mail smtp, mailer, outgoing mail, phpmailer, plugin, Post, posts, privacy, security, sendmail, smtp, ssl, tls, wordpress smtp, wp smtp, wp-phpmailer, wp_mail, wp mail, mailer
4
  Requires at least: 2.7
5
  Tested up to: 4.5.3
6
- Stable tag: 1.44
7
 
8
  WP Mail Bank reconfigures the PHP Mailer and make it more enhanced with advanced SMTP settings options.
9
 
@@ -222,9 +222,14 @@ If any problem occurs, please contact us at [support@tech-banker.com](mailto:sup
222
 
223
  == Changelog ==
224
 
 
 
 
 
 
225
  = 1.44 =
226
 
227
- * Compatibility with 4.5
228
  * Few Urgent Bugs Fixed
229
 
230
  = 1.43 =
1
  === WP Mail Bank - Best PHPMailer & SMTP Mailer ===
2
  Contributors: contact-banker, Gallery-Bank
3
+ Tags: email, gmail, mail, mail smtp, mailer, outgoing mail, phpmailer, sendmail, smtp, ssl, tls, wordpress smtp, wp smtp, wp-phpmailer, wp_mail, wp mail, mailer, mail bank
4
  Requires at least: 2.7
5
  Tested up to: 4.5.3
6
+ Stable tag: 1.45
7
 
8
  WP Mail Bank reconfigures the PHP Mailer and make it more enhanced with advanced SMTP settings options.
9
 
222
 
223
  == Changelog ==
224
 
225
+ = 1.45 =
226
+
227
+ * Security Issue Fixed
228
+ * Few Urgent Bugs Fixed
229
+
230
  = 1.44 =
231
 
232
+ * Compatibility with 4.5.3
233
  * Few Urgent Bugs Fixed
234
 
235
  = 1.43 =
views/automatic-plugin-update.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  if (!is_user_logged_in())
3
  {
4
  return;
@@ -58,17 +58,18 @@ else
58
  </div>
59
  </form>
60
  <script type="text/javascript">
61
-
62
- function mail_bank_autoupdate(control)
63
  {
64
- var mail_bank_updates = jQuery(control).val();
65
- jQuery.post(ajaxurl, "mail_bank_updates="+mail_bank_updates+"&param=mail_bank_plugin_updates&action=add_mail_library&_wpnonce=<?php echo $plugin_update_nonce ;?>", function(data)
66
  {
67
- });
 
 
 
 
68
  }
69
-
70
  </script>
71
  <?php
72
  }
73
  }
74
- ?>
1
+ <?php
2
  if (!is_user_logged_in())
3
  {
4
  return;
58
  </div>
59
  </form>
60
  <script type="text/javascript">
61
+ if(typeof(mail_bank_autoupdate) != "function")
 
62
  {
63
+ function mail_bank_autoupdate(control)
 
64
  {
65
+ var mail_bank_updates = jQuery(control).val();
66
+ jQuery.post(ajaxurl, "mail_bank_updates="+mail_bank_updates+"&param=mail_bank_plugin_updates&action=add_mail_library&_wpnonce=<?php echo $plugin_update_nonce ;?>", function(data)
67
+ {
68
+ });
69
+ }
70
  }
 
71
  </script>
72
  <?php
73
  }
74
  }
75
+ ?>
views/mail_header.php CHANGED
@@ -27,12 +27,12 @@ else
27
  <a class="nav-tab" id="other_services" href="admin.php?page=other_services"><?php _e("Our Other Services", mail_bank);?></a>
28
  </h2>
29
  <?php
30
- if($_REQUEST["page"] != "mail_feature_requests")
31
  {
32
  ?>
33
  <div class="custom-message green" style="display: block;margin-top:30px;max-width:965px;">
34
  <div style="padding: 4px 0;">
35
- <p style="font:12px/1.0em Arial !important;font-weight:bold;">If you don't find any features you were looking for in this Plugin,
36
  please write us <a target="_self" href="admin.php?page=mail_feature_requests">here</a> and we shall try to implement this for you as soon as possible! We are looking forward for your valuable <a target="_self" href="admin.php?page=mail_feature_requests">Feedback</a></p>
37
  </div>
38
  </div>
@@ -40,13 +40,13 @@ else
40
  }
41
  ?>
42
  <script>
43
-
44
  jQuery(document).ready(function()
45
  {
46
- jQuery(".nav-tab-wrapper > a#<?php echo $_REQUEST["page"];?>").addClass("nav-tab-active");
47
  });
48
-
49
  </script>
50
- <?php
51
  }
52
- ?>
27
  <a class="nav-tab" id="other_services" href="admin.php?page=other_services"><?php _e("Our Other Services", mail_bank);?></a>
28
  </h2>
29
  <?php
30
+ if(isset($_GET["page"]) ? esc_attr($_GET["page"]) : "" != "mail_feature_requests")
31
  {
32
  ?>
33
  <div class="custom-message green" style="display: block;margin-top:30px;max-width:965px;">
34
  <div style="padding: 4px 0;">
35
+ <p style="font:12px/1.0em Arial !important;font-weight:bold;">If you don't find any features you were looking for in this Plugin,
36
  please write us <a target="_self" href="admin.php?page=mail_feature_requests">here</a> and we shall try to implement this for you as soon as possible! We are looking forward for your valuable <a target="_self" href="admin.php?page=mail_feature_requests">Feedback</a></p>
37
  </div>
38
  </div>
40
  }
41
  ?>
42
  <script>
43
+
44
  jQuery(document).ready(function()
45
  {
46
+ jQuery(".nav-tab-wrapper > a#<?php echo isset($_GET["page"]) ? esc_attr($_GET["page"]) : "";?>").addClass("nav-tab-active");
47
  });
48
+
49
  </script>
50
+ <?php
51
  }
52
+ ?>
views/mail_settings.php CHANGED
@@ -400,46 +400,58 @@ jQuery("#ux_frm_email").validate
400
  }
401
  });
402
 
403
- function message_close()
404
  {
405
- jQuery("#message").css("display", "none");
 
 
 
406
  }
407
 
408
- function backup_rdl ()
409
  {
410
- var value = jQuery("#ux_rdl_on").prop("checked");
411
- if(value == false)
412
- {
413
- jQuery("#ux_smtp_host").css("display","block");
414
- }
415
- else
416
  {
417
- jQuery("#ux_smtp_host").css("display","none");
 
 
 
 
 
 
 
 
418
  }
419
  }
420
 
421
- function show_return_path()
422
  {
423
- if(jQuery("#ux_chk_return_path").prop("checked") == "0")
424
  {
425
- jQuery("#return_path").css("display","block");
426
- }
427
- else
428
- {
429
- jQuery("#return_path").css("display","none");
 
 
 
430
  }
431
  }
432
 
433
- function smtp_username ()
434
  {
435
- var value = jQuery("#ux_rdl_authentication_use").prop("checked");
436
- if(value == false)
437
- {
438
- jQuery("#ux_smtp").css("display","none");
439
- }
440
- else
441
  {
442
- jQuery("#ux_smtp").css("display","block");
 
 
 
 
 
 
 
 
443
  }
444
  }
445
  </script>
400
  }
401
  });
402
 
403
+ if(typeof(message_close) != "function")
404
  {
405
+ function message_close()
406
+ {
407
+ jQuery("#message").css("display", "none");
408
+ }
409
  }
410
 
411
+ if(typeof(backup_rdl) != "function")
412
  {
413
+ function backup_rdl ()
 
 
 
 
 
414
  {
415
+ var value = jQuery("#ux_rdl_on").prop("checked");
416
+ if(value == false)
417
+ {
418
+ jQuery("#ux_smtp_host").css("display","block");
419
+ }
420
+ else
421
+ {
422
+ jQuery("#ux_smtp_host").css("display","none");
423
+ }
424
  }
425
  }
426
 
427
+ if(typeof(show_return_path) != "function")
428
  {
429
+ function show_return_path()
430
  {
431
+ if(jQuery("#ux_chk_return_path").prop("checked") == "0")
432
+ {
433
+ jQuery("#return_path").css("display","block");
434
+ }
435
+ else
436
+ {
437
+ jQuery("#return_path").css("display","none");
438
+ }
439
  }
440
  }
441
 
442
+ if(typeof(smtp_username) != "function")
443
  {
444
+ function smtp_username ()
 
 
 
 
 
445
  {
446
+ var value = jQuery("#ux_rdl_authentication_use").prop("checked");
447
+ if(value == false)
448
+ {
449
+ jQuery("#ux_smtp").css("display","none");
450
+ }
451
+ else
452
+ {
453
+ jQuery("#ux_smtp").css("display","block");
454
+ }
455
  }
456
  }
457
  </script>
views/test_email.php CHANGED
@@ -53,9 +53,9 @@ else
53
  This is a Test Email from WP Mail Bank.
54
  Thanks for using it!
55
  Best Regards
56
- <strong>WP Mail Bank</strong>";
57
- wp_editor( $distribution, $name ="uxEmailTemplate" ,array("media_buttons" => false,
58
- "textarea_rows" => 8, "tabindex" => 4,"tinymce" =>false ));
59
  ?>
60
  <p class="wpib-desc-italic"><?php _e("You can specify the message of the email you want to send for testing.", mail_bank); ?></p>
61
  </div>
@@ -67,7 +67,7 @@ else
67
  </div>
68
  </div>
69
  </div>
70
-
71
  </div>
72
  </div>
73
  </div>
@@ -113,16 +113,16 @@ jQuery(document).ready(function()
113
  jQuery("label ").css("margin-left","6px");
114
  });
115
  jQuery("#ux_frm_test_email").validate
116
- ({
117
  rules:
118
- {
119
  ux_email_to:
120
- {
121
  required: true,
122
  email: true
123
  },
124
  ux_email_subject:
125
- {
126
  required: true
127
  }
128
  },
@@ -133,7 +133,7 @@ jQuery("#ux_frm_test_email").validate
133
  error.insertAfter(ctrl);
134
  jQuery(".error_field").css("float","left");
135
  jQuery(".error_field").css("position","static");
136
-
137
  },
138
  submitHandler: function(form)
139
  {
@@ -158,22 +158,31 @@ jQuery("#ux_frm_test_email").validate
158
  jQuery("#console_log_div").css("display","block");
159
  jQuery("#result_div").css("display","none");
160
  jQuery("#ux_console_log").html(data);
161
- }
162
  });
163
  }
164
  });jQuery("#return_path").css("display","block");
165
- function console_log()
166
  {
167
- jQuery("#ux_test_mail").css("display","none");
168
- jQuery("#ux_mail_console").css("display","block");
 
 
 
169
  }
170
- function back_settings()
171
  {
172
- window.location.href = "admin.php?page=smtp_mail";
 
 
 
173
  }
174
- function send_test_email()
175
- {
176
- jQuery("#ux_test_mail").css("display","block");
177
- jQuery("#ux_mail_console").css("display","none");
 
 
 
178
  }
179
- </script>
53
  This is a Test Email from WP Mail Bank.
54
  Thanks for using it!
55
  Best Regards
56
+ <strong>WP Mail Bank</strong>";
57
+ wp_editor( $distribution, $name ="uxEmailTemplate" ,array("media_buttons" => false,
58
+ "textarea_rows" => 8, "tabindex" => 4,"tinymce" =>false ));
59
  ?>
60
  <p class="wpib-desc-italic"><?php _e("You can specify the message of the email you want to send for testing.", mail_bank); ?></p>
61
  </div>
67
  </div>
68
  </div>
69
  </div>
70
+
71
  </div>
72
  </div>
73
  </div>
113
  jQuery("label ").css("margin-left","6px");
114
  });
115
  jQuery("#ux_frm_test_email").validate
116
+ ({
117
  rules:
118
+ {
119
  ux_email_to:
120
+ {
121
  required: true,
122
  email: true
123
  },
124
  ux_email_subject:
125
+ {
126
  required: true
127
  }
128
  },
133
  error.insertAfter(ctrl);
134
  jQuery(".error_field").css("float","left");
135
  jQuery(".error_field").css("position","static");
136
+
137
  },
138
  submitHandler: function(form)
139
  {
158
  jQuery("#console_log_div").css("display","block");
159
  jQuery("#result_div").css("display","none");
160
  jQuery("#ux_console_log").html(data);
161
+ }
162
  });
163
  }
164
  });jQuery("#return_path").css("display","block");
165
+ if(typeof(console_log) != "function")
166
  {
167
+ function console_log()
168
+ {
169
+ jQuery("#ux_test_mail").css("display","none");
170
+ jQuery("#ux_mail_console").css("display","block");
171
+ }
172
  }
173
+ if(typeof(back_settings) != "function")
174
  {
175
+ function back_settings()
176
+ {
177
+ window.location.href = "admin.php?page=smtp_mail";
178
+ }
179
  }
180
+ if(typeof(send_test_email) != "function")
181
+ {
182
+ function send_test_email()
183
+ {
184
+ jQuery("#ux_test_mail").css("display","block");
185
+ jQuery("#ux_mail_console").css("display","none");
186
+ }
187
  }
188
+ </script>
views/wp_system_status.php CHANGED
@@ -86,7 +86,7 @@ else
86
  <label class="layout-control-label">MySQL Version :</label>
87
  <div class="layout-controls wp_layout_control_mail_bank">
88
  <span>
89
- <?php
90
  global $wpdb;
91
  echo $wpdb->db_version();
92
  ?>
@@ -109,7 +109,7 @@ else
109
  <label class="layout-control-label">PHP Post Max Size :</label>
110
  <div class="layout-controls wp_layout_control_mail_bank">
111
  <span>
112
- <?php
113
  echo ini_get("post_max_size");
114
  ?>
115
  </span>
@@ -381,7 +381,7 @@ else
381
  <div class="widget-layout-body">
382
  <div class="layout-control-group">
383
  <label class="layout-control-label">Theme Name :</label>
384
-
385
  <div class="layout-controls wp_layout_control_mail_bank">
386
  <span><?php echo $active_theme->Name; ?></span>
387
  </div>
@@ -404,7 +404,7 @@ else
404
  </div>
405
  </div>
406
  </div>
407
- <?php
408
  }
409
  ?>
410
  </div>
@@ -430,7 +430,7 @@ else
430
  }
431
  return o;
432
  };
433
-
434
  jQuery("a.system-report").click(function () {
435
  var report = "";
436
  jQuery(".layout-span6 .widget-layout").each(function () {
@@ -468,11 +468,11 @@ else
468
  jQuery(this).fadeOut();
469
  jQuery("a.system-report").fadeIn();
470
  })
471
- jQuery(document).ready(function()
472
  {
473
  jQuery("#wp_system_status").addClass("nav-tab-active");
474
  });
475
  </script>
476
- <?php
477
  }
478
- ?>
86
  <label class="layout-control-label">MySQL Version :</label>
87
  <div class="layout-controls wp_layout_control_mail_bank">
88
  <span>
89
+ <?php
90
  global $wpdb;
91
  echo $wpdb->db_version();
92
  ?>
109
  <label class="layout-control-label">PHP Post Max Size :</label>
110
  <div class="layout-controls wp_layout_control_mail_bank">
111
  <span>
112
+ <?php
113
  echo ini_get("post_max_size");
114
  ?>
115
  </span>
381
  <div class="widget-layout-body">
382
  <div class="layout-control-group">
383
  <label class="layout-control-label">Theme Name :</label>
384
+
385
  <div class="layout-controls wp_layout_control_mail_bank">
386
  <span><?php echo $active_theme->Name; ?></span>
387
  </div>
404
  </div>
405
  </div>
406
  </div>
407
+ <?php
408
  }
409
  ?>
410
  </div>
430
  }
431
  return o;
432
  };
433
+
434
  jQuery("a.system-report").click(function () {
435
  var report = "";
436
  jQuery(".layout-span6 .widget-layout").each(function () {
468
  jQuery(this).fadeOut();
469
  jQuery("a.system-report").fadeIn();
470
  })
471
+ jQuery(document).ready(function()
472
  {
473
  jQuery("#wp_system_status").addClass("nav-tab-active");
474
  });
475
  </script>
476
+ <?php
477
  }
478
+ ?>
wp-mail-bank.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Wp Mail Bank
4
  Plugin URI: http://tech-banker.com
5
  Description: WP Mail Bank reconfigures the wp_mail() function and make it more enhanced.
6
  Author: Tech Banker
7
- Version: 1.44
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
@@ -20,312 +20,338 @@ if (!defined("MAIL_FILE")) define("MAIL_FILE","wp-mail-bank/wp-mail-bank.php");
20
 
21
  global $phpmailer;
22
 
23
-
24
- function create_global_menus_for_mail_bank()
25
  {
26
- global $wpdb,$current_user;
27
- if(is_super_admin())
28
- {
29
- $role = "administrator";
30
- }
31
- else
32
  {
33
- $role = $wpdb->prefix . "capabilities";
34
- $current_user->role = array_keys($current_user->$role);
35
- $role = $current_user->role[0];
 
 
 
 
 
 
 
 
 
36
  }
37
- include MAIL_BK_PLUGIN_DIR . "/lib/wp-include-menus.php";
38
  }
 
39
  ///////////////////////////////////// Functions for Returing Table Names ////////////////////////////////////////
40
- function wp_mail_bank()
41
  {
42
- global $wpdb;
43
- return $wpdb->prefix . "mail_bank";
 
 
 
44
  }
45
  ///////////////////////////////////// Call CSS & JS Scripts - Back End ////////////////////////////////////////
46
-
47
- function backend_plugin_js_scripts_mail_bank()
48
- {
49
- wp_enqueue_script("jquery");
50
- wp_enqueue_script("jquery.validate.min.js", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
51
- }
52
-
53
- function backend_plugin_css_scripts_mail_bank()
54
  {
55
- wp_enqueue_style("framework.css", plugins_url("/assets/css/framework.css",__FILE__));
56
- wp_enqueue_style("wp-mail-bank.css", plugins_url("/assets/css/wp-mail-bank.css",__FILE__));
 
 
 
57
  }
58
 
59
- function wp_mail_bank_configure($phpmailer)
60
  {
61
- global $wpdb;
62
- $data=$wpdb->get_row
63
- (
64
- "SELECT * FROM ".wp_mail_bank()
65
- );
66
- $mail_type = $data->mailer_type;
67
- $phpmailer->Mailer = $data->mailer_type == 0 ? "smtp" : "mail";
68
- $ux_chk_email_from_name = get_option("show_from_name_in_email");
69
- if( $ux_chk_email_from_name == "" || $ux_chk_email_from_name == "1")
70
- {
71
- $phpmailer->FromName = stripslashes(htmlspecialchars_decode($data->from_name, ENT_QUOTES));
72
- }
73
- $ux_chk_from_email = get_option("show_from_email_in_email");
74
- if( $ux_chk_from_email == "" || $ux_chk_from_email == "1")
75
  {
76
- $phpmailer->From = $data->from_email;
 
77
  }
 
78
 
79
- $phpmailer->Sender = $data->return_path == 0 ? $data->return_email : $data->from_email;
80
- $phpmailer->WordWrap = $data->word_wrap;
81
- $phpmailer->SMTPOptions = array
82
- (
83
- 'ssl' => array
84
- (
85
- 'verify_peer' => false,
86
- 'verify_peer_name' => false,
87
- 'allow_self_signed' => true
88
- )
89
- );
90
- if($data->mailer_type == 0)
91
  {
92
- switch($data->encryption)
 
 
 
 
 
 
 
 
93
  {
94
- case 0 :
95
- $phpmailer->SMTPSecure ="";
96
- break;
97
- case 1 :
98
- $phpmailer->SMTPSecure ="ssl";
99
- break;
100
- case 2 :
101
- $phpmailer->SMTPSecure ="tls";
102
- break;
103
  }
104
- $phpmailer->Host = $data->smtp_host;
105
- $phpmailer->Port = $data->smtp_port;
106
- if($data->smtp_keep_alive == 1)
107
  {
108
- $phpmailer->SMTPKeepAlive = TRUE;
109
  }
110
- if($data->authentication == 1)
 
 
 
 
 
 
 
 
 
 
 
 
111
  {
112
- $phpmailer->SMTPAuth = TRUE;
113
- $phpmailer->Username = $data->smtp_username;
114
- $phpmailer->Password = $data->smtp_password;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
  }
117
  }
118
 
 
119
  ////////////////////////////////////// Class Files Action Functions START here /////////////////////////////////////////
120
  if(isset($_REQUEST["action"]))
121
  {
122
- switch($_REQUEST["action"])
123
  {
124
  case "add_mail_library":
125
  add_action( "admin_init", "add_mail_library");
126
- function add_mail_library()
127
  {
128
- global $wpdb,$current_user,$user_role_permission;
129
- if(is_super_admin())
130
- {
131
- $role = "administrator";
132
- }
133
- else
134
  {
135
- $role = $wpdb->prefix . "capabilities";
136
- $current_user->role = array_keys($current_user->$role);
137
- $role = $current_user->role[0];
 
 
 
 
 
 
 
 
 
138
  }
139
- include MAIL_BK_PLUGIN_DIR . "/lib/add_mail_class_file.php";
140
  }
141
  break;
142
  }
143
  }
144
  ///////////////////////////////////// Call Languages for Multi-Lingual ////////////////////////////////////////
145
 
146
- function mail_bank_plugin_load_text_domain()
147
  {
148
- if (function_exists("load_plugin_textdomain"))
149
  {
150
- load_plugin_textdomain(mail_bank, false, MAIL_BK_PLUGIN_DIRNAME . "/lang");
 
 
 
151
  }
152
  }
153
 
 
154
  ///////////////////////////////////// admin menu////////////////////////////////////////
155
 
156
- function add_mail_icon($meta = TRUE)
157
  {
158
- global $wp_admin_bar, $wpdb, $current_user;
159
- if (is_user_logged_in())
160
  {
161
- if(is_super_admin())
162
- {
163
- $role = "administrator";
164
- }
165
- else
166
  {
167
- $role = $wpdb->prefix . "capabilities";
168
- $current_user->role = array_keys($current_user->$role);
169
- $role = $current_user->role[0];
170
- }
171
- switch ($role)
172
- {
173
- case "administrator":
174
- $wp_admin_bar->add_menu(array(
175
- "id" => "mail_bank",
176
- "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
177
- height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />WP Mail Bank"),
178
- "href" => __(site_url() . "/wp-admin/admin.php?page=smtp_mail"),
179
- ));
 
 
 
 
 
 
180
 
181
- $wp_admin_bar->add_menu(array(
182
- "parent" => "mail_bank",
183
- "id" => "Settings",
184
- "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
185
- "title" => __("Settings", mail_bank))
186
- );
187
- $wp_admin_bar->add_menu(array(
188
- "parent" => "mail_bank",
189
- "id" => "send_test_email",
190
- "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
191
- "title" => __("Send Test Email", mail_bank))
192
- );
193
- $wp_admin_bar->add_menu(array(
194
- "parent" => "mail_bank",
195
- "id" => "mail_plugin_update",
196
- "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
197
- "title" => __("Plugin Updates", mail_bank))
198
- );
199
- $wp_admin_bar->add_menu(array(
200
- "parent" => "mail_bank",
201
- "id" => "mail_feedback_link",
202
- "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
203
- "title" => __("Feature Requests", mail_bank))
204
- );
205
- $wp_admin_bar->add_menu(array(
206
- "parent" => "mail_bank",
207
- "id" => "recommended",
208
- "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
209
- "title" => __("Recommendations", mail_bank))
210
- );
211
- $wp_admin_bar->add_menu(array(
212
- "parent" => "mail_bank",
213
- "id" => "other_services",
214
- "href" => site_url() . "/wp-admin/admin.php?page=other_services",
215
- "title" => __("Our Other Services", mail_bank))
216
- );
217
- $wp_admin_bar->add_menu(array(
218
- "parent" => "mail_bank",
219
- "id" => "wp_system_status",
220
- "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
221
- "title" => __("System Status", mail_bank))
222
- );
223
- break;
224
- case "editor":
225
- $wp_admin_bar->add_menu(array(
226
- "id" => "mail_bank",
227
- "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
228
- height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Wp Mail Bank"),
229
- "href" => __(site_url() . "/wp-admin/admin.php?page=mail_settings"),
230
- ));
231
 
232
- $wp_admin_bar->add_menu(array(
233
- "parent" => "mail_bank",
234
- "id" => "Settings",
235
- "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
236
- "title" => __("Settings", mail_bank))
237
- );
238
- $wp_admin_bar->add_menu(array(
239
- "parent" => "mail_bank",
240
- "id" => "send_test_email",
241
- "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
242
- "title" => __("Send Test Email", mail_bank))
243
- );
244
- $wp_admin_bar->add_menu(array(
245
- "parent" => "mail_bank",
246
- "id" => "mail_plugin_update",
247
- "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
248
- "title" => __("Plugin Updates", mail_bank))
249
- );
250
- $wp_admin_bar->add_menu(array(
251
- "parent" => "mail_bank",
252
- "id" => "mail_feedback_link",
253
- "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
254
- "title" => __("Feature Requests", mail_bank))
255
- );
256
- $wp_admin_bar->add_menu(array(
257
- "parent" => "mail_bank",
258
- "id" => "recommended",
259
- "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
260
- "title" => __("Recommendations", mail_bank))
261
- );
262
- $wp_admin_bar->add_menu(array(
263
- "parent" => "mail_bank",
264
- "id" => "other_services",
265
- "href" => site_url() . "/wp-admin/admin.php?page=other_services",
266
- "title" => __("Our Other Services", mail_bank))
267
- );
268
- $wp_admin_bar->add_menu(array(
269
- "parent" => "mail_bank",
270
- "id" => "wp_system_status",
271
- "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
272
- "title" => __("System Status", mail_bank))
273
- );
274
- break;
275
- case "author":
276
- $wp_admin_bar->add_menu(array(
277
- "id" => "mail_bank",
278
- "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
279
- height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Wp Mail Bank"),
280
- "href" => __(site_url() . "/wp-admin/admin.php?page=mail_settings"),
281
- ));
282
 
283
- $wp_admin_bar->add_menu(array(
284
- "parent" => "mail_bank",
285
- "id" => "Settings",
286
- "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
287
- "title" => __("Settings", mail_bank))
288
- );
289
- $wp_admin_bar->add_menu(array(
290
- "parent" => "mail_bank",
291
- "id" => "send_test_email",
292
- "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
293
- "title" => __("Send Test Email", mail_bank))
294
- );
295
- $wp_admin_bar->add_menu(array(
296
- "parent" => "mail_bank",
297
- "id" => "mail_plugin_update",
298
- "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
299
- "title" => __("Plugin Updates", mail_bank))
300
- );
301
- $wp_admin_bar->add_menu(array(
302
- "parent" => "mail_bank",
303
- "id" => "mail_feedback_link",
304
- "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
305
- "title" => __("Feature Requests", mail_bank))
306
- );
307
- $wp_admin_bar->add_menu(array(
308
- "parent" => "mail_bank",
309
- "id" => "recommended",
310
- "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
311
- "title" => __("Recommendations", mail_bank))
312
- );
313
- $wp_admin_bar->add_menu(array(
314
- "parent" => "mail_bank",
315
- "id" => "other_services",
316
- "href" => site_url() . "/wp-admin/admin.php?page=other_services",
317
- "title" => __("Our Other Services", mail_bank))
318
- );
319
- $wp_admin_bar->add_menu(array(
320
- "parent" => "mail_bank",
321
- "id" => "wp_system_status",
322
- "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
323
- "title" => __("System Status", mail_bank))
324
- );
325
- break;
 
326
  }
327
  }
328
  }
 
329
  ///////////////////////////////////// Call Install Script on Plugin Activation ////////////////////////////////////////
330
  if(!function_exists("plugin_install_script_for_mail_bank"))
331
  {
@@ -355,27 +381,31 @@ if(!function_exists("plugin_install_script_for_mail_bank"))
355
  }
356
  }
357
 
358
- function mail_bank_plugin_update_message($args)
359
  {
360
- $response = wp_remote_get( 'http://plugins.svn.wordpress.org/wp-mail-bank/trunk/readme.txt' );
361
- if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) )
362
  {
363
- // Output Upgrade Notice
364
- $matches = null;
365
- $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote($args['Version']) . '\s*=|$)~Uis';
366
- $upgrade_notice = '';
367
- if ( preg_match( $regexp, $response['body'], $matches ) ) {
368
- $changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
369
- $upgrade_notice .= '<div class="framework_plugin_message">';
370
- foreach ( $changelog as $index => $line ) {
371
- $upgrade_notice .= "<p>".$line."</p>";
 
 
 
 
 
 
372
  }
373
- $upgrade_notice .= '</div> ';
374
- echo $upgrade_notice;
375
  }
376
  }
377
  }
378
 
 
379
  $is_option_auto_update = get_option("mail-bank-automatic-update");
380
 
381
  if($is_option_auto_update == "" || $is_option_auto_update == "1")
4
  Plugin URI: http://tech-banker.com
5
  Description: WP Mail Bank reconfigures the wp_mail() function and make it more enhanced.
6
  Author: Tech Banker
7
+ Version: 1.45
8
  Author URI: http://tech-banker.com
9
  License: GPLv3 or later
10
  */
20
 
21
  global $phpmailer;
22
 
23
+ if(!function_exists("create_global_menus_for_mail_bank"))
 
24
  {
25
+ function create_global_menus_for_mail_bank()
 
 
 
 
 
26
  {
27
+ global $wpdb,$current_user;
28
+ if(is_super_admin())
29
+ {
30
+ $role = "administrator";
31
+ }
32
+ else
33
+ {
34
+ $role = $wpdb->prefix . "capabilities";
35
+ $current_user->role = array_keys($current_user->$role);
36
+ $role = $current_user->role[0];
37
+ }
38
+ include MAIL_BK_PLUGIN_DIR . "/lib/wp-include-menus.php";
39
  }
 
40
  }
41
+
42
  ///////////////////////////////////// Functions for Returing Table Names ////////////////////////////////////////
43
+ if(!function_exists("wp_mail_bank"))
44
  {
45
+ function wp_mail_bank()
46
+ {
47
+ global $wpdb;
48
+ return $wpdb->prefix . "mail_bank";
49
+ }
50
  }
51
  ///////////////////////////////////// Call CSS & JS Scripts - Back End ////////////////////////////////////////
52
+ if(!function_exists("backend_plugin_js_scripts_mail_bank"))
 
 
 
 
 
 
 
53
  {
54
+ function backend_plugin_js_scripts_mail_bank()
55
+ {
56
+ wp_enqueue_script("jquery");
57
+ wp_enqueue_script("jquery.validate.min.js", plugins_url("/assets/js/jquery.validate.min.js",__FILE__));
58
+ }
59
  }
60
 
61
+ if(!function_exists("backend_plugin_css_scripts_mail_bank"))
62
  {
63
+ function backend_plugin_css_scripts_mail_bank()
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  {
65
+ wp_enqueue_style("framework.css", plugins_url("/assets/css/framework.css",__FILE__));
66
+ wp_enqueue_style("wp-mail-bank.css", plugins_url("/assets/css/wp-mail-bank.css",__FILE__));
67
  }
68
+ }
69
 
70
+ if(!function_exists("wp_mail_bank_configure"))
71
+ {
72
+ function wp_mail_bank_configure($phpmailer)
 
 
 
 
 
 
 
 
 
73
  {
74
+ global $wpdb;
75
+ $data=$wpdb->get_row
76
+ (
77
+ "SELECT * FROM ".wp_mail_bank()
78
+ );
79
+ $mail_type = $data->mailer_type;
80
+ $phpmailer->Mailer = $data->mailer_type == 0 ? "smtp" : "mail";
81
+ $ux_chk_email_from_name = get_option("show_from_name_in_email");
82
+ if( $ux_chk_email_from_name == "" || $ux_chk_email_from_name == "1")
83
  {
84
+ $phpmailer->FromName = stripslashes(htmlspecialchars_decode($data->from_name, ENT_QUOTES));
 
 
 
 
 
 
 
 
85
  }
86
+ $ux_chk_from_email = get_option("show_from_email_in_email");
87
+ if( $ux_chk_from_email == "" || $ux_chk_from_email == "1")
 
88
  {
89
+ $phpmailer->From = $data->from_email;
90
  }
91
+
92
+ $phpmailer->Sender = $data->return_path == 0 ? $data->return_email : $data->from_email;
93
+ $phpmailer->WordWrap = $data->word_wrap;
94
+ $phpmailer->SMTPOptions = array
95
+ (
96
+ 'ssl' => array
97
+ (
98
+ 'verify_peer' => false,
99
+ 'verify_peer_name' => false,
100
+ 'allow_self_signed' => true
101
+ )
102
+ );
103
+ if($data->mailer_type == 0)
104
  {
105
+ switch($data->encryption)
106
+ {
107
+ case 0 :
108
+ $phpmailer->SMTPSecure ="";
109
+ break;
110
+ case 1 :
111
+ $phpmailer->SMTPSecure ="ssl";
112
+ break;
113
+ case 2 :
114
+ $phpmailer->SMTPSecure ="tls";
115
+ break;
116
+ }
117
+ $phpmailer->Host = $data->smtp_host;
118
+ $phpmailer->Port = $data->smtp_port;
119
+ if($data->smtp_keep_alive == 1)
120
+ {
121
+ $phpmailer->SMTPKeepAlive = TRUE;
122
+ }
123
+ if($data->authentication == 1)
124
+ {
125
+ $phpmailer->SMTPAuth = TRUE;
126
+ $phpmailer->Username = $data->smtp_username;
127
+ $phpmailer->Password = $data->smtp_password;
128
+ }
129
  }
130
  }
131
  }
132
 
133
+
134
  ////////////////////////////////////// Class Files Action Functions START here /////////////////////////////////////////
135
  if(isset($_REQUEST["action"]))
136
  {
137
+ switch(esc_attr($_REQUEST["action"]))
138
  {
139
  case "add_mail_library":
140
  add_action( "admin_init", "add_mail_library");
141
+ if(!function_exists("add_mail_library"))
142
  {
143
+ function add_mail_library()
 
 
 
 
 
144
  {
145
+ global $wpdb,$current_user,$user_role_permission;
146
+ if(is_super_admin())
147
+ {
148
+ $role = "administrator";
149
+ }
150
+ else
151
+ {
152
+ $role = $wpdb->prefix . "capabilities";
153
+ $current_user->role = array_keys($current_user->$role);
154
+ $role = $current_user->role[0];
155
+ }
156
+ include MAIL_BK_PLUGIN_DIR . "/lib/add_mail_class_file.php";
157
  }
 
158
  }
159
  break;
160
  }
161
  }
162
  ///////////////////////////////////// Call Languages for Multi-Lingual ////////////////////////////////////////
163
 
164
+ if(!function_exists("mail_bank_plugin_load_text_domain"))
165
  {
166
+ function mail_bank_plugin_load_text_domain()
167
  {
168
+ if (function_exists("load_plugin_textdomain"))
169
+ {
170
+ load_plugin_textdomain(mail_bank, false, MAIL_BK_PLUGIN_DIRNAME . "/lang");
171
+ }
172
  }
173
  }
174
 
175
+
176
  ///////////////////////////////////// admin menu////////////////////////////////////////
177
 
178
+ if(!function_exists("add_mail_icon"))
179
  {
180
+ function add_mail_icon($meta = TRUE)
 
181
  {
182
+ global $wp_admin_bar, $wpdb, $current_user;
183
+ if (is_user_logged_in())
 
 
 
184
  {
185
+ if(is_super_admin())
186
+ {
187
+ $role = "administrator";
188
+ }
189
+ else
190
+ {
191
+ $role = $wpdb->prefix . "capabilities";
192
+ $current_user->role = array_keys($current_user->$role);
193
+ $role = $current_user->role[0];
194
+ }
195
+ switch ($role)
196
+ {
197
+ case "administrator":
198
+ $wp_admin_bar->add_menu(array(
199
+ "id" => "mail_bank",
200
+ "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
201
+ height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />WP Mail Bank"),
202
+ "href" => __(site_url() . "/wp-admin/admin.php?page=smtp_mail"),
203
+ ));
204
 
205
+ $wp_admin_bar->add_menu(array(
206
+ "parent" => "mail_bank",
207
+ "id" => "Settings",
208
+ "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
209
+ "title" => __("Settings", mail_bank))
210
+ );
211
+ $wp_admin_bar->add_menu(array(
212
+ "parent" => "mail_bank",
213
+ "id" => "send_test_email",
214
+ "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
215
+ "title" => __("Send Test Email", mail_bank))
216
+ );
217
+ $wp_admin_bar->add_menu(array(
218
+ "parent" => "mail_bank",
219
+ "id" => "mail_plugin_update",
220
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
221
+ "title" => __("Plugin Updates", mail_bank))
222
+ );
223
+ $wp_admin_bar->add_menu(array(
224
+ "parent" => "mail_bank",
225
+ "id" => "mail_feedback_link",
226
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
227
+ "title" => __("Feature Requests", mail_bank))
228
+ );
229
+ $wp_admin_bar->add_menu(array(
230
+ "parent" => "mail_bank",
231
+ "id" => "recommended",
232
+ "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
233
+ "title" => __("Recommendations", mail_bank))
234
+ );
235
+ $wp_admin_bar->add_menu(array(
236
+ "parent" => "mail_bank",
237
+ "id" => "other_services",
238
+ "href" => site_url() . "/wp-admin/admin.php?page=other_services",
239
+ "title" => __("Our Other Services", mail_bank))
240
+ );
241
+ $wp_admin_bar->add_menu(array(
242
+ "parent" => "mail_bank",
243
+ "id" => "wp_system_status",
244
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
245
+ "title" => __("System Status", mail_bank))
246
+ );
247
+ break;
248
+ case "editor":
249
+ $wp_admin_bar->add_menu(array(
250
+ "id" => "mail_bank",
251
+ "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
252
+ height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Wp Mail Bank"),
253
+ "href" => __(site_url() . "/wp-admin/admin.php?page=mail_settings"),
254
+ ));
255
 
256
+ $wp_admin_bar->add_menu(array(
257
+ "parent" => "mail_bank",
258
+ "id" => "Settings",
259
+ "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
260
+ "title" => __("Settings", mail_bank))
261
+ );
262
+ $wp_admin_bar->add_menu(array(
263
+ "parent" => "mail_bank",
264
+ "id" => "send_test_email",
265
+ "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
266
+ "title" => __("Send Test Email", mail_bank))
267
+ );
268
+ $wp_admin_bar->add_menu(array(
269
+ "parent" => "mail_bank",
270
+ "id" => "mail_plugin_update",
271
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
272
+ "title" => __("Plugin Updates", mail_bank))
273
+ );
274
+ $wp_admin_bar->add_menu(array(
275
+ "parent" => "mail_bank",
276
+ "id" => "mail_feedback_link",
277
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
278
+ "title" => __("Feature Requests", mail_bank))
279
+ );
280
+ $wp_admin_bar->add_menu(array(
281
+ "parent" => "mail_bank",
282
+ "id" => "recommended",
283
+ "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
284
+ "title" => __("Recommendations", mail_bank))
285
+ );
286
+ $wp_admin_bar->add_menu(array(
287
+ "parent" => "mail_bank",
288
+ "id" => "other_services",
289
+ "href" => site_url() . "/wp-admin/admin.php?page=other_services",
290
+ "title" => __("Our Other Services", mail_bank))
291
+ );
292
+ $wp_admin_bar->add_menu(array(
293
+ "parent" => "mail_bank",
294
+ "id" => "wp_system_status",
295
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
296
+ "title" => __("System Status", mail_bank))
297
+ );
298
+ break;
299
+ case "author":
300
+ $wp_admin_bar->add_menu(array(
301
+ "id" => "mail_bank",
302
+ "title" => __("<img src=\"" . plugins_url("/assets/images/mail.png",__FILE__)."\" width=\"25\"
303
+ height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Wp Mail Bank"),
304
+ "href" => __(site_url() . "/wp-admin/admin.php?page=mail_settings"),
305
+ ));
306
 
307
+ $wp_admin_bar->add_menu(array(
308
+ "parent" => "mail_bank",
309
+ "id" => "Settings",
310
+ "href" => site_url() . "/wp-admin/admin.php?page=smtp_mail",
311
+ "title" => __("Settings", mail_bank))
312
+ );
313
+ $wp_admin_bar->add_menu(array(
314
+ "parent" => "mail_bank",
315
+ "id" => "send_test_email",
316
+ "href" => site_url() . "/wp-admin/admin.php?page=send_test_email",
317
+ "title" => __("Send Test Email", mail_bank))
318
+ );
319
+ $wp_admin_bar->add_menu(array(
320
+ "parent" => "mail_bank",
321
+ "id" => "mail_plugin_update",
322
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_plugin_updates",
323
+ "title" => __("Plugin Updates", mail_bank))
324
+ );
325
+ $wp_admin_bar->add_menu(array(
326
+ "parent" => "mail_bank",
327
+ "id" => "mail_feedback_link",
328
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_feature_requests",
329
+ "title" => __("Feature Requests", mail_bank))
330
+ );
331
+ $wp_admin_bar->add_menu(array(
332
+ "parent" => "mail_bank",
333
+ "id" => "recommended",
334
+ "href" => site_url() . "/wp-admin/admin.php?page=recommended_plugins",
335
+ "title" => __("Recommendations", mail_bank))
336
+ );
337
+ $wp_admin_bar->add_menu(array(
338
+ "parent" => "mail_bank",
339
+ "id" => "other_services",
340
+ "href" => site_url() . "/wp-admin/admin.php?page=other_services",
341
+ "title" => __("Our Other Services", mail_bank))
342
+ );
343
+ $wp_admin_bar->add_menu(array(
344
+ "parent" => "mail_bank",
345
+ "id" => "wp_system_status",
346
+ "href" => site_url() . "/wp-admin/admin.php?page=mail_system_status",
347
+ "title" => __("System Status", mail_bank))
348
+ );
349
+ break;
350
+ }
351
  }
352
  }
353
  }
354
+
355
  ///////////////////////////////////// Call Install Script on Plugin Activation ////////////////////////////////////////
356
  if(!function_exists("plugin_install_script_for_mail_bank"))
357
  {
381
  }
382
  }
383
 
384
+ if(!function_exists("mail_bank_plugin_update_message"))
385
  {
386
+ function mail_bank_plugin_update_message($args)
 
387
  {
388
+ $response = wp_remote_get( 'http://plugins.svn.wordpress.org/wp-mail-bank/trunk/readme.txt' );
389
+ if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) )
390
+ {
391
+ // Output Upgrade Notice
392
+ $matches = null;
393
+ $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote($args['Version']) . '\s*=|$)~Uis';
394
+ $upgrade_notice = '';
395
+ if ( preg_match( $regexp, $response['body'], $matches ) ) {
396
+ $changelog = (array) preg_split('~[\r\n]+~', trim($matches[1]));
397
+ $upgrade_notice .= '<div class="framework_plugin_message">';
398
+ foreach ( $changelog as $index => $line ) {
399
+ $upgrade_notice .= "<p>".$line."</p>";
400
+ }
401
+ $upgrade_notice .= '</div> ';
402
+ echo $upgrade_notice;
403
  }
 
 
404
  }
405
  }
406
  }
407
 
408
+
409
  $is_option_auto_update = get_option("mail-bank-automatic-update");
410
 
411
  if($is_option_auto_update == "" || $is_option_auto_update == "1")