ITRO Popup Plugin - Version 5.2

Version Description

= 5.0.2 = IMPROVED: system info on the popup admin page ADDED: force table installation in case something gone wrong during plugin activation

= 5.0.1 = ADDED: force_balance_tags used to prevent popup content break the DOM

= 5.0 = FIXED: automatic top margin not working with popup delay ADDED: close cross can be a custom image IMPROVED: cleaned the js script in itro-admin-scripts.js IMPROVED: admin pannel aspect and options order IMPROVED: plugin version check for DB updates

Download this release

Release Info

Developer martinalucaroni
Plugin Icon 128x128 ITRO Popup Plugin
Version 5.2
Comparing to
See all releases

Code changes from version 5.1 to 5.2

admin/popup-admin.php CHANGED
@@ -7,7 +7,11 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
 
8
  global $ITRO_VER;
9
 
10
- if ( !current_user_can( 'manage_options' ) ) {
 
 
 
 
11
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
12
  }
13
 
@@ -135,6 +139,14 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y')
135
  if( !empty($_POST['background_source']) ){
136
  itro_update_option('background_source',$_POST['background_source']);
137
  }
 
 
 
 
 
 
 
 
138
  }else{
139
  //WP Editor Content
140
  $field_value = stripslashes(itro_get_field( 'custom_html' ));
@@ -188,6 +200,31 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
188
  <img style="vertical-align:super; cursor:help" src="<?php echo itroImages . 'question_mark.png' ; ?>" title="<?php _e('Display many other options','itro-plugin');?>" />
189
  </p>
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  <!-- popup display location!-->
192
  <p>
193
  <h3><?php _e("DECIDE WHERE POPUP WILL BE DISPLAYED","itro-plugin")?></h3>
7
 
8
  global $ITRO_VER;
9
 
10
+ $currentUser = wp_get_current_user();
11
+ global $wp_roles;
12
+ $userRoles = $currentUser->roles;
13
+ $allowedRoles = itro_get_option('roles');
14
+ if ( empty(array_intersect($userRoles, $allowedRoles)) && !in_array( 'administrator',$userRoles) ) {
15
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
16
  }
17
 
139
  if( !empty($_POST['background_source']) ){
140
  itro_update_option('background_source',$_POST['background_source']);
141
  }
142
+
143
+ if(isset($_POST['roles'])){
144
+ $roles_users=json_encode($_POST['roles']);
145
+ itro_update_option('roles',$roles_users);
146
+ }
147
+ else{
148
+ itro_update_option('roles',NULL);
149
+ }
150
  }else{
151
  //WP Editor Content
152
  $field_value = stripslashes(itro_get_field( 'custom_html' ));
200
  <img style="vertical-align:super; cursor:help" src="<?php echo itroImages . 'question_mark.png' ; ?>" title="<?php _e('Display many other options','itro-plugin');?>" />
201
  </p>
202
 
203
+ <!-- roles !-->
204
+ <p>
205
+ <h3><?php _e("SELECT THE ROLE","itro-plugin") ?></h3>
206
+ <?php
207
+ $checked="";
208
+ $roles_obj = new WP_Roles();
209
+ foreach ($roles_obj->roles as $role=>$role_val) {
210
+ $allowedRoles = json_decode(itro_get_option('roles'));
211
+ if(in_array($role,$allowedRoles)){
212
+ $checked="checked";
213
+ } else {
214
+ $checked="";
215
+ }
216
+ if($role=='administrator'){
217
+ $disabled='disabled';
218
+ } else {
219
+ $disabled='';
220
+ }
221
+ echo "<input type='checkbox' name='roles[]' id='roles_$role' value='$role' $checked $disabled>";
222
+ echo '<label for="roles_'.$role.'">'.$role_val['name'].'</label>';
223
+ echo "<br><br>";
224
+ }
225
+ ?>
226
+ </p>
227
+
228
  <!-- popup display location!-->
229
  <p>
230
  <h3><?php _e("DECIDE WHERE POPUP WILL BE DISPLAYED","itro-plugin")?></h3>
functions/core-function.php CHANGED
@@ -41,13 +41,13 @@ function itro_init() {
41
 
42
  switch (get_locale()) {
43
  case 'en_US':
44
- $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write watever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
45
  break;
46
  case 'it_IT':
47
  $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Questo &egrave; un esempio di popup.</span></h1><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Le impostazioni base per iniziare sono: Altezza popup, Tempo popup, Prossima visualizzazione, Colore bordo, Colore sfondo.</span></p><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Scrivi qualunque cosa vuoi nell&#39;editor di testo di wordpress e buon lavoro!</span></p><p style="text-align: center;">&nbsp;</p>';
48
  break;
49
  default:
50
- $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write watever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
51
  }
52
  itro_update_field('custom_html', $welcome_text);
53
 
@@ -289,6 +289,7 @@ function ipp_validate_data($data_name, $data) {
289
  break;
290
  //cleaned by json_encode() **to improve
291
  case 'selected_page_id':
 
292
  break;
293
  default:
294
  $data = NULL;
41
 
42
  switch (get_locale()) {
43
  case 'en_US':
44
+ $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write whatever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
45
  break;
46
  case 'it_IT':
47
  $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Questo &egrave; un esempio di popup.</span></h1><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Le impostazioni base per iniziare sono: Altezza popup, Tempo popup, Prossima visualizzazione, Colore bordo, Colore sfondo.</span></p><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Scrivi qualunque cosa vuoi nell&#39;editor di testo di wordpress e buon lavoro!</span></p><p style="text-align: center;">&nbsp;</p>';
48
  break;
49
  default:
50
+ $welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write whatever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
51
  }
52
  itro_update_field('custom_html', $welcome_text);
53
 
289
  break;
290
  //cleaned by json_encode() **to improve
291
  case 'selected_page_id':
292
+ case 'roles':
293
  break;
294
  default:
295
  $data = NULL;
mc-main.php CHANGED
@@ -6,14 +6,14 @@ Description: EN - Show a perfecly centered customizable popup and a popup-system
6
  Author: ITRO Team
7
  E-mail: support@itroteam.com
8
  Text Domain: itro-popup
9
- Version: 5.1
10
  Author URI: https://www.itroteam.com
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
  global $ITRO_VER;
16
- $ITRO_VER = '5.1';
17
 
18
  global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization
19
  $popup_fired = false;
6
  Author: ITRO Team
7
  E-mail: support@itroteam.com
8
  Text Domain: itro-popup
9
+ Version: 5.2
10
  Author URI: https://www.itroteam.com
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
  global $ITRO_VER;
16
+ $ITRO_VER = '5.2';
17
 
18
  global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization
19
  $popup_fired = false;
readme.txt CHANGED
@@ -4,7 +4,8 @@ Donate link: https://www.itroteam.com/leave-a-review/
4
  Tags: multilingual popup, popup, popup message, popuup optin, popup box, popup ads, popup advertising, popup block, popup content warning, fancy box, fancy popup, advertising popup, pop-up, lightbox popup
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2.2
7
- Stable tag: 5.1
 
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
4
  Tags: multilingual popup, popup, popup message, popuup optin, popup box, popup ads, popup advertising, popup block, popup content warning, fancy box, fancy popup, advertising popup, pop-up, lightbox popup
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2.2
7
+ Requires PHP: 7.0
8
+ Stable tag: 5.2
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
templates/itro-popup-template.php CHANGED
@@ -48,7 +48,7 @@ function itro_popup_template()
48
  </div>
49
  <?php if ( itro_get_option('age_restriction') != 'yes'){ ?>
50
  <div id="ipp_mobile_close_tab">
51
- <span id="ipp_mobile_close_txt" onclick="itro_exit_anim();">CLOSE</span>
52
  </div>
53
  <?php }?>
54
  </div>
48
  </div>
49
  <?php if ( itro_get_option('age_restriction') != 'yes'){ ?>
50
  <div id="ipp_mobile_close_tab">
51
+ <span id="ipp_mobile_close_txt" onclick="itro_exit_anim();"><?php _e('CLOSE','itro-plugin'); ?></span>
52
  </div>
53
  <?php }?>
54
  </div>