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

Version Description

  • FIX: Proper Sanitization, Escaping, Validation of all Post Calls
  • FIX: Removal of all function_exists, class_exists, typeof from all the files.
  • FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
  • FIX: Error Reporting in file Removed
  • FIX: Auto Updates Removed
  • FIX: Curl Calls Removed
Download this release

Release Info

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

Code changes from version 3.0.3 to 3.0.4

includes/footer.php CHANGED
@@ -106,8 +106,7 @@ else
106
  jQuery(this).find("> a").append("<span class=\"selected\"></span>");
107
  }
108
  });
109
- if(typeof(load_sidebar_content_mail_bank) != "function")
110
- {
111
  function load_sidebar_content_mail_bank()
112
  {
113
  var menus_height = jQuery(".page-sidebar-menu-tech-banker").height();
@@ -121,7 +120,7 @@ else
121
  jQuery(".page-sidebar-menu-tech-banker").attr("style","min-height:"+content_height+"px")
122
  }
123
  }
124
- }
125
  jQuery(".page-sidebar-tech-banker").on("click", "li > a", function(e)
126
  {
127
  var hasSubMenu = jQuery(this).next().hasClass("sub-menu");
@@ -147,9 +146,7 @@ else
147
  sub.slideDown(slideSpeed);
148
  }
149
  });
150
- if(typeof(paste_only_digits_mail_bank) != "function")
151
- {
152
- function paste_only_digits_mail_bank(control_id)
153
  {
154
  jQuery("#"+control_id).on("paste keypress",function(e)
155
  {
@@ -160,25 +157,21 @@ else
160
  }, 5);
161
  });
162
  }
163
- }
164
- if(typeof(remove_unwanted_spaces_mail_bank) != "function")
165
- {
166
- function remove_unwanted_spaces_mail_bank(id)
167
  {
168
  var api_key = jQuery("#"+id).val();
169
  api_key = api_key.replace(/[ ]/g, "");
170
  jQuery("#"+id).val("");
171
  jQuery("#"+id).val(jQuery.trim(api_key));
172
  }
173
- }
174
  var sidebar_load_interval = setInterval(load_sidebar_content_mail_bank ,1000);
175
  setTimeout(function()
176
  {
177
  clearInterval(sidebar_load_interval);
178
  }, 5000);
179
- if(typeof(overlay_loading_mail_bank) != "function")
180
- {
181
- function overlay_loading_mail_bank(control_id)
182
  {
183
  var overlay_opacity = jQuery("<div class=\"opacity_overlay\"></div>");
184
  jQuery("body").append(overlay_opacity);
@@ -196,18 +189,14 @@ else
196
  }
197
  }
198
  }
199
- }
200
- if(typeof(remove_overlay_mail_bank) != "function")
201
- {
202
- function remove_overlay_mail_bank()
203
  {
204
  jQuery(".loader_opacity").remove();
205
  jQuery(".opacity_overlay").remove();
206
  }
207
- }
208
- if(typeof(base64_encode)!= "function")
209
- {
210
- function base64_encode(data)
211
  {
212
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
213
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
@@ -234,19 +223,15 @@ else
234
  var r = data.length % 3;
235
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
236
  }
237
- }
238
- if(typeof(another_test_email_mail_bank) != "function")
239
- {
240
- function another_test_email_mail_bank()
241
  {
242
  jQuery("#ux_div_mail_console").css("display","none");
243
  jQuery("#console_log_div").css("display","none");
244
  jQuery("#ux_div_test_mail").css("display","block");
245
  }
246
- }
247
- if(typeof(check_links_oauth_mail_bank) != "function")
248
- {
249
- function check_links_oauth_mail_bank()
250
  {
251
  var smtp_host = jQuery("#ux_txt_host").val();
252
  var indexof = smtp_host.indexOf("yahoo");
@@ -271,14 +256,12 @@ else
271
  jQuery("#ux_link_content").text("");
272
  }
273
  }
274
- }
275
- if(typeof(mail_bank_mail_sender) != "function")
276
- {
277
- function mail_bank_mail_sender(to_email_address)
278
  {
279
  jQuery.post(ajaxurl,
280
  {
281
- data: base64_encode(jQuery("#ux_frm_test_email_configuration").serialize()),
282
  param: "mail_bank_test_email_configuration_module",
283
  action: "mail_bank_action",
284
  _wp_nonce: "<?php echo isset($mail_bank_test_email_configuration) ? $mail_bank_test_email_configuration : "";?>"
@@ -309,10 +292,8 @@ else
309
  load_sidebar_content_mail_bank();
310
  });
311
  }
312
- }
313
- if(typeof(mail_bank_send_test_mail) != "function")
314
- {
315
- function mail_bank_send_test_mail()
316
  {
317
  jQuery("#ux_frm_test_email_configuration").validate
318
  ({
@@ -369,7 +350,7 @@ else
369
  }
370
  });
371
  }
372
- }
373
  // Close popup
374
  jQuery("[data-popup-close-translator]").on("click", function(e)
375
  {
@@ -381,9 +362,7 @@ else
381
  }
382
  e.preventDefault();
383
  });
384
- if(typeof(open_popup_mail_bank) != "function")
385
- {
386
- function open_popup_mail_bank()
387
  {
388
  jQuery("[data-popup-open]").on("click", function(e)
389
  {
@@ -408,7 +387,7 @@ else
408
  }
409
  });
410
  }
411
- }
412
  var translation_request_array = [];
413
  var url = "<?php echo tech_banker_url."/feedbacks.php";?>";
414
  var domain_url = "<?php echo site_url(); ?>";
@@ -473,22 +452,18 @@ else
473
  });
474
  }
475
  });
476
- if(typeof(show_pop_up_mail_bank) != "function")
477
- {
478
- function show_pop_up_mail_bank()
479
  {
480
  open_popup_mail_bank();
481
  }
482
- }
483
- if(typeof(premium_edition_notification_mail_bank) != "function")
484
- {
485
- function premium_edition_notification_mail_bank()
486
  {
487
  var premium_edition = <?php echo json_encode($mb_message_premium_edition); ?>;
488
  var shortCutFunction = jQuery("#toastTypeGroup_error input:checked").val();
489
  var $toast = toastr[shortCutFunction](premium_edition);
490
  }
491
- }
492
  jQuery(document).ready(function()
493
  {
494
  show_pop_up_mail_bank();
@@ -502,9 +477,7 @@ else
502
  {
503
  case "wp_mail_bank_wizard":
504
  ?>
505
- if(typeof(show_hide_details_wp_mail_bank) != "function")
506
- {
507
- function show_hide_details_wp_mail_bank()
508
  {
509
  if(jQuery("#ux_div_wizard_set_up").hasClass("wizard-set-up"))
510
  {
@@ -517,10 +490,8 @@ else
517
  jQuery("#ux_div_wizard_set_up").addClass("wizard-set-up");
518
  }
519
  }
520
- }
521
- if(typeof(plugin_stats_wp_mail_bank) != "function")
522
- {
523
- function plugin_stats_wp_mail_bank(type)
524
  {
525
  overlay_loading_mail_bank();
526
  jQuery.post(ajaxurl,
@@ -536,7 +507,7 @@ else
536
  window.location.href = "admin.php?page=mb_email_configuration";
537
  });
538
  }
539
- }
540
  <?php
541
  break;
542
  case "mb_email_configuration":
@@ -546,9 +517,7 @@ else
546
  if(email_configuration_mail_bank == 1)
547
  {
548
  ?>
549
- if(typeof(select_credentials_mail_bank) != "function")
550
- {
551
- function select_credentials_mail_bank()
552
  {
553
  var selected_credential = jQuery("#ux_ddl_mb_authentication").val();
554
  var type = jQuery("#ux_ddl_type").val();
@@ -572,10 +541,8 @@ else
572
  }
573
  }
574
  }
575
- }
576
- if(typeof(mail_bank_second_step_settings) != "function")
577
- {
578
- function mail_bank_second_step_settings()
579
  {
580
  jQuery("#ux_div_first_step").css("display","none");
581
  jQuery("#test_email").css("display","none");
@@ -584,9 +551,7 @@ else
584
  jQuery("#ux_div_frm_wizard li:eq(1)").addClass("active");
585
  jQuery("#ux_div_frm_wizard li:eq(2)").removeClass("active");
586
  }
587
- }
588
- if(typeof(mail_bank_third_step_settings) != "function")
589
- {
590
  function mail_bank_third_step_settings()
591
  {
592
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
@@ -597,10 +562,8 @@ else
597
  jQuery("#ux_div_frm_wizard li:eq(1)").addClass("active");
598
  jQuery("#ux_div_frm_wizard li:eq(2)").addClass("active");
599
  }
600
- }
601
- if(typeof(mail_bank_from_name_override) != "function")
602
- {
603
- function mail_bank_from_name_override()
604
  {
605
  var from_name = jQuery("#ux_ddl_from_name").val();
606
  if(jQuery.trim(from_name) == "dont_override")
@@ -612,10 +575,8 @@ else
612
  jQuery("#ux_txt_mb_from_name").attr("disabled",false);
613
  }
614
  }
615
- }
616
- if(typeof(mail_bank_from_email_override) != "function")
617
- {
618
- function mail_bank_from_email_override()
619
  {
620
  var from_email = jQuery("#ux_ddl_from_email").val();
621
  if(jQuery.trim(from_email) == "dont_override")
@@ -627,10 +588,8 @@ else
627
  jQuery("#ux_txt_mb_from_email_configuration").attr("disabled",false);
628
  }
629
  }
630
- }
631
- if(typeof(mail_bank_validate_settings) != "function")
632
- {
633
- function mail_bank_validate_settings()
634
  {
635
  jQuery("#ux_frm_email_configuration").validate
636
  ({
@@ -701,7 +660,7 @@ else
701
  {
702
  jQuery.post(ajaxurl,
703
  {
704
- data: base64_encode(jQuery("#ux_frm_email_configuration").serialize()),
705
  action: "mail_bank_action",
706
  param: "mail_bank_email_configuration_settings_module",
707
  _wp_nonce: "<?php echo $mail_bank_email_configuration_settings; ?>"
@@ -733,10 +692,8 @@ else
733
  }
734
  });
735
  }
736
- }
737
- if(typeof(change_settings_mail_bank) != "function")
738
- {
739
- function change_settings_mail_bank()
740
  {
741
  var type = jQuery("#ux_ddl_type").val();
742
  switch(type)
@@ -750,10 +707,8 @@ else
750
  }
751
  select_credentials_mail_bank();
752
  }
753
- }
754
- if(typeof(mail_bank_get_host_port) != "function")
755
- {
756
- function mail_bank_get_host_port()
757
  {
758
  change_settings_mail_bank();
759
  var smtp_user = jQuery("#ux_txt_email_address").val();
@@ -779,10 +734,8 @@ else
779
  change_settings_mail_bank();
780
  });
781
  }
782
- }
783
- if(typeof(change_link_content_mail_bank) != "function")
784
- {
785
- function change_link_content_mail_bank()
786
  {
787
  var host_type = jQuery("#ux_txt_host").val();
788
  var indexof = host_type.indexOf("yahoo");
@@ -812,18 +765,18 @@ else
812
  select_credentials_mail_bank();
813
  }
814
  }
815
- }
816
  jQuery(document).ready(function()
817
  {
818
  if(window.CKEDITOR)
819
  {
820
  CKEDITOR.replace("ux_content");
821
  }
822
- jQuery("#ux_ddl_type").val("<?php echo isset($email_configuration_array["mailer_type"]) ? $email_configuration_array["mailer_type"] : "";?>");
823
- jQuery("#ux_ddl_mb_authentication").val("<?php echo isset($email_configuration_array["auth_type"]) ? $email_configuration_array["auth_type"] : "login";?>");
824
- jQuery("#ux_ddl_from_name").val("<?php echo isset($email_configuration_array["sender_name_configuration"]) ? $email_configuration_array["sender_name_configuration"] : "";?>");
825
- jQuery("#ux_ddl_from_email").val("<?php echo isset($email_configuration_array["from_email_configuration"]) ? $email_configuration_array["from_email_configuration"] : "";?>");
826
- jQuery("#ux_ddl_encryption").val("<?php echo isset($email_configuration_array["enc_type"]) ? $email_configuration_array["enc_type"] : "" ?>");
827
  <?php
828
  if(isset($test_secret_key_error))
829
  {
@@ -874,7 +827,7 @@ else
874
  if($email_configuration_array["hostname"] != "")
875
  {
876
  ?>
877
- jQuery("#ux_txt_host").val("<?php echo $email_configuration_array["hostname"];?>");
878
  <?php
879
  }
880
  else
@@ -885,17 +838,13 @@ else
885
  }
886
  ?>
887
  });
888
- if(typeof(mail_bank_move_to_second_step) != "function")
889
- {
890
  function mail_bank_move_to_second_step()
891
  {
892
  jQuery("#ux_div_first_step").addClass("first-step-helper");
893
  mail_bank_validate_settings();
894
  }
895
- }
896
- if(typeof(mail_bank_move_to_first_step) != "function")
897
- {
898
- function mail_bank_move_to_first_step()
899
  {
900
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
901
  jQuery("#test_email").removeClass("second-step-helper");
@@ -905,10 +854,8 @@ else
905
  jQuery("#ux_div_step_progres_bar_width").css("width","33%");
906
  jQuery("#ux_div_frm_wizard li:eq(1)").removeClass("active");
907
  }
908
- }
909
- if(typeof(mail_bank_save_changes) != "function")
910
- {
911
- function mail_bank_save_changes()
912
  {
913
  overlay_loading_mail_bank(<?php echo json_encode($mb_update_email_configuration);?>);
914
  setTimeout(function()
@@ -917,19 +864,15 @@ else
917
  window.location.href = "admin.php?page=mb_email_configuration";
918
  }, 3000);
919
  }
920
- }
921
- if(typeof(mail_bank_move_to_third_step) != "function")
922
- {
923
  function mail_bank_move_to_third_step()
924
  {
925
  mail_bank_validate_settings();
926
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
927
  jQuery("#test_email").addClass("second-step-helper");
928
  }
929
- }
930
- if(typeof(mail_bank_select_port) != "function")
931
- {
932
- function mail_bank_select_port()
933
  {
934
  var encryption = jQuery("#ux_ddl_encryption").val();
935
  switch(encryption)
@@ -943,7 +886,7 @@ else
943
  break;
944
  }
945
  }
946
- }
947
  var sidebar_load_interval = setInterval(load_sidebar_content_mail_bank ,1000);
948
  setTimeout(function()
949
  {
@@ -1060,16 +1003,14 @@ else
1060
  }
1061
  });
1062
  });
1063
- if(typeof(prevent_datepicker_mail_bank) != "function")
1064
- {
1065
- function prevent_datepicker_mail_bank(id)
1066
  {
1067
  jQuery("#"+id).on("keypress",function(e)
1068
  {
1069
  e.preventDefault();
1070
  });
1071
  }
1072
- }
1073
  var oTable = jQuery("#ux_tbl_email_logs").dataTable
1074
  ({
1075
  "pagingType": "full_numbers",
@@ -1096,8 +1037,6 @@ else
1096
  {
1097
  jQuery("input[type=checkbox]", oTable.fnGetFilteredNodes()).attr("checked",this.checked);
1098
  });
1099
- if(typeof(check_email_logs) != "function")
1100
- {
1101
  function check_email_logs(id)
1102
  {
1103
  if(jQuery("input:checked", oTable.fnGetFilteredNodes()).length == jQuery("input[type=checkbox]", oTable.fnGetFilteredNodes()).length)
@@ -1109,7 +1048,7 @@ else
1109
  jQuery("#ux_chk_all_email_logs").removeAttr("checked");
1110
  }
1111
  }
1112
- }
1113
  var ux_frm_email_logs = jQuery("#ux_frm_email_logs").validate
1114
  ({
1115
  submitHandler:function(form)
@@ -1130,11 +1069,9 @@ else
1130
  ?>
1131
  jQuery(document).ready(function()
1132
  {
1133
- jQuery("#ux_ddl_automatic_plugin_updates").val("<?php echo isset($settings_data_array["automatic_plugin_update"]) ? $settings_data_array["automatic_plugin_update"] : "disable";?>");
1134
- jQuery("#ux_ddl_debug_mode").val("<?php echo isset($settings_data_array["debug_mode"]) ? $settings_data_array["debug_mode"] : "enable";?>");
1135
- jQuery("#ux_ddl_remove_tables").val("<?php echo isset($settings_data_array["remove_tables_at_uninstall"]) ? $settings_data_array["remove_tables_at_uninstall"] : "disable";?>");
1136
- jQuery("#ux_ddl_monitor_email_logs").val("<?php echo isset($settings_data_array["monitor_email_logs"]) ? $settings_data_array["monitor_email_logs"] : "enable";?>");
1137
- jQuery("#ux_ddl_error_reporting").val("<?php echo isset($settings_data_array["error_reporting"]) ? $settings_data_array["error_reporting"] : "enable";?>");
1138
  });
1139
  jQuery("#ux_frm_settings").validate
1140
  ({
@@ -1143,7 +1080,7 @@ else
1143
  overlay_loading_mail_bank(<?php echo json_encode($mb_update_settings);?>);
1144
  jQuery.post(ajaxurl,
1145
  {
1146
- data: base64_encode(jQuery("#ux_frm_settings").serialize()),
1147
  action: "mail_bank_action",
1148
  param: "mail_bank_settings_module",
1149
  _wp_nonce: "<?php echo $mail_bank_settings; ?>"
@@ -1174,9 +1111,7 @@ else
1174
  if(roles_and_capabilities_mail_bank == 1)
1175
  {
1176
  ?>
1177
- if(typeof(full_control_function_mail_bank)!= "function")
1178
- {
1179
- function full_control_function_mail_bank(id,div_id)
1180
  {
1181
  var checkbox_id = jQuery(id).prop("checked");
1182
  jQuery("#"+div_id+ " input[type=checkbox]").each(function()
@@ -1200,10 +1135,8 @@ else
1200
  }
1201
  });
1202
  }
1203
- }
1204
- if(typeof(show_roles_capabilities_mail_bank)!= "function")
1205
- {
1206
- function show_roles_capabilities_mail_bank(id,div_id)
1207
  {
1208
  if(jQuery(id).prop("checked"))
1209
  {
@@ -1214,10 +1147,10 @@ else
1214
  jQuery("#"+div_id).css("display","none");
1215
  }
1216
  }
1217
- }
1218
  jQuery(document).ready(function()
1219
  {
1220
- jQuery("#ux_ddl_mail_bank_menu").val("<?php echo isset($details_roles_capabilities["show_mail_bank_top_bar_menu"]) ? $details_roles_capabilities["show_mail_bank_top_bar_menu"] : "enable";?>");
1221
  show_roles_capabilities_mail_bank("#ux_chk_author","ux_div_author_roles");
1222
  full_control_function_mail_bank("#ux_chk_full_control_author","ux_div_author_roles");
1223
  show_roles_capabilities_mail_bank("#ux_chk_editor","ux_div_editor_roles");
106
  jQuery(this).find("> a").append("<span class=\"selected\"></span>");
107
  }
108
  });
109
+
 
110
  function load_sidebar_content_mail_bank()
111
  {
112
  var menus_height = jQuery(".page-sidebar-menu-tech-banker").height();
120
  jQuery(".page-sidebar-menu-tech-banker").attr("style","min-height:"+content_height+"px")
121
  }
122
  }
123
+
124
  jQuery(".page-sidebar-tech-banker").on("click", "li > a", function(e)
125
  {
126
  var hasSubMenu = jQuery(this).next().hasClass("sub-menu");
146
  sub.slideDown(slideSpeed);
147
  }
148
  });
149
+ function paste_only_digits_mail_bank(control_id)
 
 
150
  {
151
  jQuery("#"+control_id).on("paste keypress",function(e)
152
  {
157
  }, 5);
158
  });
159
  }
160
+
161
+ function remove_unwanted_spaces_mail_bank(id)
 
 
162
  {
163
  var api_key = jQuery("#"+id).val();
164
  api_key = api_key.replace(/[ ]/g, "");
165
  jQuery("#"+id).val("");
166
  jQuery("#"+id).val(jQuery.trim(api_key));
167
  }
168
+
169
  var sidebar_load_interval = setInterval(load_sidebar_content_mail_bank ,1000);
170
  setTimeout(function()
171
  {
172
  clearInterval(sidebar_load_interval);
173
  }, 5000);
174
+ function overlay_loading_mail_bank(control_id)
 
 
175
  {
176
  var overlay_opacity = jQuery("<div class=\"opacity_overlay\"></div>");
177
  jQuery("body").append(overlay_opacity);
189
  }
190
  }
191
  }
192
+
193
+ function remove_overlay_mail_bank()
 
 
194
  {
195
  jQuery(".loader_opacity").remove();
196
  jQuery(".opacity_overlay").remove();
197
  }
198
+
199
+ function base64_encode_mail_bank(data)
 
 
200
  {
201
  var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
202
  var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
223
  var r = data.length % 3;
224
  return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
225
  }
226
+
227
+ function another_test_email_mail_bank()
 
 
228
  {
229
  jQuery("#ux_div_mail_console").css("display","none");
230
  jQuery("#console_log_div").css("display","none");
231
  jQuery("#ux_div_test_mail").css("display","block");
232
  }
233
+
234
+ function check_links_oauth_mail_bank()
 
 
235
  {
236
  var smtp_host = jQuery("#ux_txt_host").val();
237
  var indexof = smtp_host.indexOf("yahoo");
256
  jQuery("#ux_link_content").text("");
257
  }
258
  }
259
+
260
+ function mail_bank_mail_sender(to_email_address)
 
 
261
  {
262
  jQuery.post(ajaxurl,
263
  {
264
+ data: base64_encode_mail_bank(jQuery("#ux_frm_test_email_configuration").serialize()),
265
  param: "mail_bank_test_email_configuration_module",
266
  action: "mail_bank_action",
267
  _wp_nonce: "<?php echo isset($mail_bank_test_email_configuration) ? $mail_bank_test_email_configuration : "";?>"
292
  load_sidebar_content_mail_bank();
293
  });
294
  }
295
+
296
+ function mail_bank_send_test_mail()
 
 
297
  {
298
  jQuery("#ux_frm_test_email_configuration").validate
299
  ({
350
  }
351
  });
352
  }
353
+
354
  // Close popup
355
  jQuery("[data-popup-close-translator]").on("click", function(e)
356
  {
362
  }
363
  e.preventDefault();
364
  });
365
+ function open_popup_mail_bank()
 
 
366
  {
367
  jQuery("[data-popup-open]").on("click", function(e)
368
  {
387
  }
388
  });
389
  }
390
+
391
  var translation_request_array = [];
392
  var url = "<?php echo tech_banker_url."/feedbacks.php";?>";
393
  var domain_url = "<?php echo site_url(); ?>";
452
  });
453
  }
454
  });
455
+ function show_pop_up_mail_bank()
 
 
456
  {
457
  open_popup_mail_bank();
458
  }
459
+
460
+ function premium_edition_notification_mail_bank()
 
 
461
  {
462
  var premium_edition = <?php echo json_encode($mb_message_premium_edition); ?>;
463
  var shortCutFunction = jQuery("#toastTypeGroup_error input:checked").val();
464
  var $toast = toastr[shortCutFunction](premium_edition);
465
  }
466
+
467
  jQuery(document).ready(function()
468
  {
469
  show_pop_up_mail_bank();
477
  {
478
  case "wp_mail_bank_wizard":
479
  ?>
480
+ function show_hide_details_wp_mail_bank()
 
 
481
  {
482
  if(jQuery("#ux_div_wizard_set_up").hasClass("wizard-set-up"))
483
  {
490
  jQuery("#ux_div_wizard_set_up").addClass("wizard-set-up");
491
  }
492
  }
493
+
494
+ function plugin_stats_wp_mail_bank(type)
 
 
495
  {
496
  overlay_loading_mail_bank();
497
  jQuery.post(ajaxurl,
507
  window.location.href = "admin.php?page=mb_email_configuration";
508
  });
509
  }
510
+
511
  <?php
512
  break;
513
  case "mb_email_configuration":
517
  if(email_configuration_mail_bank == 1)
518
  {
519
  ?>
520
+ function select_credentials_mail_bank()
 
 
521
  {
522
  var selected_credential = jQuery("#ux_ddl_mb_authentication").val();
523
  var type = jQuery("#ux_ddl_type").val();
541
  }
542
  }
543
  }
544
+
545
+ function mail_bank_second_step_settings()
 
 
546
  {
547
  jQuery("#ux_div_first_step").css("display","none");
548
  jQuery("#test_email").css("display","none");
551
  jQuery("#ux_div_frm_wizard li:eq(1)").addClass("active");
552
  jQuery("#ux_div_frm_wizard li:eq(2)").removeClass("active");
553
  }
554
+
 
 
555
  function mail_bank_third_step_settings()
556
  {
557
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
562
  jQuery("#ux_div_frm_wizard li:eq(1)").addClass("active");
563
  jQuery("#ux_div_frm_wizard li:eq(2)").addClass("active");
564
  }
565
+
566
+ function mail_bank_from_name_override()
 
 
567
  {
568
  var from_name = jQuery("#ux_ddl_from_name").val();
569
  if(jQuery.trim(from_name) == "dont_override")
575
  jQuery("#ux_txt_mb_from_name").attr("disabled",false);
576
  }
577
  }
578
+
579
+ function mail_bank_from_email_override()
 
 
580
  {
581
  var from_email = jQuery("#ux_ddl_from_email").val();
582
  if(jQuery.trim(from_email) == "dont_override")
588
  jQuery("#ux_txt_mb_from_email_configuration").attr("disabled",false);
589
  }
590
  }
591
+
592
+ function mail_bank_validate_settings()
 
 
593
  {
594
  jQuery("#ux_frm_email_configuration").validate
595
  ({
660
  {
661
  jQuery.post(ajaxurl,
662
  {
663
+ data: base64_encode_mail_bank(jQuery("#ux_frm_email_configuration").serialize()),
664
  action: "mail_bank_action",
665
  param: "mail_bank_email_configuration_settings_module",
666
  _wp_nonce: "<?php echo $mail_bank_email_configuration_settings; ?>"
692
  }
693
  });
694
  }
695
+
696
+ function change_settings_mail_bank()
 
 
697
  {
698
  var type = jQuery("#ux_ddl_type").val();
699
  switch(type)
707
  }
708
  select_credentials_mail_bank();
709
  }
710
+
711
+ function mail_bank_get_host_port()
 
 
712
  {
713
  change_settings_mail_bank();
714
  var smtp_user = jQuery("#ux_txt_email_address").val();
734
  change_settings_mail_bank();
735
  });
