MailChimp Forms by MailMunch - Version 2.0.5

Version Description

Download this release

Release Info

Developer mailmunch
Plugin Icon 128x128 MailChimp Forms by MailMunch
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.4 to 2.0.5

admin/class-mailchimp-mailmunch-admin.php CHANGED
@@ -159,7 +159,13 @@ class Mailchimp_Mailmunch_Admin {
159
  * @since 2.0.0
160
  */
161
  public function getStep() {
162
- if (isset($_GET['step'])) { $step = $_GET['step']; }
 
 
 
 
 
 
163
  elseif ($this->mailmunch_api->skipOnBoarding()) { $step = ''; }
164
  else {
165
  $step = 'connect';
159
  * @since 2.0.0
160
  */
161
  public function getStep() {
162
+ if (isset($_GET['step'])) {
163
+ $step = $_GET['step'];
164
+ if ($step == 'skip_onboarding') {
165
+ $this->mailmunch_api->setSkipOnBoarding();
166
+ $step = '';
167
+ }
168
+ }
169
  elseif ($this->mailmunch_api->skipOnBoarding()) { $step = ''; }
170
  else {
171
  $step = 'connect';
admin/css/mailchimp-mailmunch-admin.css CHANGED
@@ -59,6 +59,10 @@
59
  padding: 20px;
60
  }
61
 
 
 
 
 
62
  #connect-mailchimp {
63
  text-align: center;
64
  display: inline-block;
59
  padding: 20px;
60
  }
61
 
62
+ .inside-container .skip-link-container {
63
+ margin-bottom: 25px;
64
+ }
65
+
66
  #connect-mailchimp {
67
  text-align: center;
68
  display: inline-block;
admin/js/mailchimp-mailmunch-admin.js CHANGED
@@ -32,17 +32,23 @@
32
  $(function() {
33
  $("#connect-mailchimp").click(function() {
34
  var width = 500;
35
- var height = 650;
36
  window.open($(this).attr("href"), "MailMunchIntegration", "top="+ (($(window).height()/2)-(height/2)) +", left="+ (($(window).width()/2)-(width/2)) +", width="+width+", height="+height);
37
  return false;
38
  });
39
 
40
  window.addEventListener("message", function(event) {
41
- if (typeof(event.data) != 'undefined' && event.data.access_token) {
 
 
 
 
 
 
42
  $("#connect-mailchimp").hide();
43
  $("#loader").show();
44
  var form = $('#mailchimp-access-token-form');
45
- form.find('input[name=access_token]').val(event.data.access_token);
46
  form.submit();
47
  }
48
  }, false);
32
  $(function() {
33
  $("#connect-mailchimp").click(function() {
34
  var width = 500;
35
+ var height = 600;
36
  window.open($(this).attr("href"), "MailMunchIntegration", "top="+ (($(window).height()/2)-(height/2)) +", left="+ (($(window).width()/2)-(width/2)) +", width="+width+", height="+height);
37
  return false;
38
  });
39
 
40
  window.addEventListener("message", function(event) {
41
+ if (typeof(event.data) != 'undefined') {
42
+ var access_token = '';
43
+ if (typeof(event.data) == 'string') {
44
+ access_token = event.data;
45
+ } else {
46
+ access_token = event.data.access_token;
47
+ }
48
  $("#connect-mailchimp").hide();
49
  $("#loader").show();
50
  var form = $('#mailchimp-access-token-form');
51
+ form.find('input[name=access_token]').val(access_token);
52
  form.submit();
53
  }
54
  }, false);
admin/partials/mailchimp-mailmunch-connect.php CHANGED
@@ -31,6 +31,10 @@
31
  <img src="<?php echo plugins_url( 'img/mailchimp_logo.png', dirname(__FILE__) ) ?>" />
32
  <span class="button button-primary">Connect to MailChimp</span>
33
  </a>
 
 
 
 
34
  </td>
35
  </tr>
36
  </tbody>
31
  <img src="<?php echo plugins_url( 'img/mailchimp_logo.png', dirname(__FILE__) ) ?>" />
32
  <span class="button button-primary">Connect to MailChimp</span>
33
  </a>
34
+
35
+ <div class="skip-link-container">
36
+ <a id="skip-onboarding" href="<?php echo add_query_arg( array('step' => 'skip_onboarding') ); ?>">skip this and create a form</a>
37
+ </div>
38
  </td>
39
  </tr>
40
  </tbody>
includes/class-mailmunch-api.php CHANGED
@@ -170,6 +170,10 @@
170
  return false;
171
  }
172
 
 
 
 
 
173
  function skipOnBoarding() {
174
  $skipOnBoarding = get_option($this->getPrefix(). 'skip_onboarding');
175
  return $skipOnBoarding == true;
@@ -214,7 +218,7 @@
214
  delete_option($this->getPrefix(). 'guest_user');
215
  delete_option($this->getPrefix(). 'wordpress_instance_id');
216
 
217
- update_option($this->getPrefix(). 'skip_onboarding', true);
218
 
219
  return true;
220
  }
170
  return false;
171
  }
172
 
173
+ function setSkipOnBoarding() {
174
+ update_option($this->getPrefix(). 'skip_onboarding', true);
175
+ }
176
+
177
  function skipOnBoarding() {
178
  $skipOnBoarding = get_option($this->getPrefix(). 'skip_onboarding');
179
  return $skipOnBoarding == true;
218
  delete_option($this->getPrefix(). 'guest_user');
219
  delete_option($this->getPrefix(). 'wordpress_instance_id');
220
 
221
+ $this->setSkipOnBoarding();
222
 
223
  return true;
224
  }
mailchimp-mailmunch.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: MailChimp Forms by MailMunch
17
  * Plugin URI: http://connect.mailchimp.com/integrations/mailmunch-email-list-builder
18
  * Description: The MailChimp plugin allows you to quickly and easily add signup forms for your MailChimp lists. Popup, Embedded, Top Bar and a variety of different options available.
19
- * Version: 2.0.4
20
  * Author: MailMunch
21
  * Author URI: http://www.mailmunch.co
22
  * License: GPL-2.0+
16
  * Plugin Name: MailChimp Forms by MailMunch
17
  * Plugin URI: http://connect.mailchimp.com/integrations/mailmunch-email-list-builder
18
  * Description: The MailChimp plugin allows you to quickly and easily add signup forms for your MailChimp lists. Popup, Embedded, Top Bar and a variety of different options available.
19
+ * Version: 2.0.5
20
  * Author: MailMunch
21
  * Author URI: http://www.mailmunch.co
22
  * License: GPL-2.0+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: mailchimp,mailchimp form,mailchimp newsletter,mailchimp plugin,newsletter,
4
 
5
  Requires at least: 3.0.1
6
  Tested up to: 4.2
7
- Stable tag: 2.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
 
5
  Requires at least: 3.0.1
6
  Tested up to: 4.2
7
+ Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10