MailPoet Newsletters (Previous) - Version 2.6.17

Version Description

  • 2015-09-04 =
  • Enhanced redirection check in email URLs.
  • Fixed old-style PHP constructors.
  • Fixed newsletter preview bug.
  • Fixed import issues on old PHP versions.
  • Fixed minor issues.
Download this release

Release Info

Developer JoN1oP
Plugin Icon 128x128 MailPoet Newsletters (Previous)
Version 2.6.17
Comparing to
See all releases

Code changes from version 2.6.16 to 2.6.17

Files changed (158) hide show
  1. classes/WJ_Analytics.php +1 -3
  2. classes/WJ_Bridge.php +88 -0
  3. classes/WJ_Import.php +6 -2
  4. classes/WJ_Settings.php +1 -2
  5. classes/WJ_StatsSessionManager.php +1 -2
  6. classes/WJ_Upgrade.php +5 -1
  7. classes/WJ_Utils.php +1 -2
  8. controllers/ajax/campaigns.php +2 -2
  9. controllers/ajax/config.php +10 -2
  10. controllers/ajax/subscribers.php +2 -2
  11. controllers/ajax/tmce.php +2 -2
  12. controllers/back.php +3 -3
  13. controllers/back/campaigns.php +8 -7
  14. controllers/back/config.php +3 -3
  15. controllers/back/premium.php +3 -1
  16. controllers/back/statistics.php +2 -1
  17. controllers/back/subscribers.php +9 -7
  18. controllers/front.php +2 -2
  19. controllers/front/confirm.php +2 -2
  20. controllers/front/email.php +2 -2
  21. controllers/front/stats.php +19 -11
  22. controllers/front/subscribers.php +7 -3
  23. core/base.php +33 -7
  24. core/controller.php +1 -1
  25. core/model.php +1 -1
  26. core/module/statistics_model.php +1 -1
  27. core/view.php +2 -2
  28. helpers/articles.php +2 -2
  29. helpers/autonews.php +3 -1
  30. helpers/back.php +2 -2
  31. helpers/backloader.php +3 -4
  32. helpers/bookmarks.php +2 -1
  33. helpers/bounce.php +1 -1
  34. helpers/campaigns.php +2 -1
  35. helpers/charts.php +2 -2
  36. helpers/conflicts.php +2 -1
  37. helpers/cron.php +2 -2
  38. helpers/dividers.php +2 -1
  39. helpers/email.php +3 -4
  40. helpers/file.php +2 -2
  41. helpers/form_engine.php +5 -4
  42. helpers/forms.php +1 -1
  43. helpers/front.php +10 -3
  44. helpers/http.php +3 -4
  45. helpers/image.php +4 -4
  46. helpers/install.php +1 -1
  47. helpers/jsonp.php +3 -2
  48. helpers/licence.php +2 -2
  49. helpers/mailer.php +20 -25
  50. helpers/numbers.php +2 -3
  51. helpers/plugins_import.php +2 -2
  52. helpers/queue.php +1 -1
  53. helpers/quick_html.php +2 -2
  54. helpers/readme.php +2 -1
  55. helpers/rules.php +1 -1
  56. helpers/server.php +2 -2
  57. helpers/shortcodes.php +2 -1
  58. helpers/themes.php +2 -2
  59. helpers/toolbox.php +2 -2
  60. helpers/uninstall.php +3 -2
  61. helpers/update.php +1 -1
  62. helpers/validation.php +4 -2
  63. helpers/wj_engine.php +3 -1
  64. helpers/wp_tools.php +2 -2
  65. helpers/zip.php +3 -3
  66. inc/dBug.php +1 -1
  67. inc/pear/pop3.php +1 -2
  68. inc/phpmailer/class.phpmailer.php +9 -6
  69. index.php +1 -1
  70. js/admin-ajax-proto.js +1 -1
  71. js/admin-config-settings.js +1 -1
  72. js/admin.js +1 -1
  73. languages/wysija-newsletters-af.mo +0 -0
  74. languages/wysija-newsletters-ar.mo +0 -0
  75. languages/wysija-newsletters-be.mo +0 -0
  76. languages/wysija-newsletters-bg_BG.mo +0 -0
  77. languages/wysija-newsletters-bn_BD.mo +0 -0
  78. languages/wysija-newsletters-bs_BA.mo +0 -0
  79. languages/wysija-newsletters-ca.mo +0 -0
  80. languages/wysija-newsletters-ca@valencia.mo +0 -0
  81. languages/wysija-newsletters-ca_ES.mo +0 -0
  82. languages/wysija-newsletters-cs_CZ.mo +0 -0
  83. languages/wysija-newsletters-da_DK.mo +0 -0
  84. languages/wysija-newsletters-de_CH.mo +0 -0
  85. languages/wysija-newsletters-de_DE.mo +0 -0
  86. languages/wysija-newsletters-el.mo +0 -0
  87. languages/wysija-newsletters-en_GB.mo +0 -0
  88. languages/wysija-newsletters-es.mo +0 -0
  89. languages/wysija-newsletters-es_419.mo +0 -0
  90. languages/wysija-newsletters-es_AR.mo +0 -0
  91. languages/wysija-newsletters-es_ES.mo +0 -0
  92. languages/wysija-newsletters-es_MX.mo +0 -0
  93. languages/wysija-newsletters-et.mo +0 -0
  94. languages/wysija-newsletters-eu.mo +0 -0
  95. languages/wysija-newsletters-fa.mo +0 -0
  96. languages/wysija-newsletters-fa_IR.mo +0 -0
  97. languages/wysija-newsletters-fi.mo +0 -0
  98. languages/wysija-newsletters-fr_FR.mo +0 -0
  99. languages/wysija-newsletters-gl_ES.mo +0 -0
  100. languages/wysija-newsletters-he_IL.mo +0 -0
  101. languages/wysija-newsletters-hi_IN.mo +0 -0
  102. languages/wysija-newsletters-hr_HR.mo +0 -0
  103. languages/wysija-newsletters-hu_HU.mo +0 -0
  104. languages/wysija-newsletters-hy_AM.mo +0 -0
  105. languages/wysija-newsletters-id.mo +0 -0
  106. languages/wysija-newsletters-is_IS.mo +0 -0
  107. languages/wysija-newsletters-it_IT.mo +0 -0
  108. languages/wysija-newsletters-ja.mo +0 -0
  109. languages/wysija-newsletters-ko_KR.mo +0 -0
  110. languages/wysija-newsletters-lt_LT.mo +0 -0
  111. languages/wysija-newsletters-lv.mo +0 -0
  112. languages/wysija-newsletters-mk_MK.mo +0 -0
  113. languages/wysija-newsletters-nb_NO.mo +0 -0
  114. languages/wysija-newsletters-nl_NL.mo +0 -0
  115. languages/wysija-newsletters-pl_PL.mo +0 -0
  116. languages/wysija-newsletters-pt_BR.mo +0 -0
  117. languages/wysija-newsletters-pt_PT.mo +0 -0
  118. languages/wysija-newsletters-ro_RO.mo +0 -0
  119. languages/wysija-newsletters-ru_RU.mo +0 -0
  120. languages/wysija-newsletters-sk_SK.mo +0 -0
  121. languages/wysija-newsletters-sl_SI.mo +0 -0
  122. languages/wysija-newsletters-sq.mo +0 -0
  123. languages/wysija-newsletters-sr_RS.mo +0 -0
  124. languages/wysija-newsletters-sr_RS@latin.mo +0 -0
  125. languages/wysija-newsletters-sv_SE.mo +0 -0
  126. languages/wysija-newsletters-tr_TR.mo +0 -0
  127. languages/wysija-newsletters-uk.mo +0 -0
  128. languages/wysija-newsletters-ur_PK.mo +0 -0
  129. languages/wysija-newsletters-vi.mo +0 -0
  130. languages/wysija-newsletters-zh_CN.mo +0 -0
  131. languages/wysija-newsletters-zh_TW.mo +0 -0
  132. models/campaign.php +2 -4
  133. models/campaign_list.php +2 -4
  134. models/config.php +1 -1
  135. models/email.php +2 -2
  136. models/email_user_stat.php +2 -2
  137. models/email_user_url.php +3 -5
  138. models/list.php +2 -4
  139. models/queue.php +2 -5
  140. models/url.php +3 -5
  141. models/url_mail.php +2 -2
  142. models/user.php +2 -2
  143. models/user_field.php +2 -2
  144. models/user_history.php +2 -2
  145. models/user_list.php +2 -5
  146. models/wp_posts.php +294 -230
  147. readme.txt +10 -3
  148. views/back.php +1 -1
  149. views/back/campaigns.php +7 -55
  150. views/back/config.php +5 -0
  151. views/back/premium.php +1 -1
  152. views/back/statistics.php +1 -1
  153. views/back/subscribers.php +2 -2
  154. views/back/tmce.php +2 -2
  155. views/front.php +1 -1
  156. views/front/confirm.php +1 -1
  157. views/front/widget_nl.php +1 -1
  158. widgets/wysija_nl.php +2 -2
classes/WJ_Analytics.php CHANGED
@@ -162,9 +162,7 @@ class WJ_Analytics {
162
  )
163
  );
164
 
165
- function __construct() {
166
-
167
- }
168
 
169
  /**
170
  * Send data to Mixpanel by enqueuing the analytics JS file.
162
  )
163
  );
164
 
165
+ function __construct() {}
 
 
166
 
167
  /**
168
  * Send data to Mixpanel by enqueuing the analytics JS file.
classes/WJ_Bridge.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('WYSIJA') or die('Restricted access');
3
+
4
+ class WJ_Bridge {
5
+ public $error;
6
+ private $api_key = '';
7
+ public function __construct($api_key) {
8
+ $this->api_key = $api_key;
9
+ }
10
+
11
+ public function send_mail(& $object)
12
+ {
13
+
14
+ $msg = array(
15
+ 'to' => array(
16
+ 'name' => '' ,
17
+ 'address' => $object->to[0][0] ),
18
+ 'reply_to'=> array(
19
+ 'name' => '' ,
20
+ 'address' => $object->ReplyTo[0][0] ),
21
+ 'from' => array(
22
+ 'name' => $object->FromName ,
23
+ 'address' => $object->From ),
24
+ );
25
+
26
+ // set the subject
27
+ if (!empty ($object->Subject)) $msg['subject']= $object->Subject;
28
+
29
+ // set the body
30
+ if (!empty ($object->sendHTML) || !empty($object->AltBody)){
31
+ $msg['html']= $object->Body;
32
+ if (!empty ($object->AltBody)) $msg['text']=$object->AltBody;
33
+ }else{
34
+ $msg['text']=$object->Body;
35
+ }
36
+
37
+ if(!empty($object->to[0][1])) $msg['to']['name'] = $object->to[0][1];
38
+
39
+ if(!empty($object->ReplyTo[0][1])) $msg['reply_to']['name']= $object->ReplyTo[0][1];
40
+
41
+ $url = 'https://bridge.mailpoet.com/api/messages';
42
+
43
+ $args = array( $msg );
44
+
45
+ return $this->run( $url, $args);
46
+
47
+ }
48
+
49
+ protected function run($url, $args)
50
+ {
51
+ $return = null;
52
+ $data = json_encode($args);
53
+
54
+ $params = array(
55
+ 'headers' => array(
56
+ 'Content-Type: application/json',
57
+ 'Authorization' => 'Basic ' . base64_encode('api:' . $this->api_key )
58
+ ),
59
+ 'body' => $data
60
+ );
61
+
62
+ $result = null;
63
+ $result = wp_remote_post($url, $params);
64
+
65
+ try {
66
+ if (!($result instanceof WP_Error) && in_array( (int)$result['response']['code'], array( 201, 400, 401) ) )
67
+ {
68
+ switch( $result['response']['code'] ){
69
+ case 201:
70
+ $return = true;
71
+ break;
72
+ case 400:
73
+ $this->error = 'Bad input';
74
+ break;
75
+ case 401:
76
+ $this->error = 'Not Authorized';
77
+ break;
78
+ }
79
+
80
+ }
81
+ } catch(Exception $e) {
82
+ $this->error = 'Unexpected error: '.$e->getMessage() . ' ['.var_export($result, true).']';// do nothing
83
+ }
84
+
85
+ return $return;
86
+ }
87
+
88
+ }
classes/WJ_Import.php CHANGED
@@ -464,8 +464,8 @@ class WJ_Import extends WYSIJA_object {
464
 
465
  $query .= implode(', ', $lines);
466
 
467
- // update values when the user already exists
468
- $query .= ' ON DUPLICATE KEY UPDATE '.implode(', ', array_map(function($v) { return '`'.$v.'` = VALUES(`'.$v.'`)'; }, $this->_data_to_insert));
469
 
470
  // replace query to import the subscribers
471
  $model_wysija = new WYSIJA_model();
@@ -846,4 +846,8 @@ class WJ_Import extends WYSIJA_object {
846
  return $this->_data_result;
847
  }
848
 
 
 
 
 
849
  }
464
 
465
  $query .= implode(', ', $lines);
466
 
467
+ // update values when the user already exists
468
+ $query .= ' ON DUPLICATE KEY UPDATE '.implode(', ', array_map(array($this, 'process_data_to_insert'), $this->_data_to_insert));
469
 
470
  // replace query to import the subscribers
471
  $model_wysija = new WYSIJA_model();
846
  return $this->_data_result;
847
  }
848
 
849
+ private function process_data_to_insert($v) {
850
+ return '`'.$v.'` = VALUES(`'.$v.'`)';
851
+ }
852
+
853
  }
classes/WJ_Settings.php CHANGED
@@ -9,8 +9,7 @@ class WJ_Settings {
9
  static private $db_prefix;
10
  static private $name = 'wysija';
11
 
12
- private function __construct() {
13
- }
14
 
15
  // db_prefix();
16
  // # => wp_wysija_
9
  static private $db_prefix;
10
  static private $name = 'wysija';
11
 
12
+ private function __construct(){}
 
13
 
14
  // db_prefix();
15
  // # => wp_wysija_
classes/WJ_StatsSessionManager.php CHANGED
@@ -16,8 +16,7 @@ class WJ_StatsSessionManager {
16
 
17
  protected $pre_defined_dates;
18
 
19
- public function __construct() {
20
- }
21
 
22
  public function set_pre_defined_dates(Array $pre_defined_dates) {
23
  $this->pre_defined_dates = $pre_defined_dates;
16
 
17
  protected $pre_defined_dates;
18
 
19
+ public function __construct(){}
 
20
 
21
  public function set_pre_defined_dates(Array $pre_defined_dates) {
22
  $this->pre_defined_dates = $pre_defined_dates;
classes/WJ_Upgrade.php CHANGED
@@ -73,7 +73,11 @@ class WJ_Upgrade extends WYSIJA_object {
73
  }
74
  }
75
 
76
- public function update_plugin_complete_actions( $update_actions, $mixed = null, $plugin = null ){
 
 
 
 
77
  $actions = array(
78
  'refresh_page' => '<a href="#" onclick="window.parent.location.reload(true);return false;" title="' . esc_attr__( 'Refresh the page you current are!', WYSIJA ) . '" target="_parent">' . __( 'Return to MailPoet', WYSIJA ) . '</a>'
79
  );
73
  }
74
  }
75
 
76
+ //$titlelink=str_replace(array('[link]','[\link]'), array('<a href="">','</a>'),'');
77
+
78
+
79
+
80
+ public function update_plugin_complete_actions( $update_actions, $mixed = null, $plugin = null ){
81
  $actions = array(
82
  'refresh_page' => '<a href="#" onclick="window.parent.location.reload(true);return false;" title="' . esc_attr__( 'Refresh the page you current are!', WYSIJA ) . '" target="_parent">' . __( 'Return to MailPoet', WYSIJA ) . '</a>'
83
  );
classes/WJ_Utils.php CHANGED
@@ -6,8 +6,7 @@ defined('WYSIJA') or die('Restricted access');
6
  */