736
  }
737
+
738
+ function change_link_content_mail_bank()
 
 
739
  {
740
  var host_type = jQuery("#ux_txt_host").val();
741
  var indexof = host_type.indexOf("yahoo");
765
  select_credentials_mail_bank();
766
  }
767
  }
768
+
769
  jQuery(document).ready(function()
770
  {
771
  if(window.CKEDITOR)
772
  {
773
  CKEDITOR.replace("ux_content");
774
  }
775
+ jQuery("#ux_ddl_type").val("<?php echo isset($email_configuration_array["mailer_type"]) ? esc_attr($email_configuration_array["mailer_type"]) : "";?>");
776
+ jQuery("#ux_ddl_mb_authentication").val("<?php echo isset($email_configuration_array["auth_type"]) ? esc_attr($email_configuration_array["auth_type"]) : "login";?>");
777
+ jQuery("#ux_ddl_from_name").val("<?php echo isset($email_configuration_array["sender_name_configuration"]) ? esc_html($email_configuration_array["sender_name_configuration"]) : "";?>");
778
+ jQuery("#ux_ddl_from_email").val("<?php echo isset($email_configuration_array["from_email_configuration"]) ? esc_attr($email_configuration_array["from_email_configuration"]) : "";?>");
779
+ jQuery("#ux_ddl_encryption").val("<?php echo isset($email_configuration_array["enc_type"]) ? esc_attr($email_configuration_array["enc_type"]) : "" ?>");
780
  <?php
781
  if(isset($test_secret_key_error))
782
  {
827
  if($email_configuration_array["hostname"] != "")
828
  {
829
  ?>
830
+ jQuery("#ux_txt_host").val("<?php echo isset($email_configuration_array["hostname"]) ? esc_attr($email_configuration_array["hostname"]) : "";?>");
831
  <?php
832
  }
833
  else
838
  }
839
  ?>
840
  });
 
 
841
  function mail_bank_move_to_second_step()
842
  {
843
  jQuery("#ux_div_first_step").addClass("first-step-helper");
844
  mail_bank_validate_settings();
845
  }
846
+
847
+ function mail_bank_move_to_first_step()
 
 
848
  {
849
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
850
  jQuery("#test_email").removeClass("second-step-helper");
854
  jQuery("#ux_div_step_progres_bar_width").css("width","33%");
855
  jQuery("#ux_div_frm_wizard li:eq(1)").removeClass("active");
856
  }
857
+
858
+ function mail_bank_save_changes()
 
 
859
  {
860
  overlay_loading_mail_bank(<?php echo json_encode($mb_update_email_configuration);?>);
861
  setTimeout(function()
864
  window.location.href = "admin.php?page=mb_email_configuration";
865
  }, 3000);
866
  }
867
+
 
 
868
  function mail_bank_move_to_third_step()
869
  {
870
  mail_bank_validate_settings();
871
  jQuery("#ux_div_first_step").removeClass("first-step-helper");
872
  jQuery("#test_email").addClass("second-step-helper");
873
  }
874
+
875
+ function mail_bank_select_port()
 
 
876
  {
877
  var encryption = jQuery("#ux_ddl_encryption").val();
878
  switch(encryption)
886
  break;
887
  }
888
  }
889
+
890
  var sidebar_load_interval = setInterval(load_sidebar_content_mail_bank ,1000);
891
  setTimeout(function()
892
  {
1003
  }
1004
  });
1005
  });
1006
+ function prevent_datepicker_mail_bank(id)
 
 
1007
  {
1008
  jQuery("#"+id).on("keypress",function(e)
1009
  {
1010
  e.preventDefault();
1011
  });
1012
  }
1013
+
1014
  var oTable = jQuery("#ux_tbl_email_logs").dataTable
1015
  ({
1016
  "pagingType": "full_numbers",
1037
  {
1038
  jQuery("input[type=checkbox]", oTable.fnGetFilteredNodes()).attr("checked",this.checked);
1039
  });
 
 
1040
  function check_email_logs(id)
1041
  {
1042
  if(jQuery("input:checked", oTable.fnGetFilteredNodes()).length == jQuery("input[type=checkbox]", oTable.fnGetFilteredNodes()).length)
1048
  jQuery("#ux_chk_all_email_logs").removeAttr("checked");
1049
  }
1050
  }
1051
+
1052
  var ux_frm_email_logs = jQuery("#ux_frm_email_logs").validate
