Official MailerLite Sign Up Forms - Version 1.6.0

Version Description

  • Compatibility updates
  • Tested up to latest WP version
Download this release

Release Info

Developer mailerlite
Plugin Icon 128x128 Official MailerLite Sign Up Forms
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.9 to 1.6.0

mailerlite.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: MailerLite - Signup forms (official)
4
  * Description: Official MailerLite Signup forms plugin for WordPress. Ability to embed MailerLite webforms and create custom ones just with few clicks.
5
- * Version: 1.5.9
6
  * Author: MailerLite
7
  * Author URI: https://www.mailerlite.com
8
  * License: GPLv2 or later
@@ -33,7 +33,7 @@ define( 'MAILERLITE_PLUGIN_URL', plugins_url( '', __FILE__ ) );
33
  // Plugin basename
34
  define( 'MAILERLITE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
35
 
36
- define( 'MAILERLITE_VERSION', '1.5.9' );
37
 
38
  define( 'MAILERLITE_PHP_VERSION', '7.2.5' );
39
  define( 'MAILERLITE_WP_VERSION', '3.0.1' );
2
  /**
3
  * Plugin Name: MailerLite - Signup forms (official)
4
  * Description: Official MailerLite Signup forms plugin for WordPress. Ability to embed MailerLite webforms and create custom ones just with few clicks.
5
+ * Version: 1.6.0
6
  * Author: MailerLite
7
  * Author URI: https://www.mailerlite.com
8
  * License: GPLv2 or later
33
  // Plugin basename
34
  define( 'MAILERLITE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
35
 
36
+ define( 'MAILERLITE_VERSION', '1.6.0' );
37
 
38
  define( 'MAILERLITE_PHP_VERSION', '7.2.5' );
39
  define( 'MAILERLITE_WP_VERSION', '3.0.1' );
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: mailerlite
3
  Donate link: https://www.mailerlite.com/
4
  Tags: mailerlite, newsletter, subscribe, form, webform
5
  Requires at least: 3.0.1
6
- Tested up to: 6.0.1
7
  Requires PHP: 7.2.5
8
- Stable tag: 1.5.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -130,6 +130,10 @@ Add your custom CSS rules to the end of your theme stylesheet, /wp-content/theme
130
 
131
  == Changelog ==
132
 
 
 
 
 
133
  = 1.5.9 =
134
  * Update - API client
135
 
3
  Donate link: https://www.mailerlite.com/
4
  Tags: mailerlite, newsletter, subscribe, form, webform
5
  Requires at least: 3.0.1
6
+ Tested up to: 6.0.2
7
  Requires PHP: 7.2.5
8
+ Stable tag: 1.6.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.6.0 =
134
+ * Compatibility updates
135
+ * Tested up to latest WP version
136
+
137
  = 1.5.9 =
138
  * Update - API client
139
 
src/Api/RewriteAPI.php CHANGED
@@ -67,17 +67,20 @@ class RewriteAPI
67
 
68
  $groups = [];
69
 
70
- foreach ($response->data as $record) {
71
 
72
- $group = new MailerLiteGroup();
73
- $group->id = $record->id;
74
- $group->name = $record->name;
75
- $group->total = $record->active_count;
76
- $group->opened = $record->open_rate->float;
77
- $group->clicked = $record->click_rate->float;
78
- $group->date_created = $record->created_at;
79
 
80
- $groups[] = $group;
 
 
 
 
 
 
 
 
 
81
  }
82
 
83
  return $groups;
@@ -100,7 +103,7 @@ class RewriteAPI
100
 
101
  $response = self::parseResponse($response);
102
 
103
- return count( $response->data ) > 0;
104
  }
105
 
106
  /**
67
 
68
  $groups = [];
69
 
70
+ if (isset($response->data)) {
71
 
72
+ foreach ($response->data as $record) {
 
 
 
 
 
 
73
 
74
+ $group = new MailerLiteGroup();
75
+ $group->id = $record->id;
76
+ $group->name = $record->name;
77
+ $group->total = $record->active_count;
78
+ $group->opened = $record->open_rate->float;
79
+ $group->clicked = $record->click_rate->float;
80
+ $group->date_created = $record->created_at;
81
+
82
+ $groups[] = $group;
83
+ }
84
  }
85
 
86
  return $groups;
103
 
104
  $response = self::parseResponse($response);
105
 
106
+ return count( $response->data ?? [] ) > 0;
107
  }
108
 
109
  /**
src/Modules/Gutenberg.php CHANGED
@@ -114,7 +114,7 @@ class Gutenberg
114
  /**
115
  * The selected block preview HTML
116
  */
117
- public function form_preview_html() {
118
 
119
  check_admin_referer( 'mailerlite_preview', 'ml_nonce' );
120
 
@@ -125,14 +125,16 @@ class Gutenberg
125
  /**
126
  * The selected block preview iframe - used to display the form without interruptions
127
  */
128
- public function form_preview_iframe() {
129
 
130
  global $wpdb;
131
 
132
  $form_id = 0;
133
 
134
- if ( isset($_POST['form_id']) )
135
- $form_id = absint( $_POST['form_id'] );
 
 
136
 
137
  check_admin_referer( 'mailerlite_gutenberg', 'ml_nonce' );
138
 
@@ -163,7 +165,7 @@ class Gutenberg
163
 
164
  wp_send_json_success( [
165
  'html' => $html,
166
- 'edit_link' => admin_url( 'admin-ajax.php' ) . '?action=mailerlite_redirect_to_form_edit&ml_nonce='.$nonce.'&form_id=' . $form_id,
167
  ] );
168
  }
169
  }
114
  /**
115
  * The selected block preview HTML
116
  */
117
+ public static function form_preview_html() {
118
 
119
  check_admin_referer( 'mailerlite_preview', 'ml_nonce' );
120
 
125
  /**
126
  * The selected block preview iframe - used to display the form without interruptions
127
  */
128
+ public static function form_preview_iframe() {
129
 
130
  global $wpdb;
131
 
132
  $form_id = 0;
133
 
134
+ if ( isset($_POST['form_id']) ) {
135
+
136
+ $form_id = absint($_POST['form_id']);
137
+ }
138
 
139
  check_admin_referer( 'mailerlite_gutenberg', 'ml_nonce' );
140
 
165
 
166
  wp_send_json_success( [
167
  'html' => $html,
168
+ 'edit_link' => admin_url( 'admin-ajax.php' ) . '?action=mailerlite_redirect_to_form_edit&ml_nonce='.$nonce.'&form_id=' . $form_id . '&platform=' . intval( get_option( 'mailerlite_platform', 1) ) ,
169
  ] );
170
  }
171
  }
src/Views/Iframe.php CHANGED
@@ -29,9 +29,9 @@ class Iframe
29
 
30
  ?>
31
 
32
- <div style='position: relative;'>
33
  <div style='position: absolute;top:0;left:0;width:100%;height:100%;'></div>
34
- <iframe style='z-index:1;' src='<?php echo $url ?>'
35
  onload="mlResizeIframe(this)"></iframe>
36
  </div>
37
 
29
 
30
  ?>
31
 
32
+ <div style='position:relative;pointer-events:none;'>
33
  <div style='position: absolute;top:0;left:0;width:100%;height:100%;'></div>
34
+ <iframe style='z-index:1;width:100%;' src='<?php echo $url ?>'
35
  onload="mlResizeIframe(this)"></iframe>
36
  </div>
37
 
src/Views/Preview.php CHANGED
@@ -31,16 +31,19 @@ class Preview
31
 
32
  $form_id = 0;
33
 
34
- if ( isset($_GET['form_id']) )
35
- $form_id = absint( $_GET['form_id'] );
 
 
 
 
36
  ?>
37
 
38
  <html lang="en">
39
  <head>
40
- <title></title>
41
  <?php wp_head(); ?>
42
  </head>
43
- <body>
44
  <div style='width: 400px;margin: auto;'>
45
  <?php ( new Form() )->load_mailerlite_form( $form_id ); ?>
46
  </div>
31
 
32
  $form_id = 0;
33
 
34
+ if ( isset($_GET['form_id']) ) {
35
+
36
+ $form_id = absint($_GET['form_id']);
37
+ }
38
+
39
+ remove_action( 'wp_head', 'mailerlite_universal_woo_commerce' );
40
  ?>
41
 
42
  <html lang="en">
43
  <head>
 
44
  <?php wp_head(); ?>
45
  </head>
46
+ <body style="overflow:hidden;">
47
  <div style='width: 400px;margin: auto;'>
48
  <?php ( new Form() )->load_mailerlite_form( $form_id ); ?>
49
  </div>