7
  class WJ_Utils {
8
 
9
- private function __construct() {
10
- }
11
 
12
  public static function to_int( $value ) {
13
  $boolean = (bool) $value;
6
  */
7
  class WJ_Utils {
8
 
9
+ private function __construct(){}
 
10
 
11
  public static function to_int( $value ) {
12
  $boolean = (bool) $value;
controllers/ajax/campaigns.php CHANGED
@@ -2,9 +2,9 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_campaigns extends WYSIJA_control{
4
 
5
- function WYSIJA_control_back_campaigns(){
6
  if(!WYSIJA::current_user_can('wysija_newsletters')) die('Action is forbidden.');
7
- parent::WYSIJA_control();
8
  }
9
 
10
  function save_poll(){
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_campaigns extends WYSIJA_control{
4
 
5
+ function __construct(){
6
  if(!WYSIJA::current_user_can('wysija_newsletters')) die('Action is forbidden.');
7
+ parent::__construct();;
8
  }
9
 
10
  function save_poll(){
controllers/ajax/config.php CHANGED
@@ -2,9 +2,9 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_config extends WYSIJA_control{
4
 
5
- function WYSIJA_control_back_config(){
6
  if(!WYSIJA::current_user_can('wysija_config')) die("Action is forbidden.");
7
- parent::WYSIJA_control();
8
  }
9
 
10
  function _displayErrors(){
@@ -459,4 +459,12 @@ class WYSIJA_control_back_config extends WYSIJA_control{
459
 
460
  return array('result' => $result, 'save_message' => base64_encode($save_message), 'exports' => base64_encode($helper_form_engine->render_editor_export($form_id)));
461
  }
 
 
 
 
 
 
 
 
462
  }
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_config extends WYSIJA_control{
4
 
5
+ function __construct(){
6
  if(!WYSIJA::current_user_can('wysija_config')) die("Action is forbidden.");
7
+ parent::__construct();
8
  }
9
 
10
  function _displayErrors(){
459
 
460
  return array('result' => $result, 'save_message' => base64_encode($save_message), 'exports' => base64_encode($helper_form_engine->render_editor_export($form_id)));
461
  }
462
+
463
+ function wysija_dismiss_update_notice() {
464
+ WYSIJA::update_option('wysija_dismiss_update_notice', true);
465
+ }
466
+
467
+ function wysija_dismiss_license_notice() {
468
+ WYSIJA::update_option('wysija_dismiss_license_notice', true);
469
+ }
470
  }
controllers/ajax/subscribers.php CHANGED
@@ -5,8 +5,8 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_front{
5
  var $model='user';
6
  var $view='';
7
 
8
- function WYSIJA_control_back_subscribers(){
9
- parent::WYSIJA_control_front();
10
  $data=array();
11
  foreach($_REQUEST['data'] as $vals){
12
  $data[$vals['name']]=$vals['value'];
5
  var $model='user';
6
  var $view='';
7
 
8
+ function __construct(){
9
+ parent::__construct();
10
  $data=array();
11
  foreach($_REQUEST['data'] as $vals){
12
  $data[$vals['name']]=$vals['value'];
controllers/ajax/tmce.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_tmce extends WYSIJA_control{
4
 
5
- function WYSIJA_control_back_tmce(){
6
- parent::WYSIJA_control();
7
  $this->viewObj=WYSIJA::get('tmce','view');
8
  }
9
 
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_control_back_tmce extends WYSIJA_control{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  $this->viewObj=WYSIJA::get('tmce','view');
8
  }
9
 
controllers/back.php CHANGED
@@ -12,8 +12,8 @@ class WYSIJA_control_back extends WYSIJA_control{
12
  var $viewShow=null;
13
  var $_affected_rows = 0; //affected rows by batch select
14
 
15
- function WYSIJA_control_back(){
16
- parent::WYSIJA_control();
17
  global $wysija_msg,$wysija_queries,$wysija_queries_errors;
18
  $wysija_msgTemp=get_option('wysija_msg');
19
 
@@ -186,7 +186,7 @@ class WYSIJA_control_back extends WYSIJA_control{
186
  * by default this is the first method called from a controller this is from where we route to other methods
187
  */
188
  function main(){
189
- $this->WYSIJA_control_back();
190
  if($this->model){
191
  if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];
192
  else $action='defaultDisplay';
12
  var $viewShow=null;
13
  var $_affected_rows = 0; //affected rows by batch select
14
 
15
+ function __construct(){
16
+ parent::__construct();
17
  global $wysija_msg,$wysija_queries,$wysija_queries_errors;
18
  $wysija_msgTemp=get_option('wysija_msg');
19
 
186
  * by default this is the first method called from a controller this is from where we route to other methods
187
  */
188
  function main(){
189
+ $this->__construct();
190
  if($this->model){
191
  if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];
192
  else $action='defaultDisplay';
controllers/back/campaigns.php CHANGED
@@ -12,11 +12,12 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
12
  var $filters = array();
13
  var $base_url = 'admin.php';
14
 
15
- function WYSIJA_control_back_campaigns() {
16
-
 
 
17
  }
18
 
19
-
20
  private function _wysija_subaction() {
21
  if (isset($_REQUEST['subaction'])) {
22
  if ($_REQUEST['subaction'] === 'delete') {
@@ -64,7 +65,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
64
  $condition = '>=';
65
  if ($model_config->getValue('confirm_dbleoptin'))
66
  $condition = '>';
67
- $qry1 = "SELECT count(distinct A.user_id) as nbsub,A.list_id FROM `[wysija]user_list` as A LEFT JOIN `[wysija]user` as B on A.user_id=B.user_id WHERE B.status $condition 0 and A.sub_date>0 and A.unsub_date=0 GROUP BY list_id";
68
 
69
  $total = $model_list->getResults($qry1);
70
 
@@ -203,7 +204,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
203
 
204
  // when curl or any php remote function not available mailpoet.com returns lcheck to that function
205
  function licok() {
206
- parent::WYSIJA_control_back();
207
  $dt = get_option('wysijey');
208
 
209
  if (isset($_REQUEST['xtz']) && $dt === $_REQUEST['xtz']) {
@@ -546,13 +547,13 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
546
  $this->requireSecurity();
547
  $model = WYSIJA::get( 'campaign', 'model' );
548
  $query = 'INSERT INTO `[wysija]campaign` (`name`,`description`)
549
- SELECT concat("' . mysql_real_escape_string( __( 'Copy of ', WYSIJA ) ) . '",`name`),`description` FROM [wysija]campaign
550
  WHERE campaign_id=' . (int) $_REQUEST['id'];
551
  $campaignid = $model->query( $query );
552
 
553
  /* 2 - copy the email entry */
554
  $query = 'INSERT INTO `[wysija]email` (`campaign_id`,`subject`,`body`,`type`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`,`created_at`,`modified_at`)
555
- SELECT ' . $campaignid . ', concat("' . mysql_real_escape_string( __( 'Copy of ', WYSIJA ) ) . '",`subject`),`body`,`type`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,0,' . time() . ',' . time() . ' FROM [wysija]email
556
  WHERE email_id=' . (int) $_REQUEST['email_id'];
557
  $emailid = $model->query( $query );
558
 
12
  var $filters = array();
13
  var $base_url = 'admin.php';
14
 
15
+ function __construct(){
16
+ global $wpdb;
17
+ parent::__construct();
18
+ $this->wpdb = $wpdb;
19
  }
20
 
 
21
  private function _wysija_subaction() {
22
  if (isset($_REQUEST['subaction'])) {
23
  if ($_REQUEST['subaction'] === 'delete') {
65
  $condition = '>=';
66
  if ($model_config->getValue('confirm_dbleoptin'))
67
  $condition = '>';
68
+ $qry1 = "SELECT count(distinct A.user_id) as nbsub,A.list_id FROM `[wysija]user_list` as A LEFT JOIN `[wysija]user` as B on A.user_id=B.user_id WHERE B.status $condition 0 and A.unsub_date=0 GROUP BY list_id";
69
 
70
  $total = $model_list->getResults($qry1);
71
 
204
 
205
  // when curl or any php remote function not available mailpoet.com returns lcheck to that function
206
  function licok() {
207
+ parent::__construct();
208
  $dt = get_option('wysijey');
209
 
210
  if (isset($_REQUEST['xtz']) && $dt === $_REQUEST['xtz']) {
547
  $this->requireSecurity();
548
  $model = WYSIJA::get( 'campaign', 'model' );
549
  $query = 'INSERT INTO `[wysija]campaign` (`name`,`description`)
550
+ SELECT concat("' . $this->wpdb->_real_escape( __( 'Copy of ', WYSIJA ) ) . '",`name`),`description` FROM [wysija]campaign
551
  WHERE campaign_id=' . (int) $_REQUEST['id'];
552
  $campaignid = $model->query( $query );
553
 
554
  /* 2 - copy the email entry */
555
  $query = 'INSERT INTO `[wysija]email` (`campaign_id`,`subject`,`body`,`type`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,`status`,`created_at`,`modified_at`)
556
+ SELECT ' . $campaignid . ', concat("' . $this->wpdb->_real_escape( __( 'Copy of ', WYSIJA ) ) . '",`subject`),`body`,`type`,`params`,`wj_data`,`wj_styles`,`from_email`,`from_name`,`replyto_email`,`replyto_name`,`attachments`,0,' . time() . ',' . time() . ' FROM [wysija]email
557
  WHERE email_id=' . (int) $_REQUEST['email_id'];
558
  $emailid = $model->query( $query );
559
 
controllers/back/config.php CHANGED
@@ -4,12 +4,12 @@ class WYSIJA_control_back_config extends WYSIJA_control_back{
4
  var $view='config';
5
  var $model='config';
6
 
7
- function WYSIJA_control_back_config(){
8
-
9
  }
10
 
11
  function main() {
12
- parent::WYSIJA_control_back();
13
  wp_enqueue_style('thickbox');
14
 
15
  if(!isset($_REQUEST['action'])) $this->action='main';
4
  var $view='config';
5
  var $model='config';
6
 
7
+ function __construct(){
8
+ parent::__construct();
9
  }
10
 
11
  function main() {
12
+ parent::__construct();
13
  wp_enqueue_style('thickbox');
14
 
15
  if(!isset($_REQUEST['action'])) $this->action='main';
controllers/back/premium.php CHANGED
@@ -15,8 +15,10 @@ class WYSIJA_control_back_premium extends WYSIJA_control_back {
15
  /**
16
  * Constructor
17
  */
18
- function WYSIJA_control_back_premium() {
 
19
  }
 
20
  function defaultDisplay() {
21
  $this->jsTrans['premium_activate'] = __('Already paid? Click here to activate', WYSIJA);
22
  $this->jsTrans['premium_activating'] = __('Checking license', WYSIJA);
15
  /**
16
  * Constructor
17
  */
18
+ function __construct(){
19
+ parent::__construct();
20
  }
21
+
22
  function defaultDisplay() {
23
  $this->jsTrans['premium_activate'] = __('Already paid? Click here to activate', WYSIJA);
24
  $this->jsTrans['premium_activating'] = __('Checking license', WYSIJA);
controllers/back/statistics.php CHANGED
@@ -41,7 +41,8 @@ class WYSIJA_control_back_statistics extends WYSIJA_control_back {
41
  /**
42
  * Constructor
43
  */
44
- function WYSIJA_control_back_statistics() {
 
45
  }
46
 
47
  public function defaultDisplay() {
41
  /**
42
  * Constructor
43
  */
44
+ function __construct(){
45
+ parent::__construct();
46
  }
47
 
48
  public function defaultDisplay() {
controllers/back/subscribers.php CHANGED
@@ -17,8 +17,9 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
17
  */
18
  var $_filter_by_inactive_users = true;
19
 
20
- function WYSIJA_control_back_subscribers() {
21
- WYSIJA_control_back::WYSIJA_control_back();
 
22
  if ($this->_filter_by_inactive_users) {
23
  // load the inactive subscribers on the listing and when a any bulk action is executed
24
  if ( empty($_REQUEST['action'])
@@ -33,6 +34,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
33
  $this->modelObj->prepare_inactive_users_table();
34
  }
35
  }
 
36
  }
37
 
38
  /*
@@ -351,12 +353,12 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
351
  }
352
 
353
  function main(){
354
- $this->messages['insert'][true]=__('Subscriber has been saved.',WYSIJA);
355
  $this->messages['insert'][false]=__('Subscriber has not been saved.',WYSIJA);
356
  $this->messages['update'][true]=__('Subscriber has been modified. [link]Edit again[/link].',WYSIJA);
357
  $this->messages['update'][false]=__('Subscriber has not been modified.',WYSIJA);
358
- $this->_cleanup_form();
359
- parent::WYSIJA_control_back();
360
 
361
  //we change the default model of the controller based on the action
362
  if(isset($_REQUEST['action'])){
@@ -371,7 +373,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
371
  }
372
  }
373
 
374
- $this->WYSIJA_control();
375
  if(!isset($_REQUEST['action']) || !$_REQUEST['action']) {
376
  $this->defaultDisplay();
377
  $this->checkTotalSubscribers();
@@ -588,7 +590,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_back{
588
  $data=$model_list->getOne(array('name','namekey','welcome_mail_id','unsub_mail_id'),array('list_id'=>(int)$_REQUEST['id']));
589
 
590
  $query='INSERT INTO `[wysija]list` (`created_at`,`name`,`namekey`,`description`,`welcome_mail_id`,`unsub_mail_id`,`is_enabled`,`ordering`)
591
- SELECT '.time().',concat("' . mysql_real_escape_string( __( 'Copy of ', WYSIJA ) ) . '",`name`) ,"copy_'.$data['namekey'].time().'" ,`description`,0,0 ,1,`ordering` FROM [wysija]list
592
  WHERE list_id='.(int)$_REQUEST['id'];
593
 
594
  $list_id = $model_list->query($query);
17
  */
18
  var $_filter_by_inactive_users = true;
19
 
20
+ function __construct() {
21
+ global $wpdb;
22
+ WYSIJA_control_back::__construct();
23
  if ($this->_filter_by_inactive_users) {
24
  // load the inactive subscribers on the listing and when a any bulk action is executed
25
  if ( empty($_REQUEST['action'])
34
  $this->modelObj->prepare_inactive_users_table();
35
  }
36
  }
37
+ $this->wpdb = $wpdb;
38
  }
39
 
40
  /*
353
  }
354
 
355
  function main(){
356
+ $this->messages['insert'][true]=__('Subscriber has been saved.',WYSIJA);
357
  $this->messages['insert'][false]=__('Subscriber has not been saved.',WYSIJA);
358
  $this->messages['update'][true]=__('Subscriber has been modified. [link]Edit again[/link].',WYSIJA);
359
  $this->messages['update'][false]=__('Subscriber has not been modified.',WYSIJA);
360
+ $this->_cleanup_form();
361
+ parent::__construct();
362
 
363
  //we change the default model of the controller based on the action
364
  if(isset($_REQUEST['action'])){
373
  }
374
  }
375
 
376
+ WYSIJA_control::__construct();
377
  if(!isset($_REQUEST['action']) || !$_REQUEST['action']) {
378
  $this->defaultDisplay();
379
  $this->checkTotalSubscribers();
590
  $data=$model_list->getOne(array('name','namekey','welcome_mail_id','unsub_mail_id'),array('list_id'=>(int)$_REQUEST['id']));
591
 
592
  $query='INSERT INTO `[wysija]list` (`created_at`,`name`,`namekey`,`description`,`welcome_mail_id`,`unsub_mail_id`,`is_enabled`,`ordering`)
593
+ SELECT '.time().',concat("' . $this->wpdb->_real_escape( __( 'Copy of ', WYSIJA ) ) . '",`name`) ,"copy_'.$data['namekey'].time().'" ,`description`,0,0 ,1,`ordering` FROM [wysija]list
594
  WHERE list_id='.(int)$_REQUEST['id'];
595
 
596
  $list_id = $model_list->query($query);
controllers/front.php CHANGED
@@ -4,9 +4,9 @@ defined('WYSIJA') or die('Restricted access');
4
 
5
  class WYSIJA_control_front extends WYSIJA_control{
6
 
7
- function WYSIJA_control_front($extension="wysija-newsletters"){
8
  $this->extension=$extension;
9
- parent::WYSIJA_control();
10
  $_REQUEST = stripslashes_deep($_REQUEST);
11
  $_POST = stripslashes_deep($_POST);
12
 
4
 
5
  class WYSIJA_control_front extends WYSIJA_control{
6
 
7
+ function __construct($extension="wysija-newsletters"){
8
  $this->extension=$extension;
9
+ parent::__construct();
10
  $_REQUEST = stripslashes_deep($_REQUEST);
11
  $_POST = stripslashes_deep($_POST);
12
 
controllers/front/confirm.php CHANGED
@@ -6,8 +6,8 @@ class WYSIJA_control_front_confirm extends WYSIJA_control_front{
6
  var $model='user';
7
  var $view='confirm';
8
 
9
- function WYSIJA_control_front_confirm(){
10
- parent::WYSIJA_control_front();
11
  }
12
 
13
  function _testKeyuser(){
6
  var $model='user';
7
  var $view='confirm';
8
 
9
+ function __construct(){
10
+ parent::__construct();
11
  }
12
 
13
  function _testKeyuser(){
controllers/front/email.php CHANGED
@@ -5,8 +5,8 @@ class WYSIJA_control_front_email extends WYSIJA_control_front{
5
  var $model='email';
6
  var $view='email';
7
 
8
- function WYSIJA_control_front_email(){
9
- parent::WYSIJA_control_front();
10
  }
11
 
12
  function view(){
5
  var $model='email';
6
  var $view='email';
7
 
8
+ function __construct(){
9
+ parent::__construct();
10
  }
11
 
12
  function view(){
controllers/front/stats.php CHANGED
@@ -5,17 +5,17 @@ defined('WYSIJA') or die('Restricted access');
5
  class WYSIJA_control_front_stats extends WYSIJA_control_front{
6
  var $model='' ;
7
  var $view='';
8
-
9
  /**
10
  * Possible characters to be url encoded
11
- * @var array
12
  */
13
  protected $characters_to_encode = array(
14
  '@'
15
  );
16
 
17
- function WYSIJA_control_front_stats(){
18
- parent::WYSIJA_control_front();
19
  }
20
 
21
  /**
@@ -24,13 +24,21 @@ class WYSIJA_control_front_stats extends WYSIJA_control_front{
24
  */
25
  function analyse(){
26
  if(isset($_REQUEST['email_id']) && isset($_REQUEST['user_id'])){
27
-
28
  $WJ_Stats = new WJ_Stats();
29
  if(!empty($WJ_Stats->clicked_url)){
30
  // clicked stats
31
  $url = $this->encode_url($WJ_Stats->subscriber_clicked());
32
- do_action('mpoet_click_stats', $WJ_Stats);
33
- $this->redirect($url);
 
 
 
 
 
 
 
 
 
34
  }else{
35
  // opened stat
36
  $WJ_Stats->subscriber_opened();
@@ -39,7 +47,7 @@ class WYSIJA_control_front_stats extends WYSIJA_control_front{
39
 
40
  return true;
41
  }
42
-
43
  /**
44
  * Encode some special characters in url
45
  * @param string $url
@@ -47,10 +55,10 @@ class WYSIJA_control_front_stats extends WYSIJA_control_front{
47
  */
48
  protected function encode_url($url) {
49
  return str_replace(
50
- $this->characters_to_encode,
51
- array_map('urlencode', $this->characters_to_encode),
52
  $url
53
  );
54
  }
55
-
56
  }
5
  class WYSIJA_control_front_stats extends WYSIJA_control_front{
6
  var $model='' ;
7
  var $view='';
8
+
9
  /**
10
  * Possible characters to be url encoded
11
+ * @var array
12
  */
13
  protected $characters_to_encode = array(
14
  '@'
15
  );
16
 
17
+ function __construct(){
18
+ parent::__construct();
19
  }
20
 
21
  /**
24
  */
25
  function analyse(){
26
  if(isset($_REQUEST['email_id']) && isset($_REQUEST['user_id'])){
 
27
  $WJ_Stats = new WJ_Stats();
28
  if(!empty($WJ_Stats->clicked_url)){
29
  // clicked stats
30
  $url = $this->encode_url($WJ_Stats->subscriber_clicked());
31
+ $model_email = WYSIJA::get('email', 'model');
32
+ $email_object = $model_email->getOne(false,array('email_id' => $_REQUEST['email_id']));
33
+ if (preg_match('/'. preg_replace('/\//', '\\/', $WJ_Stats->subscriber_clicked()) .'/', $email_object['body']) ||
34
+ preg_match('/^'. preg_replace('/\//', '\\/', get_site_url()) .'/', $url)) {
35
+ do_action('mpoet_click_stats', $WJ_Stats);
36
+ $this->redirect($url);
37
+ }
38
+ header('HTTP/1.0 404 Not Found');
39
+ echo '<h1>404 Not Found</h1>';
40
+ echo 'The page that you have requested could not be found.';
41
+ exit();
42
  }else{
43
  // opened stat
44
  $WJ_Stats->subscriber_opened();
47
 
48
  return true;
49
  }
50
+
51
  /**
52
  * Encode some special characters in url
53
  * @param string $url
55
  */
56
  protected function encode_url($url) {
57
  return str_replace(
58
+ $this->characters_to_encode,
59
+ array_map('urlencode', $this->characters_to_encode),
60
  $url
61
  );
62
  }
63
+
64
  }
controllers/front/subscribers.php CHANGED
@@ -5,8 +5,8 @@ class WYSIJA_control_front_subscribers extends WYSIJA_control_front{
5
  var $model='user';
6
  var $view='widget_nl';
7
 
8
- function WYSIJA_control_front_subscribers(){
9
- parent::WYSIJA_control_front();
10
  if(isset($_REQUEST['message_success'])){
11
  $this->messages['insert'][true]=$_REQUEST['message_success'];
12
  }else{
@@ -127,7 +127,11 @@ class WYSIJA_control_front_subscribers extends WYSIJA_control_front{
127
  $widget_NL=new WYSIJA_NL_Widget(true);
128
  $widget_NL->iFrame=true;
129
  $subscription_form = $widget_NL->widget($widget_data,$widget_data);
130
-
 
 
 
 
131
  echo $subscription_form;
132
  exit;
133
  }
5
  var $model='user';
6
  var $view='widget_nl';
7
 
8
+ function __construct(){
9
+ parent::__construct();
10
  if(isset($_REQUEST['message_success'])){
11
  $this->messages['insert'][true]=$_REQUEST['message_success'];
12
  }else{
127
  $widget_NL=new WYSIJA_NL_Widget(true);
128
  $widget_NL->iFrame=true;
129
  $subscription_form = $widget_NL->widget($widget_data,$widget_data);
130
+ $subscription_form = str_replace("</head>", '<script type="text/javascript">
131
+ /* <![CDATA[ */
132
+ var wysijaAJAX = {"action":"wysija_ajax","controller":"subscribers","ajaxurl":"'.admin_url('admin-ajax.php','absolute').'","loadingTrans":"'.__('Loading...',WYSIJA).'"};
133
+ /* ]]> */
134
+ </script></head>', $subscription_form);
135
  echo $subscription_form;
136
  exit;
137
  }
core/base.php CHANGED
@@ -19,13 +19,13 @@ class WYSIJA_object{
19
  * Static variable holding core MailPoet's version
20
  * @var array
21
  */
22
- static $version = '2.6.16';
23
 
24
- function WYSIJA_object(){
25
 
26
- }
27
 
28
- /**
29
  * Order an array by param name string compare
30
  *
31
  * @param array $a Array with the param to compare
@@ -247,7 +247,7 @@ class WYSIJA_help extends WYSIJA_object{
247
 
248
  static $admin_body_class_runner = false;
249
 
250
- function WYSIJA_help(){
251
  add_action( 'widgets_init', array( $this, 'widgets_init' ), 1 );
252
 
253
  // Only load this when ajax is not used
@@ -259,6 +259,18 @@ class WYSIJA_help extends WYSIJA_object{
259
  add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
260
  }
261
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  function widgets_init() {
263
  //load the widget file
264
  require_once(WYSIJA_WIDGETS.'wysija_nl.php');
@@ -419,8 +431,8 @@ class WYSIJA_help extends WYSIJA_object{
419
 
420
  class WYSIJA extends WYSIJA_object{
421
 
422
- function WYSIJA(){
423
-
424
  }
425
 
426
  /**
@@ -1605,6 +1617,20 @@ register_deactivation_hook(WYSIJA_FILE, array( 'WYSIJA', 'deactivate' ));
1605
  register_activation_hook(WYSIJA_FILE, array( 'WYSIJA', 'activate' ));
1606
  add_action( 'init', array('WYSIJA','create_post_type') );
1607
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1608
 
1609
  // launch application
1610
  $helper = WYSIJA::get(WYSIJA_SIDE,'helper');
19
  * Static variable holding core MailPoet's version
20
  * @var array
21
  */
22
+ static $version = '2.6.17';
23
 
24
+ function __construct(){}
25
 
26
+ function WYSIJA_object(){} // TODO: remove in next version
27
 
28
+ /**
29
  * Order an array by param name string compare
30
  *
31
  * @param array $a Array with the param to compare
247
 
248
  static $admin_body_class_runner = false;
249
 
250
+ function __construct(){
251
  add_action( 'widgets_init', array( $this, 'widgets_init' ), 1 );
252
 
253
  // Only load this when ajax is not used
259
  add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
260
  }
261
 
262
+ function WYSIJA_help() { // TODO: remove in next version
263
+ add_action( 'widgets_init', array( $this, 'widgets_init' ), 1 );
264
+
265
+ // Only load this when ajax is not used
266
+ if ( !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
267
+ add_action( 'init', array( $this, 'register_scripts' ), 1 );
268
+ }
269
+
270
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
271
+ add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
272
+ }
273
+
274
  function widgets_init() {
275
  //load the widget file
276
  require_once(WYSIJA_WIDGETS.'wysija_nl.php');
431
 
432
  class WYSIJA extends WYSIJA_object{
433
 
434
+ function __construct(){
435
+ parent::__construct();
436
  }
437
 
438
  /**
1617
  register_activation_hook(WYSIJA_FILE, array( 'WYSIJA', 'activate' ));
1618
  add_action( 'init', array('WYSIJA','create_post_type') );
1619
 
1620
+ // check for PHP version and display a warning notice if it's <5.3
1621
+ if ( version_compare( PHP_VERSION , '5.3' , '<' ) &&
1622
+ !get_option("wysija_dismiss_update_notice") &&
1623
+ empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
1624
+ strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
1625
+
1626
+ $a = new WYSIJA_object();
1627
+ $a->notice(__("Your version of PHP is outdated. If you don't upgrade soon, new versions of MailPoet won't work.")
1628
+ . "<br />"
1629
+ . str_replace( array('[link]', '[/link]'), array('<a href="https://support.mailpoet.com/knowledgebase/how-to-prepare-my-site-for-mailpoet-3-0/" target="_blank" >', '</a>'), __("[link]Read how to update your version of PHP.[/link]")
1630
+ . "<br /><br />"
1631
+ . str_replace( array('[link]', '[/link]'), array('<a href="javascript:;" class="wysija_dismiss_update_notice">', '</a>'), __("[link]Dismiss[/link] this notice."))
1632
+ ), true, true);
1633
+ }
1634
 
1635
  // launch application
1636
  $helper = WYSIJA::get(WYSIJA_SIDE,'helper');
core/controller.php CHANGED
@@ -15,7 +15,7 @@ class WYSIJA_control extends WYSIJA_object{
15
  var $joins=array();
16
  var $title="";
17
 
18
- function WYSIJA_control(){
19
  //setup some required objects for the request
20
  if(!defined('DOING_AJAX')){
21
  if($this->view) $this->viewObj = WYSIJA::get($this->view,"view",false,$this->extension);
15
  var $joins=array();
16
  var $title="";
17
 
18
+ function __construct(){
19
  //setup some required objects for the request
20
  if(!defined('DOING_AJAX')){
21
  if($this->view) $this->viewObj = WYSIJA::get($this->view,"view",false,$this->extension);
core/model.php CHANGED
@@ -30,7 +30,7 @@ class WYSIJA_model extends WYSIJA_object{
30
  var $time_start = 0;
31
  var $query_duration = 0;
32
 
33
- function WYSIJA_model($extensions=''){
34
  if(defined('WYSIJA_DBG') && WYSIJA_DBG>0) $this->dbg=true;
35
  global $wpdb;
36
  $this->wpprefix=$wpdb->prefix;
30
  var $time_start = 0;
31
  var $query_duration = 0;
32
 
33
+ function __construct($extensions=''){
34
  if(defined('WYSIJA_DBG') && WYSIJA_DBG>0) $this->dbg=true;
35
  global $wpdb;
36
  $this->wpprefix=$wpdb->prefix;
core/module/statistics_model.php CHANGED
@@ -17,7 +17,7 @@ class WYSIJA_module_statistics_model extends WYSIJA_model {
17
  const STATS_PREFIX = 'sc_'; // prefix of stat tables
18
 
19
  public function __construct() {
20
- parent::WYSIJA_model();
21
  $this->clean_up_out_of_date_tables();
22
  }
23
 
17
  const STATS_PREFIX = 'sc_'; // prefix of stat tables
18
 
19
  public function __construct() {
20
+ parent::__construct();
21
  $this->clean_up_out_of_date_tables();
22
  }
23
 
core/view.php CHANGED
@@ -41,8 +41,8 @@ class WYSIJA_view extends WYSIJA_object {
41
  */
42
  var $font_size = 12;
43
 
44
- function WYSIJA_view() {
45
-
46
  }
47
 
48
  /**
41
  */
42
  var $font_size = 12;
43
 
44
+ function __construct(){
45
+ parent::__construct();
46
  }
47
 
48
  /**
helpers/articles.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_articles extends WYSIJA_object {
4
 
5
- function WYSIJA_help_articles() {
6
-
7
  }
8
 
9
  function stripShortcodes($content) {
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_articles extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  function stripShortcodes($content) {
helpers/autonews.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_autonews extends WYSIJA_object {
4
- function WYSIJA_help_autonews() {
 
 
5
  }
6
 
7
  function events($key=false,$get=true,$value_set=array()){
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_autonews extends WYSIJA_object {
4
+
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  function events($key=false,$get=true,$value_set=array()){
helpers/back.php CHANGED
@@ -7,8 +7,8 @@ defined('WYSIJA') or die('Restricted access');
7
  */
8
  class WYSIJA_help_back extends WYSIJA_help{
9
 
10
- function WYSIJA_help_back(){
11
- parent::WYSIJA_help();
12
  //check that the application has been installed properly
13
  $config=WYSIJA::get('config','model');
14
 
7
  */
8
  class WYSIJA_help_back extends WYSIJA_help{
9
 
10
+ function __construct(){
11
+ parent::__construct();
12
  //check that the application has been installed properly
13
  $config=WYSIJA::get('config','model');
14
 
helpers/backloader.php CHANGED
@@ -8,11 +8,10 @@ class WYSIJA_help_backloader extends WYSIJA_help{
8
 
9
  var $jsVariables = '';
10
 
11
- function WYSIJA_help_backloader(){
12
-
13
- parent::WYSIJA_help();
14
-
15
  }
 
16
  /**
17
  *
18
  * @param type $controller
8
 
9
  var $jsVariables = '';
10
 
11
+ function __construct() {
12
+ parent::__construct();
 
 
13
  }
14
+
15
  /**
16
  *
17
  * @param type $controller
helpers/bookmarks.php CHANGED
@@ -2,7 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_bookmarks extends WYSIJA_object {
4
 
5
- function WYSIJA_help_bookmarks() {
 
6
  }
7
 
8
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_bookmarks extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/bounce.php CHANGED
@@ -21,7 +21,7 @@ class WYSIJA_help_bounce extends WYSIJA_help {
21
  var $messages = array();
22
  var $record_ms_bounce = false; // only used in multisite scenario
23
 
24
- function WYSIJA_help_bounce() {
25
  $this->config = WYSIJA::get('config', 'model');
26
  $this->mailer = WYSIJA::get('mailer', 'helper');
27
  $this->rulesClass = WYSIJA::get('rules', 'helper');
21
  var $messages = array();
22
  var $record_ms_bounce = false; // only used in multisite scenario
23
 
24
+ function __construct() {
25
  $this->config = WYSIJA::get('config', 'model');
26
  $this->mailer = WYSIJA::get('mailer', 'helper');
27
  $this->rulesClass = WYSIJA::get('rules', 'helper');
helpers/campaigns.php CHANGED
@@ -7,8 +7,9 @@ add_action( 'wp_ajax_mailpoet.search_terms', 'WYSIJA_help_campaigns::ajax_search
7
  */
8
  defined('WYSIJA') or die('Restricted access');
9
  class WYSIJA_help_campaigns extends WYSIJA_object{
10
- function WYSIJA_help_campaigns(){
11
 
 
 
12
  }
13
 
14
  function saveParameters($email_id, $key, $value)
7
  */
8
  defined('WYSIJA') or die('Restricted access');
9
  class WYSIJA_help_campaigns extends WYSIJA_object{
 
10
 
11
+ function __construct(){
12
+ parent::__construct();
13
  }
14
 
15
  function saveParameters($email_id, $key, $value)
helpers/charts.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_charts extends WYSIJA_object {
4
 
5
- function WYSIJA_help_charts() {
6
-
7
  }
8
 
9
  function pieChart($id, $options = array()) {
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_charts extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  function pieChart($id, $options = array()) {
helpers/conflicts.php CHANGED
@@ -2,8 +2,9 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_conflicts extends WYSIJA_object{
4
  var $cleanHooks=array();
5
- function WYSIJA_help_conflicts(){
6
 
 
 
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_conflicts extends WYSIJA_object{
4
  var $cleanHooks=array();
 
5
 
6
+ function __construct(){
7
+ parent::__construct();
8
  }
9
 
10
  /**
helpers/cron.php CHANGED
@@ -4,8 +4,8 @@ class WYSIJA_help_cron extends WYSIJA_object{
4
 
5
  var $report=false;
6
 
7
- function WYSIJA_help_cron(){
8
-
9
  }
10
 
11
  /**
4
 
5
  var $report=false;
6
 
7
+ function __construct(){
8
+ parent::__construct();
9
  }
10
 
11
  /**
helpers/dividers.php CHANGED
@@ -2,7 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_dividers extends WYSIJA_object {
4
 
5
- function WYSIJA_help_dividers() {
 
6
  }
7
 
8
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_dividers extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/email.php CHANGED
@@ -2,11 +2,10 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_email extends WYSIJA_object{
4
 
5
- function WYSIJA_help_email(){
6
-
7
  }
8
 
9
-
10
  /**
11
  * used to strip the unsubscribe links and the view in browser links from an email html
12
  * @param type $content
@@ -87,7 +86,7 @@ class WYSIJA_help_email extends WYSIJA_object{
87
  }
88
 
89
  $mailer=WYSIJA::get('mailer','helper');
90
- $mailer->WYSIJA_help_mailer('',$values,$testMultisite);
91
 
92
  $current_user=WYSIJA::wp_get_userdata();
93
  $mailer->testemail=true;
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_email extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
 
9
  /**
10
  * used to strip the unsubscribe links and the view in browser links from an email html
11
  * @param type $content
86
  }
87
 
88
  $mailer=WYSIJA::get('mailer','helper');
89
+ $mailer->__construct('',$values,$testMultisite);
90
 
91
  $current_user=WYSIJA::wp_get_userdata();
92
  $mailer->testemail=true;
helpers/file.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_file extends WYSIJA_object{
4
 
5
- function WYSIJA_help_file(){
6
-
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_file extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/form_engine.php CHANGED
@@ -25,10 +25,11 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
25
  private $_unique_fields = array('firstname', 'lastname', 'list');
26
 
27
  // constructor
28
- function __construct() {
29
-
30
  }
31
 
 
32
  // i18n methods
33
  public function get_translations() {
34
  return array(
@@ -650,12 +651,12 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
650
 
651
  $posted_form = (isset($_POST['form_id']) && (int)$_POST['form_id'] > 0) ? (int)$_POST['form_id'] : 0;
652
 
653
- if($data['form_id'] === $posted_form) {
654
  $view = WYSIJA::get('widget_nl','view','front');
655
  if(count($view->getMsgs()) > 0) {
656
  $output .= $view->messages();
657
  }
658
- }
659
 
660
  try {
661
  $output .= $helper_render_engine->render($data, 'templates/form/web/template.html');
25
  private $_unique_fields = array('firstname', 'lastname', 'list');
26
 
27
  // constructor
28
+ function __construct(){
29
+ parent::__construct();
30
  }
31
 
32
+
33
  // i18n methods
34
  public function get_translations() {
35
  return array(
651
 
652
  $posted_form = (isset($_POST['form_id']) && (int)$_POST['form_id'] > 0) ? (int)$_POST['form_id'] : 0;
653
 
654
+ /* if($data['form_id'] === $posted_form) {
655
  $view = WYSIJA::get('widget_nl','view','front');
656
  if(count($view->getMsgs()) > 0) {
657
  $output .= $view->messages();
658
  }
659
+ }*/
660
 
661
  try {
662
  $output .= $helper_render_engine->render($data, 'templates/form/web/template.html');
helpers/forms.php CHANGED
@@ -5,7 +5,7 @@ class WYSIJA_help_forms{
5
  var $eachValues = array();
6
  var $eachValuesSec = array();
7
 
8
- function WYSIJA_help_forms(){
9
  // I believe this is for translation purpose, making sure the correct language is loaded
10
  add_action( 'init', array( $this, 'apply_filters' ), 20 );
11
 
5
  var $eachValues = array();
6
  var $eachValuesSec = array();
7
 
8
+ function __construct(){
9
  // I believe this is for translation purpose, making sure the correct language is loaded
10
  add_action( 'init', array( $this, 'apply_filters' ), 20 );
11
 
helpers/front.php CHANGED
@@ -5,8 +5,8 @@ defined('WYSIJA') or die('Restricted access');
5
  */
6
  class WYSIJA_help_front extends WYSIJA_help{
7
 
8
- function WYSIJA_help_front(){
9
- parent::WYSIJA_help();
10
 
11
  // wysija form shortcode
12
  add_shortcode('wysija_form', array($this,'scan_form_shortcode'));
@@ -268,7 +268,14 @@ class WYSIJA_help_front extends WYSIJA_help{
268
  function scan_subscribers_count_shortcode($attributes) {
269
  $user = WYSIJA::get('user','model');
270
  $list_ids = !empty($attributes['list_id']) ? explode(',', $attributes['list_id']) : array();
271
- $confirmed_subscribers = !empty($attributes['confirmed_subscribers']) ? (bool)$attributes['confirmed_subscribers'] : true;
 
 
 
 
 
 
 
272
  return $user->countSubscribers($list_ids, $confirmed_subscribers);
273
  }
274
 
5
  */
6
  class WYSIJA_help_front extends WYSIJA_help{
7
 
8
+ function __construct(){
9
+ parent::__construct();
10
 
11
  // wysija form shortcode
12
  add_shortcode('wysija_form', array($this,'scan_form_shortcode'));
268
  function scan_subscribers_count_shortcode($attributes) {
269
  $user = WYSIJA::get('user','model');
270
  $list_ids = !empty($attributes['list_id']) ? explode(',', $attributes['list_id']) : array();
271
+
272
+ // if double optin is on we count only the confirmed subscribers, otherwise we count both confirmed and unconfirmed
273
+ $confirmed_subscribers = false;
274
+ $model_config = WYSIJA::get('config', 'model');
275
+ if ($model_config->getValue('confirm_dbleoptin')){
276
+ $confirmed_subscribers = true;
277
+ }
278
+
279
  return $user->countSubscribers($list_ids, $confirmed_subscribers);
280
  }
281
 
helpers/http.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_http extends WYSIJA_object{
4
-
5
-
6
- function WYSIJA_help_http(){
7
-
8
  }
9
 
10
  /**
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_http extends WYSIJA_object{
4
+
5
+ function __construct(){
6
+ parent::__construct();
 
7
  }
8
 
9
  /**
helpers/image.php CHANGED
@@ -3,11 +3,11 @@ defined('WYSIJA') or die('Restricted access');
3
  require_once(dirname(__FILE__).DS.'file.php');
4
  class WYSIJA_help_image extends WYSIJA_help_file{
5
 
6
- function WYSIJA_help_image(){
 
 
7
 
8
- }
9
-
10
- /**
11
  * get a list of images from a directory
12
  * @param type $template
13
  * @return type
3
  require_once(dirname(__FILE__).DS.'file.php');
4
  class WYSIJA_help_image extends WYSIJA_help_file{
5
 
6
+ function __construct(){
7
+ parent::__construct();
8
+ }
9
 
10
+ /**
 
 
11
  * get a list of images from a directory
12
  * @param type $template
13
  * @return type
helpers/install.php CHANGED
@@ -2,7 +2,7 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_install extends WYSIJA_object{
4
 
5
- function WYSIJA_help_install(){
6
  if(file_exists(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php')) require_once(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php');
7
  }
8
 
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_install extends WYSIJA_object{
4
 
5
+ function __construct(){
6
  if(file_exists(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php')) require_once(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php');
7
  }
8
 
helpers/jsonp.php CHANGED
@@ -2,9 +2,10 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_jsonp extends WYSIJA_object {
4
 
5
- function WYSIJA_help_jsonp() {
6
-
7
  }
 
8
  /**
9
  * Is valid callback
10
  *
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_jsonp extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
+
9
  /**
10
  * Is valid callback
11
  *
helpers/licence.php CHANGED
@@ -5,8 +5,8 @@ defined('WYSIJA') or die('Restricted access');
5
  */
6
  class WYSIJA_help_licence extends WYSIJA_help{
7
 
8
- function WYSIJA_help_licence(){
9
- parent::WYSIJA_help();
10
  }
11
 
12
  /**
5
  */
6
  class WYSIJA_help_licence extends WYSIJA_help{
7
 
8
+ function __construct(){
9
+ parent::__construct();
10
  }
11
 
12
  /**
helpers/mailer.php CHANGED
@@ -39,7 +39,7 @@ class WYSIJA_help_mailer extends acymailingPHPMailer {
39
  * @param array $config
40
  * @param boolean $multisiteTest
41
  */
42
- function WYSIJA_help_mailer($extension='',$config=false, $multisiteTest=false) {
43
 
44
  $this->subscriberClass = WYSIJA::get( 'user', 'model' );
45
  $this->subscriberClass->getFormat = OBJECT;
@@ -110,30 +110,25 @@ class WYSIJA_help_mailer extends acymailingPHPMailer {
110
  $this->sendGrid->Password = trim($this->config->getValue('smtp_password'));
111
  $this->isSendGridRest=true;
112
  }else{
113
- $this->IsSMTP();
114
-
115
- if(strpos($this->Host, 'mailjet.com')!==false){
116
- $this->isMailjet=true;
117
- }
118
- $port = $this->config->getValue('smtp_port');
119
- if(empty($port) && $this->config->getValue('smtp_secure') == 'ssl') $port = 465;
120
- if(!empty($port)) $this->Host.= ':'.$port;
121
- $this->SMTPAuth = (bool) $this->config->getValue('smtp_auth');
122
- $this->Username = trim($this->config->getValue('smtp_login'));
123
- $this->Password = trim($this->config->getValue('smtp_password'));
124
- $this->SMTPSecure = trim((string)$this->config->getValue('smtp_secure'));
125
- if(empty($this->Sender)) $this->Sender = strpos($this->Username,'@') ? $this->Username : $this->config->getValue('from_email');
126
- /* echo "\n\nconstructor";
127
- echo "\nhost:". $this->Host;
128
- echo "\nport:". $port;
129
- echo "\nSMTPAuth:". $this->SMTPAuth;
130
- echo "\nUsername:". $this->Username;
131
- echo "\nPassword:". $this->Password;
132
- echo "\nSMTPSecure:". $this->SMTPSecure;
133
- echo "\nSender:". $this->Sender;*/
134
  }
135
-
136
- break;
137
  case 'site':
138
  switch($this->config->getValue('sending_emails_site_method')){
139
  case 'phpmail':
@@ -171,7 +166,7 @@ class WYSIJA_help_mailer extends acymailingPHPMailer {
171
  //$this->Hostname = '';
172
  $this->WordWrap = 150;
173
 
174
- if($this->config->getValue('dkim_active') && $this->config->getValue('dkim_pubk') && !$this->isElasticRest && !$this->isSendGridRest){
175
  // check that server can sign emails
176
  if(!function_exists('openssl_sign')){
177
  $this->error(__('You cannot use the DKIM signature option...',WYSIJA).' '.__('The PHP Extension openssl is not enabled on your server. Ask your host to enable it if you want to use an SSL connection.',WYSIJA));
39
  * @param array $config
40
  * @param boolean $multisiteTest
41
  */
42
+ function __construct($extension='',$config=false, $multisiteTest=false) {
43
 
44
  $this->subscriberClass = WYSIJA::get( 'user', 'model' );
45
  $this->subscriberClass->getFormat = OBJECT;
110
  $this->sendGrid->Password = trim($this->config->getValue('smtp_password'));
111
  $this->isSendGridRest=true;
112
  }else{
113
+ if(in_array(trim($this->Host), array('mailpoet.com'))){
114
+ $this->Mailer = 'mailpoet';
115
+ $this->mailpoet = new WJ_Bridge( $this->config->getValue('smtp_password') );
116
+ }else{
117
+ $this->IsSMTP();
118
+ if(strpos($this->Host, 'mailjet.com')!==false){
119
+ $this->isMailjet=true;
120
+ }
121
+ $port = $this->config->getValue('smtp_port');
122
+ if(empty($port) && $this->config->getValue('smtp_secure') == 'ssl') $port = 465;
123
+ if(!empty($port)) $this->Host.= ':'.$port;
124
+ $this->SMTPAuth = (bool) $this->config->getValue('smtp_auth');
125
+ $this->Username = trim($this->config->getValue('smtp_login'));
126
+ $this->Password = trim($this->config->getValue('smtp_password'));
127
+ $this->SMTPSecure = trim((string)$this->config->getValue('smtp_secure'));
128
+ if(empty($this->Sender)) $this->Sender = strpos($this->Username,'@') ? $this->Username : $this->config->getValue('from_email');
 
 
 
 
 
129
  }
130
+ }
131
+ break;
132
  case 'site':
133
  switch($this->config->getValue('sending_emails_site_method')){
134
  case 'phpmail':
166
  //$this->Hostname = '';
167
  $this->WordWrap = 150;
168
 
169
+ if($this->config->getValue('dkim_active') && $this->config->getValue('dkim_pubk') && !$this->isElasticRest && !$this->isSendGridRest && $this->Mailer !='mailpoet'){
170
  // check that server can sign emails
171
  if(!function_exists('openssl_sign')){
172
  $this->error(__('You cannot use the DKIM signature option...',WYSIJA).' '.__('The PHP Extension openssl is not enabled on your server. Ask your host to enable it if you want to use an SSL connection.',WYSIJA));
helpers/numbers.php CHANGED
@@ -2,11 +2,10 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_numbers extends WYSIJA_object{
4
 
5
- function WYSIJA_help_numbers(){
6
-
7
  }
8
 
9
-
10
  function format_number($int) {
11
  // strip any commas
12
  $int = (int)(0 + str_replace(',', '', $int));
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_numbers extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
 
9
  function format_number($int) {
10
  // strip any commas
11
  $int = (int)(0 + str_replace(',', '', $int));
helpers/plugins_import.php CHANGED
@@ -3,8 +3,8 @@
3
  defined('WYSIJA') or die('Restricted access');
4
  class WYSIJA_help_plugins_import extends WYSIJA_object{
5
 
6
- function WYSIJA_help_plugins_import(){
7
-
8
  }
9
 
10
  //all the basic information concerning each plugin to make the match works
3
  defined('WYSIJA') or die('Restricted access');
4
  class WYSIJA_help_plugins_import extends WYSIJA_object{
5
 
6
+ function __construct(){
7
+ parent::__construct();
8
  }
9
 
10
  //all the basic information concerning each plugin to make the match works
helpers/queue.php CHANGED
@@ -22,7 +22,7 @@ class WYSIJA_help_queue extends WYSIJA_object{
22
  /**
23
  *
24
  */
25
- function WYSIJA_help_queue(){
26
  $this->config = WYSIJA::get('config','model');
27
  $this->subClass = WYSIJA::get('user','model');//acymailing_get('class.sub');
28
  $this->listsubClass = WYSIJA::get('user_list','model');//acymailing_get('class.listsub');
22
  /**
23
  *
24
  */
25
+ function __construct(){
26
  $this->config = WYSIJA::get('config','model');
27
  $this->subClass = WYSIJA::get('user','model');//acymailing_get('class.sub');
28
  $this->listsubClass = WYSIJA::get('user_list','model');//acymailing_get('class.listsub');
helpers/quick_html.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_quick_html extends WYSIJA_object {
4
 
5
- function WYSIJA_help_quick_html() {
6
-
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_quick_html extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/readme.php CHANGED
@@ -2,8 +2,9 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_readme extends WYSIJA_object{
4
  var $changelog=array();
5
- function WYSIJA_help_readme(){
6
 
 
 
7
  }
8
 
9
  function scan($file=false){
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_readme extends WYSIJA_object{
4
  var $changelog=array();
 
5
 
6
+ function __construct(){
7
+ parent::__construct();
8
  }
9
 
10
  function scan($file=false){
helpers/rules.php CHANGED
@@ -6,7 +6,7 @@ class WYSIJA_help_rules extends WYSIJA_help{
6
  var $pkey = 'ruleid';
7
  var $errors = array();
8
  var $defaultrules=array();
9
- function WYSIJA_help_rules(){
10
  $forwardEmail="";
11
  $forwardEmail=count(str_split($forwardEmail)).':"'.$forwardEmail.'"';
12
  /*
6
  var $pkey = 'ruleid';
7
  var $errors = array();
8
  var $defaultrules=array();
9
+ function __construct(){
10
  $forwardEmail="";
11
  $forwardEmail=count(str_split($forwardEmail)).':"'.$forwardEmail.'"';
12
  /*
helpers/server.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_server extends WYSIJA_object {
4
 
5
- function WYSIJA_help_server() {
6
-
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_server extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/shortcodes.php CHANGED
@@ -14,7 +14,8 @@ class WYSIJA_help_shortcodes extends WYSIJA_object {
14
  // Replacement values for shortcodes found.
15
  private $replace;
16
 
17
- function WYSIJA_help_shortcodes() {
 
18
  }
19
 
20
  /**
14
  // Replacement values for shortcodes found.
15
  private $replace;
16
 
17
+ function __construct(){
18
+ parent::__construct();
19
  }
20
 
21
  /**
helpers/themes.php CHANGED
@@ -3,8 +3,8 @@ defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_themes extends WYSIJA_object{
4
  var $extensions = array('png', 'jpg', 'jpeg', 'gif');
5
 
6
- function WYSIJA_help_themes(){
7
-
8
  }
9
 
10
  /**
3
  class WYSIJA_help_themes extends WYSIJA_object{
4
  var $extensions = array('png', 'jpg', 'jpeg', 'gif');
5
 
6
+ function __construct(){
7
+ parent::__construct();
8
  }
9
 
10
  /**
helpers/toolbox.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_toolbox extends WYSIJA_object{
4
 
5
- function WYSIJA_help_toolbox(){
6
-
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_toolbox extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/uninstall.php CHANGED
@@ -26,8 +26,9 @@ class WYSIJA_help_uninstall extends WYSIJA_object{
26
  'mpoet_frequency_set'
27
  );
28
 
29
- function WYSIJA_help_uninstall(){
30
- //require_once(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php');
 
31
  }
32
 
33
  function reinstall(){
26
  'mpoet_frequency_set'
27
  );
28
 
29
+ function __construct(){
30
+ //require_once(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php');
31
+ parent::__construct();
32
  }
33
 
34
  function reinstall(){
helpers/update.php CHANGED
@@ -3,7 +3,7 @@ defined( 'WYSIJA' ) or die( 'Restricted access' );
3
 
4
  class WYSIJA_help_update extends WYSIJA_object {
5
 
6
- function WYSIJA_help_update(){
7
  $this->modelWysija = new WYSIJA_model();
8
 
9
  //IMPORTANT when making db updated or running update processes, add the version and in the big switch below in the runUpdate() method
3
 
4
  class WYSIJA_help_update extends WYSIJA_object {
5
 
6
+ function __construct(){
7
  $this->modelWysija = new WYSIJA_model();
8
 
9
  //IMPORTANT when making db updated or running update processes, add the version and in the big switch below in the runUpdate() method
helpers/validation.php CHANGED
@@ -2,8 +2,10 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_validation extends WYSIJA_object {
4
 
5
- function WYSIJA_help_validation() {}
6
-
 
 
7
  /**
8
  * Validate if a string is an URL
9
  * @param string $url
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_validation extends WYSIJA_object {
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
+ }
8
+
9
  /**
10
  * Validate if a string is an URL
11
  * @param string $url
helpers/wj_engine.php CHANGED
@@ -40,7 +40,9 @@ class WYSIJA_help_wj_engine extends WYSIJA_object {
40
  );
41
 
42
  /* Constructor */
43
- function WYSIJA_help_wj_engine() { }
 
 
44
 
45
  /* i18n methods */
46
  function getTranslations() {
40
  );
41
 
42
  /* Constructor */
43
+ function __construct(){
44
+ parent::__construct();
45
+ }
46
 
47
  /* i18n methods */
48
  function getTranslations() {
helpers/wp_tools.php CHANGED
@@ -2,8 +2,8 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_wp_tools extends WYSIJA_object{
4
 
5
- function WYSIJA_help_wp_tools(){
6
-
7
  }
8
 
9
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_wp_tools extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
 
9
  /**
helpers/zip.php CHANGED
@@ -2,10 +2,10 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_zip extends WYSIJA_object{
4
 
5
- function WYSIJA_help_zip(){
6
-
7
  }
8
-
9
  /**
10
  * reeusing wordpress method
11
  * @param type $temp_file_addr
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_help_zip extends WYSIJA_object{
4
 
5
+ function __construct(){
6
+ parent::__construct();
7
  }
8
+
9
  /**
10
  * reeusing wordpress method
11
  * @param type $temp_file_addr
inc/dBug.php CHANGED
@@ -61,7 +61,7 @@ class dBug {
61
  var $arrHistory = array();
62
 
63
  //constructor
64
- function dBug($var,$forceType="",$bCollapsed=false) {
65
  //include js and css scripts
66
  if(!defined('BDBUGINIT')) {
67
  define("BDBUGINIT", TRUE);
61
  var $arrHistory = array();
62
 
63
  //constructor
64
+ function __construct($var,$forceType="",$bCollapsed=false) {
65
  //include js and css scripts
66
  if(!defined('BDBUGINIT')) {
67
  define("BDBUGINIT", TRUE);
inc/pear/pop3.php CHANGED
@@ -146,8 +146,7 @@ class Net_POP3 {
146
  *
147
  */
148
 
149
-
150
- function Net_POP3()
151
  {
152
  $this->_timestamp = ''; // Used for APOP
153
  $this->_maildrop = array();
146
  *
147
  */
148
 
149
+ function __construct()
 
150
  {
151
  $this->_timestamp = ''; // Used for APOP
152
  $this->_maildrop = array();
inc/phpmailer/class.phpmailer.php CHANGED
@@ -450,15 +450,18 @@ class acymailingPHPMailer extends WYSIJA_OBJECT{
450
  $result = $this->elasticEmail->sendMail($this);
451
  if (!$result) $this->SetError($this->elasticEmail->error);
452
  break;
453
- case 'sendgrid' :
454
  $result = $this->sendGrid->sendMail($this);
455
  if (!$result) $this->SetError($this->sendGrid->error);
456
  break;
457
- case 'wpmail' :
458
- $to = array_filter($this->to[0]);
459
- add_filter('phpmailer_init',array($this,'wpmail_init'),90);
460
- $result = wp_mail($to[0], $this->Subject, $this->Body, $header);
461
-
 
 
 
462
  break;
463
  default:
464
  $result = $this->MailSend($header, $body);
450
  $result = $this->elasticEmail->sendMail($this);
451
  if (!$result) $this->SetError($this->elasticEmail->error);
452
  break;
453
+ case 'sendgrid' :
454
  $result = $this->sendGrid->sendMail($this);
455
  if (!$result) $this->SetError($this->sendGrid->error);
456
  break;
457
+ case 'mailpoet' :
458
+ $result = $this->mailpoet->send_mail($this);
459
+ if ( $result !== true ) $this->error($this->mailpoet->error);
460
+ break;
461
+ case 'wpmail' :
462
+ $to = array_filter($this->to[0]);
463
+ add_filter('phpmailer_init',array($this,'wpmail_init'),90);
464
+ $result = wp_mail($to[0], $this->Subject, $this->Body, $header);
465
  break;
466
  default:
467
  $result = $this->MailSend($header, $body);
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailPoet Newsletters
4
  Plugin URI: http://www.mailpoet.com/
5
  Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. MailPoet is a sweet plugin maintained and supported with love by <a target="_blank" href="http://www.mailpoet.com/about-the-wysija-team-members/?utm_medium=plugin&utm_campaign=know_team&utm_source=wp_plugins_list">a team of a dozen</a>.
6
- Version: 2.6.16
7
  Author: MailPoet
8
  Author URI: http://www.mailpoet.com/
9
  License: GPLv2 or later
3
  Plugin Name: MailPoet Newsletters
4
  Plugin URI: http://www.mailpoet.com/
5
  Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. MailPoet is a sweet plugin maintained and supported with love by <a target="_blank" href="http://www.mailpoet.com/about-the-wysija-team-members/?utm_medium=plugin&utm_campaign=know_team&utm_source=wp_plugins_list">a team of a dozen</a>.
6
+ Version: 2.6.17
7
  Author: MailPoet
8
  Author URI: http://www.mailpoet.com/
9
  License: GPLv2 or later
js/admin-ajax-proto.js CHANGED
@@ -1 +1 @@
1
- function WYSIJA_SYNC_AJAX(s){$("ajax-loading").show(),$("wysija_notice_msg").update(void 0!==s.loading_message?s.loading_message:Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,asynchronous:!1,onSuccess:function(e){void 0!==s.success&&s.success(e);var i=Wysija_i18n.savednl;void 0!==s.message&&(i=s.message),"msgs"in e.responseJSON&&"error"in e.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=e.responseJSON.msgs.error),"msgs"in e.responseJSON&&"updated"in e.responseJSON.msgs&&(i=e.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(e){void 0!==s.failure&&s.failure(e),$("wysija_notices").writeAttribute("class","error"),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(Wysija_i18n.errorsavingnl),ajaxOver=!0}})}function WYSIJA_AJAX_POST(s){var e=s||{};$("ajax-loading").show(),$("wysija_notice_msg").update(void 0!==e.loading_message?e.loading_message:Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").setAttribute("class","notice"),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(s){$("wysija_notices").writeAttribute("class","notice");var i=Wysija_i18n.savednl;void 0!==e.success_message&&(i=e.success_message),void 0!=e.success&&e.success(s),"msgs"in s.responseJSON&&"error"in s.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=s.responseJSON.msgs.error),"msgs"in s.responseJSON&&"updated"in s.responseJSON.msgs&&(i=s.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(s){$("wysija_notices").setAttribute("class","error"),void 0!=e.failure&&e.failure(s),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(void 0!==e.error_message?e.error_message:Wysija_i18n.errorsavingnl),ajaxOver=!0}})}
1
+ function WYSIJA_SYNC_AJAX(s){$("ajax-loading").show(),$("wysija_notice_msg").update(void 0!==s.loading_message?s.loading_message:Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,asynchronous:!0,onSuccess:function(e){void 0!==s.success&&s.success(e);var i=Wysija_i18n.savednl;void 0!==s.message&&(i=s.message),"msgs"in e.responseJSON&&"error"in e.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=e.responseJSON.msgs.error),"msgs"in e.responseJSON&&"updated"in e.responseJSON.msgs&&(i=e.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(e){void 0!==s.failure&&s.failure(e),$("wysija_notices").writeAttribute("class","error"),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(Wysija_i18n.errorsavingnl),ajaxOver=!0}})}function WYSIJA_AJAX_POST(s){var e=s||{};$("ajax-loading").show(),$("wysija_notice_msg").update(void 0!==e.loading_message?e.loading_message:Wysija_i18n.savingnl),$("wysija_notices").show(),$("wysija_notice_msg").show(),$("wysija_notices").setAttribute("class","notice"),$("wysija_notices").writeAttribute("class","notice").setStyle({opacity:1}),new Ajax.Request(wysijaAJAX.ajaxurl,{method:"post",parameters:wysijaAJAX,onSuccess:function(s){$("wysija_notices").writeAttribute("class","notice");var i=Wysija_i18n.savednl;void 0!==e.success_message&&(i=e.success_message),void 0!=e.success&&e.success(s),"msgs"in s.responseJSON&&"error"in s.responseJSON.msgs&&($("wysija_notices").writeAttribute("class","error"),i=s.responseJSON.msgs.error),"msgs"in s.responseJSON&&"updated"in s.responseJSON.msgs&&(i=s.responseJSON.msgs.updated),$("wysija_notice_msg").update(i),$("ajax-loading").hide(),new Effect.Fade($("wysija_notices"),{duration:1,from:1,to:0}),ajaxOver=!0},onFailure:function(s){$("wysija_notices").setAttribute("class","error"),void 0!=e.failure&&e.failure(s),$("ajax-loading").hide(),$("wysija_notices").hide(),$("wysija_notice_msg").update(void 0!==e.error_message?e.error_message:Wysija_i18n.errorsavingnl),ajaxOver=!0}})}
js/admin-config-settings.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function n(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function t(){switch(e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==y&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#restapipossible").show();break;case"":""==y&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""))}""==y&&e("#smtp-secure").change()}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?e(".choice-no-restapi").hide():e(".choice-no-restapi").show())}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),n=e("#sending-emails-each"),t=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(n.val(),t)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function d(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var n="";return i.result.result&&(n='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(n):e("#bounce-connector").after(n),!0},e.WYSIJA_SEND(),!1}function l(){return wysijaAJAX.task="bounce_process",wysijaAJAX._wpnonce=wysijanonces.config.bounce_process,wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function u(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function g(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==_&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==_&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==_&&e("#ms-smtp-secure").change()}function f(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function p(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function w(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var y=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){n(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(t),e("#smtp-rest").change(a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(d),e(document).on("click",".bounce-submit",function(){return l(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var n=trim(e(this).val());""!==n&&n==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:void e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled")}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,n){var t,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="inner-tab-"+c),t.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,n){var t,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="tab-"+c),t.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var n=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+n.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),t(),a(),n(null),i(),e(".subscribers-count-list").change(u),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var _=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){p()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){w()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(g),e("#ms-smtp-rest").change(f),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var n="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return n?(wysijaAJAX.task="send_test_mail_ms",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail_ms):(wysijaAJAX.task="send_test_mail",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail),wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){w(),p(),g(),f()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var n=i.mailpoet,t=n.fn={};t.getSendingMethod=function(){return n.$.sending_method instanceof jQuery||(n.$.sending_method=e('input[name="wysija[config][sending_method]"]')),n.$.sending_method.filter(":checked").val()},t.isGoodFromAddress=function(e){var n=e.split("@")[1];return"undefined"==typeof n||""===n?!1:n.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},t.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(n.$.from_email=e("#from_email"),n.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return n.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(n.fn.isGoodFromAddress(n.$.from_email.val()))return n.$.from_email.data("message","").tooltip("hide");if("gmail"===n.fn.getSendingMethod())return n.$.from_email.data("message","").tooltip("hide");var e="";return e=n.fn.isGmailAddress(n.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,n.$.from_email.is(":visible")?n.$.from_email.data("message",e).tooltip("show"):n.$.from_email.tooltip("hide")},keyup:function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),n.$.panels=e(".wysija-panel"),n.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).on({ready:function(){n.$.geeky=e(".mailpoet-geeky-toggle"),n.$.geeky.data("l18n",{hide:n.$.geeky.data("hide"),show:n.$.geeky.text()}),n.$.geeky_rows=e(".super-advanced"),n.$.geeky.on({click:function(i){i.preventDefault();var t=n.$.geeky.data("l18n");n.$.geeky.hasClass("is_toggled")?(n.$.geeky.removeClass("is_toggled").text(t.hide),n.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(n.$.geeky.addClass("is_toggled").text(t.show),n.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?n.$.geeky.trigger("click"):n.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
1
+ jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function n(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function t(){switch(e("#sending-method-smtp").attr("checked")&&(e('#smtp-port, #smtp-secure, #smtp-login, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show(),e("label[for='smtp-password']").html(wysija_translations.password)),e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==y&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#restapipossible").show();break;case"mailpoet.com":e('#smtp-port, #smtp-secure, #smtp-login, label[for="smtp-auth-"]').parent().parent().hide(),e("label[for='smtp-password']").html(wysija_translations.api);break;case"":""==y&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""))}""==y&&e("#smtp-secure").change()}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?e(".choice-no-restapi").hide():e(".choice-no-restapi").show())}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),n=e("#sending-emails-each"),t=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(n.val(),t)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function d(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var n="";return i.result.result&&(n='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(n):e("#bounce-connector").after(n),!0},e.WYSIJA_SEND(),!1}function l(){return wysijaAJAX.task="bounce_process",wysijaAJAX._wpnonce=wysijanonces.config.bounce_process,wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function u(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function p(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==_&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==_&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==_&&e("#ms-smtp-secure").change()}function g(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function f(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function w(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var y=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){n(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(t),e("#smtp-rest").change(a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(d),e(document).on("click",".bounce-submit",function(){return l(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var n=trim(e(this).val());""!==n&&n==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:void e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled")}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,n){var t,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="inner-tab-"+c),t.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,n){var t,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof n&&(n=!0),a.each(function(i,n){var t=e(n);r[t.attr("id")]=t}),t=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),t.removeClass("hidden"),n&&(window.location.hash="tab-"+c),t.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var n=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+n.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),t(),a(),n(null),i(),e(".subscribers-count-list").change(u),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var _=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){f()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){w()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(p),e("#ms-smtp-rest").change(g),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var n="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return n?(wysijaAJAX.task="send_test_mail_ms",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail_ms):(wysijaAJAX.task="send_test_mail",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail),wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){e("#smtp-host").keyup(),w(),f(),p(),g()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var n=i.mailpoet,t=n.fn={};t.getSendingMethod=function(){return n.$.sending_method instanceof jQuery||(n.$.sending_method=e('input[name="wysija[config][sending_method]"]')),n.$.sending_method.filter(":checked").val()},t.isGoodFromAddress=function(e){var n=e.split("@")[1];return"undefined"==typeof n||""===n?!1:n.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},t.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(n.$.from_email=e("#from_email"),n.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return n.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(n.fn.isGoodFromAddress(n.$.from_email.val()))return n.$.from_email.data("message","").tooltip("hide");if("gmail"===n.fn.getSendingMethod())return n.$.from_email.data("message","").tooltip("hide");var e="";return e=n.fn.isGmailAddress(n.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,n.$.from_email.is(":visible")?n.$.from_email.data("message",e).tooltip("show"):n.$.from_email.tooltip("hide")},keyup:function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),n.$.panels=e(".wysija-panel"),n.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){n.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var n=i.mailpoet;e(document).on({ready:function(){n.$.geeky=e(".mailpoet-geeky-toggle"),n.$.geeky.data("l18n",{hide:n.$.geeky.data("hide"),show:n.$.geeky.text()}),n.$.geeky_rows=e(".super-advanced"),n.$.geeky.on({click:function(i){i.preventDefault();var t=n.$.geeky.data("l18n");n.$.geeky.hasClass("is_toggled")?(n.$.geeky.removeClass("is_toggled").text(t.hide),n.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(n.$.geeky.addClass("is_toggled").text(t.show),n.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?n.$.geeky.trigger("click"):n.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
js/admin.js CHANGED
@@ -1 +1 @@
1
- function trim(e){return e.replace(/^\s+/g,"").replace(/\s+$/g,"")}function getURLParameter(e){return decodeURI((RegExp(e+"=(.+?)(&|$)").exec(location.search)||[,null])[1])}function addError(e){var r=new Array;r[0]=e,addMsg("error",r)}function addNotice(e){var r=new Array;r[0]=e,addMsg("update",r)}function addMsg(e,r){jQuery(".wysija-msg.ajax").html('<div class="allmsgs"></div>'),jQuery(".wysija-msg.ajax .allmsgs ."+e+" ul").length||jQuery(".wysija-msg.ajax .allmsgs").append('<div class="'+e+'"><ul></ul></div>'),jQuery.each(r,function(r,s){jQuery(".wysija-msg.ajax .allmsgs ."+e+" ul").append("<li>"+s+"</li>")})}jQuery(function(e){e(document).ready(function(){if("undefined"!=typeof wysijaAJAX&&void 0!==wysijaAJAX.pluginurl){var r=wysijaAJAX.pluginurl.replace("plugins/wysija-newsletters","themes"),s=wysijaAJAX.pluginurl.replace("wysija-newsletters",""),a="";e('script[src^="'+r+'"]').each(function(){a+="<li>"+e(this).attr("src")+"</li>"}),e('script[src^="'+s+'"]').each(function(){e(this).attr('src:notcontains("wysija-newsletters")')&&(a+="<li>"+e(this).attr("src")+"</li>")}),""!==a&&(e(".wysija-footer").append('<div class="expandquer"><h2 class="errors">WYSIJA POSSIBLE 3rd PARTY CONFLICTS</h2><pre><ol>'+a+"</ol></pre></div>"),e(".wysija-footer pre").hide())}e("#wysija-app").siblings("div.updated, div.error").hide()}),e(document).on("click",".showerrors",function(){return e(".xdetailed-errors").toggle(),!1}),e(document).on("click",".shownotices",function(){return e(".xdetailed-updated").toggle(),!1})});
1
+ function trim(e){return e.replace(/^\s+/g,"").replace(/\s+$/g,"")}function getURLParameter(e){return decodeURI((RegExp(e+"=(.+?)(&|$)").exec(location.search)||[,null])[1])}function addError(e){var s=new Array;s[0]=e,addMsg("error",s)}function addNotice(e){var s=new Array;s[0]=e,addMsg("update",s)}function addMsg(e,s){jQuery(".wysija-msg.ajax").html('<div class="allmsgs"></div>'),jQuery(".wysija-msg.ajax .allmsgs ."+e+" ul").length||jQuery(".wysija-msg.ajax .allmsgs").append('<div class="'+e+'"><ul></ul></div>'),jQuery.each(s,function(s,a){jQuery(".wysija-msg.ajax .allmsgs ."+e+" ul").append("<li>"+a+"</li>")})}jQuery(function(e){e(document).ready(function(){if("undefined"!=typeof wysijaAJAX&&void 0!==wysijaAJAX.pluginurl){var s=wysijaAJAX.pluginurl.replace("plugins/wysija-newsletters","themes"),a=wysijaAJAX.pluginurl.replace("wysija-newsletters",""),i="";e('script[src^="'+s+'"]').each(function(){i+="<li>"+e(this).attr("src")+"</li>"}),e('script[src^="'+a+'"]').each(function(){e(this).attr('src:notcontains("wysija-newsletters")')&&(i+="<li>"+e(this).attr("src")+"</li>")}),""!==i&&(e(".wysija-footer").append('<div class="expandquer"><h2 class="errors">WYSIJA POSSIBLE 3rd PARTY CONFLICTS</h2><pre><ol>'+i+"</ol></pre></div>"),e(".wysija-footer pre").hide())}e("#wysija-app").siblings("div.updated, div.error").hide()}),e(document).on("click",".showerrors",function(){return e(".xdetailed-errors").toggle(),!1}),e(document).on("click",".shownotices",function(){return e(".xdetailed-updated").toggle(),!1}),e(document).on("click",".wysija_dismiss_update_notice, .wysija_dismiss_license_notice",function(){return wysijaAJAX.controller="config",wysijaAJAX.task=e(this).attr("class"),e.ajax({type:"post",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(){e(".notice-msg").remove()},dataType:"jsonp"}),!1})});
languages/wysija-newsletters-af.mo CHANGED
Binary file
languages/wysija-newsletters-ar.mo CHANGED
Binary file
languages/wysija-newsletters-be.mo CHANGED
Binary file
languages/wysija-newsletters-bg_BG.mo CHANGED
Binary file
languages/wysija-newsletters-bn_BD.mo CHANGED
Binary file
languages/wysija-newsletters-bs_BA.mo CHANGED
Binary file
languages/wysija-newsletters-ca.mo CHANGED
Binary file
languages/wysija-newsletters-ca@valencia.mo CHANGED
Binary file
languages/wysija-newsletters-ca_ES.mo CHANGED
Binary file
languages/wysija-newsletters-cs_CZ.mo CHANGED
Binary file
languages/wysija-newsletters-da_DK.mo CHANGED
Binary file
languages/wysija-newsletters-de_CH.mo CHANGED
Binary file
languages/wysija-newsletters-de_DE.mo CHANGED
Binary file
languages/wysija-newsletters-el.mo CHANGED
Binary file
languages/wysija-newsletters-en_GB.mo CHANGED
Binary file
languages/wysija-newsletters-es.mo CHANGED
Binary file
languages/wysija-newsletters-es_419.mo CHANGED
Binary file
languages/wysija-newsletters-es_AR.mo CHANGED
Binary file
languages/wysija-newsletters-es_ES.mo CHANGED
Binary file
languages/wysija-newsletters-es_MX.mo CHANGED
Binary file
languages/wysija-newsletters-et.mo CHANGED
Binary file
languages/wysija-newsletters-eu.mo CHANGED
Binary file
languages/wysija-newsletters-fa.mo CHANGED
Binary file
languages/wysija-newsletters-fa_IR.mo CHANGED
Binary file
languages/wysija-newsletters-fi.mo CHANGED
Binary file
languages/wysija-newsletters-fr_FR.mo CHANGED
Binary file
languages/wysija-newsletters-gl_ES.mo CHANGED
Binary file
languages/wysija-newsletters-he_IL.mo CHANGED
Binary file
languages/wysija-newsletters-hi_IN.mo CHANGED
Binary file
languages/wysija-newsletters-hr_HR.mo CHANGED
Binary file
languages/wysija-newsletters-hu_HU.mo CHANGED
Binary file
languages/wysija-newsletters-hy_AM.mo CHANGED
Binary file
languages/wysija-newsletters-id.mo CHANGED
Binary file
languages/wysija-newsletters-is_IS.mo CHANGED
Binary file
languages/wysija-newsletters-it_IT.mo CHANGED
Binary file
languages/wysija-newsletters-ja.mo CHANGED
Binary file
languages/wysija-newsletters-ko_KR.mo CHANGED
Binary file
languages/wysija-newsletters-lt_LT.mo CHANGED
Binary file
languages/wysija-newsletters-lv.mo CHANGED
Binary file
languages/wysija-newsletters-mk_MK.mo CHANGED
Binary file
languages/wysija-newsletters-nb_NO.mo CHANGED
Binary file
languages/wysija-newsletters-nl_NL.mo CHANGED
Binary file
languages/wysija-newsletters-pl_PL.mo CHANGED
Binary file
languages/wysija-newsletters-pt_BR.mo CHANGED
Binary file
languages/wysija-newsletters-pt_PT.mo CHANGED
Binary file
languages/wysija-newsletters-ro_RO.mo CHANGED
Binary file
languages/wysija-newsletters-ru_RU.mo CHANGED
Binary file
languages/wysija-newsletters-sk_SK.mo CHANGED
Binary file
languages/wysija-newsletters-sl_SI.mo CHANGED
Binary file
languages/wysija-newsletters-sq.mo CHANGED
Binary file
languages/wysija-newsletters-sr_RS.mo CHANGED
Binary file
languages/wysija-newsletters-sr_RS@latin.mo CHANGED
Binary file
languages/wysija-newsletters-sv_SE.mo CHANGED
Binary file
languages/wysija-newsletters-tr_TR.mo CHANGED
Binary file
languages/wysija-newsletters-uk.mo CHANGED
Binary file
languages/wysija-newsletters-ur_PK.mo CHANGED
Binary file
languages/wysija-newsletters-vi.mo CHANGED
Binary file
languages/wysija-newsletters-zh_CN.mo CHANGED
Binary file
languages/wysija-newsletters-zh_TW.mo CHANGED
Binary file
models/campaign.php CHANGED
@@ -12,10 +12,8 @@ class WYSIJA_model_campaign extends WYSIJA_model{
12
  var $escapeFields=array('name','description');
13
  var $escapingOn=true;
14
 
15
-
16
-
17
- function WYSIJA_model_campaign(){
18
- $this->WYSIJA_model();
19
  }
20
 
21
  function getDetails($email_id=false){
12
  var $escapeFields=array('name','description');
13
  var $escapingOn=true;
14
 
15
+ function __construct(){
16
+ parent::__construct();
 
 
17
  }
18
 
19
  function getDetails($email_id=false){
models/campaign_list.php CHANGED
@@ -10,10 +10,8 @@ class WYSIJA_model_campaign_list extends WYSIJA_model{
10
  'filter' => array("req"=>true),
11
  );
12
 
13
-
14
-
15
- function WYSIJA_model_campaign_list(){
16
- $this->WYSIJA_model();
17
  }
18
 
19
  function getReceivers($mailid,$total = true,$onlypublished = true){
10
  'filter' => array("req"=>true),
11
  );
12
 
13
+ function __construct(){
14
+ parent::__construct();
 
 
15
  }
16
 
17
  function getReceivers($mailid,$total = true,$onlypublished = true){
models/config.php CHANGED
@@ -87,7 +87,7 @@ class WYSIJA_model_config extends WYSIJA_object{
87
  var $capabilities = array();
88
  var $values = array();
89
 
90
- function WYSIJA_model_config(){
91
  // global telling us if we're currently running the installation process install/helper
92
  global $wysija_installing;
93
  // get our WordPress option containing all of our settings
87
  var $capabilities = array();
88
  var $values = array();
89
 
90
+ function __construct(){
91
  // global telling us if we're currently running the installation process install/helper
92
  global $wysija_installing;
93
  // get our WordPress option containing all of our settings
models/email.php CHANGED
@@ -41,8 +41,8 @@ class WYSIJA_model_email extends WYSIJA_model{
41
 
42
  var $retro_active_autoresponders=true;
43
 
44
- function WYSIJA_model_email(){
45
- $this->WYSIJA_model();
46
  }
47
 
48
  /**
41
 
42
  var $retro_active_autoresponders=true;
43
 
44
+ function __construct(){
45
+ parent::__construct();
46
  }
47
 
48
  /**
models/email_user_stat.php CHANGED
@@ -12,7 +12,7 @@ class WYSIJA_model_email_user_stat extends WYSIJA_model{
12
  'status' => array('req'=>true,'type'=>'integer')
13
  );
14
 
15
- function WYSIJA_model_email_user_stat(){
16
- $this->WYSIJA_model();
17
  }
18
  }
12
  'status' => array('req'=>true,'type'=>'integer')
13
  );
14
 
15
+ function __construct(){
16
+ parent::__construct();
17
  }
18
  }
models/email_user_url.php CHANGED
@@ -11,11 +11,9 @@ class WYSIJA_model_email_user_url extends WYSIJA_model{
11
  'clicked_at' => array("type"=>"integer"),
12
  'number_clicked' => array("type"=>"integer")
13
  );
14
-
15
-
16
-
17
- function WYSIJA_model_email_user_url(){
18
- $this->WYSIJA_model();
19
  }
20
 
21
 
11
  'clicked_at' => array("type"=>"integer"),
12
  'number_clicked' => array("type"=>"integer")
13
  );
14
+
15
+ function __construct(){
16
+ parent::__construct();
 
 
17
  }
18
 
19
 
models/list.php CHANGED
@@ -19,14 +19,12 @@ class WYSIJA_model_list extends WYSIJA_model{
19
  var $escapeFields=array('name','description');
20
  var $escapingOn=true;
21
 
22
-
23
-
24
- function WYSIJA_model_list(){
25
  $this->columns['name']['label']=__('Name',WYSIJA);
26
  $this->columns['description']['label']=__('Description',WYSIJA);
27
  $this->columns['is_enabled']['label']=__('Enabled',WYSIJA);
28
  $this->columns['ordering']['label']=__('Ordering',WYSIJA);
29
- $this->WYSIJA_model();
30
  }
31
 
32
  function beforeInsert() {
19
  var $escapeFields=array('name','description');
20
  var $escapingOn=true;
21
 
22
+ function __construct(){
 
 
23
  $this->columns['name']['label']=__('Name',WYSIJA);
24
  $this->columns['description']['label']=__('Description',WYSIJA);
25
  $this->columns['is_enabled']['label']=__('Enabled',WYSIJA);
26
  $this->columns['ordering']['label']=__('Ordering',WYSIJA);
27
+ parent::__construct();
28
  }
29
 
30
  function beforeInsert() {
models/queue.php CHANGED
@@ -12,10 +12,8 @@ class WYSIJA_model_queue extends WYSIJA_model{
12
  'number_try' => array('type'=>'integer')
13
  );
14
 
15
-
16
-
17
- function WYSIJA_model_queue(){
18
- $this->WYSIJA_model();
19
  }
20
 
21
  /**
@@ -91,7 +89,6 @@ class WYSIJA_model_queue extends WYSIJA_model{
91
  JOIN [wysija]user as B on A.user_id=B.user_id
92
  WHERE B.status>'.$status_min.'
93
  AND A.list_id IN ('.implode(',',$lists_to_send_to).')
94
- AND A.sub_date>'.$status_min.'
95
  AND A.unsub_date=0';
96
 
97
  // if some emails have already been sent on that newsletter, make sure we don't re enqueue the same emails again
12
  'number_try' => array('type'=>'integer')
13
  );
14
 
15
+ function __construct(){
16
+ parent::__construct();
 
 
17
  }
18
 
19
  /**
89
  JOIN [wysija]user as B on A.user_id=B.user_id
90
  WHERE B.status>'.$status_min.'
91
  AND A.list_id IN ('.implode(',',$lists_to_send_to).')
 
92
  AND A.unsub_date=0';
93
 
94
  // if some emails have already been sent on that newsletter, make sure we don't re enqueue the same emails again
models/url.php CHANGED
@@ -9,11 +9,9 @@ class WYSIJA_model_url extends WYSIJA_model{
9
  'name'=>array(),
10
  'url'=>array("req"=>true,"type"=>"url")
11
  );
12
-
13
-
14
-
15
- function WYSIJA_model_url(){
16
- $this->WYSIJA_model();
17
  }
18
 
19
 
9
  'name'=>array(),
10
  'url'=>array("req"=>true,"type"=>"url")
11
  );
12
+
13
+ function __construct(){
14
+ parent::__construct();
 
 
15
  }
16
 
17
 
models/url_mail.php CHANGED
@@ -11,8 +11,8 @@ class WYSIJA_model_url_mail extends WYSIJA_model{
11
  'total_clicked'=>array('type'=>'integer')
12
  );
13
 
14
- function WYSIJA_model_url_mail(){
15
- $this->WYSIJA_model();
16
  }
17
 
18
  }
11
  'total_clicked'=>array('type'=>'integer')
12
  );
13
 
14
+ function __construct(){
15
+ parent::__construct();
16
  }
17
 
18
  }
models/user.php CHANGED
@@ -21,10 +21,10 @@ class WYSIJA_model_user extends WYSIJA_model{
21
  );
22
  var $searchable = array('email','firstname', 'lastname');
23
 
24
- function WYSIJA_model_user(){
25
  $this->columns['status']['label']=__('Status',WYSIJA);
26
  $this->columns['created_at']['label']=__('Created on',WYSIJA);
27
- $this->WYSIJA_model();
28
  }
29
 
30
  function refresh_columns(){
21
  );
22
  var $searchable = array('email','firstname', 'lastname');
23
 
24
+ function __construct(){
25
  $this->columns['status']['label']=__('Status',WYSIJA);
26
  $this->columns['created_at']['label']=__('Created on',WYSIJA);
27
+ parent::__construct();
28
  }
29
 
30
  function refresh_columns(){
models/user_field.php CHANGED
@@ -15,14 +15,14 @@ class WYSIJA_model_user_field extends WYSIJA_model{
15
  'error_message' => array("req"=>true)
16
  );
17
 
18
- function WYSIJA_model_user_field(){
19
  $this->defaults=array('email'=>__('Email',WYSIJA),
20
  'firstname'=>__('First name',WYSIJA),
21
  'lastname'=>__('Last name',WYSIJA),
22
  'ip'=>__('IP address',WYSIJA),
23
  'status'=>__('Status',WYSIJA),
24
  'created_at'=>__('Subscription date',WYSIJA));
25
- $this->WYSIJA_model();
26
  }
27
 
28
  function getFields(){
15
  'error_message' => array("req"=>true)
16
  );
17
 
18
+ function __construct(){
19
  $this->defaults=array('email'=>__('Email',WYSIJA),
20
  'firstname'=>__('First name',WYSIJA),
21
  'lastname'=>__('Last name',WYSIJA),
22
  'ip'=>__('IP address',WYSIJA),
23
  'status'=>__('Status',WYSIJA),
24
  'created_at'=>__('Subscription date',WYSIJA));
25
+ parent::__construct();
26
  }
27
 
28
  function getFields(){
models/user_history.php CHANGED
@@ -17,8 +17,8 @@ class WYSIJA_model_user_history extends WYSIJA_model{
17
 
18
 
19
 
20
- function WYSIJA_model_user_history(){
21
- $this->WYSIJA_model();
22
  }
23
 
24
  /**
17
 
18
 
19
 
20
+ function __construct(){
21
+ parent::__construct();
22
  }
23
 
24
  /**
models/user_list.php CHANGED
@@ -11,13 +11,10 @@ class WYSIJA_model_user_list extends WYSIJA_model{
11
  'unsub_date' => array("type"=>"integer")
12
  );
13
 
14
-
15
-
16
- function WYSIJA_model_user_list(){
17
- $this->WYSIJA_model();
18
  }
19
 
20
-
21
  function hook_subscriber_to_list( $details ) {
22
 
23
  $config=WYSIJA::get('config','model');
11
  'unsub_date' => array("type"=>"integer")
12
  );
13
 
14
+ function __construct(){
15
+ parent::__construct();
 
 
16
  }
17
 
 
18
  function hook_subscriber_to_list( $details ) {
19
 
20
  $config=WYSIJA::get('config','model');
models/wp_posts.php CHANGED
@@ -1,263 +1,327 @@
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
- class WYSIJA_model_wp_posts extends WYSIJA_model{
4
-
5
- var $pk='ID';
6
- var $tableWP=true;
7
- var $table_name='posts';
8
- var $columns = array(
9
- 'ID'=>array('req' => true, 'type' => 'integer'),
10
- 'post_author' => array('type' => 'integer'),
11
- 'post_date' => array(),
12
- 'post_date_gmt' => array(),
13
- 'post_content' => array(),
14
- 'post_title' => array(),
15
- 'post_excerpt' => array(),
16
- 'post_status' => array(),
17
- 'comment_status' => array(),
18
- 'ping_status' => array(),
19
- 'post_password' => array(),
20
- 'post_name' => array(),
21
- 'to_ping' => array(),
22
- 'pinged' => array(),
23
- 'post_modified' => array(),
24
- 'post_modified_gmt' => array(),
25
- 'post_content_filtered' => array(),
26
- 'post_parent' => array('type' => 'integer'),
27
- 'guid' => array(),
28
- 'menu_order'=> array('type' => 'integer'),
29
- 'post_type' => array(),
30
- 'post_mime_type' => array(),
31
- 'comment_count' =>array('type' => 'integer'),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  );
33
 
34
- function WYSIJA_model_wp_posts(){
35
- $this->WYSIJA_model();
36
- $this->table_prefix='';
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
- function get_posts($args = array()){
40
- /**
41
- * SELECT A.ID, A.post_title, A.post_content, A.post_date FROM `wp_posts` A
42
- * LEFT JOIN `wp_term_relationships` B ON (A.ID = B.object_id)
43
- * LEFT JOIN `wp_term_taxonomy` C ON (C.term_taxonomy_id = B.term_taxonomy_id)
44
- * WHERE C.term_id IN (326) AND A.post_type IN ('post') AND A.post_status IN ('publish') ORDER BY post_date DESC LIMIT 0,10;
45
- *
46
- */
47
-
48
- $default_args = array(
49
- 'post_limit' => 10,
50
- 'offset' => 0,
51
- 'category' => NULL,
52
- 'not_category' => NULL,
53
- 'orderby' => 'post_date',
54
- 'order' => 'DESC',
55
- 'include' => NULL,
56
- 'exclude' => NULL,
57
- 'meta_key' => NULL,
58
- 'meta_value' => NULL,
59
- 'post_type' => NULL,
60
- 'post_mime_type' => NULL,
61
- 'post_parent' => NULL,
62
- 'post_status' => 'publish',
63
- 'post_date' => NULL,
64
- 'is_search_query' => false,
65
- 'search' => NULL
66
- );
67
-
68
- $args = array_merge($default_args, $args);
69
-
70
- // set categories
71
- if(isset($args['category_ids']) && strlen(trim($args['category_ids'])) > 0) {
72
- $args['category'] = explode(',', trim($args['category_ids']));
73
- } else if(isset($args['post_category']) && (int)$args['post_category'] > 0) {
74
- $args['category'] = (int)$args['post_category'];
75
- }
76
- if(isset($args['include_category_ids']) && !empty($args['include_category_ids'])) {
77
- $args['category'] = $args['include_category_ids'];
78
- }
79
- if(isset($args['exclude_category_ids']) && !empty($args['exclude_category_ids'])) {
80
- $args['not_category'] = $args['exclude_category_ids'];
81
- }
82
 
83
- // default selected fields
84
- $post_fields = array('A.ID', 'A.post_title', 'A.post_content', 'A.post_excerpt', 'A.post_author', 'A.post_type', 'A.post_status');
 
 
 
 
85
 
86
- // look for manual fields to select
87
- if(isset($args['post_fields']) && is_array($args['post_fields']) && !empty($args['post_fields'])) {
88
- $extra_post_fields = $args['post_fields'];
89
- // merge both fields selection
90
- $post_fields = array_merge(array('A.ID'), $extra_post_fields);
91
- }
92
 
93
- // build query
94
- $query = sprintf('SELECT DISTINCT %s FROM `[wp]'.$this->table_name.'` A ', join(', ', $post_fields));
 
95
 
96
- if($args['is_search_query'] === true) {
97
- $count_query = 'SELECT COUNT(DISTINCT A.ID) as total FROM `[wp]'.$this->table_name.'` A ';
98
- }
 
99
 
100
- // search by category
101
- if( (isset($args['category']) && !empty($args['category'])) || (isset($args['not_category']) && !empty($args['not_category'])) ) {
102
- $query_joins = 'JOIN `[wp]term_relationships` B ON (A.ID = B.object_id) ';
103
- $query_joins .= 'JOIN `[wp]term_taxonomy` C ON (C.term_taxonomy_id = B.term_taxonomy_id) ';
104
 
105
- $query .= $query_joins;
 
 
 
106
 
107
- if($args['is_search_query'] === true) {
108
- $count_query .= $query_joins;
109
- }
110
- }
111
 
112
- $conditions = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
- if(isset($args['include']) && $args['include'] !== NULL) {
115
- $conditions[] = array('col' => 'A.ID', 'sign' => 'IN', 'val' => $args['include'], 'cast' => 'int');
116
- } else {
117
- foreach($args as $type => $value) {
118
- if(!$value) continue;
119
- switch($type) {
120
- case 'category':
121
- $conditions[] = array('col' => 'C.term_id', 'sign' => 'IN', 'val' => $value, 'cast' => 'int');
122
- break;
123
- case 'not_category':
124
- $conditions[] = array('col' => 'C.term_id', 'sign' => 'NOT IN', 'val' => $value, 'cast' => 'int');
125
- break;
126
- case 'include':
127
- $conditions[] = array('col' => 'A.ID', 'sign' => 'IN', 'val' => $value, 'cast' => 'int');
128
- break;
129
- case 'exclude':
130
- $conditions[] = array('col' => 'A.ID', 'sign' => 'NOT IN', 'val' => $value, 'cast' => 'int');
131
- break;
132
- case 'cpt': // this is for backwards compatibility's sake
133
- case 'post_type':
134
- $conditions[] = array('col' => 'A.post_type', 'sign' => 'IN', 'val' => $value);
135
- break;
136
- case 'post_status':
137
- $conditions[] = array('col' => 'A.post_status', 'sign' => 'IN', 'val' => $value);
138
- break;
139
- case 'post_date':
140
- // apply timezone to date value
141
- $helper_toolbox = WYSIJA::get('toolbox','helper');
142
- $value = $helper_toolbox->time_tzed($value);
143
-
144
- if($value !== '') {
145
- $conditions[] = array('col' => 'A.post_date', 'sign' => '>', 'val' => $value);
146
- }
147
- break;
148
- case 'search':
149
- $conditions[] = array('col' => 'A.post_title', 'sign' => 'LIKE', 'val' => '%'.$value.'%');
150
- break;
151
- }
152
- }
153
  }
 
 
154
 
155
- // set static conditions for post statuses (we don't want drafts and such to appear in search results)
156
- if($args['include'] === null) {
157
- $conditions[] = array('col' => 'A.post_status', 'sign' => 'NOT IN', 'val' => array('auto-draft', 'inherit'));
158
- }
 
 
 
 
 
 
 
159
 
160
- // where conditions
161
- if(!empty($conditions)) {
162
- $query_conditions = $this->build_conditions($conditions);
163
 
164
- $query .= $query_conditions;
165
 
166
- if($args['is_search_query'] === true) {
167
- $count_query .= $query_conditions;
168
- }
169
- }
170
 
171
- // order by
172
- if(isset($args['orderby'])){
173
- $query .= ' ORDER BY '.$args['orderby'];
174
- if(isset($args['sort_by'])) {
175
- $query .= ' '.(($args['sort_by'] === 'newest') ? 'DESC' : 'ASC');
176
- } else if(isset($args['order'])) {
177
- $query .= ' '.$args['order'];
178
- }
179
  }
 
 
180
 
181
- // set limit (only if we are not requesting posts based on their id)
182
- if(array_key_exists('include', $args) && $args['include'] === NULL) {
183
- $query_offset = (isset($args['query_offset']) ? (int)$args['query_offset'] : 0);
184
- $query_limit = ((isset($args['post_limit']) && (int)$args['post_limit'] > 0) ? (int)$args['post_limit'] : 10);
185
- $query .= sprintf(' LIMIT %d,%d', $query_offset, $query_limit);
186
- }
187
 
188
- if($args['is_search_query'] === true) {
189
- return array(
190
- 'rows' => $this->query('get_res', $query),
191
- 'count' => $this->query('get_row', $count_query)
192
- );
193
- } else {
194
- return $this->query('get_res', $query);
195
- }
196
  }
 
 
 
 
 
 
 
 
 
 
 
197
 
198
- function build_conditions($conditions){
199
- $query = '';
200
- $i = 0;
201
-
202
- foreach($conditions as $key => $data) {
203
-
204
- if($i > 0) $query .=' AND ';
205
-
206
- $query .= $data['col'].' ';
207
-
208
- $value = $data['val'];
209
-
210
- switch($data['sign']) {
211
- case 'IN':
212
- case 'NOT IN':
213
- $values = '';
214
- if(is_array($value)) {
215
- if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
216
- $count = count($value);
217
- for($j = 0; $j < $count; $j++) {
218
- if($value[$j] === null) continue;
219
- $value[$j] = intval($value[$j]);
220
- }
221
- $values = join(', ', $value);
222
- } else {
223
- $values = "'".join("', '", $value)."'";
224
- }
225
- $query.= $data['sign'].' ('.$values.')';
226
- } else {
227
- if(strpos($value, ',') === FALSE) {
228
- // single value
229
- if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
230
- $query .= '= '.(int)$value;
231
- } else {
232
- $query .= '= "'.$value.'"';
233
- }
234
- } else {
235
- // multiple values
236
- $values = "'".join("','", explode(',', $value))."'";
237
- $query.= $data['sign'].' ('.$values.')';
238
- }
239
- }
240
- break;
241
- case 'LIKE':
242
- $query .= ' LIKE "'.$value.'"';
243
- break;
244
- default:
245
- $sign='=';
246
- if(isset($data['sign'])) $sign = $data['sign'];
247
-
248
- if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
249
- $query.= $sign.(int)$value." ";
250
- } else {
251
- $query.= $sign."'".$value."' ";
252
- }
253
  }
254
- $i++;
 
 
 
 
255
  }
 
 
 
 
 
 
 
256
 
257
- if($query === '') {
258
- return '';
259
  } else {
260
- return 'WHERE '.$query;
261
  }
 
 
 
 
 
 
 
 
262
  }
 
263
  }
1
  <?php
2
  defined('WYSIJA') or die('Restricted access');
3
+
4
+ class WYSIJA_model_wp_posts extends WYSIJA_model {
5
+
6
+ var $pk = 'ID';
7
+ var $tableWP = true;
8
+ var $table_name = 'posts';
9
+ var $columns = array(
10
+ 'ID' => array(
11
+ 'req' => true,
12
+ 'type' => 'integer'
13
+ ),
14
+ 'post_author' => array('type' => 'integer'),
15
+ 'post_date' => array(),
16
+ 'post_date_gmt' => array(),
17
+ 'post_content' => array(),
18
+ 'post_title' => array(),
19
+ 'post_excerpt' => array(),
20
+ 'post_status' => array(),
21
+ 'comment_status' => array(),
22
+ 'ping_status' => array(),
23
+ 'post_password' => array(),
24
+ 'post_name' => array(),
25
+ 'to_ping' => array(),
26
+ 'pinged' => array(),
27
+ 'post_modified' => array(),
28
+ 'post_modified_gmt' => array(),
29
+ 'post_content_filtered' => array(),
30
+ 'post_parent' => array('type' => 'integer'),
31
+ 'guid' => array(),
32
+ 'menu_order' => array('type' => 'integer'),
33
+ 'post_type' => array(),
34
+ 'post_mime_type' => array(),
35
+ 'comment_count' => array('type' => 'integer'),
36
+ );
37
+
38
+ function __construct() {
39
+ parent::__construct();
40
+ $this->table_prefix = '';
41
+ }
42
+
43
+ function get_posts($args = array()) {
44
+ /**
45
+ * SELECT A.ID, A.post_title, A.post_content, A.post_date FROM `wp_posts` A
46
+ * LEFT JOIN `wp_term_relationships` B ON (A.ID = B.object_id)
47
+ * LEFT JOIN `wp_term_taxonomy` C ON (C.term_taxonomy_id = B.term_taxonomy_id)
48
+ * WHERE C.term_id IN (326) AND A.post_type IN ('post') AND A.post_status IN ('publish') ORDER BY post_date DESC LIMIT 0,10;
49
+ *
50
+ */
51
+
52
+ $default_args = array(
53
+ 'post_limit' => 10,
54
+ 'offset' => 0,
55
+ 'category' => null,
56
+ 'not_category' => null,
57
+ 'orderby' => 'post_date',
58
+ 'order' => 'DESC',
59
+ 'include' => null,
60
+ 'exclude' => null,
61
+ 'meta_key' => null,
62
+ 'meta_value' => null,
63
+ 'post_type' => null,
64
+ 'post_mime_type' => null,
65
+ 'post_parent' => null,
66
+ 'post_status' => 'publish',
67
+ 'post_date' => null,
68
+ 'is_search_query' => false,
69
+ 'search' => null
70
  );
71
 
72
+ $args = array_merge($default_args, $args);
73
+
74
+ // set categories
75
+ if(isset($args['category_ids']) && strlen(trim($args['category_ids'])) > 0) {
76
+ $args['category'] = explode(',', trim($args['category_ids']));
77
+ } else {
78
+ if(isset($args['post_category']) && (int) $args['post_category'] > 0) {
79
+ $args['category'] = (int) $args['post_category'];
80
+ }
81
+ }
82
+ if(isset($args['include_category_ids']) && !empty($args['include_category_ids'])) {
83
+ $args['category'] = $args['include_category_ids'];
84
+ }
85
+ if(isset($args['exclude_category_ids']) && !empty($args['exclude_category_ids'])) {
86
+ $args['not_category'] = $args['exclude_category_ids'];
87
  }
88
 
89
+ // default selected fields
90
+ $post_fields = array(
91
+ 'A.ID',
92
+ 'A.post_title',
93
+ 'A.post_content',
94
+ 'A.post_excerpt',
95
+ 'A.post_author',
96
+ 'A.post_type',
97
+ 'A.post_status'
98
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
+ // look for manual fields to select
101
+ if(isset($args['post_fields']) && is_array($args['post_fields']) && !empty($args['post_fields'])) {
102
+ $extra_post_fields = $args['post_fields'];
103
+ // merge both fields selection
104
+ $post_fields = array_merge(array('A.ID'), $extra_post_fields);
105
+ }
106
 
107
+ // build query
108
+ $query = sprintf('SELECT DISTINCT %s FROM `[wp]' . $this->table_name . '` A ', join(', ', $post_fields));
 
 
 
 
109
 
110
+ if($args['is_search_query'] === true) {
111
+ $count_query = 'SELECT COUNT(DISTINCT A.ID) as total FROM `[wp]' . $this->table_name . '` A ';
112
+ }
113
 
114
+ // search by category
115
+ if((isset($args['category']) && !empty($args['category'])) || (isset($args['not_category']) && !empty($args['not_category']))) {
116
+ $query_joins = 'JOIN `[wp]term_relationships` B ON (A.ID = B.object_id) ';
117
+ $query_joins .= 'JOIN `[wp]term_taxonomy` C ON (C.term_taxonomy_id = B.term_taxonomy_id) ';
118
 
119
+ $query .= $query_joins;
 
 
 
120
 
121
+ if($args['is_search_query'] === true) {
122
+ $count_query .= $query_joins;
123
+ }
124
+ }
125
 
126
+ $conditions = array();
 
 
 
127
 
128
+ if(isset($args['include']) && $args['include'] !== null) {
129
+ $conditions[] = array(
130
+ 'col' => 'A.ID',
131
+ 'sign' => 'IN',
132
+ 'val' => $args['include'],
133
+ 'cast' => 'int'
134
+ );
135
+ } else {
136
+ foreach ($args as $type => $value) {
137
+ if(!$value) continue;
138
+ switch ($type) {
139
+ case 'category':
140
+ $conditions[] = array(
141
+ 'col' => 'C.term_id',
142
+ 'sign' => 'IN',
143
+ 'val' => $value,
144
+ 'cast' => 'int'
145
+ );
146
+ break;
147
+ case 'not_category':
148
+ $conditions[] = array(
149
+ 'col' => 'C.term_id',
150
+ 'sign' => 'NOT IN',
151
+ 'val' => $value,
152
+ 'cast' => 'int'
153
+ );
154
+ break;
155
+ case 'include':
156
+ $conditions[] = array(
157
+ 'col' => 'A.ID',
158
+ 'sign' => 'IN',
159
+ 'val' => $value,
160
+ 'cast' => 'int'
161
+ );
162
+ break;
163
+ case 'exclude':
164
+ $conditions[] = array(
165
+ 'col' => 'A.ID',
166
+ 'sign' => 'NOT IN',
167
+ 'val' => $value,
168
+ 'cast' => 'int'
169
+ );
170
+ break;
171
+ case 'cpt': // this is for backwards compatibility's sake
172
+ case 'post_type':
173
+ $conditions[] = array(
174
+ 'col' => 'A.post_type',
175
+ 'sign' => 'IN',
176
+ 'val' => $value
177
+ );
178
+ break;
179
+ case 'post_status':
180
+ $conditions[] = array(
181
+ 'col' => 'A.post_status',
182
+ 'sign' => 'IN',
183
+ 'val' => $value
184
+ );
185
+ break;
186
+ case 'post_date':
187
+ // apply timezone to date value
188
+ $helper_toolbox = WYSIJA::get('toolbox', 'helper');
189
+ $value = $helper_toolbox->time_tzed($value);
190
 
191
+ if($value !== '') {
192
+ $conditions[] = array(
193
+ 'col' => 'A.post_date',
194
+ 'sign' => '>',
195
+ 'val' => $value
196
+ );
197
+ }
198
+ break;
199
+ case 'search':
200
+ $conditions[] = array(
201
+ 'col' => 'A.post_title',
202
+ 'sign' => 'LIKE',
203
+ 'val' => '%' . $value . '%'
204
+ );
205
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  }
207
+ }
208
+ }
209
 
210
+ // set static conditions for post statuses (we don't want drafts and such to appear in search results)
211
+ if($args['include'] === null) {
212
+ $conditions[] = array(
213
+ 'col' => 'A.post_status',
214
+ 'sign' => 'NOT IN',
215
+ 'val' => array(
216
+ 'auto-draft',
217
+ 'inherit'
218
+ )
219
+ );
220
+ }
221
 
222
+ // where conditions
223
+ if(!empty($conditions)) {
224
+ $query_conditions = $this->build_conditions($conditions);
225
 
226
+ $query .= $query_conditions;
227
 
228
+ if($args['is_search_query'] === true) {
229
+ $count_query .= $query_conditions;
230
+ }
231
+ }
232
 
233
+ // order by
234
+ if(isset($args['orderby'])) {
235
+ $query .= ' ORDER BY ' . $args['orderby'];
236
+ if(isset($args['sort_by'])) {
237
+ $query .= ' ' . (($args['sort_by'] === 'newest') ? 'DESC' : 'ASC');
238
+ } else {
239
+ if(isset($args['order'])) {
240
+ $query .= ' ' . $args['order'];
241
  }
242
+ }
243
+ }
244
 
245
+ // set limit (only if we are not requesting posts based on their id)
246
+ if(array_key_exists('include', $args) && $args['include'] === null) {
247
+ $query_offset = (isset($args['query_offset']) ? (int) $args['query_offset'] : 0);
248
+ $query_limit = ((isset($args['post_limit']) && (int) $args['post_limit'] > 0) ? (int) $args['post_limit'] : 10);
249
+ $query .= sprintf(' LIMIT %d,%d', $query_offset, $query_limit);
250
+ }
251
 
252
+ if($args['is_search_query'] === true) {
253
+ return array(
254
+ 'rows' => $this->query('get_res', $query),
255
+ 'count' => $this->query('get_row', $count_query)
256
+ );
257
+ } else {
258
+ return $this->query('get_res', $query);
 
259
  }
260
+ }
261
+
262
+ function build_conditions($conditions) {
263
+ $query = '';
264
+ $i = 0;
265
+
266
+ foreach ($conditions as $key => $data) {
267
+
268
+ if($i > 0) $query .= ' AND ';
269
+
270
+ $query .= $data['col'] . ' ';
271
 
272
+ $value = $data['val'];
273
+
274
+ switch ($data['sign']) {
275
+ case 'IN':
276
+ case 'NOT IN':
277
+ $values = '';
278
+ if(is_array($value)) {
279
+ if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
280
+ $count = count($value);
281
+ for ($j = 0; $j < $count; $j++) {
282
+ if($value[$j] === null) continue;
283
+ $value[$j] = intval($value[$j]);
284
+ }
285
+ $values = join(', ', $value);
286
+ } else {
287
+ $values = "'" . join("', '", $value) . "'";
288
+ }
289
+ $query .= $data['sign'] . ' (' . $values . ')';
290
+ } else {
291
+ if(strpos($value, ',') === false) {
292
+ // single value
293
+ if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
294
+ $query .= '= ' . (int) $value;
295
+ } else {
296
+ $query .= '= "' . $value . '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  }
298
+ } else {
299
+ // multiple values
300
+ $values = "'" . join("','", explode(',', $value)) . "'";
301
+ $query .= $data['sign'] . ' (' . $values . ')';
302
+ }
303
  }
304
+ break;
305
+ case 'LIKE':
306
+ $query .= ' LIKE "' . $value . '"';
307
+ break;
308
+ default:
309
+ $sign = '=';
310
+ if(isset($data['sign'])) $sign = $data['sign'];
311
 
312
+ if(array_key_exists('cast', $data) && $data['cast'] === 'int') {
313
+ $query .= $sign . (int) $value . " ";
314
  } else {
315
+ $query .= $sign . "'" . $value . "' ";
316
  }
317
+ }
318
+ $i++;
319
+ }
320
+
321
+ if($query === '') {
322
+ return '';
323
+ } else {
324
+ return 'WHERE ' . $query;
325
  }
326
+ }
327
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === MailPoet Newsletters ===
2
- Contributors: wysija, kgjerstad, benheu, JoN1oP, badshark, rafaehlers, rafaelfunchal, _dorsvenabili, vvaz, keiferski
3
  Tags: newsletter, newsletters, email newsletter, email subscription, newsletter signup, post notification, autoresponder, newsletter alert, auto newsletter, automatic post notification, email newsletters, email signup, auto post notifications, newsletter widget, newsletter builder, subscribe widget, signup widget, email subscription, newsletter plugin, widget, subscription, emailing, mailpoet, wysija, mandrill, sendgrid
4
  Requires at least: 3.3
5
  Tested up to: 4.2
6
- Stable tag: 2.6.16
7
  Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
8
 
9
  == Description ==
@@ -130,6 +130,13 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
 
133
  = 2.6.16 - 2015-06-23 =
134
  * Added HHVM support
135
  * Added MariaDB support
@@ -970,4 +977,4 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
970
  * minor bugfixes
971
 
972
  = 0.9 - 2011/12/3 =
973
- * Hello World.
1
  === MailPoet Newsletters ===
2
+ Contributors: wysija, kgjerstad, benheu, JoN1oP, badshark, rafaehlers, vvaz, keiferski, mrcasual
3
  Tags: newsletter, newsletters, email newsletter, email subscription, newsletter signup, post notification, autoresponder, newsletter alert, auto newsletter, automatic post notification, email newsletters, email signup, auto post notifications, newsletter widget, newsletter builder, subscribe widget, signup widget, email subscription, newsletter plugin, widget, subscription, emailing, mailpoet, wysija, mandrill, sendgrid
4
  Requires at least: 3.3
5
  Tested up to: 4.2
6
+ Stable tag: 2.6.17
7
  Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
8
 
9
  == Description ==
130
 
131
  == Changelog ==
132
 
133
+ = 2.6.17 - 2015-09-04 =
134
+ * Enhanced redirection check in email URLs.
135
+ * Fixed old-style PHP constructors.
136
+ * Fixed newsletter preview bug.
137
+ * Fixed import issues on old PHP versions.
138
+ * Fixed minor issues.
139
+
140
  = 2.6.16 - 2015-06-23 =
141
  * Added HHVM support
142
  * Added MariaDB support
977
  * minor bugfixes
978
 
979
  = 0.9 - 2011/12/3 =
980
+ * Hello World.
views/back.php CHANGED
@@ -13,7 +13,7 @@ class WYSIJA_view_back extends WYSIJA_view{
13
  var $listingHeader = '';
14
  var $hiddenFields = '';
15
 
16
- function WYSIJA_view_back(){
17
  /* the default actions to be linked in a listing */
18
  if(!$this->column_actions) $this->column_actions=array('view'=>__('View',WYSIJA),'edit'=>__('Edit',WYSIJA),'delete'=>__('Delete',WYSIJA));
19
 
13
  var $listingHeader = '';
14
  var $hiddenFields = '';
15
 
16
+ function __construct(){
17
  /* the default actions to be linked in a listing */
18
  if(!$this->column_actions) $this->column_actions=array('view'=>__('View',WYSIJA),'edit'=>__('Edit',WYSIJA),'delete'=>__('Delete',WYSIJA));
19
 
views/back/campaigns.php CHANGED
@@ -7,9 +7,9 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
7
  var $column_action_list = 'name';
8
  var $queuedemails = false;
9
 
10
- function WYSIJA_view_back_campaigns() {
11
  $this->title = __('All Newsletters');
12
- $this->WYSIJA_view_back();
13
  $this->jsTrans['selecmiss'] = __('Select at least 1 subscriber!', WYSIJA);
14
  $this->search = array('title' => __('Search newsletters', WYSIJA));
15
  $this->column_actions = array('editlist' => __('Edit', WYSIJA), 'duplicatelist' => __('Duplicate', WYSIJA), 'deletelist' => __('Delete', WYSIJA));
@@ -35,8 +35,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
35
  break;
36
  }
37
  }
38
-
39
- WYSIJA_view_back::header($data);
40
  }
41
 
42
  function main($data) {
@@ -1940,7 +1939,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
1940
  <input type="button" id="sub-theme-box" name="submit" value="<?php echo esc_attr(__('Upload Theme (.zip)', WYSIJA)); ?>" class="button-secondary"/>
1941
  <span id="filter-selection"></span>
1942
  &nbsp;&nbsp;
1943
- <span><?php echo str_replace(array('[link]', '[/link]'), array('<a href="http://support.mailpoet.com/knowledgebase/guide-to-creating-your-own-wysija-theme?utm_source=wpadmin&utm_campaign=theme%20guide" target="_blank">', '</a>'), __('[link]Guide[/link] to create your own theme.', WYSIJA)); ?></span>
1944
  <div id="wj_paginator">
1945
  <a class="selected" href="javascript:;" data-type="free"><?php _e('Free', WYSIJA); ?></a>
1946
  <a href="javascript:;" data-type="premium"><?php _e('Premium', WYSIJA); ?></a>
@@ -2925,14 +2924,12 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
2925
  $model_config->save(array('wysija_whats_new' => WYSIJA::get_version()));
2926
  }
2927
 
2928
- $data = $this->_inject_alert( $data );
2929
-
2930
  $sharing_data = $model_config->getValue('analytics');
2931
  if( empty( $sharing_data ) ){
2932
  $data['sections'][] = array(
2933
  'title' => __('One quick question...',WYSIJA),
2934
 
2935
- 'content' => '<div class="feature-section"><iframe frameborder="0" width="100%" height="370" scrolling="auto" allowtransparency="true" src="//mailpoet.polldaddy.com/s/what-s-new-poll-june-2015?iframe=1"><a href="//mailpoet.polldaddy.com/s/what-s-new-poll-june-2015">View Survey</a></iframe></div>'.
2936
  '<div class="mpoet-update-subscribe" ><h4>'.__( 'Subscribe to our newsletters', WYSIJA ).'</h4><div class="mpoet-update-subscribe-left"> <p>'.__('We send a monthly newsletter with the following:',WYSIJA).'</p>' .
2937
  '<ul>' .
2938
  '<li>'.__('Important plugin updates',WYSIJA).'</li>' .
@@ -2976,7 +2973,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
2976
  $data['sections'][] = array(
2977
  'title' => 'Answer our survey and make your plugin better',
2978
 
2979
- 'content' => '<iframe frameborder="0" width="100%" height="600" scrolling="auto" allowtransparency="true" src="//mailpoet.polldaddy.com/s/mailpoet-survey-2014?iframe=1"><a href="//mailpoet.polldaddy.com/s/mailpoet-survey-2014">View Survey</a></iframe><hr/>',
2980
  'format' => 'title-content',
2981
  );
2982
  }
@@ -3076,26 +3073,6 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
3076
  echo '<div class="'.$class_name.'">';
3077
  echo '</div>';
3078
  echo '</div>';
3079
-
3080
-
3081
- echo '<div class="mpoet-update-subscribe" ><div class="mpoet-update-subscribe-left"><h4>'.__( 'Subscribe to our newsletters', WYSIJA ).'</h4> <p>'.__('We send a monthly newsletter with the following:',WYSIJA).'</p>' .
3082
- '<ul>' .
3083
- '<li>'.__('Important plugin updates',WYSIJA).'</li>' .
3084
- '<li>'.__('Coupons',WYSIJA).'</li>' .
3085
- '<li>'.__('Tips for you, or your customers',WYSIJA).'</li>' .
3086
- '<li>'.__('What we’re working on',WYSIJA).'</li>' .
3087
- '<li>'.__('News from us, the team',WYSIJA).'</li>' .
3088
- '</ul>
3089
- <p>View an <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=1181&wysijap=subscriptions-3">an example blog post email</a> and <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=64&wysijap=subscriptions-2">an example newsletter</a>.</p>
3090
- </div>' .
3091
- '<div class="mpoet-update-subscribe-right">' .
3092
-
3093
- '<iframe width="380" scrolling="no" frameborder="0" src="http://www.mailpoet.com/?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=5&external_site=1&wysijap=subscriptions-3" class="iframe-wysija" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 180px; left: 0pt; visibility: visible; background-color: #f1f1f1!important;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="Subscription Wysija"></iframe>
3094
- </div>
3095
- <div style="clear:both;"></div>
3096
-
3097
- </div>';
3098
-
3099
  break;
3100
 
3101
  default :
@@ -3170,32 +3147,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
3170
  // returning the new data array
3171
  return $data;
3172
  }
3173
-
3174
- private function _inject_alert( $data ){
3175
- if ( WYSIJA::current_user_can( 'install_plugins' ) && version_compare( PHP_VERSION , '5.3' , '<' )) {
3176
-
3177
- $data['abouttext'] .= '</div><div class="mp_php_alert">
3178
- <h3>'.__('Hey! Your site is running an old software!', WYSIJA).'</h3>
3179
- <ul>
3180
- <li> '.__('MailPoet is modernizing itself in the coming months.',WYSIJA).'</li>
3181
- <li>'.__("In order to enjoy our latest enhancements, you'll need to ask your hosting company to update your site.",WYSIJA).'</li>
3182
-
3183
- <li>'.' <h4>'.__("What are the benefits of updating my site now?",WYSIJA).'</h4>'.'</li>
3184
- <li>
3185
- <ol>
3186
- <li>'.__("Your website will be more secure, running an updated software.",WYSIJA).'</li>
3187
- <li>'.__("Your MailPoet will be more performant, scalable and reliable.",WYSIJA).'</li>
3188
- <li>'.__("You will be one-step closer to the next generation of WordPress coming in 2015 which will require more recent software.",WYSIJA).'</li>
3189
- </ol>
3190
- </li>
3191
- <li><h4>'.__("Ready to Update your site?",WYSIJA).'</h4></li>
3192
- <li><a href="http://support.mailpoet.com/knowledgebase/how-to-prepare-my-site-for-mailpoet-3-0" target="_blank">'.__("Yes, please guide me!",WYSIJA).'</a> - <a href="http://support.mailpoet.com/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=contact_php_update" class="mp_negative" target="_blank">'.__("No, I have a few concerns...",WYSIJA).'</a></li>
3193
- </ul>';
3194
-
3195
- }
3196
- return $data;
3197
- }
3198
-
3199
  private function _get_social_buttons($inline=true){
3200
 
3201
  if($inline){
7
  var $column_action_list = 'name';
8
  var $queuedemails = false;
9
 
10
+ function __construct() {
11
  $this->title = __('All Newsletters');
12
+ parent::__construct();
13
  $this->jsTrans['selecmiss'] = __('Select at least 1 subscriber!', WYSIJA);
14
  $this->search = array('title' => __('Search newsletters', WYSIJA));
15
  $this->column_actions = array('editlist' => __('Edit', WYSIJA), 'duplicatelist' => __('Duplicate', WYSIJA), 'deletelist' => __('Delete', WYSIJA));
35
  break;
36
  }
37
  }
38
+ parent::header($data);
 
39
  }
40
 
41
  function main($data) {
1939
  <input type="button" id="sub-theme-box" name="submit" value="<?php echo esc_attr(__('Upload Theme (.zip)', WYSIJA)); ?>" class="button-secondary"/>
1940
  <span id="filter-selection"></span>
1941
  &nbsp;&nbsp;
1942
+ <span><?php echo str_replace(array('[link]', '[/link]'), array('<a href="http://support.mailpoet.com/knowledgebase/guide-to-creating-your-own-mailpoet-theme?utm_source=wpadmin&utm_campaign=theme%20guide" target="_blank">', '</a>'), __('[link]Guide[/link] to create your own theme.', WYSIJA)); ?></span>
1943
  <div id="wj_paginator">
1944
  <a class="selected" href="javascript:;" data-type="free"><?php _e('Free', WYSIJA); ?></a>
1945
  <a href="javascript:;" data-type="premium"><?php _e('Premium', WYSIJA); ?></a>
2924
  $model_config->save(array('wysija_whats_new' => WYSIJA::get_version()));
2925
  }
2926
 
 
 
2927
  $sharing_data = $model_config->getValue('analytics');
2928
  if( empty( $sharing_data ) ){
2929
  $data['sections'][] = array(
2930
  'title' => __('One quick question...',WYSIJA),
2931
 
2932
+ 'content' => '<div class="feature-section"><iframe frameborder="0" width="100%" height="370" scrolling="auto" allowtransparency="true" src="//mailpoet.polldaddy.com/s/what-s-new-sept-2015?iframe=1"><a href="//mailpoet.polldaddy.com/s/what-s-new-sept-2015">View Survey</a></iframe></div>'.
2933
  '<div class="mpoet-update-subscribe" ><h4>'.__( 'Subscribe to our newsletters', WYSIJA ).'</h4><div class="mpoet-update-subscribe-left"> <p>'.__('We send a monthly newsletter with the following:',WYSIJA).'</p>' .
2934
  '<ul>' .
2935
  '<li>'.__('Important plugin updates',WYSIJA).'</li>' .
2973
  $data['sections'][] = array(
2974
  'title' => 'Answer our survey and make your plugin better',
2975
 
2976
+ 'content' => '<iframe frameborder="0" width="100%" height="600" scrolling="auto" allowtransparency="true" src="//mailpoet.polldaddy.com/s/what-s-new-sept-2015?iframe=1"><a href="//mailpoet.polldaddy.com/s/what-s-new-sept-2015">View Survey</a></iframe><hr/>',
2977
  'format' => 'title-content',
2978
  );
2979
  }
3073
  echo '<div class="'.$class_name.'">';
3074
  echo '</div>';
3075
  echo '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3076
  break;
3077
 
3078
  default :
3147
  // returning the new data array
3148
  return $data;
3149
  }
3150
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3151
  private function _get_social_buttons($inline=true){
3152
 
3153
  if($inline){
views/back/config.php CHANGED
@@ -1101,6 +1101,11 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
1101
 
1102
  </tbody>
1103
  </table>
 
 
 
 
 
1104
  <?php
1105
  }
1106
 
1101
 
1102
  </tbody>
1103
  </table>
1104
+ <script>
1105
+ wysija_translations = {};
1106
+ wysija_translations.api = "<?php _e('API Key', WYSIJA); ?>";
1107
+ wysija_translations.password = "<?php _e('Password', WYSIJA); ?>";
1108
+ </script>
1109
  <?php
1110
  }
1111
 
views/back/premium.php CHANGED
@@ -2,7 +2,7 @@
2
  defined('WYSIJA') or die('Restricted access');
3
 
4
  class WYSIJA_view_back_premium extends WYSIJA_view_back{
5
- function WYSIJA_view_back_premium(){
6
  $this->skip_header =true;
7
 
8
  }
2
  defined('WYSIJA') or die('Restricted access');
3
 
4
  class WYSIJA_view_back_premium extends WYSIJA_view_back{
5
+ function __construct(){
6
  $this->skip_header =true;
7
 
8
  }
views/back/statistics.php CHANGED
@@ -3,7 +3,7 @@ defined('WYSIJA') or die('Restricted access');
3
 
4
  class WYSIJA_view_back_statistics extends WYSIJA_view_back{
5
  public $icon = 'icon-stats';
6
- function WYSIJA_view_back_statistics(){
7
  $this->title = __('Stats dashboard');
8
  if (empty($this->viewObj))
9
  $this->viewObj = new stdClass ();
3
 
4
  class WYSIJA_view_back_statistics extends WYSIJA_view_back{
5
  public $icon = 'icon-stats';
6
+ function __construct(){
7
  $this->title = __('Stats dashboard');
8
  if (empty($this->viewObj))
9
  $this->viewObj = new stdClass ();
views/back/subscribers.php CHANGED
@@ -7,10 +7,10 @@ class WYSIJA_view_back_subscribers extends WYSIJA_view_back
7
  var $icon = "icon-users";
8
  var $column_action_list = "email";
9
 
10
- function WYSIJA_view_back_subscribers()
11
  {
12
  $this->title = __("Lists and Subscribers", WYSIJA);
13
- $this->WYSIJA_view_back();
14
 
15
  $this->search = array("title" => __("Search subscribers", WYSIJA));
16
  $this->column_actions = array('editlist' => __('Edit', WYSIJA), 'duplicatelist' => __('Duplicate', WYSIJA), 'deletelist' => __('Delete', WYSIJA));
7
  var $icon = "icon-users";
8
  var $column_action_list = "email";
9
 
10
+ function __construct()
11
  {
12
  $this->title = __("Lists and Subscribers", WYSIJA);
13
+ parent::__construct();
14
 
15
  $this->search = array("title" => __("Search subscribers", WYSIJA));
16
  $this->column_actions = array('editlist' => __('Edit', WYSIJA), 'duplicatelist' => __('Duplicate', WYSIJA), 'deletelist' => __('Delete', WYSIJA));
views/back/tmce.php CHANGED
@@ -6,8 +6,8 @@ class WYSIJA_view_back_tmce extends WYSIJA_view_back{
6
  var $icon='icon-options-general';
7
  var $scripts=array();
8
 
9
- function WYSIJA_view_back_tmce(){
10
- $this->WYSIJA_view_back();
11
  }
12
 
13
  function getScriptsStyles(){
6
  var $icon='icon-options-general';
7
  var $scripts=array();
8
 
9
+ function __construct(){
10
+ parent::__construct();
11
  }
12
 
13
  function getScriptsStyles(){
views/front.php CHANGED
@@ -2,7 +2,7 @@
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_view_front extends WYSIJA_view{
4
  var $controller='';
5
- function WYSIJA_view_front(){
6
 
7
  }
8
  /**
2
  defined('WYSIJA') or die('Restricted access');
3
  class WYSIJA_view_front extends WYSIJA_view{
4
  var $controller='';
5
+ function __construct(){
6
 
7
  }
8
  /**
views/front/confirm.php CHANGED
@@ -3,7 +3,7 @@
3
  defined( 'WYSIJA' ) or die( 'Restricted access' );
4
  class WYSIJA_view_front_confirm extends WYSIJA_view_front {
5
 
6
- function WYSIJA_view_front_confirm(){
7
  $this->model = WYSIJA::get( 'user','model' );
8
 
9
  add_action( 'wp_head', array( $this, 'add_noindex' ) );
3
  defined( 'WYSIJA' ) or die( 'Restricted access' );
4
  class WYSIJA_view_front_confirm extends WYSIJA_view_front {
5
 
6
+ function __construct(){
7
  $this->model = WYSIJA::get( 'user','model' );
8
 
9
  add_action( 'wp_head', array( $this, 'add_noindex' ) );
views/front/widget_nl.php CHANGED
@@ -2,7 +2,7 @@
2
  defined( 'WYSIJA' ) or die( 'Restricted access' );
3
  class WYSIJA_view_front_widget_nl extends WYSIJA_view_front {
4
 
5
- function WYSIJA_view_front_widget_nl(){
6
  $this->model=WYSIJA::get('user','model');
7
  }
8
 
2
  defined( 'WYSIJA' ) or die( 'Restricted access' );
3
  class WYSIJA_view_front_widget_nl extends WYSIJA_view_front {
4
 
5
+ function __construct(){
6
  $this->model=WYSIJA::get('user','model');
7
  }
8
 
widgets/wysija_nl.php CHANGED
@@ -9,7 +9,7 @@ class WYSIJA_NL_Widget extends WP_Widget {
9
  var $iFrame = false;
10
 
11
 
12
- function WYSIJA_NL_Widget( $core_only = false ) {
13
  static $script_registered;
14
 
15
  if ( WYSIJA_SIDE == 'front' ){
@@ -47,7 +47,7 @@ class WYSIJA_NL_Widget extends WP_Widget {
47
  add_action( 'init', array( $this, 'add_translated_default' ) );
48
 
49
  $this->classid = strtolower( str_replace( __CLASS__ . '_', '', get_class( $this ) ) );
50
- $this->WP_Widget( $namekey, $title, $params,$sizeWindow );
51
 
52
  }
53
 
9
  var $iFrame = false;
10
 
11
 
12
+ function __construct( $core_only = false ) {
13
  static $script_registered;
14
 
15
  if ( WYSIJA_SIDE == 'front' ){
47
  add_action( 'init', array( $this, 'add_translated_default' ) );
48
 
49
  $this->classid = strtolower( str_replace( __CLASS__ . '_', '', get_class( $this ) ) );
50
+ parent::__construct($namekey, $title, $params,$sizeWindow );
51
 
52
  }
53