1053
  ({
1054
  submitHandler:function(form)
1069
  ?>
1070
  jQuery(document).ready(function()
1071
  {
1072
+ jQuery("#ux_ddl_debug_mode").val("<?php echo isset($settings_data_array["debug_mode"]) ? esc_attr($settings_data_array["debug_mode"]) : "enable";?>");
1073
+ jQuery("#ux_ddl_remove_tables").val("<?php echo isset($settings_data_array["remove_tables_at_uninstall"]) ? esc_attr($settings_data_array["remove_tables_at_uninstall"]) : "disable";?>");
1074
+ jQuery("#ux_ddl_monitor_email_logs").val("<?php echo isset($settings_data_array["monitor_email_logs"]) ? esc_attr($settings_data_array["monitor_email_logs"]) : "enable";?>");
 
 
1075
  });
1076
  jQuery("#ux_frm_settings").validate
1077
  ({
1080
  overlay_loading_mail_bank(<?php echo json_encode($mb_update_settings);?>);
1081
  jQuery.post(ajaxurl,
1082
  {
1083
+ data: base64_encode_mail_bank(jQuery("#ux_frm_settings").serialize()),
1084
  action: "mail_bank_action",
1085
  param: "mail_bank_settings_module",
1086
  _wp_nonce: "<?php echo $mail_bank_settings; ?>"
1111
  if(roles_and_capabilities_mail_bank == 1)
1112
  {
1113
  ?>
1114
+ function full_control_function_mail_bank(id,div_id)
 
 
1115
  {
1116
  var checkbox_id = jQuery(id).prop("checked");
1117
  jQuery("#"+div_id+ " input[type=checkbox]").each(function()
1135
  }
1136
  });
1137
  }
1138
+
1139
+ function show_roles_capabilities_mail_bank(id,div_id)
 
 
1140
  {
1141
  if(jQuery(id).prop("checked"))
1142
  {
1147
  jQuery("#"+div_id).css("display","none");
1148
  }
1149
  }
1150
+
1151
  jQuery(document).ready(function()
1152
  {
1153
+ jQuery("#ux_ddl_mail_bank_menu").val("<?php echo isset($details_roles_capabilities["show_mail_bank_top_bar_menu"]) ? esc_attr($details_roles_capabilities["show_mail_bank_top_bar_menu"]) : "enable";?>");
1154
  show_roles_capabilities_mail_bank("#ux_chk_author","ux_div_author_roles");
1155
  full_control_function_mail_bank("#ux_chk_full_control_author","ux_div_author_roles");
1156
  show_roles_capabilities_mail_bank("#ux_chk_editor","ux_div_editor_roles");
includes/mailer.php CHANGED
@@ -320,26 +320,25 @@ if(!class_exists("mail_bank_auth_host"))
320
  $email_configuration_data_array = unserialize($email_configuration_data);
321
  if($email_configuration_data_array["mailer_type"] == "smtp")
322
  {
323
- if(!function_exists("wp_mail"))
324
- {
325
- function wp_mail($to,$subject,$message,$headers="",$attachments="")
326
- {
327
- global $wpdb;
328
- $email_configuration_data_array = $wpdb->get_var
329
- (
330
- $wpdb->prepare
331
- (
332
- "SELECT meta_value FROM ".mail_bank_meta().
333
- " WHERE meta_key=%s",
334
- "email_configuration"
335
- )
336
- );
337
- $email_configuration_settings = unserialize($email_configuration_data_array);
338
- $obj_send_test_mail = new mail_bank_auth_host($email_configuration_settings);
339
- $result = $obj_send_test_mail->send_test_mail_bank($to,$subject,$message,$headers,$attachments,$email_configuration_settings);
340
- return $result;
341
- }
342
- }
343
  }
344
  }
345
  }
320
  $email_configuration_data_array = unserialize($email_configuration_data);
321
  if($email_configuration_data_array["mailer_type"] == "smtp")
322
  {
323
+
324
+ function wp_mail($to,$subject,$message,$headers="",$attachments="")
325
+ {
326
+ global $wpdb;
327
+ $email_configuration_data_array = $wpdb->get_var
328
+ (
329
+ $wpdb->prepare
330
+ (
331
+ "SELECT meta_value FROM ".mail_bank_meta().
332
+ " WHERE meta_key=%s",
333
+ "email_configuration"
334
+ )
335
+ );
336
+ $email_configuration_settings = unserialize($email_configuration_data_array);
337
+ $obj_send_test_mail = new mail_bank_auth_host($email_configuration_settings);
338
+ $result = $obj_send_test_mail->send_test_mail_bank($to,$subject,$message,$headers,$attachments,$email_configuration_settings);
339
+ return $result;
340
+ }
341
+
 
342
  }
343
  }
344
  }
includes/queries.php CHANGED
@@ -28,39 +28,37 @@ else
28
  }
29
  else
30
  {
31
- if(!function_exists("get_mail_bank_log_data_unserialize"))
32
- {
33
- function get_mail_bank_log_data_unserialize($data,$start_date,$end_date)
34
- {
35
- $array_details = array();
36
- foreach($data as $raw_row)
37
- {
38
- $unserialize_data = unserialize($raw_row->meta_value);
39
- $unserialize_data["id"] = $raw_row->id;
40
- $unserialize_data["meta_id"] = $raw_row->meta_id;
41
- if($unserialize_data["timestamp"] >=$start_date && $unserialize_data["timestamp"] <= $end_date)
42
- array_push($array_details,$unserialize_data);
43
- }
44
- return $array_details;
45
- }
46
- }
47
- if(!function_exists("get_mail_bank_meta_value"))
48
- {
49
- function get_mail_bank_meta_value($meta_key)
50
- {
51
- global $wpdb;
52
- $meta_value = $wpdb->get_var
53
- (
54
- $wpdb->prepare
55
- (
56
- "SELECT meta_value FROM ".mail_bank_meta().
57
- " WHERE meta_key=%s",
58
- $meta_key
59
- )
60
- );
61
- return unserialize($meta_value);
62
- }
63
- }
64
 
65
  if(isset($_GET["page"]))
66
  {
@@ -77,7 +75,7 @@ else
77
  "edit_pages",
78
  "read"
79
  );
80
- $other_roles_array = isset($details_roles_capabilities["capabilities"]) && $details_roles_capabilities["capabilities"] != "" ? $details_roles_capabilities["capabilities"] : $other_roles_access_array;
81
  break;
82
 
83
  case "mb_settings":
28
  }
29
  else
30
  {
31
+
32
+ function get_mail_bank_log_data_unserialize($data,$start_date,$end_date)
33
+ {
34
+ $array_details = array();
35
+ foreach($data as $raw_row)
36
+ {
37
+ $unserialize_data = unserialize($raw_row->meta_value);
38
+ $unserialize_data["id"] = $raw_row->id;
39
+ $unserialize_data["meta_id"] = $raw_row->meta_id;
40
+ if($unserialize_data["timestamp"] >=$start_date && $unserialize_data["timestamp"] <= $end_date)
41
+ array_push($array_details,$unserialize_data);
42
+ }
43
+ return $array_details;
44
+ }
45
+
46
+
47
+ function get_mail_bank_meta_value($meta_key)
48
+ {
49
+ global $wpdb;
50
+ $meta_value = $wpdb->get_var
51
+ (
52
+ $wpdb->prepare
53
+ (
54
+ "SELECT meta_value FROM ".mail_bank_meta().
55
+ " WHERE meta_key=%s",
56
+ $meta_key
57
+ )
58
+ );
59
+ return unserialize($meta_value);
60
+ }
61
+
 
 
62
 
63
  if(isset($_GET["page"]))
64
  {
75
  "edit_pages",
76
  "read"
77
  );
78
+ $other_roles_array = isset($details_roles_capabilities["capabilities"]) && $details_roles_capabilities["capabilities"] != "" ? esc_attr($details_roles_capabilities["capabilities"]) : $other_roles_access_array;
79
  break;
80
 
81
  case "mb_settings":
includes/translations.php CHANGED
@@ -32,144 +32,144 @@ else
32
  $wp_langs["af"] = "Afrikaans";
33
  $wp_langs["ak"] = "Akan";
34
  $wp_langs["sq"] = "Shqip";
35
- $wp_langs["arq"] = "الدارجة الجزايرية";
36
- $wp_langs["am"] = "አማርኛ";
37
- $wp_langs["hy"] = "Հայերեն";
38
- $wp_langs["rup_mk"] = "Armãneashce";
39
  $wp_langs["frp"] = "Arpitan";
40
- $wp_langs["as"] = "অসমীয়া";
41
  $wp_langs["ast"] = "Asturianu";
42
- $wp_langs["az"] = "Azərbaycan dili";
43
- $wp_langs["az_tr"] = "Azərbaycan Türkcəsi";
44
- $wp_langs["bcc"] = "بلوچی مکرانی";
45
- $wp_langs["ba"] = "башҡорт теле";
46
  $wp_langs["eu"] = "Euskara";
47
- $wp_langs["bel"] = "Беларуская мова";
48
- $wp_langs["bn_bd"] = "বাংলা";
49
  $wp_langs["bs_ba"] = "Bosanski";
50
  $wp_langs["bre"] = "Brezhoneg";
51
- $wp_langs["bg_bg"] = "Български";
52
- $wp_langs["ca"] = "Català";
53
- $wp_langs["bal"] = "Català (Balear)";
54
  $wp_langs["ceb"] = "Cebuano";
55
- $wp_langs["zh_hk"] = "香港中文版 ";
56
- $wp_langs["zh_tw"] = "繁體中文";
57
  $wp_langs["co"] = "Corsu";
58
  $wp_langs["hr"] = "Hrvatski";
59
- $wp_langs["dv"] = "ދިވެހި";
60
- $wp_langs["nl_be"] = "Nederlands (België)";
61
- $wp_langs["dzo"] = "རྫོང་ཁ";
62
  $wp_langs["en_ca"] = "English (Canada)";
63
  $wp_langs["en_nz"] = "English (New Zealand)";
64
  $wp_langs["en_za"] = "English (South Africa)";
65
  $wp_langs["eo"] = "Esperanto";
66
  $wp_langs["et"] = "Eesti";
67
- $wp_langs["fo"] = "Føroyskt";
68
  $wp_langs["fi"] = "Suomi";
69
- $wp_langs["fr_be"] = "Français de Belgique";
70
- $wp_langs["fr_ca"] = "Français du Canada";
71
  $wp_langs["fy"] = "Frysk";
72
  $wp_langs["fur"] = "Friulian";
73
  $wp_langs["fuc"] = "Pulaar";
74
  $wp_langs["gl_es"] = "Galego";
75
- $wp_langs["ka_ge"] = "ქართული";
76
  $wp_langs["de_ch"] = "Deutsch (Schweiz)";
77
  $wp_langs["kal"] = "Kalaallisut";
78
- $wp_langs["gn"] = "Avañe'";
79
- $wp_langs["gu"] = "ગુજરાતી";
80
  $wp_langs["hat"] = "Kreyol ayisyen";
81
- $wp_langs["haw_us"] = "Ōlelo Hawaiʻi";
82
- $wp_langs["haz"] = "هزاره گی";
83
- $wp_langs["hi_in"] = "हिन्दी";
84
  $wp_langs["hu_hu"] = "Magyar";
85
- $wp_langs["is_is"] = "Íslenska";
86
  $wp_langs["ido"] = "Ido";
87
  $wp_langs["id_id"] = "Bahasa Indonesia";
88
  $wp_langs["ga"] = "Gaelige";
89
  $wp_langs["it_it"] = "Italiano";
90
- $wp_langs["ja"] = "日本語";
91
  $wp_langs["jv_id"] = "Basa Jawa";
92
  $wp_langs["kab"] = "Taqbaylit";
93
- $wp_langs["kn"] = "ಕನ್ನಡ";
94
- $wp_langs["kk"] = "Қазақ тілі";
95
- $wp_langs["km"] = "ភាសាខ្មែរ";
96
  $wp_langs["kin"] = "Ikinyarwanda";
97
- $wp_langs["ky_ky"] = "кыргыз тили";
98
- $wp_langs["ko_kr"] = "한국어";
99
- $wp_langs["ckb"] = "كوردی‎";
100
- $wp_langs["lo"] = "ພາສາລາວ";
101
- $wp_langs["lv"] = "Latviešu valoda";
102
  $wp_langs["li"] = "Limburgs";
103
  $wp_langs["lin"] = "Ngala";
104
- $wp_langs["lt_lt"] = "Lietuvių kalba";
105
- $wp_langs["lb_lu"] = "Lëtzebuergesch";
106
- $wp_langs["mk_mk"] = "Македонски јазик";
107
  $wp_langs["mg_mg"] = "Malagasy";
108
  $wp_langs["ms_my"] = "Bahasa Melayu";
109
- $wp_langs["ml_in"] = "മലയാളം";
110
- $wp_langs["mri"] = "Te Reo Māori";
111
- $wp_langs["mr"] = "मराठी";
112
- $wp_langs["xmf"] = "მარგალური ნინა";
113
- $wp_langs["mn"] = "Монгол";
114
  $wp_langs["me_me"] = "Crnogorski jezik";
115
- $wp_langs["ary"] = "العربية المغربية";
116
- $wp_langs["my_mm"] = "ဗမာစာ";
117
- $wp_langs["ne_np"] = "नेपाली";
118
  $wp_langs["nn_no"] = "Norsk nynorsk";
119
  $wp_langs["oci"] = "Occitan";
120
- $wp_langs["ory"] = "ଓଡ଼ିଆ";
121
- $wp_langs["os"] = "Ирон";
122
- $wp_langs["ps"] = "پښتو";
123
- $wp_langs["fa_ir"] = "فارسی";
124
- $wp_langs["fa_af"] = "(فارسی (افغانستان";
125
  $wp_langs["pl_pl"] = "Polski";
126
- $wp_langs["pa_in"] = "ਪੰਜਾਬੀ";
127
- $wp_langs["rhg"] = "Ruáinga";
128
  $wp_langs["roh"] = "Rumantsch Vallader";
129
- $wp_langs["rue"] = "Русиньскый";
130
- $wp_langs["sah"] = "Сахалыы";
131
- $wp_langs["sa_in"] = "भारतम्";
132
  $wp_langs["srd"] = "Sardu";
133
- $wp_langs["gd"] = "Gàidhlig";
134
- $wp_langs["sr_rs"] = "Српски језик";
135
- $wp_langs["szl"] = "Ślōnskŏ gŏdka";
136
- $wp_langs["snd"] = "سنڌي";
137
- $wp_langs["si_lk"] = "සිංහල";
138
- $wp_langs["sk_sk"] = "Slovenčina";
139
- $wp_langs["sl_si"] = "Slovenščina";
140
  $wp_langs["so_so"] = "Afsoomaali";
141
- $wp_langs["azb"] = "گؤنئی آذربایجان";
142
- $wp_langs["es_ar"] = "Español de Argentina";
143
- $wp_langs["es_cl"] = "Español de Chile";
144
- $wp_langs["es_co"] = "Español de Colombia";
145
- $wp_langs["es_gt"] = "Español de Guatemala";
146
- $wp_langs["es_pe"] = "Español de Perú";
147
- $wp_langs["es_pr"] = "Español de Puerto Rico";
148
- $wp_langs["es_es"] = "Español";
149
- $wp_langs["es_ve"] = "Español de Venezuela";
150
  $wp_langs["su_id"] = "Basa Sunda";
151
  $wp_langs["sw"] = "Kiswahili";
152
  $wp_langs["sv_se"] = "Svenska";
153
- $wp_langs["gsw"] = "Schwyzerdütsch";
154
  $wp_langs["tl"] = "Tagalog";
155
  $wp_langs["tah"] = "Reo Tahiti";
156
- $wp_langs["tg"] = "Тоҷикӣ";
157
- $wp_langs["tzm"] = "ⵜⴰⵎⴰⵣⵉⵖⵜ";
158
- $wp_langs["ta_in"] = "தமிழ்";
159
- $wp_langs["ta_lk"] = "தமிழ்";
160
- $wp_langs["tt_ru"] = "Татар теле";
161
- $wp_langs["te"] = "తెలుగు";
162
- $wp_langs["bo"] = "བོད་སྐད";
163
- $wp_langs["tir"] = "ትግርኛ";
164
- $wp_langs["tuk"] = "Türkmençe";
165
  $wp_langs["twd"] = "Twents";
166
- $wp_langs["ug_cn"] = "Uyƣurqə";
167
- $wp_langs["ur"] = "اردو";
168
- $wp_langs["uz_uz"] = "Ozbekcha";
169
- $wp_langs["vi"] = "Tiếng Việt";
170
  $wp_langs["wa"] = "Walon";
171
  $wp_langs["cy"] = "Cymraeg";
172
- $wp_langs["yor"] = "Yorùbá";
173
  $locale = strtolower(get_locale());
174
  if(array_key_exists("$locale",$wp_langs))
175
  {
@@ -351,18 +351,12 @@ else
351
  $mb_back_to_email_logs = __("Back to Email Logs","wp-mail-bank");
352
 
353
  // Settings
354
- $mb_settings_automatic_plugin_update = __("Automatic Plugin Updates", "wp-mail-bank");
355
- $mb_settings_automatic_plugin_update_tooltip = __("Please choose a specific option whether to allow Automatic Plugin Updates", "wp-mail-bank");
356
  $mb_settings_debug_mode = __("Debug Mode","wp-mail-bank");
357
  $mb_settings_debug_mode_tooltip = __("Please choose a specific option for Debug Mode","wp-mail-bank");
358
  $mb_remove_tables_title = __("Remove Tables at Uninstall","wp-mail-bank");
359
  $mb_remove_tables_tooltip = __("Please choose a specific option whether to allow Remove Tables at Uninstall","wp-mail-bank");
360
  $mb_monitoring_email_log_title = __("Monitoring Email Logs","wp-mail-bank");
361
  $mb_monitoring_email_log_tooltip = __("This field is used to allow Email Logs to monitor or not","wp-mail-bank");
362
- $mb_other_settings_error_reporting = __("Error Reporting","wp-mail-bank");
363
- $mbother_settings_error_reporting_tooltip = __("If you would like to Report your Errors in Error Logs Menu, then you would need to Choose Enable from dropdown or vice-versa","wp-mail-bank");
364
-
365
-
366
  // Roles and Capabilities
367
  $mb_roles_capabilities_show_menu = __("Show Mail Bank Menu","wp-mail-bank");
368
  $mb_roles_capabilities_show_menu_tooltip = __("Please choose a specific role who can see Sidebar Menu","wp-mail-bank");
32
  $wp_langs["af"] = "Afrikaans";
33
  $wp_langs["ak"] = "Akan";
34
  $wp_langs["sq"] = "Shqip";
35
+ $wp_langs["arq"] = "??????? ?????????";
36
+ $wp_langs["am"] = "????";
37
+ $wp_langs["hy"] = "???????";
38
+ $wp_langs["rup_mk"] = "Arm�neashce";
39
  $wp_langs["frp"] = "Arpitan";
40
+ $wp_langs["as"] = "???????";
41
  $wp_langs["ast"] = "Asturianu";
42
+ $wp_langs["az"] = "Az?rbaycan dili";
43
+ $wp_langs["az_tr"] = "Az?rbaycan T�rkc?si";
44
+ $wp_langs["bcc"] = "????? ??????";
45
+ $wp_langs["ba"] = "??????? ????";
46
  $wp_langs["eu"] = "Euskara";
47
+ $wp_langs["bel"] = "?????????? ????";
48
+ $wp_langs["bn_bd"] = "?????";
49
  $wp_langs["bs_ba"] = "Bosanski";
50
  $wp_langs["bre"] = "Brezhoneg";
51
+ $wp_langs["bg_bg"] = "?????????";
52
+ $wp_langs["ca"] = "Catal�";
53
+ $wp_langs["bal"] = "Catal� (Balear)";
54
  $wp_langs["ceb"] = "Cebuano";
55
+ $wp_langs["zh_hk"] = "????? ";
56
+ $wp_langs["zh_tw"] = "????";
57
  $wp_langs["co"] = "Corsu";
58
  $wp_langs["hr"] = "Hrvatski";
59
+ $wp_langs["dv"] = "??????";
60
+ $wp_langs["nl_be"] = "Nederlands (Belgi�)";
61
+ $wp_langs["dzo"] = "??????";
62
  $wp_langs["en_ca"] = "English (Canada)";
63
  $wp_langs["en_nz"] = "English (New Zealand)";
64
  $wp_langs["en_za"] = "English (South Africa)";
65
  $wp_langs["eo"] = "Esperanto";
66
  $wp_langs["et"] = "Eesti";
67
+ $wp_langs["fo"] = "F�royskt";
68
  $wp_langs["fi"] = "Suomi";
69
+ $wp_langs["fr_be"] = "Fran�ais de Belgique";
70
+ $wp_langs["fr_ca"] = "Fran�ais du Canada";
71
  $wp_langs["fy"] = "Frysk";
72
  $wp_langs["fur"] = "Friulian";
73
  $wp_langs["fuc"] = "Pulaar";
74
  $wp_langs["gl_es"] = "Galego";
75
+ $wp_langs["ka_ge"] = "???????";
76
  $wp_langs["de_ch"] = "Deutsch (Schweiz)";
77
  $wp_langs["kal"] = "Kalaallisut";
78
+ $wp_langs["gn"] = "Ava�e'?";
79
+ $wp_langs["gu"] = "???????";
80
  $wp_langs["hat"] = "Kreyol ayisyen";
81
+ $wp_langs["haw_us"] = "Olelo Hawai?i";
82
+ $wp_langs["haz"] = "????? ??";
83
+ $wp_langs["hi_in"] = "??????";
84
  $wp_langs["hu_hu"] = "Magyar";
85
+ $wp_langs["is_is"] = "�slenska";
86
  $wp_langs["ido"] = "Ido";
87
  $wp_langs["id_id"] = "Bahasa Indonesia";
88
  $wp_langs["ga"] = "Gaelige";
89
  $wp_langs["it_it"] = "Italiano";
90
+ $wp_langs["ja"] = "???";
91
  $wp_langs["jv_id"] = "Basa Jawa";
92
  $wp_langs["kab"] = "Taqbaylit";
93
+ $wp_langs["kn"] = "?????";
94
+ $wp_langs["kk"] = "????? ????";
95
+ $wp_langs["km"] = "?????????";
96
  $wp_langs["kin"] = "Ikinyarwanda";
97
+ $wp_langs["ky_ky"] = "?????? ????";
98
+ $wp_langs["ko_kr"] = "???";
99
+ $wp_langs["ckb"] = "??????";
100
+ $wp_langs["lo"] = "???????";
101
+ $wp_langs["lv"] = "Latvie�u valoda";
102
  $wp_langs["li"] = "Limburgs";
103
  $wp_langs["lin"] = "Ngala";
104
+ $wp_langs["lt_lt"] = "Lietuviu kalba";
105
+ $wp_langs["lb_lu"] = "L�tzebuergesch";
106
+ $wp_langs["mk_mk"] = "?????????? ?????";
107
  $wp_langs["mg_mg"] = "Malagasy";
108
  $wp_langs["ms_my"] = "Bahasa Melayu";
109
+ $wp_langs["ml_in"] = "??????";
110
+ $wp_langs["mri"] = "Te Reo Maori";
111
+ $wp_langs["mr"] = "?????";
112
+ $wp_langs["xmf"] = "????????? ????";
113
+ $wp_langs["mn"] = "??????";
114
  $wp_langs["me_me"] = "Crnogorski jezik";
115
+ $wp_langs["ary"] = "??????? ????????";
116
+ $wp_langs["my_mm"] = "?????";
117
+ $wp_langs["ne_np"] = "??????";
118
  $wp_langs["nn_no"] = "Norsk nynorsk";
119
  $wp_langs["oci"] = "Occitan";
120
+ $wp_langs["ory"] = "?????";
121
+ $wp_langs["os"] = "????";
122
+ $wp_langs["ps"] = "????";
123
+ $wp_langs["fa_ir"] = "?????";
124
+ $wp_langs["fa_af"] = "(????? (?????????";
125
  $wp_langs["pl_pl"] = "Polski";
126
+ $wp_langs["pa_in"] = "??????";
127
+ $wp_langs["rhg"] = "Ru�inga";
128
  $wp_langs["roh"] = "Rumantsch Vallader";
129
+ $wp_langs["rue"] = "??????????";
130
+ $wp_langs["sah"] = "???????";
131
+ $wp_langs["sa_in"] = "??????";
132
  $wp_langs["srd"] = "Sardu";
133
+ $wp_langs["gd"] = "G�idhlig";
134
+ $wp_langs["sr_rs"] = "?????? ?????";
135
+ $wp_langs["szl"] = "Slonsko godka";
136
+ $wp_langs["snd"] = "????";
137
+ $wp_langs["si_lk"] = "?????";
138
+ $wp_langs["sk_sk"] = "Slovencina";
139
+ $wp_langs["sl_si"] = "Sloven�cina";
140
  $wp_langs["so_so"] = "Afsoomaali";
141
+ $wp_langs["azb"] = "????? ?????????";
142
+ $wp_langs["es_ar"] = "Espa�ol de Argentina";
143
+ $wp_langs["es_cl"] = "Espa�ol de Chile";
144
+ $wp_langs["es_co"] = "Espa�ol de Colombia";
145
+ $wp_langs["es_gt"] = "Espa�ol de Guatemala";
146
+ $wp_langs["es_pe"] = "Espa�ol de Per�";
147
+ $wp_langs["es_pr"] = "Espa�ol de Puerto Rico";
148
+ $wp_langs["es_es"] = "Espa�ol";
149
+ $wp_langs["es_ve"] = "Espa�ol de Venezuela";
150
  $wp_langs["su_id"] = "Basa Sunda";
151
  $wp_langs["sw"] = "Kiswahili";
152
  $wp_langs["sv_se"] = "Svenska";
153
+ $wp_langs["gsw"] = "Schwyzerd�tsch";
154
  $wp_langs["tl"] = "Tagalog";
155
  $wp_langs["tah"] = "Reo Tahiti";
156
+ $wp_langs["tg"] = "??????";
157
+ $wp_langs["tzm"] = "????????";
158
+ $wp_langs["ta_in"] = "?????";
159
+ $wp_langs["ta_lk"] = "?????";
160
+ $wp_langs["tt_ru"] = "????? ????";
161
+ $wp_langs["te"] = "??????";
162
+ $wp_langs["bo"] = "???????";
163
+ $wp_langs["tir"] = "????";
164
+ $wp_langs["tuk"] = "T�rkmen�e";
165
  $wp_langs["twd"] = "Twents";
166
+ $wp_langs["ug_cn"] = "Uy?urq?";
167
+ $wp_langs["ur"] = "????";
168
+ $wp_langs["uz_uz"] = "Ozbekcha";
169
+ $wp_langs["vi"] = "Ti?ng Vi?t";
170
  $wp_langs["wa"] = "Walon";
171
  $wp_langs["cy"] = "Cymraeg";
172
+ $wp_langs["yor"] = "Yor�b�";
173
  $locale = strtolower(get_locale());
174
  if(array_key_exists("$locale",$wp_langs))
175
  {
351
  $mb_back_to_email_logs = __("Back to Email Logs","wp-mail-bank");
352
 
353
  // Settings
 
 
354
  $mb_settings_debug_mode = __("Debug Mode","wp-mail-bank");
355
  $mb_settings_debug_mode_tooltip = __("Please choose a specific option for Debug Mode","wp-mail-bank");
356
  $mb_remove_tables_title = __("Remove Tables at Uninstall","wp-mail-bank");
357
  $mb_remove_tables_tooltip = __("Please choose a specific option whether to allow Remove Tables at Uninstall","wp-mail-bank");
358
  $mb_monitoring_email_log_title = __("Monitoring Email Logs","wp-mail-bank");
359
  $mb_monitoring_email_log_tooltip = __("This field is used to allow Email Logs to monitor or not","wp-mail-bank");
 
 
 
 
360
  // Roles and Capabilities
361
  $mb_roles_capabilities_show_menu = __("Show Mail Bank Menu","wp-mail-bank");
362
  $mb_roles_capabilities_show_menu_tooltip = __("Please choose a specific role who can see Sidebar Menu","wp-mail-bank");
lib/action-library.php CHANGED
@@ -21,8 +21,6 @@ if (!is_user_logged_in()) {
21
  if (!$access_granted) {
22
  return;
23
  } else {
24
- if (!function_exists("get_mail_bank_details_unserialize")) {
25
-
26
  function get_mail_bank_details_unserialize($email_data_manage, $mb_date1, $mb_date2) {
27
  $email_details = array();
28
  foreach ($email_data_manage as $raw_row) {
@@ -34,9 +32,6 @@ if (!is_user_logged_in()) {
34
  }
35
  return $email_details;
36
  }
37
-
38
- }
39
-
40
  if (isset($_REQUEST["param"])) {
41
  $obj_dbHelper_mail_bank = new dbHelper_mail_bank();
42
  switch (esc_attr($_REQUEST["param"])) {
@@ -77,37 +72,20 @@ if (!is_user_logged_in()) {
77
  $plugin_stat_data["extensions"] = get_loaded_extensions();
78
  $plugin_stat_data["plugins"] = $plugin_info_wp_mail_bank->get_plugin_info_wp_mail_bank();
79
  $plugin_stat_data["themes"] = $theme_details;
80
-
81
-
82
- if (function_exists("curl_init")) {
83
- $ch = curl_init();
84
- curl_setopt($ch, CURLOPT_URL, $url);
85
- curl_setopt($ch, CURLOPT_POST, 1);
86
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
87
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
88
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
89
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
90
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")));
91
- $result = curl_exec($ch);
92
- update_option("mb_tech_banker_site_id", $result);
93
- curl_close($ch);
94
- } else {
95
- $response = wp_safe_remote_post($url, array
96
- (
97
- "method" => "POST",
98
- "timeout" => 45,
99
- "redirection" => 5,
100
- "httpversion" => "1.0",
101
- "blocking" => false,
102
- "headers" => array(),
103
- "body" => array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")
104
- ));
105
-
106
- if (!is_wp_error($response)) {
107
- $response["body"] != "" ? update_option("mb_tech_banker_site_id", $response["body"]) : "";
108
- } else {
109
- update_option("mb_tech_banker_site_id", "error");
110
- }
111
  }
112
  }
113
  }
@@ -139,7 +117,7 @@ if (!is_user_logged_in()) {
139
  }
140
  $phpmailer->SMTPDebug = true;
141
 
142
- $to = esc_attr($form_data["ux_txt_email"]);
143
  $subject = stripcslashes(htmlspecialchars_decode($form_data["ux_txt_subject"], ENT_QUOTES));
144
  $message = htmlspecialchars_decode(!empty($form_data["ux_email_configuration_text_area"]) ? esc_attr($form_data["ux_email_configuration_text_area"]) : "This is a demo Test Email for Email Setup - Mail Bank");
145
  $headers = "Content-Type: text/html; charset= utf-8" . "\r\n";
@@ -164,10 +142,12 @@ if (!is_user_logged_in()) {
164
  );
165
  $settings_data_array = unserialize($settings_data);
166
  $debugging_output = "";
 
167
 
168
- if ($unserialized_email_configuration_data["mailer_type"] == "smtp") {
169
  $mail_bank_mail_status = get_option("mail_bank_mail_status");
170
- if ($settings_data_array["debug_mode"] == "enable") {
 
171
  $debugging_output .= $mb_email_configuration_send_test_email_textarea . "\n";
172
  $debugging_output .= $mb_test_email_sending_test_email . " " . $to . "\n";
173
  $debugging_output .= $mb_test_email_status . " : ";
@@ -183,10 +163,10 @@ if (!is_user_logged_in()) {
183
 
184
  $email_logs_data_array = array();
185
  $email_logs_data_array["email_to"] = $to_address[0][0];
186
-
187
- if ($settings_data_array["monitor_email_logs"] == "enable") {
188
- $email_logs_data_array["sender_name"] = $unserialized_email_configuration_data["sender_name"];
189
- $email_logs_data_array["sender_email"] = $unserialized_email_configuration_data["sender_email"];
190
  $email_logs_data_array["cc"] = "";
191
  $email_logs_data_array["bcc"] = "";
192
  $email_logs_data_array["subject"] = $phpmailer->Subject;
@@ -223,12 +203,9 @@ if (!is_user_logged_in()) {
223
  parse_str(isset($_REQUEST["data"]) ? base64_decode($_REQUEST["data"]) : "", $settings_array);
224
 
225
  $settings_data = array();
226
- $settings_data["automatic_plugin_update"] = esc_attr($settings_array["ux_ddl_automatic_plugin_updates"]);
227
  $settings_data["debug_mode"] = esc_attr($settings_array["ux_ddl_debug_mode"]);
228
  $settings_data["remove_tables_at_uninstall"] = esc_attr($settings_array["ux_ddl_remove_tables"]);
229
  $settings_data["monitor_email_logs"] = esc_attr($settings_array["ux_ddl_monitor_email_logs"]);
230
- $settings_data["error_reporting"] = esc_attr($settings_array["ux_ddl_error_reporting"]);
231
-
232
  $where = array();
233
  $settings_data_array = array();
234
  $where["meta_key"] = "settings";
@@ -269,7 +246,7 @@ if (!is_user_logged_in()) {
269
  )
270
  );
271
  $email_configuration_array = unserialize($email_configuration_data);
272
- $update_email_configuration_array["password"] = $email_configuration_array["password"];
273
  } else {
274
  $update_email_configuration_array["password"] = base64_encode(esc_html($form_data["ux_txt_password"]));
275
  }
@@ -304,9 +281,6 @@ if (!is_user_logged_in()) {
304
 
305
  case "error_logs_module":
306
  if (wp_verify_nonce(isset($_REQUEST["_wp_nonce"]) ? esc_attr($_REQUEST["_wp_nonce"]) : "", "clear_error_logs_nonce")) {
307
- if (file_exists(MAIL_BANK_ERROR_LOGS_FILE)) {
308
- file_put_contents(MAIL_BANK_ERROR_LOGS_FILE, "");
309
- }
310
  }
311
  break;
312
 
21
  if (!$access_granted) {
22
  return;
23
  } else {
 
 
24
  function get_mail_bank_details_unserialize($email_data_manage, $mb_date1, $mb_date2) {
25
  $email_details = array();
26
  foreach ($email_data_manage as $raw_row) {
32
  }
33
  return $email_details;
34
  }
 
 
 
35
  if (isset($_REQUEST["param"])) {
36
  $obj_dbHelper_mail_bank = new dbHelper_mail_bank();
37
  switch (esc_attr($_REQUEST["param"])) {
72
  $plugin_stat_data["extensions"] = get_loaded_extensions();
73
  $plugin_stat_data["plugins"] = $plugin_info_wp_mail_bank->get_plugin_info_wp_mail_bank();
74
  $plugin_stat_data["themes"] = $theme_details;
75
+
76
+ $response = wp_safe_remote_post($url, array
77
+ (
78
+ "method" => "POST",
79
+ "timeout" => 45,
80
+ "redirection" => 5,
81
+ "httpversion" => "1.0",
82
+ "blocking" => false,
83
+ "headers" => array(),
84
+ "body" => array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")
85
+ ));
86
+
87
+ if (!is_wp_error($response)) {
88
+ $response["body"] != "" ? update_option("mb_tech_banker_site_id", $response["body"]) : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
  }
91
  }
117
  }
118
  $phpmailer->SMTPDebug = true;
119
 
120
+ $to = isset($form_data["ux_txt_email"]) ? esc_attr($form_data["ux_txt_email"]) :"";
121
  $subject = stripcslashes(htmlspecialchars_decode($form_data["ux_txt_subject"], ENT_QUOTES));
122
  $message = htmlspecialchars_decode(!empty($form_data["ux_email_configuration_text_area"]) ? esc_attr($form_data["ux_email_configuration_text_area"]) : "This is a demo Test Email for Email Setup - Mail Bank");
123
  $headers = "Content-Type: text/html; charset= utf-8" . "\r\n";
142
  );
143
  $settings_data_array = unserialize($settings_data);
144
  $debugging_output = "";
145
+ $mailer_type_mail_bank = isset($unserialized_email_configuration_data["mailer_type"]) ? esc_attr($unserialized_email_configuration_data["mailer_type"]) :"";
146
 
147
+ if ($mailer_type_mail_bank == "smtp") {
148
  $mail_bank_mail_status = get_option("mail_bank_mail_status");
149
+ $debug_mode_mail_bank = isset($settings_data_array["debug_mode"]) ? esc_attr($settings_data_array["debug_mode"]) :"";
150
+ if ($debug_mode_mail_bank == "enable") {
151
  $debugging_output .= $mb_email_configuration_send_test_email_textarea . "\n";
152
  $debugging_output .= $mb_test_email_sending_test_email . " " . $to . "\n";
153
  $debugging_output .= $mb_test_email_status . " : ";
163
 
164
  $email_logs_data_array = array();
165
  $email_logs_data_array["email_to"] = $to_address[0][0];
166
+ $monitor_email_logs = isset($settings_data_array["monitor_email_logs"]) ? esc_attr($settings_data_array["monitor_email_logs"]) :"";
167
+ if ($monitor_email_logs == "enable") {
168
+ $email_logs_data_array["sender_name"] = isset($unserialized_email_configuration_data["sender_name"]) ? esc_attr($unserialized_email_configuration_data["sender_name"]) :"";
169
+ $email_logs_data_array["sender_email"] = isset($unserialized_email_configuration_data["sender_email"]) ? esc_attr($unserialized_email_configuration_data["sender_email"]) :"";
170
  $email_logs_data_array["cc"] = "";
171
  $email_logs_data_array["bcc"] = "";
172
  $email_logs_data_array["subject"] = $phpmailer->Subject;
203
  parse_str(isset($_REQUEST["data"]) ? base64_decode($_REQUEST["data"]) : "", $settings_array);
204
 
205
  $settings_data = array();
 
206
  $settings_data["debug_mode"] = esc_attr($settings_array["ux_ddl_debug_mode"]);
207
  $settings_data["remove_tables_at_uninstall"] = esc_attr($settings_array["ux_ddl_remove_tables"]);
208
  $settings_data["monitor_email_logs"] = esc_attr($settings_array["ux_ddl_monitor_email_logs"]);
 
 
209
  $where = array();
210
  $settings_data_array = array();
211
  $where["meta_key"] = "settings";
246
  )
247
  );
248
  $email_configuration_array = unserialize($email_configuration_data);
249
+ $update_email_configuration_array["password"] =isset($email_configuration_array["password"]) ? esc_attr($email_configuration_array["password"]) :"";
250
  } else {
251
  $update_email_configuration_array["password"] = base64_encode(esc_html($form_data["ux_txt_password"]));
252
  }
281
 
282
  case "error_logs_module":
283
  if (wp_verify_nonce(isset($_REQUEST["_wp_nonce"]) ? esc_attr($_REQUEST["_wp_nonce"]) : "", "clear_error_logs_nonce")) {
 
 
 
284
  }
285
  break;
286
 
lib/admin-bar-menu.php CHANGED
@@ -42,7 +42,7 @@ else
42
  );
43
 
44
  $roles_and_capabilities_unserialized_data = unserialize($role_capabilities);
45
- $capabilities = explode(",",$roles_and_capabilities_unserialized_data["roles_and_capabilities"]);
46
 
47
  if(is_super_admin())
48
  {
42
  );
43
 
44
  $roles_and_capabilities_unserialized_data = unserialize($role_capabilities);
45
+ $capabilities = explode(",", isset($roles_and_capabilities_unserialized_data["roles_and_capabilities"]) ? esc_attr($roles_and_capabilities_unserialized_data["roles_and_capabilities"]) :"");
46
 
47
  if(is_super_admin())
48
  {
lib/callback.php CHANGED
@@ -7,7 +7,7 @@
7
  * @version 2.0.0
8
  */
9
  if(!defined("ABSPATH")) exit; // Exit if accessed directly
10
- $code = $_REQUEST["code"];
11
  $url = admin_url("admin.php?page=mb_email_configuration&access_token=$code");
12
  header("location: $url");
13
  ?>
7
  * @version 2.0.0
8
  */
9
  if(!defined("ABSPATH")) exit; // Exit if accessed directly
10
+ $code = isset($_REQUEST["code"]) ? esc_attr($_REQUEST["code"]) :"";
11
  $url = admin_url("admin.php?page=mb_email_configuration&access_token=$code");
12
  header("location: $url");
13
  ?>
lib/helper.php CHANGED
@@ -37,89 +37,88 @@ else
37
  Created By: Tech Banker Team
38
  */
39
 
40
- if(!class_exists("dbHelper_mail_bank"))
41
- {
42
- class dbHelper_mail_bank
43
- {
44
- /*
45
- Function Name: insertCommand
46
- Parameters: Yes($table_name,$data)
47
- Description: This Function is used for Insert data in database.
48
- Created On: 15-06-2016 10:43
49
- Created By: Tech Banker Team
50
- */
51
-
52
- function insertCommand($table_name,$data)
53
- {
54
- global $wpdb;
55
- $wpdb->insert($table_name,$data);
56
- return $wpdb->insert_id;
57
- }
58
-
59
- /*
60
- Function Name: updateCommand
61
- Parameters: Yes($table_name,$data,$where)
62
- Description: This function is used for Update data in database.
63
- Created On: 15-06-2016 10:43
64
- Created By: Tech Banker Team
65
- */
66
-
67
- function updateCommand($table_name,$data,$where)
68
- {
69
- global $wpdb;
70
- $wpdb->update($table_name,$data,$where);
71
- }
72
-
73
- /*
74
- Function Name: deleteCommand
75
- Parameters: Yes($table_name,$where)
76
- Description: This function is used for delete data from database.
77
- Created On: 15-06-2016 10:43
78
- Created By: Tech Banker Team
79
- */
80
-
81
- function deleteCommand($table_name,$where)
82
- {
83
- global $wpdb;
84
- $wpdb->delete($table_name,$where);
85
- }
86
-
87
- /*
88
- Function Name: file_reader
89
- Parameters: Yes($filepath)
90
- Description: This function is used to read file contents
91
- Created On: 18-01-2017 11:24
92
- Created By: Tech Banker Team
93
- */
94
-
95
- public static function file_reader($filepath)
96
- {
97
- $reader = "";
98
- if(file_exists($filepath))
99
- {
100
- $reader = file_get_contents($filepath);
101
- }
102
- return $reader;
103
- }
104
-
105
- /*
106
- Function Name: bulk_deleteCommand
107
- Parameters: Yes($table_name,$data,$where)
108
- Decription: This function is being used to delete multiple data from database.
109
- Created On: 15-06-2016 10:43
110
- Created By: Tech Banker Team
111
- */
112
-
113
- function bulk_deleteCommand($table_name,$where,$data)
114
- {
115
- global $wpdb;
116
- $wpdb->query
117
- (
118
- "DELETE FROM $table_name WHERE $where IN ($data)"
119
- );
120
- }
121
- }
122
- }
123
 
124
  /*
125
  Class Name: mail_bank_discover_host
@@ -129,125 +128,120 @@ else
129
  Created By: Tech Banker Team
130
  */
131
 
132
- if(!class_exists("mail_bank_discover_host"))
133
- {
134
- class mail_bank_discover_host
135
- {
136
- public $domain;
137
- public $email_domains = array (
138
- "1and1.com" => "smtp.1and1.com",
139
- "airmail.net" => "smtp.airmail.net",
140
- "aol.com" => "smtp.aol.com",
141
- "Bluewin.ch" => "Smtpauths.bluewin.ch",
142
- "Comcast.net" => "Smtp.comcast.net",
143
- "Earthlink.net" => "Smtpauth.earthlink.net",
144
- "gmail.com" => "smtp.gmail.com",
145
- "Gmx.com" => "mail.gmx.com",
146
- "Gmx.net" => "mail.gmx.com",
147
- "Gmx.us" => "mail.gmx.com",
148
- "hotmail.com" => "smtp.live.com",
149
- "outlook.com" => "smtp.live.com",
150
- "icloud.com" => "smtp.mail.me.com",
151
- "mail.com" => "smtp.mail.com",
152
- "ntlworld.com" => "smtp.ntlworld.com",
153
- "rocketmail.com" => "smtp.mail.yahoo.com",
154
- "rogers.com" => "smtp.broadband.rogers.com",
155
- "yahoo.ca" => "smtp.mail.yahoo.ca",
156
- "yahoo.co.id" => "smtp.mail.yahoo.co.id",
157
- "yahoo.co.in" => "smtp.mail.yahoo.co.in",
158
- "yahoo.co.kr" => "smtp.mail.yahoo.com",
159
- "yahoo.com" => "smtp.mail.yahoo.com",
160
- "yahoo.com.ar" => "smtp.mail.yahoo.com.ar",
161
- "yahoo.com.au" => "smtp.mail.yahoo.com.au",
162
- "yahoo.com.br" => "smtp.mail.yahoo.com.br",
163
- "yahoo.com.cn" => "smtp.mail.yahoo.com.cn",
164
- "yahoo.com.hk" => "smtp.mail.yahoo.com.hk",
165
- "yahoo.com.mx" => "smtp.mail.yahoo.com",
166
- "yahoo.com.my" => "smtp.mail.yahoo.com.my",
167
- "yahoo.com.ph" => "smtp.mail.yahoo.com.ph",
168
- "yahoo.com.sg" => "smtp.mail.yahoo.com.sg",
169
- "yahoo.com.tw" => "smtp.mail.yahoo.com.tw",
170
- "yahoo.com.vn" => "smtp.mail.yahoo.com.vn",
171
- "yahoo.co.nz" => "smtp.mail.yahoo.com.au",
172
- "yahoo.co.th" => "smtp.mail.yahoo.co.th",
173
- "yahoo.co.uk" => "smtp.mail.yahoo.co.uk",
174
- "ymail.com" => "smtp.mail.yahoo.com",
175
- "yahoo.de" => "smtp.mail.yahoo.de",
176
- "yahoo.es" => "smtp.correo.yahoo.es",
177
- "yahoo.fr" => "smtp.mail.yahoo.fr",
178
- "yahoo.ie" => "smtp.mail.yahoo.co.uk",
179
- "yahoo.it" => "smtp.mail.yahoo.it",
180
- "zoho.com" => "smtp.zoho.com",
181
- "ameritech.net" => "outbound.att.net",
182
- "att.net" => "outbound.att.net",
183
- "bellsouth.net" => "outbound.att.net",
184
- "flash.net" => "outbound.att.net",
185
- "nvbell.net" => "outbound.att.net",
186
- "pacbell.net" => "outbound.att.net",
187
- "prodigy.net" => "outbound.att.net",
188
- "sbcglobal.net" => "outbound.att.net",
189
- "snet.net" => "outbound.att.net",
190
- "swbell.net" => "outbound.att.net",
191
- "wans.net" => "outbound.att.net"
192
- );
193
-
194
- /*
195
- Function Name: get_smtp_from_email
196
- Parameters: Yes($hostname)
197
- Description: This Function is used for getting hostname.
198
- Created On: 15-06-2016 10:43
199
- Created By: Tech Banker Team
200
- */
201
- public function get_smtp_from_email($hostname)
202
- {
203
- reset($this->email_domains);
204
- while(list($domain,$smtp) = each($this->email_domains))
205
- {
206
- if(strcasecmp($hostname,$domain) == 0)
207
- {
208
- return $smtp;
209
- }
210
- }
211
- return false;
212
- }
213
- }
214
- }
215
 
216
- if(!class_exists("plugin_info_wp_mail_bank"))
217
- {
218
- class plugin_info_wp_mail_bank
219
- {
220
- /*
221
- Function Name: get_plugin_info_wp_mail_bank
222
- Parameters: No
223
- Decription: This function is used to return the information about plugins.
224
- Created On: 21-04-2017 09:48
225
- Created By: Tech Banker Team
226
- */
227
-
228
- function get_plugin_info_wp_mail_bank()
229
- {
230
- $active_plugins = (array)get_option("active_plugins", array());
231
- if (is_multisite())
232
- $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
233
- $plugins = array();
234
- if(count($active_plugins) > 0)
235
- {
236
- $get_plugins = array();
237
- foreach($active_plugins as $plugin)
238
- {
239
- $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
240
-
241
- $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
242
- $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
243
- $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
244
- array_push($plugins,$get_plugins);
245
- }
246
- return $plugins;
247
- }
248
- }
249
- }
250
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
252
  }
253
  ?>
37
  Created By: Tech Banker Team
38
  */
39
 
40
+
41
+ class dbHelper_mail_bank
42
+ {
43
+ /*
44
+ Function Name: insertCommand
45
+ Parameters: Yes($table_name,$data)
46
+ Description: This Function is used for Insert data in database.
47
+ Created On: 15-06-2016 10:43
48
+ Created By: Tech Banker Team
49
+ */
50
+
51
+ function insertCommand($table_name,$data)
52
+ {
53
+ global $wpdb;
54
+ $wpdb->insert($table_name,$data);
55
+ return $wpdb->insert_id;
56
+ }
57
+
58
+ /*
59
+ Function Name: updateCommand
60
+ Parameters: Yes($table_name,$data,$where)
61
+ Description: This function is used for Update data in database.
62
+ Created On: 15-06-2016 10:43
63
+ Created By: Tech Banker Team
64
+ */
65
+
66
+ function updateCommand($table_name,$data,$where)
67
+ {
68
+ global $wpdb;
69
+ $wpdb->update($table_name,$data,$where);
70
+ }
71
+
72
+ /*
73
+ Function Name: deleteCommand
74
+ Parameters: Yes($table_name,$where)
75
+ Description: This function is used for delete data from database.
76
+ Created On: 15-06-2016 10:43
77
+ Created By: Tech Banker Team
78
+ */
79
+
80
+ function deleteCommand($table_name,$where)
81
+ {
82
+ global $wpdb;
83
+ $wpdb->delete($table_name,$where);
84
+ }
85
+
86
+ /*
87
+ Function Name: file_reader
88
+ Parameters: Yes($filepath)
89
+ Description: This function is used to read file contents
90
+ Created On: 18-01-2017 11:24
91
+ Created By: Tech Banker Team
92
+ */
93
+
94
+ public static function file_reader($filepath)
95
+ {
96
+ $reader = "";
97
+ if(file_exists($filepath))
98
+ {
99
+ $reader = file_get_contents($filepath);
100
+ }
101
+ return $reader;
102
+ }
103
+
104
+ /*
105
+ Function Name: bulk_deleteCommand
106
+ Parameters: Yes($table_name,$data,$where)
107
+ Decription: This function is being used to delete multiple data from database.
108
+ Created On: 15-06-2016 10:43
109
+ Created By: Tech Banker Team
110
+ */
111
+
112
+ function bulk_deleteCommand($table_name,$where,$data)
113
+ {
114
+ global $wpdb;
115
+ $wpdb->query
116
+ (
117
+ "DELETE FROM $table_name WHERE $where IN ($data)"
118
+ );
119
+ }
120
+ }
121
+
 
122
 
123
  /*
124
  Class Name: mail_bank_discover_host
128
  Created By: Tech Banker Team
129
  */
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
+ class mail_bank_discover_host
133
+ {
134
+ public $domain;
135
+ public $email_domains = array (
136
+ "1and1.com" => "smtp.1and1.com",
137
+ "airmail.net" => "smtp.airmail.net",
138
+ "aol.com" => "smtp.aol.com",
139
+ "Bluewin.ch" => "Smtpauths.bluewin.ch",
140
+ "Comcast.net" => "Smtp.comcast.net",
141
+ "Earthlink.net" => "Smtpauth.earthlink.net",
142
+ "gmail.com" => "smtp.gmail.com",
143
+ "Gmx.com" => "mail.gmx.com",
144
+ "Gmx.net" => "mail.gmx.com",
145
+ "Gmx.us" => "mail.gmx.com",
146
+ "hotmail.com" => "smtp.live.com",
147
+ "outlook.com" => "smtp.live.com",
148
+ "icloud.com" => "smtp.mail.me.com",
149
+ "mail.com" => "smtp.mail.com",
150
+ "ntlworld.com" => "smtp.ntlworld.com",
151
+ "rocketmail.com" => "smtp.mail.yahoo.com",
152
+ "rogers.com" => "smtp.broadband.rogers.com",
153
+ "yahoo.ca" => "smtp.mail.yahoo.ca",
154
+ "yahoo.co.id" => "smtp.mail.yahoo.co.id",
155
+ "yahoo.co.in" => "smtp.mail.yahoo.co.in",
156
+ "yahoo.co.kr" => "smtp.mail.yahoo.com",
157
+ "yahoo.com" => "smtp.mail.yahoo.com",
158
+ "yahoo.com.ar" => "smtp.mail.yahoo.com.ar",
159
+ "yahoo.com.au" => "smtp.mail.yahoo.com.au",
160
+ "yahoo.com.br" => "smtp.mail.yahoo.com.br",
161
+ "yahoo.com.cn" => "smtp.mail.yahoo.com.cn",
162
+ "yahoo.com.hk" => "smtp.mail.yahoo.com.hk",
163
+ "yahoo.com.mx" => "smtp.mail.yahoo.com",
164
+ "yahoo.com.my" => "smtp.mail.yahoo.com.my",
165
+ "yahoo.com.ph" => "smtp.mail.yahoo.com.ph",
166
+ "yahoo.com.sg" => "smtp.mail.yahoo.com.sg",
167
+ "yahoo.com.tw" => "smtp.mail.yahoo.com.tw",
168
+ "yahoo.com.vn" => "smtp.mail.yahoo.com.vn",
169
+ "yahoo.co.nz" => "smtp.mail.yahoo.com.au",
170
+ "yahoo.co.th" => "smtp.mail.yahoo.co.th",
171
+ "yahoo.co.uk" => "smtp.mail.yahoo.co.uk",
172
+ "ymail.com" => "smtp.mail.yahoo.com",
173
+ "yahoo.de" => "smtp.mail.yahoo.de",
174
+ "yahoo.es" => "smtp.correo.yahoo.es",
175
+ "yahoo.fr" => "smtp.mail.yahoo.fr",
176
+ "yahoo.ie" => "smtp.mail.yahoo.co.uk",
177
+ "yahoo.it" => "smtp.mail.yahoo.it",
178
+ "zoho.com" => "smtp.zoho.com",
179
+ "ameritech.net" => "outbound.att.net",
180
+ "att.net" => "outbound.att.net",
181
+ "bellsouth.net" => "outbound.att.net",
182
+ "flash.net" => "outbound.att.net",
183
+ "nvbell.net" => "outbound.att.net",
184
+ "pacbell.net" => "outbound.att.net",
185
+ "prodigy.net" => "outbound.att.net",
186
+ "sbcglobal.net" => "outbound.att.net",
187
+ "snet.net" => "outbound.att.net",
188
+ "swbell.net" => "outbound.att.net",
189
+ "wans.net" => "outbound.att.net"
190
+ );
191
+
192
+ /*
193
+ Function Name: get_smtp_from_email
194
+ Parameters: Yes($hostname)
195
+ Description: This Function is used for getting hostname.
196
+ Created On: 15-06-2016 10:43
197
+ Created By: Tech Banker Team
198
+ */
199
+ public function get_smtp_from_email($hostname)
200
+ {
201
+ reset($this->email_domains);
202
+ while(list($domain,$smtp) = each($this->email_domains))
203
+ {
204
+ if(strcasecmp($hostname,$domain) == 0)
205
+ {
206
+ return $smtp;
207
+ }
208
+ }
209
+ return false;
210
+ }
211
+ }
212
+
213
+ class plugin_info_wp_mail_bank
214
+ {
215
+ /*
216
+ Function Name: get_plugin_info_wp_mail_bank
217
+ Parameters: No
218
+ Decription: This function is used to return the information about plugins.
219
+ Created On: 21-04-2017 09:48
220
+ Created By: Tech Banker Team
221
+ */
222
+
223
+ function get_plugin_info_wp_mail_bank()
224
+ {
225
+ $active_plugins = (array)get_option("active_plugins", array());
226
+ if (is_multisite())
227
+ $active_plugins = array_merge($active_plugins, get_site_option("active_sitewide_plugins", array()));
228
+ $plugins = array();
229
+ if(count($active_plugins) > 0)
230
+ {
231
+ $get_plugins = array();
232
+ foreach($active_plugins as $plugin)
233
+ {
234
+ $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . "/" . $plugin);
235
+
236
+ $get_plugins["plugin_name"] = strip_tags($plugin_data["Name"]);
237
+ $get_plugins["plugin_author"] = strip_tags($plugin_data["Author"]);
238
+ $get_plugins["plugin_version"] = strip_tags($plugin_data["Version"]);
239
+ array_push($plugins,$get_plugins);
240
+ }
241
+ return $plugins;
242
+ }
243
+ }
244
+ }
245
  }
246
  }
247
  ?>
lib/install-script.php CHANGED
@@ -28,182 +28,172 @@ else
28
  Created By: Tech Banker Team
29
  */
30
 
31
- if(!class_exists("dbHelper_install_script_mail_bank"))
32
- {
33
- class dbHelper_install_script_mail_bank
34
- {
35
- /*
36
- Function Name: insertCommand
37
- Parameters: Yes($table_name,$data)
38
- Description: This Function is used to Insert data in database.
39
- Created On: 05-02-2016 11:40
40
- Created By: Tech Banker Team
41
- */
42
-
43
- function insertCommand($table_name,$data)
44
- {
45
- global $wpdb;
46
- $wpdb->insert($table_name,$data);
47
- return $wpdb->insert_id;
48
- }
49
 
50
- /*
51
- Function Name: updateCommand
52
- Parameters: Yes($table_name,$data,$where)
53
- Description: This function is used to Update data.
54
- Created On: 05-02-2016 11:40
55
- Created By: Tech Banker Team
56
- */
57
-
58
- function updateCommand($table_name,$data,$where)
59
- {
60
- global $wpdb;
61
- $wpdb->update($table_name,$data,$where);
62
- }
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  if(file_exists(ABSPATH ."wp-admin/includes/upgrade.php"))
67
  require_once ABSPATH ."wp-admin/includes/upgrade.php";
68
 
69
  $mail_bank_version_number = get_option("mail-bank-version-number");
70
 
71
- if(!function_exists("mail_bank_table"))
72
- {
73
- function mail_bank_table()
74
- {
75
- $sql = "CREATE TABLE IF NOT EXISTS ".mail_bank()."
76
- (
77
- `id` int(11) NOT NULL AUTO_INCREMENT,
78
- `type` varchar(100) NOT NULL,
79
- `parent_id` int(11) NOT NULL,
80
- PRIMARY KEY (`id`)
81
- )
82
- ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
83
- dbDelta($sql);
84
-
85
- $data = "INSERT INTO ". mail_bank() ." (`type`, `parent_id`) VALUES
86
- ('email_configuration', 0),
87
- ('email_logs', 0),
88
- ('settings', 0),
89
- ('roles_and_capabilities', 0)";
90
- dbDelta($data);
91
- }
92
- }
93
-
94
- if(!function_exists("mail_bank_meta_table"))
95
- {
96
- function mail_bank_meta_table()
97
- {
98
- $obj_dbHelper_install_script_mail_bank = new dbHelper_install_script_mail_bank();
99
- global $wpdb;
100
- $sql = "CREATE TABLE IF NOT EXISTS ".mail_bank_meta()."
101
- (
102
- `id` int(11) NOT NULL AUTO_INCREMENT,
103
- `meta_id` int(11) NOT NULL,
104
- `meta_key` varchar(255) NOT NULL,
105
- `meta_value` longtext NOT NULL,
106
- PRIMARY KEY (`id`)
107
- )
108
- ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
109
- dbDelta($sql);
110
-
111
- $admin_email = get_option("admin_email");
112
- $admin_name = get_option("blogname");
113
-
114
- $mail_bank_table_data = $wpdb->get_results
115
- (
116
- "SELECT * FROM " .mail_bank()
117
- );
118
-
119
- foreach($mail_bank_table_data as $row)
120
- {
121
- switch($row->type)
122
- {
123
- case "email_configuration":
124
- $email_configuration_array = array();
125
- $email_configuration_array["email_address"] = $admin_email;
126
- $email_configuration_array["reply_to"] = "";
127
- $email_configuration_array["cc"] = "";
128
- $email_configuration_array["bcc"] = "";
129
- $email_configuration_array["mailer_type"] = "smtp";
130
- $email_configuration_array["sender_name"] = $admin_name;
131
- $email_configuration_array["sender_name_configuration"] = "override";
132
- $email_configuration_array["hostname"] = "";
133
- $email_configuration_array["port"] = "587";
134
- $email_configuration_array["client_id"] = "";
135
- $email_configuration_array["client_secret"] = "";
136
- $email_configuration_array["redirect_uri"] = "";
137
- $email_configuration_array["sender_email"] = $admin_email;
138
- $email_configuration_array["from_email_configuration"] = "override";
139
- $email_configuration_array["auth_type"] = "none";
140
- $email_configuration_array["username"] = $admin_email;
141
- $email_configuration_array["password"] = "";
142
- $email_configuration_array["enc_type"] = "tls";
143
-
144
- $email_configuration_array_data = array();
145
- $email_configuration_array_data["meta_id"] = $row->id;
146
- $email_configuration_array_data["meta_key"] = "email_configuration";
147
- $email_configuration_array_data["meta_value"] = serialize($email_configuration_array);
148
- $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$email_configuration_array_data);
149
- break;
150
-
151
- case "settings":
152
- $settings_data_array = array();
153
- $settings_data_array["automatic_plugin_update"] = "disable";
154
- $settings_data_array["debug_mode"] = "enable";
155
- $settings_data_array["remove_tables_at_uninstall"] = "enable";
156
- $settings_data_array["monitor_email_logs"] = "enable";
157
- $settings_data_array["error_reporting"] = "enable";
158
-
159
- $settings_array = array();
160
- $settings_array["meta_id"] = $row->id;
161
- $settings_array["meta_key"] = "settings";
162
- $settings_array["meta_value"] = serialize($settings_data_array);
163
- $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$settings_array);
164
- break;
165
-
166
- case "roles_and_capabilities":
167
- $roles_capabilities_data_array = array();
168
- $roles_capabilities_data_array["roles_and_capabilities"] = "1,1,1,0,0,0";
169
- $roles_capabilities_data_array["show_mail_bank_top_bar_menu"] = "enable";
170
- $roles_capabilities_data_array["others_full_control_capability"] = "0";
171
- $roles_capabilities_data_array["administrator_privileges"] = "1,1,1,1,1,1,1,1,1,1";
172
- $roles_capabilities_data_array["author_privileges"] = "0,0,1,0,0,0,0,0,0,0";
173
- $roles_capabilities_data_array["editor_privileges"] = "0,0,1,0,0,0,1,0,0,0";
174
- $roles_capabilities_data_array["contributor_privileges"] = "0,0,0,0,0,0,1,0,0,0";
175
- $roles_capabilities_data_array["subscriber_privileges"] = "0,0,0,0,0,0,0,0,0,0";
176
- $roles_capabilities_data_array["other_roles_privileges"] = "0,0,0,0,0,0,0,0,0,0";
177
- $user_capabilities = get_others_capabilities_mail_bank();
178
- $other_roles_array = array();
179
- $other_roles_access_array = array(
180
- "manage_options",
181
- "edit_plugins",
182
- "edit_posts",
183
- "publish_posts",
184
- "publish_pages",
185
- "edit_pages",
186
- "read"
187
- );
188
- foreach($other_roles_access_array as $role)
189
- {
190
- if(in_array($role,$user_capabilities))
191
- {
192
- array_push($other_roles_array,$role);
193
- }
194
- }
195
- $roles_capabilities_data_array["capabilities"] = $other_roles_array;
196
-
197
- $roles_data_array = array();
198
- $roles_data_array["meta_id"] = $row->id;
199
- $roles_data_array["meta_key"] = "roles_and_capabilities";
200
- $roles_data_array["meta_value"] = serialize($roles_capabilities_data_array);
201
- $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$roles_data_array);
202
- break;
203
- }
204
- }
205
- }
206
- }
207
 
208
  $obj_dbHelper_install_script_mail_bank = new dbHelper_install_script_mail_bank();
209
  switch($mail_bank_version_number)
@@ -234,15 +224,15 @@ else
234
  $update_mail_bank_data["sender_name_configuration"] = isset($get_from_name) && $get_from_name == 1 ? "override" : "dont_override";
235
  $update_mail_bank_data["sender_name"] = isset($mail_bank_data->from_name) ? esc_html($mail_bank_data->from_name) : esc_html(get_option("blogname"));
236
  $update_mail_bank_data["from_email_configuration"] = isset($get_from_email) && $get_from_email == 1 ? "override" : "dont_override";
237
- $update_mail_bank_data["sender_email"] = isset($mail_bank_data->from_email) ? $mail_bank_data->from_email : get_option("admin_email");
238
- $update_mail_bank_data["hostname"] = isset($mail_bank_data->smtp_host) ? $mail_bank_data->smtp_host : "";
239
- $update_mail_bank_data["port"] = isset($mail_bank_data->smtp_port) ? $mail_bank_data->smtp_port : "";
240
  $update_mail_bank_data["enc_type"] = isset($mail_bank_data->encryption) && (($mail_bank_data->encryption) == 0) ? "none" : ((($mail_bank_data->encryption) == 1) ? "ssl" : "tls");
241
  $update_mail_bank_data["auth_type"] = "login";
242
  $update_mail_bank_data["client_id"] = "";
243
  $update_mail_bank_data["client_secret"] = "";
244
  $update_mail_bank_data["redirect_uri"] = "";
245
- $update_mail_bank_data["username"] = isset($mail_bank_data->smtp_username) ? $mail_bank_data->smtp_username : "";
246
  $update_mail_bank_data["password"] = isset($mail_bank_data->smtp_password) ? base64_encode($mail_bank_data->smtp_password) : "";
247
  $update_mail_bank_data["automatic_mail"] = "1";
248
 
@@ -253,8 +243,6 @@ else
253
  $update_mail_bank_data_serialize["meta_value"] = serialize($update_mail_bank_data);
254
  $obj_dbHelper_install_script_mail_bank->updateCommand(mail_bank_meta(),$update_mail_bank_data_serialize,$where);
255
  }
256
-
257
- $get_automatic_update_option = get_option("mail-bank-automatic-update");
258
  $plugin_settings_data = $wpdb->get_var
259
  (
260
  $wpdb->prepare
@@ -267,10 +255,9 @@ else
267
  $plugin_settings_data_unserialize = unserialize($plugin_settings_data);
268
 
269
  $update_plugin_data = array();
270
- $update_plugin_data["automatic_plugin_update"] = isset($get_automatic_update_option) && $get_automatic_update_option == 1 ? "enable" : "disable";
271
- $update_plugin_data["debug_mode"] = isset($plugin_settings_data_unserialize["debug_mode"]) ? $plugin_settings_data_unserialize["debug_mode"] : "enable";
272
- $update_plugin_data["remove_tables_at_uninstall"] = isset($plugin_settings_data_unserialize["remove_tables_at_uninstall"]) ? $plugin_settings_data_unserialize["remove_tables_at_uninstall"] : "disable";
273
- $update_plugin_data["monitor_email_logs"] = isset($plugin_settings_data_unserialize["monitor_email_logs"]) ? $plugin_settings_data_unserialize["monitor_email_logs"] : "enable";
274
 
275
  $update_plugin_settings_data_serialize = array();
276
  $where = array();
@@ -299,10 +286,6 @@ else
299
  );
300
 
301
  $settings_data_array = unserialize($settings_data);
302
- if(!isset($settings_data_array["error_reporting"]))
303
- {
304
- $settings_data_array["error_reporting"] = "enable";
305
- }
306
  if(!array_key_exists("monitor_email_logs", $settings_data_array))
307
  {
308
  $settings_data_array["monitor_email_logs"] = "enable";
28
  Created By: Tech Banker Team
29
  */
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
+ class dbHelper_install_script_mail_bank
33
+ {
34
+ /*
35
+ Function Name: insertCommand
36
+ Parameters: Yes($table_name,$data)
37
+ Description: This Function is used to Insert data in database.
38
+ Created On: 05-02-2016 11:40
39
+ Created By: Tech Banker Team
40
+ */
41
+
42
+ function insertCommand($table_name,$data)
43
+ {
44
+ global $wpdb;
45
+ $wpdb->insert($table_name,$data);
46
+ return $wpdb->insert_id;
47
+ }
48
+
49
+ /*
50
+ Function Name: updateCommand
51
+ Parameters: Yes($table_name,$data,$where)
52
+ Description: This function is used to Update data.
53
+ Created On: 05-02-2016 11:40
54
+ Created By: Tech Banker Team
55
+ */
56
+
57
+ function updateCommand($table_name,$data,$where)
58
+ {
59
+ global $wpdb;
60
+ $wpdb->update($table_name,$data,$where);
61
+ }
62
+ }
63
 
64
  if(file_exists(ABSPATH ."wp-admin/includes/upgrade.php"))
65
  require_once ABSPATH ."wp-admin/includes/upgrade.php";
66
 
67
  $mail_bank_version_number = get_option("mail-bank-version-number");
68
 
69
+ function mail_bank_table()
70
+ {
71
+ $sql = "CREATE TABLE IF NOT EXISTS ".mail_bank()."
72
+ (
73
+ `id` int(11) NOT NULL AUTO_INCREMENT,
74
+ `type` varchar(100) NOT NULL,
75
+ `parent_id` int(11) NOT NULL,
76
+ PRIMARY KEY (`id`)
77
+ )
78
+ ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
79
+ dbDelta($sql);
80
+
81
+ $data = "INSERT INTO ". mail_bank() ." (`type`, `parent_id`) VALUES
82
+ ('email_configuration', 0),
83
+ ('email_logs', 0),
84
+ ('settings', 0),
85
+ ('roles_and_capabilities', 0)";
86
+ dbDelta($data);
87
+ }
88
+
89
+ function mail_bank_meta_table()
90
+ {
91
+ $obj_dbHelper_install_script_mail_bank = new dbHelper_install_script_mail_bank();
92
+ global $wpdb;
93
+ $sql = "CREATE TABLE IF NOT EXISTS ".mail_bank_meta()."
94
+ (
95
+ `id` int(11) NOT NULL AUTO_INCREMENT,
96
+ `meta_id` int(11) NOT NULL,
97
+ `meta_key` varchar(255) NOT NULL,
98
+ `meta_value` longtext NOT NULL,
99
+ PRIMARY KEY (`id`)
100
+ )
101
+ ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
102
+ dbDelta($sql);
103
+
104
+ $admin_email = get_option("admin_email");
105
+ $admin_name = get_option("blogname");
106
+
107
+ $mail_bank_table_data = $wpdb->get_results
108
+ (
109
+ "SELECT * FROM " .mail_bank()
110
+ );
111
+
112
+ foreach($mail_bank_table_data as $row)
113
+ {
114
+ switch($row->type)
115
+ {
116
+ case "email_configuration":
117
+ $email_configuration_array = array();
118
+ $email_configuration_array["email_address"] = $admin_email;
119
+ $email_configuration_array["reply_to"] = "";
120
+ $email_configuration_array["cc"] = "";
121
+ $email_configuration_array["bcc"] = "";
122
+ $email_configuration_array["mailer_type"] = "smtp";
123
+ $email_configuration_array["sender_name"] = $admin_name;
124
+ $email_configuration_array["sender_name_configuration"] = "override";
125
+ $email_configuration_array["hostname"] = "";
126
+ $email_configuration_array["port"] = "587";
127
+ $email_configuration_array["client_id"] = "";
128
+ $email_configuration_array["client_secret"] = "";
129
+ $email_configuration_array["redirect_uri"] = "";
130
+ $email_configuration_array["sender_email"] = $admin_email;
131
+ $email_configuration_array["from_email_configuration"] = "override";
132
+ $email_configuration_array["auth_type"] = "none";
133
+ $email_configuration_array["username"] = $admin_email;
134
+ $email_configuration_array["password"] = "";
135
+ $email_configuration_array["enc_type"] = "tls";
136
+
137
+ $email_configuration_array_data = array();
138
+ $email_configuration_array_data["meta_id"] = $row->id;
139
+ $email_configuration_array_data["meta_key"] = "email_configuration";
140
+ $email_configuration_array_data["meta_value"] = serialize($email_configuration_array);
141
+ $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$email_configuration_array_data);
142
+ break;
143
+
144
+ case "settings":
145
+ $settings_data_array = array();
146
+ $settings_data_array["debug_mode"] = "enable";
147
+ $settings_data_array["remove_tables_at_uninstall"] = "enable";
148
+ $settings_data_array["monitor_email_logs"] = "enable";
149
+
150
+ $settings_array = array();
151
+ $settings_array["meta_id"] = $row->id;
152
+ $settings_array["meta_key"] = "settings";
153
+ $settings_array["meta_value"] = serialize($settings_data_array);
154
+ $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$settings_array);
155
+ break;
156
+
157
+ case "roles_and_capabilities":
158
+ $roles_capabilities_data_array = array();
159
+ $roles_capabilities_data_array["roles_and_capabilities"] = "1,1,1,0,0,0";
160
+ $roles_capabilities_data_array["show_mail_bank_top_bar_menu"] = "enable";
161
+ $roles_capabilities_data_array["others_full_control_capability"] = "0";
162
+ $roles_capabilities_data_array["administrator_privileges"] = "1,1,1,1,1,1,1,1,1,1";
163
+ $roles_capabilities_data_array["author_privileges"] = "0,0,1,0,0,0,0,0,0,0";
164
+ $roles_capabilities_data_array["editor_privileges"] = "0,0,1,0,0,0,1,0,0,0";
165
+ $roles_capabilities_data_array["contributor_privileges"] = "0,0,0,0,0,0,1,0,0,0";
166
+ $roles_capabilities_data_array["subscriber_privileges"] = "0,0,0,0,0,0,0,0,0,0";
167
+ $roles_capabilities_data_array["other_roles_privileges"] = "0,0,0,0,0,0,0,0,0,0";
168
+ $user_capabilities = get_others_capabilities_mail_bank();
169
+ $other_roles_array = array();
170
+ $other_roles_access_array = array(
171
+ "manage_options",
172
+ "edit_plugins",
173
+ "edit_posts",
174
+ "publish_posts",
175
+ "publish_pages",
176
+ "edit_pages",
177
+ "read"
178
+ );
179
+ foreach($other_roles_access_array as $role)
180
+ {
181
+ if(in_array($role,$user_capabilities))
182
+ {
183
+ array_push($other_roles_array,$role);
184
+ }
185
+ }
186
+ $roles_capabilities_data_array["capabilities"] = $other_roles_array;
187
+
188
+ $roles_data_array = array();
189
+ $roles_data_array["meta_id"] = $row->id;
190
+ $roles_data_array["meta_key"] = "roles_and_capabilities";
191
+ $roles_data_array["meta_value"] = serialize($roles_capabilities_data_array);
192
+ $obj_dbHelper_install_script_mail_bank->insertCommand(mail_bank_meta(),$roles_data_array);
193
+ break;
194
+ }
195
+ }
196
+ }
 
 
 
 
 
 
 
 
197
 
198
  $obj_dbHelper_install_script_mail_bank = new dbHelper_install_script_mail_bank();
199
  switch($mail_bank_version_number)
224
  $update_mail_bank_data["sender_name_configuration"] = isset($get_from_name) && $get_from_name == 1 ? "override" : "dont_override";
225
  $update_mail_bank_data["sender_name"] = isset($mail_bank_data->from_name) ? esc_html($mail_bank_data->from_name) : esc_html(get_option("blogname"));
226
  $update_mail_bank_data["from_email_configuration"] = isset($get_from_email) && $get_from_email == 1 ? "override" : "dont_override";
227
+ $update_mail_bank_data["sender_email"] = isset($mail_bank_data->from_email) ? esc_attr($mail_bank_data->from_email) : get_option("admin_email");
228
+ $update_mail_bank_data["hostname"] = isset($mail_bank_data->smtp_host) ? esc_attr($mail_bank_data->smtp_host) : "";
229
+ $update_mail_bank_data["port"] = isset($mail_bank_data->smtp_port) ? intval($mail_bank_data->smtp_port) : 0;
230
  $update_mail_bank_data["enc_type"] = isset($mail_bank_data->encryption) && (($mail_bank_data->encryption) == 0) ? "none" : ((($mail_bank_data->encryption) == 1) ? "ssl" : "tls");
231
  $update_mail_bank_data["auth_type"] = "login";
232
  $update_mail_bank_data["client_id"] = "";
233
  $update_mail_bank_data["client_secret"] = "";
234
  $update_mail_bank_data["redirect_uri"] = "";
235
+ $update_mail_bank_data["username"] = isset($mail_bank_data->smtp_username) ? esc_attr($mail_bank_data->smtp_username) : "";
236
  $update_mail_bank_data["password"] = isset($mail_bank_data->smtp_password) ? base64_encode($mail_bank_data->smtp_password) : "";
237
  $update_mail_bank_data["automatic_mail"] = "1";
238
 
243
  $update_mail_bank_data_serialize["meta_value"] = serialize($update_mail_bank_data);
244
  $obj_dbHelper_install_script_mail_bank->updateCommand(mail_bank_meta(),$update_mail_bank_data_serialize,$where);
245
  }
 
 
246
  $plugin_settings_data = $wpdb->get_var
247
  (
248
  $wpdb->prepare
255
  $plugin_settings_data_unserialize = unserialize($plugin_settings_data);
256
 
257
  $update_plugin_data = array();
258
+ $update_plugin_data["debug_mode"] = isset($plugin_settings_data_unserialize["debug_mode"]) ? esc_attr($plugin_settings_data_unserialize["debug_mode"]) : "enable";
259
+ $update_plugin_data["remove_tables_at_uninstall"] = isset($plugin_settings_data_unserialize["remove_tables_at_uninstall"]) ? esc_attr($plugin_settings_data_unserialize["remove_tables_at_uninstall"]) : "disable";
260
+ $update_plugin_data["monitor_email_logs"] = isset($plugin_settings_data_unserialize["monitor_email_logs"]) ? esc_attr($plugin_settings_data_unserialize["monitor_email_logs"]) : "enable";
 
261
 
262
  $update_plugin_settings_data_serialize = array();
263
  $where = array();
286
  );
287
 
288
  $settings_data_array = unserialize($settings_data);
 
 
 
 
289
  if(!array_key_exists("monitor_email_logs", $settings_data_array))
290
  {
291
  $settings_data_array["monitor_email_logs"] = "enable";
lib/sidebar-menu.php CHANGED
@@ -42,7 +42,7 @@ else
42
  );
43
 
44
  $roles_and_capabilities_unserialized_data = unserialize($role_capabilities);
45
- $capabilities = explode(",",$roles_and_capabilities_unserialized_data["roles_and_capabilities"]);
46
 
47
  if(is_super_admin())
48
  {
@@ -141,26 +141,24 @@ else
141
  Created By: Tech Banker Team
142
  */
143
 
144
- if(!function_exists("wp_mail_bank_wizard"))
145
- {
146
- function wp_mail_bank_wizard()
147
- {
148
- global $wpdb;
149
- $user_role_permission = get_users_capabilities_mail_bank();
150
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
151
- {
152
- include MAIL_BANK_DIR_PATH."includes/translations.php";
153
- }
154
- if(file_exists(MAIL_BANK_DIR_PATH."views/wizard/wizard.php"))
155
- {
156
- include_once MAIL_BANK_DIR_PATH."views/wizard/wizard.php";
157
- }
158
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
159
- {
160
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
161
- }
162
- }
163
- }
164
  /*
165
  Function Name: mb_email_configuration
166
  Parameters: No
@@ -169,38 +167,36 @@ else
169
  Created By: Tech Banker Team
170
  */
171
 
172
- if(!function_exists("mb_email_configuration"))
173
- {
174
- function mb_email_configuration()
175
- {
176
- global $wpdb;
177
- $user_role_permission = get_users_capabilities_mail_bank();
178
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
179
- {
180
- include MAIL_BANK_DIR_PATH."includes/translations.php";
181
- }
182
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
183
- {
184
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
185
- }
186
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
187
- {
188
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
189
- }
190
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
191
- {
192
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
193
- }
194
- if(file_exists(MAIL_BANK_DIR_PATH."views/email-setup/email-setup.php"))
195
- {
196
- include_once MAIL_BANK_DIR_PATH."views/email-setup/email-setup.php";
197
- }
198
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
199
- {
200
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
201
- }
202
- }
203
- }
204
 
205
  /*
206
  Function Name: mb_test_email
@@ -210,38 +206,36 @@ else
210
  Created By: Tech Banker Team
211
  */
212
 
213
- if(!function_exists("mb_test_email"))
214
- {
215
- function mb_test_email()
216
- {
217
- global $wpdb;
218
- $user_role_permission = get_users_capabilities_mail_bank();
219
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
220
- {
221
- include MAIL_BANK_DIR_PATH."includes/translations.php";
222
- }
223
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
224
- {
225
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
226
- }
227
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
228
- {
229
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
230
- }
231
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
232
- {
233
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
234
- }
235
- if(file_exists(MAIL_BANK_DIR_PATH."views/test-email/test-email.php"))
236
- {
237
- include_once MAIL_BANK_DIR_PATH."views/test-email/test-email.php";
238
- }
239
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
240
- {
241
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
242
- }
243
- }
244
- }
245
 
246
  /*
247
  Function Name: mb_connectivity_test
@@ -251,38 +245,36 @@ else
251
  Created By: Tech Banker Team
252
  */
253
 
254
- if(!function_exists("mb_connectivity_test"))
255
- {
256
- function mb_connectivity_test()
257
- {
258
- global $wpdb;
259
- $user_role_permission = get_users_capabilities_mail_bank();
260
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
261
- {
262
- include MAIL_BANK_DIR_PATH."includes/translations.php";
263
- }
264
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
265
- {
266
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
267
- }
268
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
269
- {
270
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
271
- }
272
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
273
- {
274
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
275
- }
276
- if(file_exists(MAIL_BANK_DIR_PATH."views/connectivity-test/connectivity-test.php"))
277
- {
278
- include_once MAIL_BANK_DIR_PATH."views/connectivity-test/connectivity-test.php";
279
- }
280
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
281
- {
282
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
283
- }
284
- }
285
- }
286
 
287
  /*
288
  Function Name: mb_email_logs
@@ -292,38 +284,37 @@ else
292
  Created By: Tech Banker Team
293
  */
294
 
295
- if(!function_exists("mb_email_logs"))
296
- {
297
- function mb_email_logs()
298
- {
299
- global $wpdb;
300
- $user_role_permission = get_users_capabilities_mail_bank();
301
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
302
- {
303
- include MAIL_BANK_DIR_PATH."includes/translations.php";
304
- }
305
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
306
- {
307
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
308
- }
309
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
310
- {
311
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
312
- }
313
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
314
- {
315
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
316
- }
317
- if(file_exists(MAIL_BANK_DIR_PATH."views/email-logs/email-logs.php"))
318
- {
319
- include_once MAIL_BANK_DIR_PATH."views/email-logs/email-logs.php";
320
- }
321
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
322
- {
323
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
324
- }
325
- }
326
- }
327
 
328
  /*
329
  Function Name: mb_settings
@@ -333,38 +324,37 @@ else
333
  Created By: Tech Banker Team
334
  */
335
 
336
- if(!function_exists("mb_settings"))
337
- {
338
- function mb_settings()
339
- {
340
- global $wpdb;
341
- $user_role_permission = get_users_capabilities_mail_bank();
342
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
343
- {
344
- include MAIL_BANK_DIR_PATH."includes/translations.php";
345
- }
346
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
347
- {
348
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
349
- }
350
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
351
- {
352
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
353
- }
354
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
355
- {
356
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
357
- }
358
- if(file_exists(MAIL_BANK_DIR_PATH."views/settings/settings.php"))
359
- {
360
- include_once MAIL_BANK_DIR_PATH."views/settings/settings.php";
361
- }
362
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
363
- {
364
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
365
- }
366
- }
367
- }
368
 
369
  /*
370
  Function Name: mb_roles_and_capabilities
@@ -374,38 +364,37 @@ else
374
  Created By: Tech Banker Team
375
  */
376
 
377
- if(!function_exists("mb_roles_and_capabilities"))
378
- {
379
- function mb_roles_and_capabilities()
380
- {
381
- global $wpdb;
382
- $user_role_permission = get_users_capabilities_mail_bank();
383
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
384
- {
385
- include MAIL_BANK_DIR_PATH."includes/translations.php";
386
- }
387
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
388
- {
389
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
390
- }
391
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
392
- {
393
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
394
- }
395
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
396
- {
397
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
398
- }
399
- if(file_exists(MAIL_BANK_DIR_PATH."views/roles-and-capabilities/roles-and-capabilities.php"))
400
- {
401
- include_once MAIL_BANK_DIR_PATH."views/roles-and-capabilities/roles-and-capabilities.php";
402
- }
403
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
404
- {
405
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
406
- }
407
- }
408
- }
409
 
410
  /*
411
  Function Name: mb_feedbacks
@@ -415,38 +404,36 @@ else
415
  Created By: Tech Banker Team
416
  */
417
 
418
- if(!function_exists("mb_feedbacks"))
419
- {
420
- function mb_feedbacks()
421
- {
422
- global $wpdb;
423
- $user_role_permission = get_users_capabilities_mail_bank();
424
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
425
- {
426
- include MAIL_BANK_DIR_PATH."includes/translations.php";
427
- }
428
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
429
- {
430
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
431
- }
432
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
433
- {
434
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
435
- }
436
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
437
- {
438
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
439
- }
440
- if(file_exists(MAIL_BANK_DIR_PATH."views/feedbacks/feedbacks.php"))
441
- {
442
- include_once MAIL_BANK_DIR_PATH."views/feedbacks/feedbacks.php";
443
- }
444
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
445
- {
446
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
447
- }
448
- }
449
- }
450
 
451
  /*
452
  Function Name: mb_system_information
@@ -456,38 +443,36 @@ else
456
  Created By: Tech Banker Team
457
  */
458
 
459
- if(!function_exists("mb_system_information"))
460
- {
461
- function mb_system_information()
462
- {
463
- global $wpdb;
464
- $user_role_permission = get_users_capabilities_mail_bank();
465
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
466
- {
467
- include MAIL_BANK_DIR_PATH."includes/translations.php";
468
- }
469
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
470
- {
471
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
472
- }
473
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
474
- {
475
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
476
- }
477
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
478
- {
479
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
480
- }
481
- if(file_exists(MAIL_BANK_DIR_PATH."views/system-information/system-information.php"))
482
- {
483
- include_once MAIL_BANK_DIR_PATH."views/system-information/system-information.php";
484
- }
485
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
486
- {
487
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
488
- }
489
- }
490
- }
491
  /*
492
  Function Name: mb_error_logs
493
  Parameters: No
@@ -496,38 +481,37 @@ else
496
  Created By: Tech Banker Team
497
  */
498
 
499
- if(!function_exists("mb_error_logs"))
500
- {
501
- function mb_error_logs()
502
- {
503
- global $wpdb;
504
- $user_role_permission = get_users_capabilities_mail_bank();
505
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
506
- {
507
- include MAIL_BANK_DIR_PATH."includes/translations.php";
508
- }
509
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
510
- {
511
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
512
- }
513
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
514
- {
515
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
516
- }
517
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
518
- {
519
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
520
- }
521
- if(file_exists(MAIL_BANK_DIR_PATH."views/error-logs/error-logs.php"))
522
- {
523
- include_once MAIL_BANK_DIR_PATH."views/error-logs/error-logs.php";
524
- }
525
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
526
- {
527
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
528
- }
529
- }
530
- }
531
  /*
532
  Function Name: mb_upgrade
533
  Parameter: No
@@ -536,38 +520,36 @@ else
536
  Created By: Tech Banker Team
537
  */
538
 
539
- if(!function_exists("mb_upgrade"))
540
- {
541
- function mb_upgrade()
542
- {
543
- global $wpdb;
544
- $user_role_permission = get_users_capabilities_mail_bank();
545
- if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
546
- {
547
- include MAIL_BANK_DIR_PATH."includes/translations.php";
548
- }
549
- if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
550
- {
551
- include_once MAIL_BANK_DIR_PATH."includes/header.php";
552
- }
553
- if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
554
- {
555
- include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
556
- }
557
- if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
558
- {
559
- include_once MAIL_BANK_DIR_PATH."includes/queries.php";
560
- }
561
- if(file_exists(MAIL_BANK_DIR_PATH."views/premium-editions/premium-editions.php"))
562
- {
563
- include_once MAIL_BANK_DIR_PATH."views/premium-editions/premium-editions.php";
564
- }
565
- if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
566
- {
567
- include_once MAIL_BANK_DIR_PATH."includes/footer.php";
568
- }
569
- }
570
- }
571
  }
572
  }
573
  ?>
42
  );
43
 
44
  $roles_and_capabilities_unserialized_data = unserialize($role_capabilities);
45
+ $capabilities = explode(",",isset($roles_and_capabilities_unserialized_data["roles_and_capabilities"]) ? esc_attr($roles_and_capabilities_unserialized_data["roles_and_capabilities"]) : "");
46
 
47
  if(is_super_admin())
48
  {
141
  Created By: Tech Banker Team
142
  */
143
 
144
+ function wp_mail_bank_wizard()
145
+ {
146
+ global $wpdb;
147
+ $user_role_permission = get_users_capabilities_mail_bank();
148
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
149
+ {
150
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
151
+ }
152
+ if(file_exists(MAIL_BANK_DIR_PATH."views/wizard/wizard.php"))
153
+ {
154
+ include_once MAIL_BANK_DIR_PATH."views/wizard/wizard.php";
155
+ }
156
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
157
+ {
158
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
159
+ }
160
+ }
161
+
 
 
162
  /*
163
  Function Name: mb_email_configuration
164
  Parameters: No
167
  Created By: Tech Banker Team
168
  */
169
 
170
+
171
+ function mb_email_configuration()
172
+ {
173
+ global $wpdb;
174
+ $user_role_permission = get_users_capabilities_mail_bank();
175
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
176
+ {
177
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
178
+ }
179
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
180
+ {
181
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
182
+ }
183
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
184
+ {
185
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
186
+ }
187
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
188
+ {
189
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
190
+ }
191
+ if(file_exists(MAIL_BANK_DIR_PATH."views/email-setup/email-setup.php"))
192
+ {
193
+ include_once MAIL_BANK_DIR_PATH."views/email-setup/email-setup.php";
194
+ }
195
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
196
+ {
197
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
198
+ }
199
+ }
 
 
200
 
201
  /*
202
  Function Name: mb_test_email
206
  Created By: Tech Banker Team
207
  */
208
 
209
+
210
+ function mb_test_email()
211
+ {
212
+ global $wpdb;
213
+ $user_role_permission = get_users_capabilities_mail_bank();
214
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
215
+ {
216
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
217
+ }
218
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
219
+ {
220
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
221
+ }
222
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
223
+ {
224
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
225
+ }
226
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
227
+ {
228
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
229
+ }
230
+ if(file_exists(MAIL_BANK_DIR_PATH."views/test-email/test-email.php"))
231
+ {
232
+ include_once MAIL_BANK_DIR_PATH."views/test-email/test-email.php";
233
+ }
234
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
235
+ {
236
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
237
+ }
238
+ }
 
 
239
 
240
  /*
241
  Function Name: mb_connectivity_test
245
  Created By: Tech Banker Team
246
  */
247
 
248
+
249
+ function mb_connectivity_test()
250
+ {
251
+ global $wpdb;
252
+ $user_role_permission = get_users_capabilities_mail_bank();
253
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
254
+ {
255
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
256
+ }
257
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
258
+ {
259
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
260
+ }
261
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
262
+ {
263
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
264
+ }
265
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
266
+ {
267
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
268
+ }
269
+ if(file_exists(MAIL_BANK_DIR_PATH."views/connectivity-test/connectivity-test.php"))
270
+ {
271
+ include_once MAIL_BANK_DIR_PATH."views/connectivity-test/connectivity-test.php";
272
+ }
273
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
274
+ {
275
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
276
+ }
277
+ }
 
 
278
 
279
  /*
280
  Function Name: mb_email_logs
284
  Created By: Tech Banker Team
285
  */
286
 
287
+
288
+ function mb_email_logs()
289
+ {
290
+ global $wpdb;
291
+ $user_role_permission = get_users_capabilities_mail_bank();
292
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
293
+ {
294
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
295
+ }
296
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
297
+ {
298
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
299
+ }
300
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
301
+ {
302
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
303
+ }
304
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
305
+ {
306
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
307
+ }
308
+ if(file_exists(MAIL_BANK_DIR_PATH."views/email-logs/email-logs.php"))
309
+ {
310
+ include_once MAIL_BANK_DIR_PATH."views/email-logs/email-logs.php";
311
+ }
312
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
313
+ {
314
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
315
+ }
316
+ }
317
+
 
318
 
319
  /*
320
  Function Name: mb_settings
324
  Created By: Tech Banker Team
325
  */
326
 
327
+
328
+ function mb_settings()
329
+ {
330
+ global $wpdb;
331
+ $user_role_permission = get_users_capabilities_mail_bank();
332
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
333
+ {
334
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
335
+ }
336
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
337
+ {
338
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
339
+ }
340
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
341
+ {
342
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
343
+ }
344
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
345
+ {
346
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
347
+ }
348
+ if(file_exists(MAIL_BANK_DIR_PATH."views/settings/settings.php"))
349
+ {
350
+ include_once MAIL_BANK_DIR_PATH."views/settings/settings.php";
351
+ }
352
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
353
+ {
354
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
355
+ }
356
+ }
357
+
 
358
 
359
  /*
360
  Function Name: mb_roles_and_capabilities
364
  Created By: Tech Banker Team
365
  */
366
 
367
+
368
+ function mb_roles_and_capabilities()
369
+ {
370
+ global $wpdb;
371
+ $user_role_permission = get_users_capabilities_mail_bank();
372
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
373
+ {
374
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
375
+ }
376
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
377
+ {
378
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
379
+ }
380
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
381
+ {
382
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
383
+ }
384
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
385
+ {
386
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
387
+ }
388
+ if(file_exists(MAIL_BANK_DIR_PATH."views/roles-and-capabilities/roles-and-capabilities.php"))
389
+ {
390
+ include_once MAIL_BANK_DIR_PATH."views/roles-and-capabilities/roles-and-capabilities.php";
391
+ }
392
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
393
+ {
394
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
395
+ }
396
+ }
397
+
 
398
 
399
  /*
400
  Function Name: mb_feedbacks
404
  Created By: Tech Banker Team
405
  */
406
 
407
+
408
+ function mb_feedbacks()
409
+ {
410
+ global $wpdb;
411
+ $user_role_permission = get_users_capabilities_mail_bank();
412
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
413
+ {
414
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
415
+ }
416
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
417
+ {
418
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
419
+ }
420
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
421
+ {
422
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
423
+ }
424
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
425
+ {
426
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
427
+ }
428
+ if(file_exists(MAIL_BANK_DIR_PATH."views/feedbacks/feedbacks.php"))
429
+ {
430
+ include_once MAIL_BANK_DIR_PATH."views/feedbacks/feedbacks.php";
431
+ }
432
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
433
+ {
434
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
435
+ }
436
+ }
 
 
437
 
438
  /*
439
  Function Name: mb_system_information
443
  Created By: Tech Banker Team
444
  */
445
 
446
+
447
+ function mb_system_information()
448
+ {
449
+ global $wpdb;
450
+ $user_role_permission = get_users_capabilities_mail_bank();
451
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
452
+ {
453
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
454
+ }
455
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
456
+ {
457
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
458
+ }
459
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
460
+ {
461
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
462
+ }
463
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
464
+ {
465
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
466
+ }
467
+ if(file_exists(MAIL_BANK_DIR_PATH."views/system-information/system-information.php"))
468
+ {
469
+ include_once MAIL_BANK_DIR_PATH."views/system-information/system-information.php";
470
+ }
471
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
472
+ {
473
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
474
+ }
475
+ }
 
 
476
  /*
477
  Function Name: mb_error_logs
478
  Parameters: No
481
  Created By: Tech Banker Team
482
  */
483
 
484
+
485
+ function mb_error_logs()
486
+ {
487
+ global $wpdb;
488
+ $user_role_permission = get_users_capabilities_mail_bank();
489
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
490
+ {
491
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
492
+ }
493
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
494
+ {
495
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
496
+ }
497
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
498
+ {
499
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
500
+ }
501
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
502
+ {
503
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
504
+ }
505
+ if(file_exists(MAIL_BANK_DIR_PATH."views/error-logs/error-logs.php"))
506
+ {
507
+ include_once MAIL_BANK_DIR_PATH."views/error-logs/error-logs.php";
508
+ }
509
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
510
+ {
511
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
512
+ }
513
+ }
514
+
 
515
  /*
516
  Function Name: mb_upgrade
517
  Parameter: No
520
  Created By: Tech Banker Team
521
  */
522
 
523
+
524
+ function mb_upgrade()
525
+ {
526
+ global $wpdb;
527
+ $user_role_permission = get_users_capabilities_mail_bank();
528
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/translations.php"))
529
+ {
530
+ include MAIL_BANK_DIR_PATH."includes/translations.php";
531
+ }
532
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/header.php"))
533
+ {
534
+ include_once MAIL_BANK_DIR_PATH."includes/header.php";
535
+ }
536
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/sidebar.php"))
537
+ {
538
+ include_once MAIL_BANK_DIR_PATH."includes/sidebar.php";
539
+ }
540
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/queries.php"))
541
+ {
542
+ include_once MAIL_BANK_DIR_PATH."includes/queries.php";
543
+ }
544
+ if(file_exists(MAIL_BANK_DIR_PATH."views/premium-editions/premium-editions.php"))
545
+ {
546
+ include_once MAIL_BANK_DIR_PATH."views/premium-editions/premium-editions.php";
547
+ }
548
+ if(file_exists(MAIL_BANK_DIR_PATH."includes/footer.php"))
549
+ {
550
+ include_once MAIL_BANK_DIR_PATH."includes/footer.php";
551
+ }
552
+ }
 
 
553
  }
554
  }
555
  ?>
lib/uninstall-script.php DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
- /**
3
- * This file contains code for remove tables and options at uninstall.
4
- *
5
- * @author Tech Banker
6
- * @package wp-mail-bank/lib
7
- * @version 2.0.0
8
- */
9
-
10
- if(!defined("ABSPATH")) exit; // Exit if accessed directly
11
- if(!is_user_logged_in())
12
- {
13
- return;
14
- }
15
- else
16
- {
17
- if(!current_user_can("manage_options"))
18
- {
19
- return;
20
- }
21
- else
22
- {
23
- $type = get_option("wp-mail-bank-wizard-set-up");
24
- delete_option("wp-mail-bank-wizard-set-up");
25
- if($type == "opt_in")
26
- {
27
- global $wp_version, $wpdb;
28
- $user_role_permission = get_users_capabilities_mail_bank();
29
- if(file_exists(MAIL_BANK_DIR_PATH."lib/helper.php"))
30
- {
31
- include_once MAIL_BANK_DIR_PATH."lib/helper.php";
32
- }
33
- $plugin_info_wp_mail_bank = new plugin_info_wp_mail_bank();
34
- $url = tech_banker_stats_url."/wp-admin/admin-ajax.php";
35
-
36
-
37
- $theme_details = array();
38
-
39
- if($wp_version >= 3.4)
40
- {
41
- $active_theme = wp_get_theme();
42
- $theme_details["theme_name"] = strip_tags($active_theme->Name);
43
- $theme_details["theme_version"] = strip_tags($active_theme->Version);
44
- $theme_details["author_url"] = strip_tags($active_theme->{"Author URI"});
45
- }
46
- $plugin_stat_data = array();
47
- $plugin_stat_data["plugin_slug"] = "wp-mail-bank";
48
- $plugin_stat_data["type"] = "standard_edition";
49
- $plugin_stat_data["version_number"] = mail_bank_version_number;
50
- $plugin_stat_data["status"] = $type;
51
- $plugin_stat_data["event"] = "uninstall";
52
- $plugin_stat_data["domain_url"] = site_url();
53
- $plugin_stat_data["wp_language"] = defined("WPLANG") && WPLANG ? WPLANG : get_locale();
54
- $plugin_stat_data["email"] = get_option("admin_email");
55
- $plugin_stat_data["wp_version"] = $wp_version;
56
- $plugin_stat_data["php_version"] = esc_html(phpversion());
57
- $plugin_stat_data["mysql_version"] = $wpdb->db_version();
58
- $plugin_stat_data["max_input_vars"] = ini_get("max_input_vars");
59
- $plugin_stat_data["operating_system"] = PHP_OS ." (".PHP_INT_SIZE * 8 .") BIT";
60
- $plugin_stat_data["php_memory_limit"] = ini_get("memory_limit") ? ini_get("memory_limit") : "N/A";
61
- $plugin_stat_data["extensions"] = get_loaded_extensions();
62
- $plugin_stat_data["plugins"] = $plugin_info_wp_mail_bank->get_plugin_info_wp_mail_bank();
63
- $plugin_stat_data["themes"] = $theme_details;
64
-
65
-
66
- if(function_exists("curl_init"))
67
- {
68
- $ch = curl_init();
69
- curl_setopt($ch, CURLOPT_URL, $url);
70
- curl_setopt($ch, CURLOPT_POST, 1);
71
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
72
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
73
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
74
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
75
- curl_setopt($ch, CURLOPT_POSTFIELDS,
76
- http_build_query(array( "data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") !="" ? get_option("mb_tech_banker_site_id") : "", "action"=>"plugin_analysis_data")));
77
- $result = curl_exec($ch);
78
- delete_option("mb_tech_banker_site_id");
79
- curl_close($ch);
80
- }
81
- else
82
- {
83
- $response = wp_safe_remote_post($url, array
84
- (
85
- "method" => "POST",
86
- "timeout" => 45,
87
- "redirection" => 5,
88
- "httpversion" => "1.0",
89
- "blocking" => false,
90
- "headers" => array(),
91
- "body" => array( "data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action"=>"plugin_analysis_data")
92
- ));
93
- if(!is_wp_error($response))
94
- {
95
- $response["body"] != "" ? delete_option("mb_tech_banker_site_id") : "";
96
- }
97
- else
98
- {
99
- delete_option("mb_tech_banker_site_id");
100
- }
101
- }
102
- }
103
-
104
- // Drop Tables
105
- global $wpdb;
106
- $settings_remove_tables = $wpdb->get_var
107
- (
108
- $wpdb->prepare
109
- (
110
- "SELECT meta_value FROM ".mail_bank_meta()."
111
- WHERE meta_key = %s",
112
- "settings"
113
- )
114
- );
115
- $settings_remove_tables_unserialize = unserialize($settings_remove_tables);
116
-
117
- if($settings_remove_tables_unserialize["remove_tables_at_uninstall"] == "enable")
118
- {
119
- $wpdb->query("DROP TABLE IF EXISTS " .mail_bank());
120
- $wpdb->query("DROP TABLE IF EXISTS ".mail_bank_meta());
121
- // Delete options
122
- delete_option("mail-bank-version-number");
123
- }
124
- // Unschedule schedulers
125
- if(wp_next_scheduled("automatic_updates_mail_bank"))
126
- {
127
- wp_clear_scheduled_hook("automatic_updates_mail_bank");
128
- }
129
- }
130
- }
131
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/zend/mail/transport/file.php CHANGED
@@ -142,6 +142,6 @@ class mail_bank_Zend_Mail_Transport_File extends mail_bank_Zend_Mail_Transport_A
142
  */
143
  public function defaultCallback($transport)
144
  {
145
- return 'ZendMail_' . $_SERVER['REQUEST_TIME'] . '_' . mt_rand() . '.tmp';
146
  }
147
  }
142
  */
143
  public function defaultCallback($transport)
144
  {
145
+ return 'ZendMail_' . $_SERVER['REQUEST_TIME'] . '_' . mt_rand() . '.tmp';
146
  }
147
  }
