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

Version Description

  • Fixed bug that caused issues with viewing the Welcome screen.
Download this release

Release Info

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

Code changes from version 1.1.5.3 to 1.1.5.4

OMAPI/Content.php CHANGED
@@ -180,9 +180,11 @@ class OMAPI_Content {
180
  */
181
  public function api( $panel, $object ) {
182
 
 
 
183
  if ( ! $this->base->get_api_credentials() ) : ?>
184
  <p class="omapi-red"><strong><?php _e( 'You must authenticate your OptinMonster account before you can use OptinMonster on this site.', 'optin-monster-api' ); ?></strong></p>
185
- <p><em><?php printf( __( 'Need an OptinMonster account? <a href="%s" title="Click here to view OptinMonster plans and pricing" target="_blank">Click here to view OptinMonster plans and pricing.</a>', 'optin-monster-api' ), 'https://optinmonster.com/pricing/' ); ?></em></p>
186
  <?php endif; ?>
187
  <?php echo $object->get_setting_ui( 'api', 'user' ); ?>
188
  <?php echo $object->get_setting_ui( 'api', 'key' ); ?>
180
  */
181
  public function api( $panel, $object ) {
182
 
183
+ $link = $this->base->menu->has_trial_link() ? $this->base->menu->get_trial_link() : 'https://optinmonster.com/pricing/';
184
+ $text = $this->base->menu->has_trial_link() ? 'Click here to start your free 30-day trial!' : 'Click here to view OptinMonster plans and pricing.';
185
  if ( ! $this->base->get_api_credentials() ) : ?>
186
  <p class="omapi-red"><strong><?php _e( 'You must authenticate your OptinMonster account before you can use OptinMonster on this site.', 'optin-monster-api' ); ?></strong></p>
187
+ <p><em><?php printf( __( 'Need an OptinMonster account? <a href="%s" title="Click here to view OptinMonster plans and pricing" target="_blank">%s</a>', 'optin-monster-api' ), $link, $text ); ?></em></p>
188
  <?php endif; ?>
189
  <?php echo $object->get_setting_ui( 'api', 'user' ); ?>
190
  <?php echo $object->get_setting_ui( 'api', 'key' ); ?>
OMAPI/Menu.php CHANGED
@@ -96,13 +96,11 @@ class OMAPI_Menu {
96
  */
97
  public function menu() {
98
 
99
- $options = $this->base->get_option();
100
- $slug = isset( $options['welcome']['status'] ) && 'none' === $options['welcome']['status'] ? 'optin-monster-api-welcome' : 'optin-monster-api-settings';
101
  $this->hook = add_menu_page(
102
  __( 'OptinMonster', 'optin-monster-api' ),
103
  __( 'OptinMonster', 'optin-monster-api' ),
104
  apply_filters( 'optin_monster_api_menu_cap', 'manage_options' ),
105
- $slug,
106
  array( $this, 'page' ),
107
  'none',
108
  579
96
  */
97
  public function menu() {
98
 
 
 
99
  $this->hook = add_menu_page(
100
  __( 'OptinMonster', 'optin-monster-api' ),
101
  __( 'OptinMonster', 'optin-monster-api' ),
102
  apply_filters( 'optin_monster_api_menu_cap', 'manage_options' ),
103
+ 'optin-monster-api-settings',
104
  array( $this, 'page' ),
105
  'none',
106
  579
OMAPI/Validate.php CHANGED
@@ -74,6 +74,14 @@ class OMAPI_Validate {
74
  */
75
  public function maybe_validate() {
76
 
 
 
 
 
 
 
 
 
77
  // Check if the transient has expired.
78
  if ( false !== ( $transient = get_transient( '_omapi_validate' ) ) ) {
79
  return;
@@ -174,8 +182,9 @@ class OMAPI_Validate {
174
  public function hide_connect_notice_script() {
175
  ?>
176
  <script type="text/javascript">
177
- jQuery('#omapi-please-connect-notice').click(function( event ) {
178
  event.preventDefault();
 
179
  //Set the pointer to be closed for this user
180
  jQuery.post( ajaxurl, {
181
  pointer: 'omapi_please_connect_notice',
74
  */
75
  public function maybe_validate() {
76
 
77
+ // Check to see if welcome options have been set. If not, let's delay this check for a day.
78
+ // Also set a transient so that we know the plugin has been activated.
79
+ $options = $this->base->get_option();
80
+ if ( ! isset( $options['welcome']['status'] ) || 'welcomed' !== $options['welcome']['status'] ) {
81
+ set_transient( '_omapi_validate', true, DAY_IN_SECONDS );
82
+ return;
83
+ }
84
+
85
  // Check if the transient has expired.
86
  if ( false !== ( $transient = get_transient( '_omapi_validate' ) ) ) {
87
  return;
182
  public function hide_connect_notice_script() {
183
  ?>
184
  <script type="text/javascript">
185
+ jQuery(document).on('click', '#omapi-please-connect-notice .notice-dismiss', function( event ) {
186
  event.preventDefault();
187
+
188
  //Set the pointer to be closed for this user
189
  jQuery.post( ajaxurl, {
190
  pointer: 'omapi_please_connect_notice',
OMAPI/Welcome.php CHANGED
@@ -86,9 +86,17 @@ class OMAPI_Welcome {
86
 
87
  $screen = get_current_screen();
88
 
89
- if( $screen->id === 'admin_page_optin-monster-api-welcome' ){
 
 
 
90
 
91
- add_filter( 'admin_body_class', array( $this, 'add_body_classes') );
 
 
 
 
 
92
  }
93
 
94
  }
@@ -117,7 +125,7 @@ class OMAPI_Welcome {
117
  //Check if they have been welcomed
118
  if ( $options['welcome']['status'] === 'none' ) {
119
 
120
- //Update the option
121
  $options['welcome']['status'] = 'welcomed';
122
  update_option('optin_monster_api', $options );
123
 
86
 
87
  $screen = get_current_screen();
88
 
89
+ if ( 'admin_page_optin-monster-api-welcome' === $screen->id ) {
90
+ update_option( 'optin_monster_viewed_welcome', true );
91
+ add_filter( 'admin_body_class', array( $this, 'add_body_classes' ) );
92
+ }
93
 
94
+ // Make sure welcome page is always first page to view.
95
+ if ( 'toplevel_page_optin-monster-api-settings' === $screen->id ) {
96
+ $welcome = get_option( 'optin_monster_viewed_welcome', false );
97
+ if ( ! $welcome ) {
98
+ die( wp_redirect( 'admin.php?page=optin-monster-api-welcome' ) );
99
+ }
100
  }
101
 
102
  }
125
  //Check if they have been welcomed
126
  if ( $options['welcome']['status'] === 'none' ) {
127
 
128
+ // Update the option.
129
  $options['welcome']['status'] = 'welcomed';
130
  update_option('optin_monster_api', $options );
131
 
optin-monster-wp-api.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: OptinMonster API plugin to connect your WordPress site to your OptinMonster forms.
6
  * Author: Thomas Griffin
7
  * Author URI: https://thomasgriffin.io
8
- * Version: 1.1.5.3
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.1.5.3';
64
 
65
  /**
66
  * The name of the plugin.
5
  * Description: OptinMonster API plugin to connect your WordPress site to your OptinMonster forms.
6
  * Author: Thomas Griffin
7
  * Author URI: https://thomasgriffin.io
8
+ * Version: 1.1.5.4
9
  * Text Domain: optin-monster-api
10
  * Domain Path: languages
11
  *
60
  *
61
  * @var string
62
  */
63
+ public $version = '1.1.5.4';
64
 
65
  /**
66
  * The name of the plugin.
readme.txt CHANGED
@@ -151,6 +151,9 @@ OptinMonster is the <a href="http://optinmonster.com" rel="friend" title="OptinM
151
 
152
  == Changelog ==
153
 
 
 
 
154
  = 1.1.5.3 =
155
  * Fixed issue with notices appearing oddly on OM screens.
156
  * Updated support video.
151
 
152
  == Changelog ==
153
 
154
+ = 1.1.5.4 =
155
+ * Fixed bug that caused issues with viewing the Welcome screen.
156
+
157
  = 1.1.5.3 =
158
  * Fixed issue with notices appearing oddly on OM screens.
159
  * Updated support video.