Popups by OptinMonster – Best WordPress Lead Generation Plugin - Version 1.2.2

Version Description

  • Updated API calls to always be done over HTTPS.
  • Updated error responses from the OptinMonster API to be more informative.
Download this release

Release Info

Developer dvinson
Plugin Icon 128x128 Popups by OptinMonster – Best WordPress Lead Generation Plugin
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.2

OMAPI/Api.php CHANGED
@@ -93,7 +93,7 @@ class OMAPI_Api {
93
  public function __construct( $route, $creds, $method = 'POST' ) {
94
  // Set class properties.
95
  $this->route = $route;
96
- $this->protocol = $this->is_ssl() ? 'https://' : 'http://';
97
  $this->url = $this->protocol . $this->base . $this->route . '/';
98
  $this->method = $method;
99
  $this->user = ! empty( $creds['user'] ) ? $creds['user'] : '';
@@ -164,7 +164,7 @@ class OMAPI_Api {
164
  // If not a 200 status header, send back error.
165
  if ( 200 != $response_code ) {
166
  $type = ! empty( $response_body->type ) ? $response_body->type : 'api-error';
167
- $error = ! empty( $response_body->error ) ? stripslashes( $response_body->error ) : '';
168
  return new WP_Error( $type, sprintf( __( 'The API returned a <strong>%s</strong> response with this message: <strong>%s</strong>', 'optin-monster-api' ), $response_code, $error ) );
169
  }
170
 
93
  public function __construct( $route, $creds, $method = 'POST' ) {
94
  // Set class properties.
95
  $this->route = $route;
96
+ $this->protocol = 'https://';
97
  $this->url = $this->protocol . $this->base . $this->route . '/';
98
  $this->method = $method;
99
  $this->user = ! empty( $creds['user'] ) ? $creds['user'] : '';
164
  // If not a 200 status header, send back error.
165
  if ( 200 != $response_code ) {
166
  $type = ! empty( $response_body->type ) ? $response_body->type : 'api-error';
167
+ $error = ! empty( $response_body->error ) && ! empty( $response_body->message ) ? stripslashes( $response_body->message ) : stripslashes( $response_body->error );
168
  return new WP_Error( $type, sprintf( __( 'The API returned a <strong>%s</strong> response with this message: <strong>%s</strong>', 'optin-monster-api' ), $response_code, $error ) );
169
  }
170
 
OMAPI/Output.php CHANGED
@@ -1127,15 +1127,16 @@ class OMAPI_Output {
1127
  * @since 1.0.0
1128
  */
1129
  public function wp_helper() {
1130
-
1131
- wp_enqueue_script(
1132
- $this->base->plugin_slug . '-wp-helper',
1133
- plugins_url( 'assets/js/helper.js', OMAPI_FILE ),
1134
- array( 'jquery'),
1135
- $this->base->version,
1136
- true
1137
- );
1138
-
 
1139
  }
1140
 
1141
  }
1127
  * @since 1.0.0
1128
  */
1129
  public function wp_helper() {
1130
+ // Only try to use the MailPoet integration if it is active.
1131
+ if ( is_plugin_active( 'wysija-newsletters/index.php' ) ) {
1132
+ wp_enqueue_script(
1133
+ $this->base->plugin_slug . '-wp-helper',
1134
+ plugins_url( 'assets/js/helper.js', OMAPI_FILE ),
1135
+ array( 'jquery'),
1136
+ $this->base->version,
1137
+ true
1138
+ );
1139
+ }
1140
  }
1141
 
1142
  }
OMAPI/Review.php CHANGED
@@ -80,7 +80,7 @@ class OMAPI_Review {
80
  public function __construct() {
81
 
82
  // Set default class properties
83
- $this->protocol = is_ssl() ? 'https://' : 'http://';
84
  $this->url = $this->protocol . $this->route;
85
 
86
  // Set our object.
80
  public function __construct() {
81
 
82
  // Set default class properties
83
+ $this->protocol = 'https://';
84
  $this->url = $this->protocol . $this->route;
85
 
86
  // Set our object.
optin-monster-wp-api.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Plugin Name: OptinMonster API
4
  * Plugin URI: http://optinmonster.com
5
- * Description: OptinMonster API plugin to connect your WordPress site to your OptinMonster forms.
6
  * Author: OptinMonster Team
7
  * Author URI: https://optinmonster.com
8
- * Version: 1.2.1
9
  * Text Domain: optin-monster-api
10
  * Domain Path: languages
11
  *
@@ -60,7 +60,7 @@ class OMAPI {
60
  *
61
  * @var string
62
  */
63
- public $version = '1.2.1';
64
 
65
  /**
66
  * The name of the plugin.
2
  /**
3
  * Plugin Name: OptinMonster API
4
  * Plugin URI: http://optinmonster.com
5
+ * Description: OptinMonster API plugin to connect your WordPress site to your OptinMonster account.
6
  * Author: OptinMonster Team
7
  * Author URI: https://optinmonster.com
8
+ * Version: 1.2.2
9
  * Text Domain: optin-monster-api
10
  * Domain Path: languages
11
  *
60
  *
61
  * @var string
62
  */
63
+ public $version = '1.2.2';
64
 
65
  /**
66
  * The name of the plugin.
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: optinmonster, griffinjt, smub
3
  Tags: wordpress popup, popup, lightbox popup, mailchimp, aweber, campaign monitor, constant contact, exit-intent, madmimi, infusionsoft, getresponse, hubspot, marketo, activecampaign, pardot, totalsend, emma, icontact, mailerlite, mailpoet, google analytics, pop over, optin forms, email list, subscribers, wordpress popup form, lightbox, wordpress popups, popups, lightbox popups, optin form, wordpress optin form, sidebar optin form, sidebar optin, sidebar form, wordpress overlay popup, wordpress popup plugin, popup plugin, wordpress lightbox optin, wordpress lightbox optin form, after post optin form, wordpress after post optin form, after post optin form plugin, lightbox popup plugin, wordpress popup solution, exit intent, exit-intent, optinmonster, optin monster, optin-monster, mobile popup, mobile popups, mobile optin forms, mobile optins, lightbox optins, wordpress mobile popup, wordpress mobile popups, wordpress mobile optin forms, wordpress lightbox optins, lead gen, lead generation, wordpress lead generation, lead generation wordpress, wordpress lead gen, fullscreen, welcome gate, interstitial
4
  Requires at least: 3.5.1
5
- Tested up to: 4.8
6
- Stable tag: 1.2.1
7
  License: GNU General Public License v2.0 or later
8
 
9
  OptinMonster helps you grow your email list by converting visitors into subscribers and customers. Get more email subscribers now!
@@ -160,6 +160,10 @@ OptinMonster is the <a href="http://optinmonster.com" rel="friend" title="OptinM
160
 
161
  == Changelog ==
162
 
 
 
 
 
163
  = 1.2.1 =
164
  * Added additional checks during save routines for user capabilities.
165
 
2
  Contributors: optinmonster, griffinjt, smub
3
  Tags: wordpress popup, popup, lightbox popup, mailchimp, aweber, campaign monitor, constant contact, exit-intent, madmimi, infusionsoft, getresponse, hubspot, marketo, activecampaign, pardot, totalsend, emma, icontact, mailerlite, mailpoet, google analytics, pop over, optin forms, email list, subscribers, wordpress popup form, lightbox, wordpress popups, popups, lightbox popups, optin form, wordpress optin form, sidebar optin form, sidebar optin, sidebar form, wordpress overlay popup, wordpress popup plugin, popup plugin, wordpress lightbox optin, wordpress lightbox optin form, after post optin form, wordpress after post optin form, after post optin form plugin, lightbox popup plugin, wordpress popup solution, exit intent, exit-intent, optinmonster, optin monster, optin-monster, mobile popup, mobile popups, mobile optin forms, mobile optins, lightbox optins, wordpress mobile popup, wordpress mobile popups, wordpress mobile optin forms, wordpress lightbox optins, lead gen, lead generation, wordpress lead generation, lead generation wordpress, wordpress lead gen, fullscreen, welcome gate, interstitial
4
  Requires at least: 3.5.1
5
+ Tested up to: 4.8.1
6
+ Stable tag: 1.2.2
7
  License: GNU General Public License v2.0 or later
8
 
9
  OptinMonster helps you grow your email list by converting visitors into subscribers and customers. Get more email subscribers now!
160
 
161
  == Changelog ==
162
 
163
+ = 1.2.2 =
164
+ * Updated API calls to always be done over HTTPS.
165
+ * Updated error responses from the OptinMonster API to be more informative.
166
+
167
  = 1.2.1 =
168
  * Added additional checks during save routines for user capabilities.
169