readme.txt CHANGED
@@ -294,6 +294,15 @@ It allows the users to view the debugging output of logged emails.
294
 
295
  == Changelog ==
296
 
 
 
 
 
 
 
 
 
 
297
  = 3.0.3 =
298
 
299
  * FIX: Code Removed from Skip Action Hook on Wizard Page
294
 
295
  == Changelog ==
296
 
297
+ = 3.0.4 =
298
+
299
+ * FIX: Proper Sanitization, Escaping, Validation of all Post Calls
300
+ * FIX: Removal of all function_exists, class_exists, typeof from all the files.
301
+ * FIX: Uninstall File moved to root folder and changes done as per wordpress guidelines.
302
+ * FIX: Error Reporting in file Removed
303
+ * FIX: Auto Updates Removed
304
+ * FIX: Curl Calls Removed
305
+
306
  = 3.0.3 =
307
 
308
  * FIX: Code Removed from Skip Action Hook on Wizard Page
uninstall.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file contains code for remove tables and options at uninstall.
4
+ *
5
+ * @author Tech Banker
6
+ * @package wp-mail-bank/lib
7
+ * @version 2.0.0
8
+ */
9
+
10
+ if (!defined('WP_UNINSTALL_PLUGIN')) {
11
+ die;
12
+ }
13
+ if(!current_user_can("manage_options"))
14
+ {
15
+ return;
16
+ }
17
+ else
18
+ {
19
+ // Drop Tables
20
+ global $wpdb;
21
+ $settings_remove_tables = $wpdb->get_var
22
+ (
23
+ $wpdb->prepare
24
+ (
25
+ "SELECT meta_value FROM " .$wpdb->prefix ."mail_bank_meta
26
+ WHERE meta_key = %s",
27
+ "settings"
28
+ )
29
+ );
30
+ $settings_remove_tables_unserialize = unserialize($settings_remove_tables);
31
+
32
+ if(esc_attr($settings_remove_tables_unserialize["remove_tables_at_uninstall"]) == "enable")
33
+ {
34
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."mail_bank");
35
+ $wpdb->query("DROP TABLE IF EXISTS " .$wpdb->prefix ."mail_bank_meta");
36
+ // Delete options
37
+ delete_option("mail-bank-version-number");
38
+ delete_option("mb_tech_banker_site_id");
39
+ delete_option("wp-mail-bank-wizard-set-up");
40
+ }
41
+
42
+ }
43
+
44
+ ?>
views/connectivity-test/connectivity-test.php CHANGED
@@ -1,148 +1,137 @@
1
  <?php
2
  /**
3
- * This Template is used for connectivity test.
4
- *
5
- * @author Tech Banker
6
- * @package wp-mail-bank/views/connectivity-test
7
- * @version 2.0.0
8
- */
9
- if(!defined("ABSPATH")) exit; // Exit if accessed directly
10
- if(!is_user_logged_in())
11
- {
12
- return;
13
- }
14
- else
15
- {
16
- $access_granted = false;
17
- foreach($user_role_permission as $permission)
18
- {
19
- if(current_user_can($permission))
20
- {
21
- $access_granted = true;
22
- break;
23
- }
24
- }
25
- if(!$access_granted)
26
- {
27
- return;
28
- }
29
- else if(conectivity_test_email_mail_bank == "1")
30
- {
31
- $connectivity_test_nonce = wp_create_nonce("connectivity_test_nonce");
32
- ?>
33
- <div class="page-bar">
34
- <ul class="page-breadcrumb">
35
- <li>
36
- <i class="icon-custom-home"></i>
37
- <a href="admin.php?page=mb_email_configuration">
38
- <?php echo $wp_mail_bank; ?>
39
- </a>
40
- <span>></span>
41
- </li>
42
- <li>
43
- <span>
44
- <?php echo $mb_connectivity_test; ?>
45
- </span>
46
- </li>
47
- </ul>
48
- </div>
49
- <div class="row">
50
- <div class="col-md-12">
51
- <div class="portlet box vivid-green">
52
- <div class="portlet-title">
53
- <div class="caption">
54
- <i class="icon-custom-globe"></i>
55
- <?php echo $mb_connectivity_test; ?>
56
- </div>
57
- </div>
58
- <div class="portlet-body form">
59
- <form id="ux_frm_settings">
60
- <div class="form-body">
61
- <?php
62
- if($mb_message_translate_help != "")
63
- {
64
- ?>
65
- <div class="note note-danger">
66
- <h4 class="block">
67
- <?php echo $mb_important_disclaimer; ?>
68
- </h4>
69
- <strong><?php echo $mb_message_translate_help;?><br/><?php echo $mb_kindly_click;?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
70
- </div>
71
- <?php
72
- }
73
- ?>
74
- <div class="form-group">
75
- <label class="control-label">
76
- <?php echo $mb_mail_server_host;?> :
77
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_mail_server_tooltip;?>" data-placement="right"></i>
78
- <span class="required" aria-required="true">*</span>
79
- </label>
80
- <input type="text" class="form-control" name="ux_txt_conn_search" id="ux_txt_conn_search" value="" placeholder="<?php echo $mb_localhost;?>">
81
- </div>
82
- <div class="form-actions">
83
- <div class="pull-right">
84
- <input type="submit" class="btn vivid-green" name="ux_btn_begin_test" id="ux_btn_begin_test" value="<?php echo $mb_begin_test;?>">
85
- </div>
86
- </div>
87
- <div class="line-separator"></div>
88
- <div id="ux_div_connectivity_test" style="display:none;">
89
- <table class="table table-striped table-bordered table-hover table-margin-top">
90
- <thead>
91
- <tr>
92
- <th rowspan="2"><?php echo $mb_transport; ?></th>
93
- <th rowspan="2"><?php echo $mb_socket; ?></th>
94
- <th rowspan="2"><?php echo $mb_status; ?></th>
95
- </tr>
96
- </thead>
97
- <tbody id="ux_tbody_smtp">
98
- </tbody>
99
- </table>
100
- </div>
101
- </div>
102
- </form>
103
- </div>
104
- </div>
105
- </div>
106
- </div>
107
- <?php
108
- }
109
- else
110
- {
111
- ?>
112
- <div class="page-bar">
113
- <ul class="page-breadcrumb">
114
- <li>
115
- <i class="icon-custom-home"></i>
116
- <a href="admin.php?page=mb_email_configuration">
117
- <?php echo $wp_mail_bank; ?>
118
- </a>
119
- <span>></span>
120
- </li>
121
- <li>
122
- <span>
123
- <?php echo $mb_connectivity_test; ?>
124
- </span>
125
- </li>
126
- </ul>
127
- </div>
128
- <div class="row">
129
- <div class="col-md-12">
130
- <div class="portlet box vivid-green">
131
- <div class="portlet-title">
132
- <div class="caption">
133
- <i class="icon-custom-paper-clip"></i>
134
- <?php echo $mb_connectivity_test; ?>
135
- </div>
136
- </div>
137
- <div class="portlet-body form">
138
- <div class="form-body">
139
- <strong><?php echo $mb_user_access_message;?></strong>
140
- </div>
141
- </div>
142
- </div>
143
- </div>
144
- </div>
145
- <?php
146
- }
147
- }
148
- ?>
1
  <?php
2
  /**
3
+ * This Template is used for connectivity test.
4
+ *
5
+ * @author Tech Banker
6
+ * @package wp-mail-bank/views/connectivity-test
7
+ * @version 2.0.0
8
+ */
9
+ if (!defined("ABSPATH"))
10
+ exit; // Exit if accessed directly
11
+ if (!is_user_logged_in()) {
12
+ return;
13
+ } else {
14
+ $access_granted = false;
15
+ foreach ($user_role_permission as $permission) {
16
+ if (current_user_can($permission)) {
17
+ $access_granted = true;
18
+ break;
19
+ }
20
+ }
21
+ if (!$access_granted) {
22
+ return;
23
+ } else if (conectivity_test_email_mail_bank == "1") {
24
+ $connectivity_test_nonce = wp_create_nonce("connectivity_test_nonce");
25
+ ?>
26
+ <div class="page-bar">
27
+ <ul class="page-breadcrumb">
28
+ <li>
29
+ <i class="icon-custom-home"></i>
30
+ <a href="admin.php?page=mb_email_configuration">
31
+ <?php echo $wp_mail_bank; ?>
32
+ </a>
33
+ <span>></span>
34
+ </li>
35
+ <li>
36
+ <span>
37
+ <?php echo $mb_connectivity_test; ?>
38
+ </span>
39
+ </li>
40
+ </ul>
41
+ </div>
42
+ <div class="row">
43
+ <div class="col-md-12">
44
+ <div class="portlet box vivid-green">
45
+ <div class="portlet-title">
46
+ <div class="caption">
47
+ <i class="icon-custom-globe"></i>
48
+ <?php echo $mb_connectivity_test; ?>
49
+ </div>
50
+ </div>
51
+ <div class="portlet-body form">
52
+ <form id="ux_frm_settings">
53
+ <div class="form-body">
54
+ <?php
55
+ if ($mb_message_translate_help != "") {
56
+ ?>
57
+ <div class="note note-danger">
58
+ <h4 class="block">
59
+ <?php echo $mb_important_disclaimer; ?>
60
+ </h4>
61
+ <strong><?php echo $mb_message_translate_help; ?><br/><?php echo $mb_kindly_click; ?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
62
+ </div>
63
+ <?php
64
+ }
65
+ ?>
66
+ <div class="form-group">
67
+ <label class="control-label">
68
+ <?php echo $mb_mail_server_host; ?> :
69
+ <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_mail_server_tooltip; ?>" data-placement="right"></i>
70
+ <span class="required" aria-required="true">*</span>
71
+ </label>
72
+ <input type="text" class="form-control" name="ux_txt_conn_search" id="ux_txt_conn_search" value="" placeholder="<?php echo $mb_localhost; ?>">
73
+ </div>
74
+ <div class="form-actions">
75
+ <div class="pull-right">
76
+ <input type="submit" class="btn vivid-green" name="ux_btn_begin_test" id="ux_btn_begin_test" value="<?php echo $mb_begin_test; ?>">
77
+ </div>
78
+ </div>
79
+ <div class="line-separator"></div>
80
+ <div id="ux_div_connectivity_test" style="display:none;">
81
+ <table class="table table-striped table-bordered table-hover table-margin-top">
82
+ <thead>
83
+ <tr>
84
+ <th rowspan="2"><?php echo $mb_transport; ?></th>
85
+ <th rowspan="2"><?php echo $mb_socket; ?></th>
86
+ <th rowspan="2"><?php echo $mb_status; ?></th>
87
+ </tr>
88
+ </thead>
89
+ <tbody id="ux_tbody_smtp">
90
+ </tbody>
91
+ </table>
92
+ </div>
93
+ </div>
94
+ </form>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ <?php
100
+ } else {
101
+ ?>
102
+ <div class="page-bar">
103
+ <ul class="page-breadcrumb">
104
+ <li>
105
+ <i class="icon-custom-home"></i>
106
+ <a href="admin.php?page=mb_email_configuration">
107
+ <?php echo $wp_mail_bank; ?>
108
+ </a>
109
+ <span>></span>
110
+ </li>
111
+ <li>
112
+ <span>
113
+ <?php echo $mb_connectivity_test; ?>
114
+ </span>
115
+ </li>
116
+ </ul>
117
+ </div>
118
+ <div class="row">
119
+ <div class="col-md-12">
120
+ <div class="portlet box vivid-green">
121
+ <div class="portlet-title">
122
+ <div class="caption">
123
+ <i class="icon-custom-paper-clip"></i>
124
+ <?php echo $mb_connectivity_test; ?>
125
+ </div>
126
+ </div>
127
+ <div class="portlet-body form">
128
+ <div class="form-body">
129
+ <strong><?php echo $mb_user_access_message; ?></strong>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <?php
136
+ }
137
+ }
 
 
 
 
 
 
 
 
 
 
 
views/email-logs/email-logs.php CHANGED
@@ -147,21 +147,21 @@ else
147
  ?>
148
  <tr>
149
  <td style="text-align: center;">
150
- <input type="checkbox" name="ux_chk_email_logs_<?php echo $value["id"]; ?>" id="ux_chk_email_logs_<?php echo $value["id"]; ?>" onclick="check_email_logs(<?php echo $value["id"]; ?>)" value="<?php echo $value["id"]; ?>">
151
  </td>
152
- <td id="ux_email_sent_to_<?php echo $value["id"] ?>">
153
- <?php echo $value["email_to"]; ?>
154
  </td>
155
- <td id="ux_email_subject_<?php echo $value["id"] ?>">
156
- <?php echo isset($value["subject"]) != "" ? $value["subject"] : "N/A"; ?>
157
  </td>
158
- <td id="ux_email_date_time_<?php echo $value["id"] ?>">
159
  <?php
160
- echo date_i18n("d M Y h:i A",$value["timestamp"]);
161
  ?>
162
- </td>
163
- <td id="ux_email_status_<?php echo $value["id"] ?>">
164
- <?php echo $value["status"]== "Sent" ? $mb_status_sent : $mb_status_not_sent; ?>
165
  </td>
166
  <td class="custom-alternative">
167
  <a href="javascript:void(0);">
@@ -237,4 +237,3 @@ else
237
  <?php
238
  }
239
  }
240
- ?>
147
  ?>
148
  <tr>
149
  <td style="text-align: center;">
150
+ <input type="checkbox" name="ux_chk_email_logs_<?php echo intval($value["id"]); ?>" id="ux_chk_email_logs_<?php echo intval($value["id"]); ?>" onclick="check_email_logs(<?php echo intval($value["id"]); ?>)" value="<?php echo intval($value["id"]); ?>">
151
  </td>
152
+ <td id="ux_email_sent_to_<?php echo intval($value["id"]) ?>">
153
+ <?php echo esc_html($value["email_to"]); ?>
154
  </td>
155
+ <td id="ux_email_subject_<?php echo intval($value["id"]) ?>">
156
+ <?php echo isset($value["subject"]) != "" ? esc_html($value["subject"]) : "N/A"; ?>
157
  </td>
158
+ <td id="ux_email_date_time_<?php echo intval($value["id"]) ?>">
159
  <?php
160
+ echo date_i18n("d M Y h:i A",intval($value["timestamp"]));
161
  ?>
162
+ </td>
163
+ <td id="ux_email_status_<?php echo intval($value["id"]) ?>">
164
+ <?php echo isset($value["status"]) == "Sent" ? esc_attr($mb_status_sent) : $mb_status_not_sent; ?>
165
  </td>
166
  <td class="custom-alternative">
167
  <a href="javascript:void(0);">
237
  <?php
238
  }
239
  }
 
views/email-setup/email-setup.php CHANGED
@@ -59,21 +59,21 @@ else
59
  </div>
60
  </div>
61
  <div class="portlet-body form">
62
- <div class="form-body">
63
- <?php
64
- if($mb_message_translate_help != "")
65
- {
66
- ?>
67
- <div class="note note-danger">
68
- <h4 class="block">
69
- <?php echo $mb_important_disclaimer; ?>
70
- </h4>
71
- <strong><?php echo $mb_message_translate_help;?><br/><?php echo $mb_kindly_click;?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
72
- </div>
73
- <?php
74
- }
75
- ?>
76
- <div class="form-wizard" id="ux_div_frm_wizard">
77
  <ul class="nav nav-pills nav-justified steps">
78
  <li class="active">
79
  <a aria-expanded="true" href="javascript:void(0);" class="step">
@@ -190,7 +190,7 @@ else
190
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_email_configuration_cc_email_address_tooltip; ?>" data-placement="right"></i>
191
  <span class="required" aria-required="true"> ( <?php echo $mb_premium_edition_label; ?> ) </span>
192
  </label>
193
- <input type="text" class="form-control" name="ux_txt_cc" id="ux_txt_cc" value="<?php echo isset($email_configuration_array["cc"]) ? $email_configuration_array["cc"] : "" ?>" disabled="disabled" placeholder="<?php echo $mb_email_configuration_cc_email_placeholder; ?>">
194
  </div>
195
  </div>
196
  <div class="col-md-6">
@@ -200,7 +200,7 @@ else
200
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_email_configuration_bcc_email_address_tooltip; ?>" data-placement="right"></i>
201
  <span class="required" aria-required="true"> ( <?php echo $mb_premium_edition_label; ?> ) </span>
202
  </label>
203
- <input type="text" class="form-control" name="ux_txt_bcc" id="ux_txt_bcc" value="<?php echo isset($email_configuration_array["bcc"]) ? $email_configuration_array["bcc"] : "" ?>" disabled="disabled" placeholder="<?php echo $mb_email_configuration_bcc_email_placeholder; ?>">
204
  </div>
205
  </div>
206
  </div>
59
  </div>
60
  </div>
61
  <div class="portlet-body form">
62
+ <div class="form-body">
63
+ <?php
64
+ if($mb_message_translate_help != "")
65
+ {
66
+ ?>
67
+ <div class="note note-danger">
68
+ <h4 class="block">
69
+ <?php echo $mb_important_disclaimer; ?>
70
+ </h4>
71
+ <strong><?php echo $mb_message_translate_help;?><br/><?php echo $mb_kindly_click;?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
72
+ </div>
73
+ <?php
74
+ }
75
+ ?>
76
+ <div class="form-wizard" id="ux_div_frm_wizard">
77
  <ul class="nav nav-pills nav-justified steps">
78
  <li class="active">
79
  <a aria-expanded="true" href="javascript:void(0);" class="step">
190
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_email_configuration_cc_email_address_tooltip; ?>" data-placement="right"></i>
191
  <span class="required" aria-required="true"> ( <?php echo $mb_premium_edition_label; ?> ) </span>
192
  </label>
193
+ <input type="text" class="form-control" name="ux_txt_cc" id="ux_txt_cc" value="<?php echo isset($email_configuration_array["cc"]) ? esc_html($email_configuration_array["cc"]) : "" ?>" disabled="disabled" placeholder="<?php echo $mb_email_configuration_cc_email_placeholder; ?>">
194
  </div>
195
  </div>
196
  <div class="col-md-6">
200
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_email_configuration_bcc_email_address_tooltip; ?>" data-placement="right"></i>
201
  <span class="required" aria-required="true"> ( <?php echo $mb_premium_edition_label; ?> ) </span>
202
  </label>
203
+ <input type="text" class="form-control" name="ux_txt_bcc" id="ux_txt_bcc" value="<?php echo isset($email_configuration_array["bcc"]) ? esc_html($email_configuration_array["bcc"]) : "" ?>" disabled="disabled" placeholder="<?php echo $mb_email_configuration_bcc_email_placeholder; ?>">
204
  </div>
205
  </div>
206
  </div>
views/error-logs/error-logs.php CHANGED
@@ -77,7 +77,7 @@ else
77
  ?>
78
  <div class="form-actions">
79
  <div class="pull-right">
80
- <a href="<?php echo content_url("wp-mail-bank/error-logs.txt");?>" download="error-logs.txt" class="btn vivid-green" name="ux_btn_download_error_logs"><?php echo $mb_download_error_logs;?></a>
81
  <input type="button" class="btn vivid-green btn_clear_error_logs" name="ux_btn_clear_error_logs" value="<?php echo $mb_clear_error_logs;?>">
82
  </div>
83
  </div>
@@ -87,12 +87,12 @@ else
87
  <?php echo $mb_error_logs_output; ?> :
88
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_error_logs_output_tooltip;?>" data-placement="right"></i>
89
  </label>
90
- <textarea rows="20" class="form-control" readonly="true"><?php echo dbHelper_mail_bank::file_reader(MAIL_BANK_ERROR_LOGS_FILE);?></textarea>
91
  </div>
92
  <div class="line-separator"></div>
93
  <div class="form-actions">
94
  <div class="pull-right">
95
- <a href="<?php echo content_url("wp-mail-bank/error-logs.txt");?>" download="error-logs.txt" class="btn vivid-green" name="ux_btn_download_error_logs"><?php echo $mb_download_error_logs;?></a>
96
  <input type="button" class="btn vivid-green btn_clear_error_logs" name="ux_btn_clear_error_logs" value="<?php echo $mb_clear_error_logs;?>">
97
  </div>
98
  </div>
77
  ?>
78
  <div class="form-actions">
79
  <div class="pull-right">
80
+ <a href="" class="btn vivid-green" name="ux_btn_download_error_logs"><?php echo $mb_download_error_logs;?></a>
81
  <input type="button" class="btn vivid-green btn_clear_error_logs" name="ux_btn_clear_error_logs" value="<?php echo $mb_clear_error_logs;?>">
82
  </div>
83
  </div>
87
  <?php echo $mb_error_logs_output; ?> :
88
  <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_error_logs_output_tooltip;?>" data-placement="right"></i>
89
  </label>
90
+ <textarea rows="20" class="form-control" readonly="true"></textarea>
91
  </div>
92
  <div class="line-separator"></div>
93
  <div class="form-actions">
94
  <div class="pull-right">
95
+ <a href="" class="btn vivid-green" name="ux_btn_download_error_logs"><?php echo $mb_download_error_logs;?></a>
96
  <input type="button" class="btn vivid-green btn_clear_error_logs" name="ux_btn_clear_error_logs" value="<?php echo $mb_clear_error_logs;?>">
97
  </div>
98
  </div>
views/feedbacks/feedbacks.php CHANGED
@@ -127,4 +127,4 @@ else
127
  <?php
128
  }
129
  }
130
- ?>
127
  <?php
128
  }
129
  }
130
+ ?>
views/roles-and-capabilities/roles-and-capabilities.php CHANGED
@@ -28,12 +28,12 @@ else
28
  }
29
  else if(roles_and_capabilities_mail_bank == "1")
30
  {
31
- $roles_and_capabilities = explode(",",isset($details_roles_capabilities["roles_and_capabilities"]) ? $details_roles_capabilities["roles_and_capabilities"] : "");
32
- $author = explode(",",isset($details_roles_capabilities["author_privileges"]) ? $details_roles_capabilities["author_privileges"] : "");
33
- $editor = explode(",",isset($details_roles_capabilities["editor_privileges"]) ? $details_roles_capabilities["editor_privileges"] : "");
34
- $contributor = explode(",",isset($details_roles_capabilities["contributor_privileges"]) ? $details_roles_capabilities["contributor_privileges"] : "");
35
- $subscriber = explode(",",isset($details_roles_capabilities["subscriber_privileges"]) ? $details_roles_capabilities["subscriber_privileges"] : "");
36
- $other_privileges = explode(",",isset($details_roles_capabilities["other_roles_privileges"]) ? $details_roles_capabilities["other_roles_privileges"] : "");
37
  ?>
38
  <div class="page-bar">
39
  <ul class="page-breadcrumb">
28
  }
29
  else if(roles_and_capabilities_mail_bank == "1")
30
  {
31
+ $roles_and_capabilities = explode(",",isset($details_roles_capabilities["roles_and_capabilities"]) ? esc_attr($details_roles_capabilities["roles_and_capabilities"]) : "");
32
+ $author = explode(",",isset($details_roles_capabilities["author_privileges"]) ? esc_attr($details_roles_capabilities["author_privileges"]) : "");
33
+ $editor = explode(",",isset($details_roles_capabilities["editor_privileges"]) ? esc_attr($details_roles_capabilities["editor_privileges"]) : "");
34
+ $contributor = explode(",",isset($details_roles_capabilities["contributor_privileges"]) ? esc_attr($details_roles_capabilities["contributor_privileges"]) : "");
35
+ $subscriber = explode(",",isset($details_roles_capabilities["subscriber_privileges"]) ? esc_attr($details_roles_capabilities["subscriber_privileges"]) : "");
36
+ $other_privileges = explode(",",isset($details_roles_capabilities["other_roles_privileges"]) ? esc_attr($details_roles_capabilities["other_roles_privileges"]) : "");
37
  ?>
38
  <div class="page-bar">
39
  <ul class="page-breadcrumb">
views/settings/settings.php CHANGED
@@ -1,194 +1,156 @@
1
  <?php
2
  /**
3
- * This Template is used for managing settings.
4
- *
5
- * @author Tech Banker
6
- * @package wp-mail-bank/views/settings
7
- * @version 2.0.0
8
- */
9
- if(!defined("ABSPATH")) exit; // Exit if accessed directly
10
- if(!is_user_logged_in())
11
- {
12
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
- else
15
- {
16
- $access_granted = false;
17
- foreach($user_role_permission as $permission)
18
- {
19
- if(current_user_can($permission))
20
- {
21
- $access_granted = true;
22
- break;
23
- }
24
- }
25
- if(!$access_granted)
26
- {
27
- return;
28
- }
29
- else if(settings_mail_bank == "1")
30
- {
31
- $mail_bank_settings = wp_create_nonce("mail_bank_settings");
32
- ?>
33
- <div class="page-bar">
34
- <ul class="page-breadcrumb">
35
- <li>
36
- <i class="icon-custom-home"></i>
37
- <a href="admin.php?page=mb_email_configuration">
38
- <?php echo $wp_mail_bank; ?>
39
- </a>
40
- <span>></span>
41
- </li>
42
- <li>
43
- <span>
44
- <?php echo $mb_settings; ?>
45
- </span>
46
- </li>
47
- </ul>
48
- </div>
49
- <div class="row">
50
- <div class="col-md-12">
51
- <div class="portlet box vivid-green">
52
- <div class="portlet-title">
53
- <div class="caption">
54
- <i class="icon-custom-paper-clip"></i>
55
- <?php echo $mb_settings; ?>
56
- </div>
57
- </div>
58
- <div class="portlet-body form">
59
- <form id="ux_frm_settings">
60
- <div class="form-body">
61
- <?php
62
- if($mb_message_translate_help != "")
63
- {
64
- ?>
65
- <div class="note note-danger">
66
- <h4 class="block">
67
- <?php echo $mb_important_disclaimer; ?>
68
- </h4>
69
- <strong><?php echo $mb_message_translate_help;?><br/><?php echo $mb_kindly_click;?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
70
- </div>
71
- <?php
72
- }
73
- ?>
74
- <div class="row">
75
- <div class="col-md-6">
76
- <div class="form-group">
77
- <label class="control-label">
78
- <?php echo $mb_settings_automatic_plugin_update;?> :
79
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_settings_automatic_plugin_update_tooltip;?>" data-placement="right"></i>
80
- <span class="required" aria-required="true">*</span>
81
- </label>
82
- <select name="ux_ddl_automatic_plugin_updates" id="ux_ddl_automatic_plugin_updates" class="form-control" >
83
- <option value="enable"><?php echo $mb_enable; ?></option>
84
- <option value="disable"><?php echo $mb_disable; ?></option>
85
- </select>
86
- </div>
87
- </div>
88
- <div class="col-md-6">
89
- <div class="form-group">
90
- <label class="control-label">
91
- <?php echo $mb_settings_debug_mode;?> :
92
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_settings_debug_mode_tooltip;?>" data-placement="right"></i>
93
- <span class="required" aria-required="true">*</span>
94
- </label>
95
- <select name="ux_ddl_debug_mode" id="ux_ddl_debug_mode" class="form-control" >
96
- <option value="enable"><?php echo $mb_enable; ?></option>
97
- <option value="disable"><?php echo $mb_disable; ?></option>
98
- </select>
99
- </div>
100
- </div>
101
- </div>
102
- <div class="row">
103
- <div class="col-md-6">
104
- <div class="form-group">
105
- <label class="control-label">
106
- <?php echo $mb_remove_tables_title;?> :
107
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_remove_tables_tooltip;?>" data-placement="right"></i>
108
- <span class="required" aria-required="true">*</span>
109
- </label>
110
- <select name="ux_ddl_remove_tables" id="ux_ddl_remove_tables" class="form-control" >
111
- <option value="enable"><?php echo $mb_enable; ?></option>
112
- <option value="disable"><?php echo $mb_disable; ?></option>
113
- </select>
114
- </div>
115
- </div>
116
- <div class="col-md-6">
117
- <div class="form-group">
118
- <label class="control-label">
119
- <?php echo $mb_monitoring_email_log_title;?> :
120
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_monitoring_email_log_tooltip;?>" data-placement="right"></i>
121
- <span class="required" aria-required="true">*</span>
122
- </label>
123
- <select name="ux_ddl_monitor_email_logs" id="ux_ddl_monitor_email_logs" class="form-control">
124
- <option value="enable"><?php echo $mb_enable; ?></option>
125
- <option value="disable"><?php echo $mb_disable; ?></option>
126
- </select>
127
- </div>
128
- </div>
129
- </div>
130
- <div class="form-group">
131
- <label class="control-label">
132
- <?php echo $mb_other_settings_error_reporting;?> :
133
- <i class="icon-custom-question tooltips" data-original-title="<?php echo $mbother_settings_error_reporting_tooltip; ?>" data-placement="right"></i>
134
- <span class="required" aria-required="true">*</span>
135
- </label>
136
- <select name="ux_ddl_error_reporting" id="ux_ddl_error_reporting" class="form-control">
137
- <option value="enable"><?php echo $mb_enable; ?></option>
138
- <option value="disable"><?php echo $mb_disable; ?></option>
139
- </select>
140
- </div>
141
- <div class="line-separator"></div>
142
- <div class="form-actions">
143
- <div class="pull-right">
144
- <input type="submit" class="btn vivid-green" name="ux_btn_save_changes" id="ux_btn_save_changes" value="<?php echo $mb_save_changes;?>">
145
- </div>
146
- </div>
147
- </div>
148
- </form>
149
- </div>
150
- </div>
151
- </div>
152
- </div>
153
- <?php
154
- }
155
- else
156
- {
157
- ?>
158
- <div class="page-bar">
159
- <ul class="page-breadcrumb">
160
- <li>
161
- <i class="icon-custom-home"></i>
162
- <a href="admin.php?page=mb_email_configuration">
163
- <?php echo $wp_mail_bank; ?>
164
- </a>
165
- <span>></span>
166
- </li>
167
- <li>
168
- <span>
169
- <?php echo $mb_settings; ?>
170
- </span>
171
- </li>
172
- </ul>
173
- </div>
174
- <div class="row">
175
- <div class="col-md-12">
176
- <div class="portlet box vivid-green">
177
- <div class="portlet-title">
178
- <div class="caption">
179
- <i class="icon-custom-paper-clip"></i>
180
- <?php echo $mb_settings; ?>
181
- </div>
182
- </div>
183
- <div class="portlet-body form">
184
- <div class="form-body">
185
- <strong><?php echo $mb_user_access_message;?></strong>
186
- </div>
187
- </div>
188
- </div>
189
- </div>
190
- </div>
191
- <?php
192
- }
193
- }
194
- ?>
1
  <?php
2
  /**
3
+ * This Template is used for managing settings.
4
+ *
5
+ * @author Tech Banker
6
+ * @package wp-mail-bank/views/settings
7
+ * @version 2.0.0
8
+ */
9
+ if (!defined("ABSPATH"))
10
+ exit; // Exit if accessed directly
11
+ if (!is_user_logged_in()) {
12
+ return;
13
+ } else {
14
+ $access_granted = false;
15
+ foreach ($user_role_permission as $permission) {
16
+ if (current_user_can($permission)) {
17
+ $access_granted = true;
18
+ break;
19
+ }
20
+ }
21
+ if (!$access_granted) {
22
+ return;
23
+ } else if (settings_mail_bank == "1") {
24
+ $mail_bank_settings = wp_create_nonce("mail_bank_settings");
25
+ ?>
26
+ <div class="page-bar">
27
+ <ul class="page-breadcrumb">
28
+ <li>
29
+ <i class="icon-custom-home"></i>
30
+ <a href="admin.php?page=mb_email_configuration">
31
+ <?php echo $wp_mail_bank; ?>
32
+ </a>
33
+ <span>></span>
34
+ </li>
35
+ <li>
36
+ <span>
37
+ <?php echo $mb_settings; ?>
38
+ </span>
39
+ </li>
40
+ </ul>
41
+ </div>
42
+ <div class="row">
43
+ <div class="col-md-12">
44
+ <div class="portlet box vivid-green">
45
+ <div class="portlet-title">
46
+ <div class="caption">
47
+ <i class="icon-custom-paper-clip"></i>
48
+ <?php echo $mb_settings; ?>
49
+ </div>
50
+ </div>
51
+ <div class="portlet-body form">
52
+ <form id="ux_frm_settings">
53
+ <div class="form-body">
54
+ <?php
55
+ if ($mb_message_translate_help != "") {
56
+ ?>
57
+ <div class="note note-danger">
58
+ <h4 class="block">
59
+ <?php echo $mb_important_disclaimer; ?>
60
+ </h4>
61
+ <strong><?php echo $mb_message_translate_help; ?><br/><?php echo $mb_kindly_click; ?><a href="javascript:void(0);" data-popup-open="ux_open_popup_translator" class="custom_links" onclick="show_pop_up_mail_bank();"><?php echo $mb_message_translate_here; ?></a></strong>
62
+ </div>
63
+ <?php
64
+ }
65
+ ?>
66
+ <div class="form-group">
67
+ <label class="control-label">
68
+ <?php echo $mb_settings_debug_mode; ?> :
69
+ <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_settings_debug_mode_tooltip; ?>" data-placement="right"></i>
70
+ <span class="required" aria-required="true">*</span>
71
+ </label>
72
+ <select name="ux_ddl_debug_mode" id="ux_ddl_debug_mode" class="form-control" >
73
+ <option value="enable"><?php echo $mb_enable; ?></option>
74
+ <option value="disable"><?php echo $mb_disable; ?></option>
75
+ </select>
76
+ </div>
77
+ <div class="row">
78
+ <div class="col-md-6">
79
+ <div class="form-group">
80
+ <label class="control-label">
81
+ <?php echo $mb_remove_tables_title; ?> :
82
+ <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_remove_tables_tooltip; ?>" data-placement="right"></i>
83
+ <span class="required" aria-required="true">*</span>
84
+ </label>
85
+ <select name="ux_ddl_remove_tables" id="ux_ddl_remove_tables" class="form-control" >
86
+ <option value="enable"><?php echo $mb_enable; ?></option>
87
+ <option value="disable"><?php echo $mb_disable; ?></option>
88
+ </select>
89
+ </div>
90
+ </div>
91
+ <div class="col-md-6">
92
+ <div class="form-group">
93
+ <label class="control-label">
94
+ <?php echo $mb_monitoring_email_log_title; ?> :
95
+ <i class="icon-custom-question tooltips" data-original-title="<?php echo $mb_monitoring_email_log_tooltip; ?>" data-placement="right"></i>
96
+ <span class="required" aria-required="true">*</span>
97
+ </label>
98
+ <select name="ux_ddl_monitor_email_logs" id="ux_ddl_monitor_email_logs" class="form-control">
99
+ <option value="enable"><?php echo $mb_enable; ?></option>
100
+ <option value="disable"><?php echo $mb_disable; ?></option>
101
+ </select>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <div class="line-separator"></div>
106
+ <div class="form-actions">
107
+ <div class="pull-right">
108
+ <input type="submit" class="btn vivid-green" name="ux_btn_save_changes" id="ux_btn_save_changes" value="<?php echo $mb_save_changes; ?>">
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </form>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ <?php
118
+ } else {
119
+ ?>
120
+ <div class="page-bar">
121
+ <ul class="page-breadcrumb">
122
+ <li>
123
+ <i class="icon-custom-home"></i>
124
+ <a href="admin.php?page=mb_email_configuration">
125
+ <?php echo $wp_mail_bank; ?>
126
+ </a>
127
+ <span>></span>
128
+ </li>
129
+ <li>
130
+ <span>
131
+ <?php echo $mb_settings; ?>
132
+ </span>
133
+ </li>
134
+ </ul>
135
+ </div>
136
+ <div class="row">
137
+ <div class="col-md-12">
138
+ <div class="portlet box vivid-green">
139
+ <div class="portlet-title">
140
+ <div class="caption">
141
+ <i class="icon-custom-paper-clip"></i>
142
+ <?php echo $mb_settings; ?>
143
+ </div>
144
+ </div>
145
+ <div class="portlet-body form">
146
+ <div class="form-body">
147
+ <strong><?php echo $mb_user_access_message; ?></strong>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ <?php
154
+ }
155
  }
156
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/wizard/wizard.php CHANGED
@@ -131,8 +131,7 @@ else
131
  </div>
132
  </div>
133
  </div>
134
- </body>
135
- </html>
136
  <?php
137
  }
138
  }
131
  </div>
132
  </div>
133
  </div>
134
+ </body></html>
 
135
  <?php
136
  }
137
  }
wp-mail-bank.php CHANGED
@@ -6,7 +6,7 @@
6
  Description: Mail Bank easily configures sending emails and logging them from your WordPress site using your preferred PHPMailer or SMTP server.
7
  Author: Tech Banker
8
  Author URI: http://beta.tech-banker.com
9
- Version: 3.0.3
10
  License: GPLv3
11
  Text Domain: wp-mail-bank
12
  Domain Path: /languages
@@ -21,15 +21,9 @@ if (!defined("MAIL_BANK_DIR_PATH"))
21
  define("MAIL_BANK_DIR_PATH", plugin_dir_path(__FILE__));
22
  if (!defined("MAIL_BANK_PLUGIN_DIRNAME"))
23
  define("MAIL_BANK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
24
- if (!defined("MAIL_BANK_MAIN_DIR"))
25
- define("MAIL_BANK_MAIN_DIR", dirname(dirname(MAIL_BANK_DIR_PATH)) . "/wp-mail-bank");
26
- if (!defined("MAIL_BANK_ERROR_LOGS_FILE"))
27
- define("MAIL_BANK_ERROR_LOGS_FILE", MAIL_BANK_MAIN_DIR . "/error-logs.txt");
28
  if (!defined("MAIL_BANK_LOCAL_TIME"))
29
  define("MAIL_BANK_LOCAL_TIME", strtotime(date_i18n("Y-m-d H:i:s")));
30
- if (!is_dir(MAIL_BANK_MAIN_DIR)) {
31
- wp_mkdir_p(MAIL_BANK_MAIN_DIR);
32
- }
33
  if (is_ssl()) {
34
  if (!defined("tech_banker_url"))
35
  define("tech_banker_url", "https://tech-banker.com");
@@ -45,26 +39,14 @@ else {
45
  if (!defined("tech_banker_stats_url"))
46
  define("tech_banker_stats_url", "http://stats.tech-banker-services.org");
47
  if (!defined("mail_bank_version_number"))
48
- define("mail_bank_version_number", "3.0.3");
49
-
50
- if (!function_exists("mail_bank_error_log_file")) {
51
 
52
- function mail_bank_error_log_file() {
53
- if (!file_exists(MAIL_BANK_ERROR_LOGS_FILE)) {
54
- $mb_error_file = fopen(MAIL_BANK_ERROR_LOGS_FILE, 'wb');
55
- fclose($mb_error_file);
56
- }
57
- }
58
-
59
- }
60
 
61
  $memory_limit_mail_bank = intval(ini_get("memory_limit"));
62
  if (!extension_loaded('suhosin') && $memory_limit_mail_bank < 512) {
63
  @ini_set("memory_limit", "512M");
64
  }
65
 
66
- @ini_set("max_execution_time", 6000);
67
- @ini_set("max_input_vars", 10000);
68
 
69
  /*
70
  Function Name: get_users_capabilities_mail_bank
@@ -74,7 +56,6 @@ if (!extension_loaded('suhosin') && $memory_limit_mail_bank < 512) {
74
  Created By: Tech Banker Team
75
  */
76
 
77
- if (!function_exists("get_users_capabilities_mail_bank")) {
78
 
79
  function get_users_capabilities_mail_bank() {
80
  global $wpdb;
@@ -99,7 +80,6 @@ if (!function_exists("get_users_capabilities_mail_bank")) {
99
  return isset($unserialized_capabilities["capabilities"]) ? $unserialized_capabilities["capabilities"] : $core_roles;
100
  }
101
 
102
- }
103
 
104
  /*
105
  Function Name: install_script_for_mail_bank
@@ -109,7 +89,6 @@ if (!function_exists("get_users_capabilities_mail_bank")) {
109
  Created By: Tech Banker Team
110
  */
111
 
112
- if (!function_exists("install_script_for_mail_bank")) {
113
 
114
  function install_script_for_mail_bank() {
115
  global $wpdb;
@@ -135,7 +114,7 @@ if (!function_exists("install_script_for_mail_bank")) {
135
  }
136
  }
137
 
138
- }
139
 
140
  /*
141
  Function Name: check_user_roles_mail_bank
@@ -145,7 +124,6 @@ if (!function_exists("install_script_for_mail_bank")) {
145
  Created By: Tech Banker Team
146
  */
147
 
148
- if (!function_exists("check_user_roles_mail_bank")) {
149
 
150
  function check_user_roles_mail_bank() {
151
  global $current_user;
@@ -153,7 +131,6 @@ if (!function_exists("check_user_roles_mail_bank")) {
153
  return $user->roles ? $user->roles[0] : false;
154
  }
155
 
156
- }
157
 
158
 
159
  /*
@@ -164,14 +141,12 @@ if (!function_exists("check_user_roles_mail_bank")) {
164
  Created By: Tech Banker Team
165
  */
166
 
167
- if (!function_exists("mail_bank")) {
168
 
169
  function mail_bank() {
170
  global $wpdb;
171
  return $wpdb->prefix . "mail_bank";
172
  }
173
 
174
- }
175
 
176
  /*
177
  Function Name: mail_bank_meta
@@ -181,14 +156,12 @@ if (!function_exists("mail_bank")) {
181
  Created By: Tech Banker Team
182
  */
183
 
184
- if (!function_exists("mail_bank_meta")) {
185
 
186
  function mail_bank_meta() {
187
  global $wpdb;
188
  return $wpdb->prefix . "mail_bank_meta";
189
  }
190
 
191
- }
192
 
193
  /*
194
  Function Name: get_others_capabilities_mail_bank
@@ -198,7 +171,6 @@ if (!function_exists("mail_bank_meta")) {
198
  Created By: Tech Banker Team
199
  */
200
 
201
- if (!function_exists("get_others_capabilities_mail_bank")) {
202
 
203
  function get_others_capabilities_mail_bank() {
204
  $user_capabilities = array();
@@ -225,7 +197,7 @@ if (!function_exists("get_others_capabilities_mail_bank")) {
225
  return $user_capabilities;
226
  }
227
 
228
- }
229
 
230
  /*
231
  Function Name: mail_bank_action_links
@@ -234,14 +206,12 @@ if (!function_exists("get_others_capabilities_mail_bank")) {
234
  Created On: 24-04-2017 12:20
235
  Created By: Tech Banker Team
236
  */
237
- if (!function_exists("mail_bank_action_links")) {
238
 
239
  function mail_bank_action_links($plugin_link) {
240
  $plugin_link[] = "<a href=\"http://beta.tech-banker.com/products/mail-bank/\" style=\"color: red; font-weight: bold;\" target=\"_blank\">Go Pro!</a>";
241
  return $plugin_link;
242
  }
243
 
244
- }
245
  /*
246
  Function Name: mail_bank_settings_link
247
  Parameters: No
@@ -250,7 +220,6 @@ if (!function_exists("mail_bank_action_links")) {
250
  Created By: Tech Banker Team
251
  */
252
 
253
- if (!function_exists("mail_bank_settings_link")) {
254
 
255
  function mail_bank_settings_link($action) {
256
  global $wpdb;
@@ -260,7 +229,6 @@ if (!function_exists("mail_bank_settings_link")) {
260
  return $action;
261
  }
262
 
263
- }
264
  $version = get_option("mail-bank-version-number");
265
  if ($version >= "3.0.0") {
266
  /* admin_enqueue_scripts for backend_js_css_for_mail_bank
@@ -270,7 +238,6 @@ if ($version >= "3.0.0") {
270
  */
271
 
272
  if (is_admin()) {
273
- if (!function_exists("backend_js_css_for_mail_bank")) {
274
 
275
  function backend_js_css_for_mail_bank() {
276
  $pages_mail_bank = array(
@@ -317,8 +284,7 @@ if ($version >= "3.0.0") {
317
 
318
  }
319
  add_action("admin_enqueue_scripts", "backend_js_css_for_mail_bank");
320
- }
321
-
322
  /*
323
  Function Name: helper_file_for_mail_bank
324
  Parameters: No
@@ -327,7 +293,6 @@ if ($version >= "3.0.0") {
327
  Created By: Tech Banker Team
328
  */
329
 
330
- if (!function_exists("helper_file_for_mail_bank")) {
331
 
332
  function helper_file_for_mail_bank() {
333
  global $wpdb;
@@ -337,8 +302,6 @@ if ($version >= "3.0.0") {
337
  }
338
  }
339
 
340
- }
341
-
342
  /*
343
  Function Name: sidebar_menu_for_mail_bank
344
  Parameters: No
@@ -347,7 +310,6 @@ if ($version >= "3.0.0") {
347
  Created By: Tech Banker Team
348
  */
349
 
350
- if (!function_exists("sidebar_menu_for_mail_bank")) {
351
 
352
  function sidebar_menu_for_mail_bank() {
353
  global $wpdb, $current_user;
@@ -360,7 +322,6 @@ if ($version >= "3.0.0") {
360
  }
361
  }
362
 
363
- }
364
 
365
  /*
366
  Function Name: topbar_menu_for_mail_bank
@@ -370,7 +331,6 @@ if ($version >= "3.0.0") {
370
  Created By: Tech Banker Team
371
  */
372
 
373
- if (!function_exists("topbar_menu_for_mail_bank")) {
374
 
375
  function topbar_menu_for_mail_bank() {
376
  global $wpdb, $current_user, $wp_admin_bar;
@@ -398,7 +358,7 @@ if ($version >= "3.0.0") {
398
  }
399
  }
400
 
401
- }
402
 
403
  /*
404
  Function Name: ajax_register_for_mail_bank
@@ -408,7 +368,6 @@ if ($version >= "3.0.0") {
408
  Created By: Tech Banker Team
409
  */
410
 
411
- if (!function_exists("ajax_register_for_mail_bank")) {
412
 
413
  function ajax_register_for_mail_bank() {
414
  global $wpdb;
@@ -421,7 +380,6 @@ if ($version >= "3.0.0") {
421
  }
422
  }
423
 
424
- }
425
 
426
  /*
427
  Function Name: plugin_load_textdomain_mail_bank
@@ -431,15 +389,11 @@ if ($version >= "3.0.0") {
431
  Created By: Tech Banker Team
432
  */
433
 
434
- if (!function_exists("plugin_load_textdomain_mail_bank")) {
435
 
436
  function plugin_load_textdomain_mail_bank() {
437
- if (function_exists("load_plugin_textdomain")) {
438
  load_plugin_textdomain("wp-mail-bank", false, MAIL_BANK_PLUGIN_DIRNAME . "/languages");
439
- }
440
  }
441
 
442
- }
443
 
444
  /*
445
  Function Name: oauth_handling_mail_bank
@@ -449,7 +403,6 @@ if ($version >= "3.0.0") {
449
  Created By: Tech Banker Team
450
  */
451
 
452
- if (!function_exists("oauth_handling_mail_bank")) {
453
 
454
  function oauth_handling_mail_bank() {
455
  if (is_admin()) {
@@ -464,7 +417,6 @@ if ($version >= "3.0.0") {
464
  }
465
  }
466
 
467
- }
468
 
469
  /*
470
  Function Name: email_configuration_mail_bank
@@ -474,7 +426,6 @@ if ($version >= "3.0.0") {
474
  Created By: Tech Banker Team
475
  */
476
 
477
- if (!function_exists("email_configuration_mail_bank")) {
478
 
479
  function email_configuration_mail_bank($phpmailer) {
480
  global $wpdb;
@@ -516,7 +467,6 @@ if ($version >= "3.0.0") {
516
  $phpmailer->Sender = $email_configuration_data_array["email_address"];
517
  }
518
 
519
- }
520
 
521
  /*
522
  Function Name: admin_functions_for_mail_bank
@@ -526,34 +476,12 @@ if ($version >= "3.0.0") {
526
  Created By: Tech Banker Team
527
  */
528
 
529
- if (!function_exists("admin_functions_for_mail_bank")) {
530
 
531
  function admin_functions_for_mail_bank() {
532
  install_script_for_mail_bank();
533
  helper_file_for_mail_bank();
534
  }
535
 
536
- }
537
-
538
- /*
539
- Function Name: plugin_auto_update_mail_bank
540
- Parameters: No
541
- Description: This function is used to Update the plugin's version.
542
- Created On: 16-06-2016 11:02
543
- Created By: Tech Banker Team
544
- */
545
-
546
- if (!function_exists("plugin_auto_update_mail_bank")) {
547
-
548
- function plugin_auto_update_mail_bank() {
549
- if (!wp_next_scheduled("automatic_updates_mail_bank")) {
550
- wp_schedule_event(MAIL_BANK_LOCAL_TIME, "daily", "automatic_updates_mail_bank");
551
- }
552
- add_action("automatic_updates_mail_bank", "mail_bank_plugin_autoupdate");
553
- }
554
-
555
- }
556
-
557
  /*
558
  Function Name: mailer_file_for_mail_bank
559
  Parameters: No
@@ -562,7 +490,6 @@ if ($version >= "3.0.0") {
562
  Created By: Tech Banker Team
563
  */
564
 
565
- if (!function_exists("mailer_file_for_mail_bank")) {
566
 
567
  function mailer_file_for_mail_bank() {
568
  if (file_exists(MAIL_BANK_DIR_PATH . "includes/mailer.php")) {
@@ -570,49 +497,15 @@ if ($version >= "3.0.0") {
570
  }
571
  }
572
 
573
- }
574
-
575
- /*
576
- Function Name: mail_bank_plugin_autoupdate
577
- Parameters: No
578
- Description: This function is used to Update the plugin automatically.
579
- Created On: 16-06-2016 11:18
580
- Created By: Tech Banker Team
581
- */
582
-
583
- if (!function_exists("mail_bank_plugin_autoupdate")) {
584
-
585
- function mail_bank_plugin_autoupdate() {
586
- try {
587
- require_once(ABSPATH . "wp-admin/includes/class-wp-upgrader.php");
588
- require_once(ABSPATH . "wp-admin/includes/misc.php");
589
- define("FS_METHOD", "direct");
590
- require_once(ABSPATH . "wp-includes/update.php");
591
- require_once(ABSPATH . "wp-admin/includes/file.php");
592
- wp_update_plugins();
593
- ob_start();
594
- $plugin_upgrader = new Plugin_Upgrader();
595
- $plugin_upgrader->upgrade(MAIL_BANK_FILE);
596
- $output = @ob_get_contents();
597
- @ob_end_clean();
598
- } catch (Exception $e) {
599
-
600
- }
601
- }
602
-
603
- }
604
-
605
- /*
606
- Function Name: user_functions_for_mail_bank
607
- Parameters: No
608
- Description: This function is used to call on init hook.
609
- Created On: 16-06-2016 11:08
610
- Created By: Tech Banker Team
611
- */
612
- if (!function_exists("user_functions_for_mail_bank")) {
613
-
614
  function user_functions_for_mail_bank() {
615
- mail_bank_error_log_file();
616
  global $wpdb;
617
  $meta_values = $wpdb->get_results
618
  (
@@ -628,15 +521,6 @@ if ($version >= "3.0.0") {
628
  $unserialize_data = unserialize($value->meta_value);
629
  array_push($meta_data_array, $unserialize_data);
630
  }
631
- if ($meta_data_array[1]["error_reporting"] == "enable") {
632
- @ini_set("log_errors", 1);
633
- @ini_set("error_log", MAIL_BANK_ERROR_LOGS_FILE);
634
- }
635
- if (isset($meta_data_array[1]["automatic_plugin_update"]) && $meta_data_array[1]["automatic_plugin_update"] == "enable") {
636
- plugin_auto_update_mail_bank();
637
- } else {
638
- wp_clear_scheduled_hook("automatic_updates_mail_bank");
639
- }
640
  mailer_file_for_mail_bank();
641
  if ($meta_data_array[0]["mailer_type"] == "php_mail_function") {
642
  add_action("phpmailer_init", "email_configuration_mail_bank");
@@ -646,55 +530,23 @@ if ($version >= "3.0.0") {
646
  oauth_handling_mail_bank();
647
  }
648
 
649
- }
 
 
 
 
650
 
651
- /*
652
- Description: Override Mail Function here.
653
- Created On: 30-06-2016 02:13
654
- Created By: Tech Banker Team
655
- */
656
-
657
- mailer_file_for_mail_bank();
658
- mail_bank_auth_host::override_wp_mail_function();
659
-
660
- /*
661
- Function Name: uninstall_script_for_mail_bank
662
- Parameters: No
663
- Description: This function is used to delete schedulers and options on Uninstall Hook.
664
- Created On: 16-06-2016 12:00
665
- Created By: Tech Banker Team
666
- */
667
-
668
- if (!function_exists("uninstall_script_for_mail_bank")) {
669
 
670
- function uninstall_script_for_mail_bank() {
671
- global $wpdb;
672
- if (is_multisite()) {
673
- $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
674
- foreach ($blog_ids as $blog_id) {
675
- switch_to_blog($blog_id);
676
- if (file_exists(MAIL_BANK_DIR_PATH . "lib/uninstall-script.php")) {
677
- include MAIL_BANK_DIR_PATH . "lib/uninstall-script.php";
678
- }
679
- restore_current_blog();
680
- }
681
- } else {
682
- if (file_exists(MAIL_BANK_DIR_PATH . "lib/uninstall-script.php")) {
683
- include MAIL_BANK_DIR_PATH . "lib/uninstall-script.php";
684
- }
685
- }
686
- }
687
-
688
- }
689
- /*
690
- Function Name: deactivation_function_for_wp_mail_bank
691
- Parameters: No
692
- Description: This function is used for executing the code on deactivation.
693
- Created On: 21-04-2017 09:22
694
- Created by: Tech Banker Team
695
- */
696
 
697
- if (!function_exists("deactivation_function_for_wp_mail_bank")) {
 
 
 
 
 
 
698
 
699
  function deactivation_function_for_wp_mail_bank() {
700
  $type = get_option("wp-mail-bank-wizard-set-up");
@@ -732,190 +584,162 @@ if ($version >= "3.0.0") {
732
  $plugin_stat_data["extensions"] = get_loaded_extensions();
733
  $plugin_stat_data["plugins"] = $plugin_info_wp_mail_bank->get_plugin_info_wp_mail_bank();
734
  $plugin_stat_data["themes"] = $theme_details;
735
- if (function_exists("curl_init")) {
736
- $ch = curl_init();
737
- curl_setopt($ch, CURLOPT_URL, $url);
738
- curl_setopt($ch, CURLOPT_POST, 1);
739
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
740
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
741
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
742
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
743
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")));
744
- $result = curl_exec($ch);
745
- update_option("mb_tech_banker_site_id", $result);
746
- curl_close($ch);
747
- } else {
748
- $response = wp_safe_remote_post($url, array
749
- (
750
- "method" => "POST",
751
- "timeout" => 45,
752
- "redirection" => 5,
753
- "httpversion" => "1.0",
754
- "blocking" => false,
755
- "headers" => array(),
756
- "body" => array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")
757
- ));
758
-
759
- if (!is_wp_error($response)) {
760
- $response["body"] != "" ? update_option("mb_tech_banker_site_id", $response["body"]) : "";
761
- } else {
762
- update_option("mb_tech_banker_site_id", "error");
763
- }
764
  }
765
  }
766
  }
767
 
768
- }
769
 
770
- /* hooks */
 
 
 
 
 
771
 
772
- /*
773
- register_activation_hook for install_script_for_mail_bank
774
- Description: This hook is used for calling the function of install script.
775
- Created On: 15-06-2016 09:46
776
- Created By: Tech Banker Team
777
- */
778
 
779
- register_activation_hook(__FILE__, "install_script_for_mail_bank");
 
 
 
 
 
780
 
781
- /*
782
- add_action for admin_functions_for_mail_bank
783
- Description: This hook contains all admin_init functions.
784
- Created On: 15-06-2016 09:46
785
- Created By: Tech Banker Team
786
- */
787
 
788
- add_action("admin_init", "admin_functions_for_mail_bank");
789
 
 
 
 
 
 
 
790
 
791
- /*
792
- add_action for user_functions_for_mail_bank
793
- Description: This hook is used for calling the function of user functions.
794
- Created On: 16-06-2016 11:07
795
- Created By: Tech Banker Team
796
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
797
 
798
- add_action("init", "user_functions_for_mail_bank");
 
 
 
 
 
 
 
 
799
 
800
  /*
801
- add_action for sidebar_menu_for_mail_bank
802
- Description: This hook is used for calling the function of sidebar menu.
803
  Created On: 15-06-2016 09:46
804
  Created By: Tech Banker Team
805
  */
806
 
807
- add_action("admin_menu", "sidebar_menu_for_mail_bank");
808
 
809
  /*
810
- add_action for sidebar_menu_for_mail_bank
811
- Description: This hook is used for calling the function of sidebar menu in multisite case.
812
- Created On: 19-10-2016 05:18
813
  Created By: Tech Banker Team
814
  */
815
 
816
- add_action("network_admin_menu", "sidebar_menu_for_mail_bank");
817
 
818
- /*
819
- add_action for topbar_menu_for_mail_bank
820
- Description: This hook is used for calling the function of topbar menu.
821
- Created On: 15-06-2016 09:46
822
- Created By: Tech Banker Team
823
  */
824
 
825
- add_action("admin_bar_menu", "topbar_menu_for_mail_bank", 100);
826
 
827
- /*
828
- add_action for plugin_load_textdomain_mail_bank
829
- Description: This hook is used for calling the function of languages.
830
- Created On: 16-06-2016 09:47
831
- Created By: Tech Banker Team
832
  */
 
833
 
834
- add_action("init", "plugin_load_textdomain_mail_bank");
835
 
836
  /*
837
- register_uninstall_hook
838
- Description: This hook is used for calling the function of uninstall script.
839
- Created On: 16-06-2016 12:00
840
  Created By: Tech Banker Team
841
  */
842
- register_uninstall_hook(__FILE__, "uninstall_script_for_mail_bank");
 
843
 
844
  /*
845
- add_action hook for ajax_register_for_mail_bank
846
- Description: This hook is used to register ajax.
847
- Created On: 16-06-2016 12:00
848
  Created By: Tech Banker Team
849
  */
850
- add_action("wp_ajax_mail_bank_action", "ajax_register_for_mail_bank");
851
- }
852
-
853
- /*
854
- register_activation_hook for install_script_for_mail_bank
855
- Description: This hook is used for calling the function of install script.
856
- Created On: 15-06-2016 09:46
857
- Created By: Tech Banker Team
858
- */
859
-
860
- register_activation_hook(__FILE__, "install_script_for_mail_bank");
861
-
862
- /*
863
- add_action for install_script_for_mail_bank
864
- Description: This hook used for calling the function of install script.
865
- Created On: 15-06-2016 09:46
866
- Created By: Tech Banker Team
867
- */
868
-
869
- add_action("admin_init", "install_script_for_mail_bank");
870
-
871
- /* deactivation_function_for_wp_mail_bank
872
- Description: This hook is used to sets the deactivation hook for a plugin.
873
- Created On: 21-04-2017 09:22
874
- Created by: Tech Banker Team
875
- */
876
-
877
- register_deactivation_hook(__FILE__, "deactivation_function_for_wp_mail_bank");
878
-
879
- /* add_filter create Go Pro link for Mail Bank
880
- Description: This hook is used for create link for premium Editions.
881
- Created On: 24-04-2017 12:21
882
- Created by: Tech Banker Team
883
- */
884
- add_filter("plugin_action_links_" . plugin_basename(__FILE__), "mail_bank_action_links");
885
-
886
-
887
- /*
888
- add_filter for mail_bank_settings_link
889
- Description: This hook is used for calling the function of settings link.
890
- Created On: 09-08-2016 02:51
891
- Created By: Tech Banker Team
892
- */
893
-
894
- add_filter("plugin_action_links_" . plugin_basename(__FILE__), "mail_bank_settings_link", 10, 2);
895
-
896
- /*
897
- Class Name: plugin_activate_wp_mail_bank
898
- Description: This function is used to add option on plugin activation.
899
- Created On: 24-04-2017 12:04
900
- Created By: Tech Banker Team
901
- */
902
-
903
- if (!function_exists("plugin_activate_wp_mail_bank")) {
904
 
905
  function plugin_activate_wp_mail_bank() {
906
  add_option("wp_mail_bank_do_activation_redirect", true);
907
  }
908
 
909
- }
910
 
911
- /*
912
- Function Name: wp_mail_bank_redirect
913
- Description: This function is used to redirect to email setup.
914
- Created On: 24-04-2017 12:04
915
- Created By: Tech Banker Team
916
- */
917
 
918
- if (!function_exists("wp_mail_bank_redirect")) {
919
 
920
  function wp_mail_bank_redirect() {
921
  if (get_option("wp_mail_bank_do_activation_redirect", false)) {
@@ -925,7 +749,6 @@ if (!function_exists("wp_mail_bank_redirect")) {
925
  }
926
  }
927
 
928
- }
929
- register_activation_hook(__FILE__, "plugin_activate_wp_mail_bank");
930
- add_action("admin_init", "wp_mail_bank_redirect");
931
  ?>
6
  Description: Mail Bank easily configures sending emails and logging them from your WordPress site using your preferred PHPMailer or SMTP server.
7
  Author: Tech Banker
8
  Author URI: http://beta.tech-banker.com
9
+ Version: 3.0.4
10
  License: GPLv3
11
  Text Domain: wp-mail-bank
12
  Domain Path: /languages
21
  define("MAIL_BANK_DIR_PATH", plugin_dir_path(__FILE__));
22
  if (!defined("MAIL_BANK_PLUGIN_DIRNAME"))
23
  define("MAIL_BANK_PLUGIN_DIRNAME", plugin_basename(dirname(__FILE__)));
 
 
 
 
24
  if (!defined("MAIL_BANK_LOCAL_TIME"))
25
  define("MAIL_BANK_LOCAL_TIME", strtotime(date_i18n("Y-m-d H:i:s")));
26
+
 
 
27
  if (is_ssl()) {
28
  if (!defined("tech_banker_url"))
29
  define("tech_banker_url", "https://tech-banker.com");
39
  if (!defined("tech_banker_stats_url"))
40
  define("tech_banker_stats_url", "http://stats.tech-banker-services.org");
41
  if (!defined("mail_bank_version_number"))
42
+ define("mail_bank_version_number", "3.0.4");
 
 
43
 
 
 
 
 
 
 
 
 
44
 
45
  $memory_limit_mail_bank = intval(ini_get("memory_limit"));
46
  if (!extension_loaded('suhosin') && $memory_limit_mail_bank < 512) {
47
  @ini_set("memory_limit", "512M");
48
  }
49
 
 
 
50
 
51
  /*
52
  Function Name: get_users_capabilities_mail_bank
56
  Created By: Tech Banker Team
57
  */
58
 
 
59
 
60
  function get_users_capabilities_mail_bank() {
61
  global $wpdb;
80
  return isset($unserialized_capabilities["capabilities"]) ? $unserialized_capabilities["capabilities"] : $core_roles;
81
  }
82
 
 
83
 
84
  /*
85
  Function Name: install_script_for_mail_bank
89
  Created By: Tech Banker Team
90
  */
91
 
 
92
 
93
  function install_script_for_mail_bank() {
94
  global $wpdb;
114
  }
115
  }
116
 
117
+
118
 
119
  /*
120
  Function Name: check_user_roles_mail_bank
124
  Created By: Tech Banker Team
125
  */
126
 
 
127
 
128
  function check_user_roles_mail_bank() {
129
  global $current_user;
131
  return $user->roles ? $user->roles[0] : false;
132
  }
133
 
 
134
 
135
 
136
  /*
141
  Created By: Tech Banker Team
142
  */
143
 
 
144
 
145
  function mail_bank() {
146
  global $wpdb;
147
  return $wpdb->prefix . "mail_bank";
148
  }
149
 
 
150
 
151
  /*
152
  Function Name: mail_bank_meta
156
  Created By: Tech Banker Team
157
  */
158
 
 
159
 
160
  function mail_bank_meta() {
161
  global $wpdb;
162
  return $wpdb->prefix . "mail_bank_meta";
163
  }
164
 
 
165
 
166
  /*
167
  Function Name: get_others_capabilities_mail_bank
171
  Created By: Tech Banker Team
172
  */
173
 
 
174
 
175
  function get_others_capabilities_mail_bank() {
176
  $user_capabilities = array();
197
  return $user_capabilities;
198
  }
199
 
200
+
201
 
202
  /*
203
  Function Name: mail_bank_action_links
206
  Created On: 24-04-2017 12:20
207
  Created By: Tech Banker Team
208
  */
 
209
 
210
  function mail_bank_action_links($plugin_link) {
211
  $plugin_link[] = "<a href=\"http://beta.tech-banker.com/products/mail-bank/\" style=\"color: red; font-weight: bold;\" target=\"_blank\">Go Pro!</a>";
212
  return $plugin_link;
213
  }
214
 
 
215
  /*
216
  Function Name: mail_bank_settings_link
217
  Parameters: No
220
  Created By: Tech Banker Team
221
  */
222
 
 
223
 
224
  function mail_bank_settings_link($action) {
225
  global $wpdb;
229
  return $action;
230
  }
231
 
 
232
  $version = get_option("mail-bank-version-number");
233
  if ($version >= "3.0.0") {
234
  /* admin_enqueue_scripts for backend_js_css_for_mail_bank
238
  */
239
 
240
  if (is_admin()) {
 
241
 
242
  function backend_js_css_for_mail_bank() {
243
  $pages_mail_bank = array(
284
 
285
  }
286
  add_action("admin_enqueue_scripts", "backend_js_css_for_mail_bank");
287
+
 
288
  /*
289
  Function Name: helper_file_for_mail_bank
290
  Parameters: No
293
  Created By: Tech Banker Team
294
  */
295
 
 
296
 
297
  function helper_file_for_mail_bank() {
298
  global $wpdb;
302
  }
303
  }
304
 
 
 
305
  /*
306
  Function Name: sidebar_menu_for_mail_bank
307
  Parameters: No
310
  Created By: Tech Banker Team
311
  */
312
 
 
313
 
314
  function sidebar_menu_for_mail_bank() {
315
  global $wpdb, $current_user;
322
  }
323
  }
324
 
 
325
 
326
  /*
327
  Function Name: topbar_menu_for_mail_bank
331
  Created By: Tech Banker Team
332
  */
333
 
 
334
 
335
  function topbar_menu_for_mail_bank() {
336
  global $wpdb, $current_user, $wp_admin_bar;
358
  }
359
  }
360
 
361
+
362
 
363
  /*
364
  Function Name: ajax_register_for_mail_bank
368
  Created By: Tech Banker Team
369
  */
370
 
 
371
 
372
  function ajax_register_for_mail_bank() {
373
  global $wpdb;
380
  }
381
  }
382
 
 
383
 
384
  /*
385
  Function Name: plugin_load_textdomain_mail_bank
389
  Created By: Tech Banker Team
390
  */
391
 
 
392
 
393
  function plugin_load_textdomain_mail_bank() {
 
394
  load_plugin_textdomain("wp-mail-bank", false, MAIL_BANK_PLUGIN_DIRNAME . "/languages");
 
395
  }
396
 
 
397
 
398
  /*
399
  Function Name: oauth_handling_mail_bank
403
  Created By: Tech Banker Team
404
  */
405
 
 
406
 
407
  function oauth_handling_mail_bank() {
408
  if (is_admin()) {
417
  }
418
  }
419
 
 
420
 
421
  /*
422
  Function Name: email_configuration_mail_bank
426
  Created By: Tech Banker Team
427
  */
428
 
 
429
 
430
  function email_configuration_mail_bank($phpmailer) {
431
  global $wpdb;
467
  $phpmailer->Sender = $email_configuration_data_array["email_address"];
468
  }
469
 
 
470
 
471
  /*
472
  Function Name: admin_functions_for_mail_bank
476
  Created By: Tech Banker Team
477
  */
478
 
 
479
 
480
  function admin_functions_for_mail_bank() {
481
  install_script_for_mail_bank();
482
  helper_file_for_mail_bank();
483
  }
484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  /*
486
  Function Name: mailer_file_for_mail_bank
487
  Parameters: No
490
  Created By: Tech Banker Team
491
  */
492
 
 
493
 
494
  function mailer_file_for_mail_bank() {
495
  if (file_exists(MAIL_BANK_DIR_PATH . "includes/mailer.php")) {
497
  }
498
  }
499
 
500
+ /*
501
+ Function Name: user_functions_for_mail_bank
502
+ Parameters: No
503
+ Description: This function is used to call on init hook.
504
+ Created On: 16-06-2016 11:08
505
+ Created By: Tech Banker Team
506
+ */
507
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  function user_functions_for_mail_bank() {
 
509
  global $wpdb;
510
  $meta_values = $wpdb->get_results
511
  (
521
  $unserialize_data = unserialize($value->meta_value);
522
  array_push($meta_data_array, $unserialize_data);
523
  }
 
 
 
 
 
 
 
 
 
524
  mailer_file_for_mail_bank();
525
  if ($meta_data_array[0]["mailer_type"] == "php_mail_function") {
526
  add_action("phpmailer_init", "email_configuration_mail_bank");
530
  oauth_handling_mail_bank();
531
  }
532
 
533
+ /*
534
+ Description: Override Mail Function here.
535
+ Created On: 30-06-2016 02:13
536
+ Created By: Tech Banker Team
537
+ */
538
 
539
+ mailer_file_for_mail_bank();
540
+ mail_bank_auth_host::override_wp_mail_function();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
 
543
+ /*
544
+ Function Name: deactivation_function_for_wp_mail_bank
545
+ Parameters: No
546
+ Description: This function is used for executing the code on deactivation.
547
+ Created On: 21-04-2017 09:22
548
+ Created by: Tech Banker Team
549
+ */
550
 
551
  function deactivation_function_for_wp_mail_bank() {
552
  $type = get_option("wp-mail-bank-wizard-set-up");
584
  $plugin_stat_data["extensions"] = get_loaded_extensions();
585
  $plugin_stat_data["plugins"] = $plugin_info_wp_mail_bank->get_plugin_info_wp_mail_bank();
586
  $plugin_stat_data["themes"] = $theme_details;
587
+
588
+ $response = wp_safe_remote_post($url, array
589
+ (
590
+ "method" => "POST",
591
+ "timeout" => 45,
592
+ "redirection" => 5,
593
+ "httpversion" => "1.0",
594
+ "blocking" => false,
595
+ "headers" => array(),
596
+ "body" => array("data" => serialize($plugin_stat_data), "site_id" => get_option("mb_tech_banker_site_id") != "" ? get_option("mb_tech_banker_site_id") : "", "action" => "plugin_analysis_data")
597
+ ));
598
+
599
+ if (!is_wp_error($response)) {
600
+ $response["body"] != "" ? update_option("mb_tech_banker_site_id", $response["body"]) : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601
  }
602
  }
603
  }
604
 
605
+ /* hooks */
606
 
607
+ /*
608
+ register_activation_hook for install_script_for_mail_bank
609
+ Description: This hook is used for calling the function of install script.
610
+ Created On: 15-06-2016 09:46
611
+ Created By: Tech Banker Team
612
+ */
613
 
614
+ register_activation_hook(__FILE__, "install_script_for_mail_bank");
 
 
 
 
 
615
 
616
+ /*
617
+ add_action for admin_functions_for_mail_bank
618
+ Description: This hook contains all admin_init functions.
619
+ Created On: 15-06-2016 09:46
620
+ Created By: Tech Banker Team
621
+ */
622
 
623
+ add_action("admin_init", "admin_functions_for_mail_bank");
 
 
 
 
 
624
 
 
625
 
626
+ /*
627
+ add_action for user_functions_for_mail_bank
628
+ Description: This hook is used for calling the function of user functions.
629
+ Created On: 16-06-2016 11:07
630
+ Created By: Tech Banker Team
631
+ */
632
 
633
+ add_action("init", "user_functions_for_mail_bank");
634
+
635
+ /*
636
+ add_action for sidebar_menu_for_mail_bank
637
+ Description: This hook is used for calling the function of sidebar menu.
638
+ Created On: 15-06-2016 09:46
639
+ Created By: Tech Banker Team
640
+ */
641
+
642
+ add_action("admin_menu", "sidebar_menu_for_mail_bank");
643
+
644
+ /*
645
+ add_action for sidebar_menu_for_mail_bank
646
+ Description: This hook is used for calling the function of sidebar menu in multisite case.
647
+ Created On: 19-10-2016 05:18
648
+ Created By: Tech Banker Team
649
+ */
650
+
651
+ add_action("network_admin_menu", "sidebar_menu_for_mail_bank");
652
+
653
+ /*
654
+ add_action for topbar_menu_for_mail_bank
655
+ Description: This hook is used for calling the function of topbar menu.
656
+ Created On: 15-06-2016 09:46
657
+ Created By: Tech Banker Team
658
+ */
659
+
660
+ add_action("admin_bar_menu", "topbar_menu_for_mail_bank", 100);
661
+
662
+ /*
663
+ add_action for plugin_load_textdomain_mail_bank
664
+ Description: This hook is used for calling the function of languages.
665
+ Created On: 16-06-2016 09:47
666
+ Created By: Tech Banker Team
667
+ */
668
+
669
+ add_action("init", "plugin_load_textdomain_mail_bank");
670
 
671
+
672
+ /*
673
+ add_action hook for ajax_register_for_mail_bank
674
+ Description: This hook is used to register ajax.
675
+ Created On: 16-06-2016 12:00
676
+ Created By: Tech Banker Team
677
+ */
678
+ add_action("wp_ajax_mail_bank_action", "ajax_register_for_mail_bank");
679
+ }
680
 
681
  /*
682
+ register_activation_hook for install_script_for_mail_bank
683
+ Description: This hook is used for calling the function of install script.
684
  Created On: 15-06-2016 09:46
685
  Created By: Tech Banker Team
686
  */
687
 
688
+ register_activation_hook(__FILE__, "install_script_for_mail_bank");
689
 
690
  /*
691
+ add_action for install_script_for_mail_bank
692
+ Description: This hook used for calling the function of install script.
693
+ Created On: 15-06-2016 09:46
694
  Created By: Tech Banker Team
695
  */
696
 
697
+ add_action("admin_init", "install_script_for_mail_bank");
698
 
699
+ /* deactivation_function_for_wp_mail_bank
700
+ Description: This hook is used to sets the deactivation hook for a plugin.
701
+ Created On: 21-04-2017 09:22
702
+ Created by: Tech Banker Team
 
703
  */
704
 
705
+ register_deactivation_hook(__FILE__, "deactivation_function_for_wp_mail_bank");
706
 
707
+ /* add_filter create Go Pro link for Mail Bank
708
+ Description: This hook is used for create link for premium Editions.
709
+ Created On: 24-04-2017 12:21
710
+ Created by: Tech Banker Team
 
711
  */
712
+ add_filter("plugin_action_links_" . plugin_basename(__FILE__), "mail_bank_action_links");
713
 
 
714
 
715
  /*
716
+ add_filter for mail_bank_settings_link
717
+ Description: This hook is used for calling the function of settings link.
718
+ Created On: 09-08-2016 02:51
719
  Created By: Tech Banker Team
720
  */
721
+
722
+ add_filter("plugin_action_links_" . plugin_basename(__FILE__), "mail_bank_settings_link", 10, 2);
723
 
724
  /*
725
+ Class Name: plugin_activate_wp_mail_bank
726
+ Description: This function is used to add option on plugin activation.
727
+ Created On: 24-04-2017 12:04
728
  Created By: Tech Banker Team
729
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
 
731
  function plugin_activate_wp_mail_bank() {
732
  add_option("wp_mail_bank_do_activation_redirect", true);
733
  }
734
 
 
735
 
736
+ /*
737
+ Function Name: wp_mail_bank_redirect
738
+ Description: This function is used to redirect to email setup.
739
+ Created On: 24-04-2017 12:04
740
+ Created By: Tech Banker Team
741
+ */
742
 
 
743
 
744
  function wp_mail_bank_redirect() {
745
  if (get_option("wp_mail_bank_do_activation_redirect", false)) {
749
  }
750
  }
751
 
752
+ register_activation_hook(__FILE__, "plugin_activate_wp_mail_bank");
753
+ add_action("admin_init", "wp_mail_bank_redirect");
 
754
  ?>