Temporary Login Without Password - Version 1.6.0

Version Description

Download this release

Release Info

Developer storeapps
Plugin Icon 128x128 Temporary Login Without Password
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.23 to 1.6.0

admin/class-wp-temporary-login-without-password-admin.php CHANGED
@@ -104,19 +104,7 @@ class Wp_Temporary_Login_Without_Password_Admin {
104
  * @since 1.5.17
105
  */
106
  public function is_plugin_page() {
107
-
108
- $pages = array(
109
- 'users_page_wp-temporary-login-without-password',
110
- 'users_page_wp-temporary-login-without-password-network'
111
- );
112
-
113
- $screen = get_current_screen();
114
-
115
- if ( in_array( $screen->id, $pages ) ) {
116
- return true;
117
- }
118
-
119
- return false;
120
  }
121
 
122
  /**
@@ -150,7 +138,8 @@ class Wp_Temporary_Login_Without_Password_Admin {
150
  $action = ! empty( $_GET['action'] ) ? $_GET['action'] : '';
151
  $user_id = ! empty( $_GET['user_id'] ) ? $_GET['user_id'] : '';
152
  $do_update = ( 'update' === $action ) ? 1 : 0;
153
- $_template_file = WTLWP_PLUGIN_DIR . '/templates/admin-settings.php';
 
154
 
155
  $is_temporary_login = false;
156
  $current_user_id = get_current_user_id();
104
  * @since 1.5.17
105
  */
106
  public function is_plugin_page() {
107
+ return Wp_Temporary_Login_Without_Password_Common::is_tlwp_admin_page();
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
 
110
  /**
138
  $action = ! empty( $_GET['action'] ) ? $_GET['action'] : '';
139
  $user_id = ! empty( $_GET['user_id'] ) ? $_GET['user_id'] : '';
140
  $do_update = ( 'update' === $action ) ? 1 : 0;
141
+
142
+ $_template_file = WTLWP_PLUGIN_DIR . '/templates/admin-settings.php';
143
 
144
  $is_temporary_login = false;
145
  $current_user_id = get_current_user_id();
includes/class-wp-temporary-login-without-password-common.php CHANGED
@@ -112,7 +112,6 @@ class Wp_Temporary_Login_Without_Password_Common {
112
 
113
  $result['error'] = false;
114
  $result['user_id'] = $user_id;
115
-
116
  }
117
 
118
  return $result;
@@ -188,13 +187,19 @@ class Wp_Temporary_Login_Without_Password_Common {
188
  public static function get_expiry_options() {
189
 
190
  $expiry_options = array(
191
- 'hour' => array( 'label' => __( 'One Hour', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS, 'order' => 5 ),
192
- '3_hours' => array( 'label' => __( 'Three Hours', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS * 3, 'order' => 10 ),
193
- 'day' => array( 'label' => __( 'One Day', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS, 'order' => 15 ),
194
- '3_days' => array( 'label' => __( 'Three Days', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS * 3, 'order' => 20 ),
195
- 'week' => array( 'label' => __( 'One Week', 'temporary-login-without-password' ), 'timestamp' => WEEK_IN_SECONDS, 'order' => 25 ),
196
- 'month' => array( 'label' => __( 'One Month', 'temporary-login-without-password' ), 'timestamp' => MONTH_IN_SECONDS, 'order' => 30 ),
197
- 'custom_date' => array( 'label' => __( 'Custom Date', 'temporary-login-without-password' ), 'timestamp' => 0, 'order' => 35 )
 
 
 
 
 
 
198
  );
199
 
200
  // Now, one can add their own options.
@@ -202,6 +207,11 @@ class Wp_Temporary_Login_Without_Password_Common {
202
 
203
  // Get Order options to sort $expiry_options array by it's array
204
  foreach ( $expiry_options as $key => $options ) {
 
 
 
 
 
205
  $orders[ $key ] = ! empty( $options['order'] ) ? $options['order'] : 100;
206
  }
207
 
@@ -227,6 +237,7 @@ class Wp_Temporary_Login_Without_Password_Common {
227
 
228
  if ( is_array( $expiry_options ) && count( $expiry_options ) > 0 ) {
229
 
 
230
  foreach ( $expiry_options as $key => $option ) {
231
 
232
  // We don't need to add option into dropdown if it's excluded
@@ -234,15 +245,29 @@ class Wp_Temporary_Login_Without_Password_Common {
234
  continue;
235
  }
236
 
237
- $label = ! empty( $option['label'] ) ? $option['label'] : '';
 
 
 
 
 
 
 
238
 
239
- $r .= "\n\t<option ";
240
 
241
- if ( $selected === $key ) {
242
- $r .= "selected='selected' ";
 
 
 
 
 
 
 
243
  }
244
 
245
- $r .= "value='" . esc_attr( $key ) . "'>$label</option>";
246
 
247
  }
248
 
@@ -285,6 +310,8 @@ class Wp_Temporary_Login_Without_Password_Common {
285
  // So, we don't need to do addition in the current timestamp
286
  $current_timestamp = 0;
287
  $timestamp = strtotime( $date );
 
 
288
  } else {
289
 
290
  // We need current gmt timestamp and from now we need to expire temporary login
@@ -467,7 +494,7 @@ class Wp_Temporary_Login_Without_Password_Common {
467
 
468
  $expire = get_user_meta( $user_id, '_wtlwp_expire', true );
469
 
470
- return ! empty( $expire ) && self::get_current_gmt_timestamp() >= floatval( $expire ) ? true : false;
471
 
472
  }
473
 
@@ -525,7 +552,13 @@ class Wp_Temporary_Login_Without_Password_Common {
525
 
526
  foreach ( $users_data as $key => $user ) {
527
  $expire = get_user_meta( $user->ID, '_wtlwp_expire', true );
528
- if ( $expire <= self::get_current_gmt_timestamp() ) {
 
 
 
 
 
 
529
  unset( $users_data[ $key ] );
530
  }
531
  }
@@ -677,51 +710,59 @@ class Wp_Temporary_Login_Without_Password_Common {
677
  */
678
  public static function time_elapsed_string( $time, $ago = false ) {
679
 
680
- if ( $ago ) {
681
- $etime = self::get_current_gmt_timestamp() - $time;
682
- } else {
683
- $etime = $time - self::get_current_gmt_timestamp();
684
- }
685
 
686
- if ( $etime < 1 ) {
687
- return __( 'Expired', 'temporary-login-without-password' );
688
- }
 
 
689
 
690
- $a = array(
691
- // 365 * 24 * 60 * 60 => 'year',
692
- // 30 * 24 * 60 * 60 => 'month',
693
- 24 * 60 * 60 => 'day',
694
- 60 * 60 => 'hour',
695
- 60 => 'minute',
696
- 1 => 'second',
697
- );
698
 
699
- $a_plural = array(
700
- 'year' => 'years',
701
- 'month' => 'months',
702
- 'day' => 'days',
703
- 'hour' => 'hours',
704
- 'minute' => 'minutes',
705
- 'second' => 'seconds',
706
- );
707
 
708
- foreach ( $a as $secs => $str ) {
709
- $d = $etime / $secs;
 
 
 
 
 
 
710
 
711
- if ( $d >= 1 ) {
712
- $r = round( $d );
713
 
714
- $time_string = ( $r > 1 ) ? $a_plural[ $str ] : $str;
 
715
 
716
- if ( $ago ) {
717
- return __( sprintf( '%d %s ago', $r, $time_string ), 'temporary-login-without-password' );
718
- } else {
719
- return __( sprintf( '%d %s remaining', $r, $time_string ), 'temporary-login-without-password' );
 
 
 
720
  }
721
  }
722
- }
723
 
724
- return __( 'Expired', 'temporary-login-without-password' );
 
 
 
 
 
 
725
 
726
  }
727
 
@@ -955,4 +996,27 @@ class Wp_Temporary_Login_Without_Password_Common {
955
  return $meta_info;
956
  }
957
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
958
  }
112
 
113
  $result['error'] = false;
114
  $result['user_id'] = $user_id;
 
115
  }
116
 
117
  return $result;
187
  public static function get_expiry_options() {
188
 
189
  $expiry_options = array(
190
+ 'hour' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'One Hour', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS, 'order' => 5 ),
191
+ '3_hours' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'Three Hours', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS * 3, 'order' => 10 ),
192
+ 'day' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'One Day', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS, 'order' => 15 ),
193
+ '3_days' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'Three Days', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS * 3, 'order' => 20 ),
194
+ 'week' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'One Week', 'temporary-login-without-password' ), 'timestamp' => WEEK_IN_SECONDS, 'order' => 25 ),
195
+ 'month' => array( 'group' => 'from_now', 'group_name' => __( 'From Now', 'temporary-login-without-password' ), 'label' => __( 'One Month', 'temporary-login-without-password' ), 'timestamp' => MONTH_IN_SECONDS, 'order' => 30 ),
196
+ 'hour_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'One Hour', 'temporary-login-without-password' ), 'expiry_label' => __( '1 hour after access', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS, 'order' => 6 ),
197
+ '3_hours_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'Three Hours', 'temporary-login-without-password' ), 'expiry_label' => __( '3 hours after access', 'temporary-login-without-password' ), 'timestamp' => HOUR_IN_SECONDS * 3, 'order' => 11 ),
198
+ 'day_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'One Day', 'temporary-login-without-password' ), 'expiry_label' => __( '1 day after access', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS, 'order' => 16 ),
199
+ '3_days_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'Three Days', 'temporary-login-without-password' ), 'expiry_label' => __( '3 days after access', 'temporary-login-without-password' ), 'timestamp' => DAY_IN_SECONDS * 3, 'order' => 21 ),
200
+ 'week_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'One Week', 'temporary-login-without-password' ), 'expiry_label' => __( '1 week after access', 'temporary-login-without-password' ), 'timestamp' => WEEK_IN_SECONDS, 'order' => 26 ),
201
+ 'month_after_access' => array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'temporary-login-without-password' ), 'label' => __( 'One Month', 'temporary-login-without-password' ), 'expiry_label' => __( '1 month after access', 'temporary-login-without-password' ), 'timestamp' => MONTH_IN_SECONDS, 'order' => 31 ),
202
+ 'custom_date' => array( 'group' => 'custom', 'group_name' => __( 'Custom', 'temporary-login-without-password' ), 'label' => __( 'Custom Date', 'temporary-login-without-password' ), 'timestamp' => 0, 'order' => 35 ),
203
  );
204
 
205
  // Now, one can add their own options.
207
 
208
  // Get Order options to sort $expiry_options array by it's array
209
  foreach ( $expiry_options as $key => $options ) {
210
+ $expiry_options[ $key ]['order'] = ! empty( $options['order'] ) ? $options['order'] : 100;
211
+ $expiry_options[ $key ]['group'] = ! empty( $options['group'] ) ? $options['group'] : __( 'from_now', '' );
212
+ $expiry_options[ $key ]['group_name'] = ! empty( $options['group_name'] ) ? $options['group_name'] : __( 'From Now', '' );
213
+ $expiry_options[ $key ]['expiry_label'] = ! empty( $options['expiry_label'] ) ? $options['expiry_label'] : '';
214
+
215
  $orders[ $key ] = ! empty( $options['order'] ) ? $options['order'] : 100;
216
  }
217
 
237
 
238
  if ( is_array( $expiry_options ) && count( $expiry_options ) > 0 ) {
239
 
240
+ $grouped_expiry_options = $groups = array();
241
  foreach ( $expiry_options as $key => $option ) {
242
 
243
  // We don't need to add option into dropdown if it's excluded
245
  continue;
246
  }
247
 
248
+ $groups[ $option['group'] ] = $option['group_name'];
249
+
250
+ $grouped_expiry_options[ $option['group'] ][ $key ] = $option;
251
+ }
252
+
253
+ foreach ( $grouped_expiry_options as $group => $options ) {
254
+
255
+ $r .= "\n\t<optgroup label='$groups[$group]'>";
256
 
257
+ foreach ( $options as $key => $option ) {
258
 
259
+ $label = ! empty( $option['label'] ) ? $option['label'] : '';
260
+
261
+ $r .= "\n\t<option ";
262
+
263
+ if ( $selected === $key ) {
264
+ $r .= "selected='selected' ";
265
+ }
266
+
267
+ $r .= "value='" . esc_attr( $key ) . "'>$label</option>";
268
  }
269
 
270
+ $r .= "</optgroup>";
271
 
272
  }
273
 
310
  // So, we don't need to do addition in the current timestamp
311
  $current_timestamp = 0;
312
  $timestamp = strtotime( $date );
313
+ } elseif ( strpos( $expiry_option, '_after_access' ) > 0 ) {
314
+ return $expiry_option;
315
  } else {
316
 
317
  // We need current gmt timestamp and from now we need to expire temporary login
494
 
495
  $expire = get_user_meta( $user_id, '_wtlwp_expire', true );
496
 
497
+ return ! empty( $expire ) && is_numeric( $expire ) && self::get_current_gmt_timestamp() >= floatval( $expire ) ? true : false;
498
 
499
  }
500
 
552
 
553
  foreach ( $users_data as $key => $user ) {
554
  $expire = get_user_meta( $user->ID, '_wtlwp_expire', true );
555
+
556
+ if ( is_string( $expire ) && strpos( $expire, '_after_access' ) ) {
557
+ $expiry_options = self::get_expiry_options();
558
+ $timestamp = ! empty( $expiry_options[ $expire ] ) ? $expiry_options[ $expire ]['timestamp'] : 0;
559
+ $expire = self::get_current_gmt_timestamp() + $timestamp;
560
+ update_user_meta( $user->ID, '_wtlwp_expire', $expire );
561
+ } elseif ( $expire <= self::get_current_gmt_timestamp() ) {
562
  unset( $users_data[ $key ] );
563
  }
564
  }
710
  */
711
  public static function time_elapsed_string( $time, $ago = false ) {
712
 
713
+ if ( is_numeric( $time ) ) {
 
 
 
 
714
 
715
+ if ( $ago ) {
716
+ $etime = self::get_current_gmt_timestamp() - $time;
717
+ } else {
718
+ $etime = $time - self::get_current_gmt_timestamp();
719
+ }
720
 
721
+ if ( $etime < 1 ) {
722
+ return __( 'Expired', 'temporary-login-without-password' );
723
+ }
 
 
 
 
 
724
 
725
+ $a = array(
726
+ // 365 * 24 * 60 * 60 => 'year',
727
+ // 30 * 24 * 60 * 60 => 'month',
728
+ 24 * 60 * 60 => 'day',
729
+ 60 * 60 => 'hour',
730
+ 60 => 'minute',
731
+ 1 => 'second',
732
+ );
733
 
734
+ $a_plural = array(
735
+ 'year' => 'years',
736
+ 'month' => 'months',
737
+ 'day' => 'days',
738
+ 'hour' => 'hours',
739
+ 'minute' => 'minutes',
740
+ 'second' => 'seconds',
741
+ );
742
 
743
+ foreach ( $a as $secs => $str ) {
744
+ $d = $etime / $secs;
745
 
746
+ if ( $d >= 1 ) {
747
+ $r = round( $d );
748
 
749
+ $time_string = ( $r > 1 ) ? $a_plural[ $str ] : $str;
750
+
751
+ if ( $ago ) {
752
+ return __( sprintf( '%d %s ago', $r, $time_string ), 'temporary-login-without-password' );
753
+ } else {
754
+ return __( sprintf( '%d %s remaining', $r, $time_string ), 'temporary-login-without-password' );
755
+ }
756
  }
757
  }
 
758
 
759
+ return __( 'Expired', 'temporary-login-without-password' );
760
+ } else {
761
+
762
+ $expiry_options = Wp_Temporary_Login_Without_Password_Common::get_expiry_options();
763
+
764
+ return ! empty( $expiry_options[ $time ] ) ? $expiry_options[ $time ]['expiry_label'] : '';
765
+ }
766
 
767
  }
768
 
996
  return $meta_info;
997
  }
998
 
999
+ /**
1000
+ * Check whether TLWP admin page?
1001
+ *
1002
+ * @return bool
1003
+ *
1004
+ * @since 1.5.24
1005
+ */
1006
+ public static function is_tlwp_admin_page() {
1007
+
1008
+ $pages = array(
1009
+ 'users_page_wp-temporary-login-without-password',
1010
+ 'users_page_wp-temporary-login-without-password-network'
1011
+ );
1012
+
1013
+ $screen = get_current_screen();
1014
+
1015
+ if ( in_array( $screen->id, $pages ) ) {
1016
+ return true;
1017
+ }
1018
+
1019
+ return false;
1020
+ }
1021
+
1022
  }
includes/feedback.php CHANGED
@@ -103,4 +103,26 @@ if ( ! function_exists( 'tlwp_review_message_data' ) ) {
103
  }
104
  }
105
 
106
- add_filter( 'tlwp_review_message_data', 'tlwp_review_message_data', 10 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
  }
105
 
106
+ add_filter( 'tlwp_review_message_data', 'tlwp_review_message_data', 10 );
107
+
108
+ if ( ! function_exists('tlwp_can_load_sweetalert_js') ) {
109
+ /**
110
+ * Can load sweetalert js
111
+ *
112
+ * @param bool $load
113
+ *
114
+ * @return bool
115
+ *
116
+ * @since 1.5.24
117
+ */
118
+ function tlwp_can_load_sweetalert_js( $load = false ) {
119
+
120
+ if ( Wp_Temporary_Login_Without_Password_Common::is_tlwp_admin_page() ) {
121
+ return true;
122
+ }
123
+
124
+ return $load;
125
+ }
126
+ }
127
+
128
+ add_filter( 'tlwp_can_load_sweetalert_js', 'tlwp_can_load_sweetalert_js', 10, 1 );
includes/feedback/assets/css/feedback.min.css CHANGED
@@ -56,4 +56,13 @@
56
  .email-subscribers_page_es_settings .ig-feedback-data-message textarea, .ig-feedback-data-message textarea {
57
  height: 200px;
58
  width: 92%
 
 
 
 
 
 
 
 
 
59
  }
56
  .email-subscribers_page_es_settings .ig-feedback-data-message textarea, .ig-feedback-data-message textarea {
57
  height: 200px;
58
  width: 92%
59
+ }
60
+
61
+ .ig-feedback-data-poll-message textarea {
62
+ height: 100px;
63
+ width: 100%;
64
+ }
65
+
66
+ .swal2-actions {
67
+ margin: 0px !important;
68
  }
includes/feedback/class-ig-feedback.php CHANGED
@@ -4,21 +4,21 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
8
  /**
9
  * IG Feedback
10
  *
11
  * The IG Feedback class adds functionality to get quick interactive feedback from users.
12
  * There are different types of feedabck widget like Stars, Emoji, Thubms Up/ Down, Number etc.
13
  *
14
- * @class IG_Feedback_V_1_0_16
15
  * @since 1.0.0
16
  * @copyright Copyright (c) 2019, Icegram
17
  * @license https://opensource.org/licenses/gpl-license GNU Public License
18
  * @author Icegram
19
  * @package feedback
20
  */
21
- class IG_Feedback_V_1_0_16 {
22
 
23
  /**
24
  * Version of Feedback Library
@@ -27,7 +27,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
27
  * @var string
28
  *
29
  */
30
- public $version = '1.0.16';
31
  /**
32
  * The API URL where we will send feedback data.
33
  *
@@ -276,7 +276,6 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
276
  }
277
 
278
  .ig-feedback-plugin-icon {
279
- style =
280
  float: left;
281
  margin-right: 0.5em;
282
  }
@@ -345,9 +344,16 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
345
  * Load Javascripts
346
  *
347
  * @since 1.0.1
 
 
348
  */
349
  public function enqueue_scripts() {
350
- wp_enqueue_script( 'sweetalert', plugin_dir_url( __FILE__ ) . 'assets/js/sweetalert2.min.js', array( 'jquery' ) );
 
 
 
 
 
351
  }
352
 
353
  /**
@@ -396,7 +402,8 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
396
  'backdrop' => true,
397
  'delay' => 3, // In Seconds
398
  'consent_text' => 'You are agree to our terms and condition',
399
- 'email' => $this->get_contact_email()
 
400
  );
401
 
402
  $params = wp_parse_args( $params, $default_params );
@@ -848,6 +855,165 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_16' ) ) {
848
  <?php
849
  }
850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  /**
852
  * Get Feedback API url
853
  *
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ if ( ! class_exists( 'IG_Feedback_V_1_1_0' ) ) {
8
  /**
9
  * IG Feedback
10
  *
11
  * The IG Feedback class adds functionality to get quick interactive feedback from users.
12
  * There are different types of feedabck widget like Stars, Emoji, Thubms Up/ Down, Number etc.
13
  *
14
+ * @class IG_Feedback_V_1_1_0
15
  * @since 1.0.0
16
  * @copyright Copyright (c) 2019, Icegram
17
  * @license https://opensource.org/licenses/gpl-license GNU Public License
18
  * @author Icegram
19
  * @package feedback
20
  */
21
+ class IG_Feedback_V_1_1_0 {
22
 
23
  /**
24
  * Version of Feedback Library
27
  * @var string
28
  *
29
  */
30
+ public $version = '1.1.0';
31
  /**
32
  * The API URL where we will send feedback data.
33
  *
276
  }
277
 
278
  .ig-feedback-plugin-icon {
 
279
  float: left;
280
  margin-right: 0.5em;
281
  }
344
  * Load Javascripts
345
  *
346
  * @since 1.0.1
347
+ *
348
+ * @modify 1.1.0
349
  */
350
  public function enqueue_scripts() {
351
+
352
+ $can_load = apply_filters( $this->plugin_abbr . '_can_load_sweetalert_js', false );
353
+
354
+ if ( $can_load ) {
355
+ wp_enqueue_script( 'sweetalert', plugin_dir_url( __FILE__ ) . 'assets/js/sweetalert2.min.js', array( 'jquery' ) );
356
+ }
357
  }
358
 
359
  /**
402
  'backdrop' => true,
403
  'delay' => 3, // In Seconds
404
  'consent_text' => 'You are agree to our terms and condition',
405
+ 'email' => $this->get_contact_email(),
406
+ 'name' => ''
407
  );
408
 
409
  $params = wp_parse_args( $params, $default_params );
855
  <?php
856
  }
857
 
858
+ /**
859
+ * Render Poll widget
860
+ *
861
+ * @param array $params
862
+ *
863
+ * @since 1.1.0
864
+ */
865
+ public function render_poll_widget( $params = array() ) {
866
+ $params = $this->prepare_widget_params( $params );
867
+
868
+ $poll_options = ! empty( $params['poll_options'] ) ? $params['poll_options'] : array();
869
+
870
+ if ( empty( $poll_options ) ) {
871
+ return;
872
+ }
873
+
874
+ $allow_multiple = ! empty( $params['allow_multiple'] ) ? $params['allow_multiple'] : false;
875
+
876
+ $title = $params['title'];
877
+ $slug = sanitize_title( $title );
878
+ $event = $this->event_prefix . $params['event'];
879
+ $desc = ! empty( $params['desc'] ) ? $params['desc'] : '';
880
+
881
+ ob_start();
882
+
883
+ ?>
884
+
885
+ <div class="ig-general-feedback" id="ig-general-feedback-<?php echo $this->plugin; ?>">
886
+ <form class="ig-general-feedback" id="ig-general-feedback">
887
+ <p><?php echo $desc; ?></p>
888
+
889
+ <p class="ig-general-feedback">
890
+ <?php foreach ( $poll_options as $value => $option ) { ?>
891
+ <input type="radio" name="feedback_data[poll_options]" value="<?php echo $value; ?>"><b style="color: <?php echo $option['color']; ?>"><?php echo $option['text']; ?></b><br/>
892
+ <?php } ?>
893
+ </p>
894
+ <p class="ig-feedback-data-poll-message" id="ig-feedback-data-poll-message">
895
+ <textarea name="feedback_data[details]" id="ig-feedback-data-poll-additional-message" placeholder="Additional feedback"></textarea>
896
+ </p>
897
+ </form>
898
+ </div>
899
+
900
+ <?php
901
+
902
+ $html = str_replace( array( "\r", "\n" ), '', trim( ob_get_clean() ) );
903
+
904
+ $params['html'] = $html;
905
+
906
+ $title = $params['title'];
907
+ $slug = sanitize_title( $title );
908
+ $event = $this->event_prefix . $params['event'];
909
+ $html = ! empty( $params['html'] ) ? $params['html'] : '';
910
+
911
+ ?>
912
+
913
+ <script type="text/javascript">
914
+
915
+ jQuery(document).ready(function ($) {
916
+
917
+ function doSend(data, meta, system_info) {
918
+
919
+ var data = {
920
+ action: '<?php echo $this->ajax_action; ?>',
921
+ feedback: {
922
+ type: '<?php echo $params['type']; ?>',
923
+ slug: '<?php echo $slug; ?>',
924
+ title: '<?php echo esc_js( $title ); ?>',
925
+ data: data
926
+ },
927
+
928
+ event: '<?php echo $event; ?>',
929
+
930
+ // Add additional information
931
+ misc: {
932
+ plugin: '<?php echo $this->plugin; ?>',
933
+ plugin_abbr: '<?php echo $this->plugin_abbr; ?>',
934
+ is_dev_mode: '<?php echo $this->is_dev_mode; ?>',
935
+ set_transient: '<?php echo $params['set_transient']; ?>',
936
+ meta_info: meta,
937
+ system_info: system_info
938
+ }
939
+ };
940
+
941
+ return jQuery.post(ajaxurl, data);
942
+ }
943
+
944
+ Swal.mixin({
945
+ footer: '',
946
+ position: '<?php echo $params['position']; ?>',
947
+ width: <?php echo $params['width']; ?>,
948
+ animation: false,
949
+ focusConfirm: false,
950
+ allowEscapeKey: true,
951
+ showCloseButton: '<?php echo $params['showCloseButton']; ?>',
952
+ allowOutsideClick: '<?php echo $params['allowOutsideClick']; ?>',
953
+ showLoaderOnConfirm: true,
954
+ confirmButtonText: '<?php echo $params['confirmButtonText']; ?>',
955
+ backdrop: '<?php echo (int) $params['backdrop']; ?>'
956
+ }).queue([
957
+ {
958
+ title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
959
+ html: '<?php echo $html; ?>',
960
+ customClass: {
961
+ popup: 'animated fadeInUpBig'
962
+ },
963
+ onOpen: () => {
964
+
965
+ },
966
+ preConfirm: () => {
967
+ var $overlay = $('#ig-general-feedback-<?php echo $this->plugin; ?>');
968
+ var $form = $overlay.find('form');
969
+ var poll_options = $form.find("input[name='feedback_data[poll_options]']:checked").val();
970
+ var message = $form.find("#ig-feedback-data-poll-additional-message").val();
971
+
972
+ if (poll_options === undefined) {
973
+ Swal.showValidationMessage('Please select option');
974
+ return;
975
+ }
976
+
977
+ var data = {
978
+ poll_option: poll_options,
979
+ additional_feedback: message
980
+ };
981
+
982
+ var meta = {
983
+
984
+ };
985
+
986
+ return doSend(data, meta, true);
987
+ }
988
+ },
989
+
990
+ ]).then(response => {
991
+
992
+ if (response.hasOwnProperty('value')) {
993
+
994
+ Swal.fire({
995
+ type: 'success',
996
+ width: <?php echo $params['width']; ?>,
997
+ title: "Thank You!",
998
+ showConfirmButton: false,
999
+ position: '<?php echo $params['position']; ?>',
1000
+ timer: 1500,
1001
+ animation: false
1002
+ });
1003
+
1004
+ }
1005
+ });
1006
+
1007
+
1008
+ });
1009
+
1010
+ </script>
1011
+
1012
+
1013
+ <?php
1014
+ }
1015
+
1016
+
1017
  /**
1018
  * Get Feedback API url
1019
  *
includes/feedback/class-ig-tracker.php CHANGED
@@ -4,15 +4,15 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- if ( ! class_exists( 'IG_Tracker_V_1_0_16' ) ) {
8
 
9
  /**
10
- * Class IG_Tracker_V_1_0_16
11
  *
12
  * Icegram tracker handler class is responsible for sending anonymous plugin
13
  * data to Icegram servers for users that actively allowed data tracking.
14
  *
15
- * @class IG_Tracker_V_1_0_16
16
  * @since 1.0.0
17
  *
18
  * @copyright Copyright (c) 2019, Icegram
@@ -20,7 +20,7 @@ if ( ! class_exists( 'IG_Tracker_V_1_0_16' ) ) {
20
  * @author Icegram
21
  * @package feedback
22
  */
23
- class IG_Tracker_V_1_0_16 {
24
 
25
  /**
26
  * Get Active, Inactive or all plugins info
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ if ( ! class_exists( 'IG_Tracker_V_1_1_0' ) ) {
8
 
9
  /**
10
+ * Class IG_Tracker_V_1_1_0
11
  *
12
  * Icegram tracker handler class is responsible for sending anonymous plugin
13
  * data to Icegram servers for users that actively allowed data tracking.
14
  *
15
+ * @class IG_Tracker_V_1_1_0
16
  * @since 1.0.0
17
  *
18
  * @copyright Copyright (c) 2019, Icegram
20
  * @author Icegram
21
  * @package feedback
22
  */
23
+ class IG_Tracker_V_1_1_0 {
24
 
25
  /**
26
  * Get Active, Inactive or all plugins info
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: temporary access, developer access, admin login, temporary login, passwordless login, customer login, secure login, access, admin, log in, login, login security, protection, user login, user login, wordpress admin login, wordpress login, wp-admin, wp-login, expiration, login, Login Without Password, user, WordPress Admin, wp-admin, developer login
5
  Requires at least: 3.0.1
6
  Tested up to: 5.3.2
7
- Stable tag: 1.5.23
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -78,16 +78,25 @@ No. at this moment it's not possible to do this.
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
81
  **1.5.23 [2020-01-14]**
 
82
  * Fix: Incorrect temporary Login URL shows up while using iThemes Security plugin with Custom URL Login enabled
83
 
84
  **1.5.22 [2019-12-23]**
 
85
  * Update: Compatibility test with WordPress 5.3.2
86
 
87
  **1.5.21 [2019-11-04]**
 
88
  * Update: Make it compatible with iThemes Security (formerly Better WP Security) plugin with Custom URL Login enabled
89
 
90
  **1.5.20 [2019-09-09]**
 
91
  * Update: Add Temporary Super Admin to all sites
92
  * Fix: JS & CSS loading issue for WordPress Multi sites
93
  * New: Added Italian translation. (Thanks [@alessioangeloro](https://profiles.wordpress.org/alessioangeloro/) for providing Italian translation)
4
  Tags: temporary access, developer access, admin login, temporary login, passwordless login, customer login, secure login, access, admin, log in, login, login security, protection, user login, user login, wordpress admin login, wordpress login, wp-admin, wp-login, expiration, login, Login Without Password, user, WordPress Admin, wp-admin, developer login
5
  Requires at least: 3.0.1
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.6.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
78
 
79
  == Changelog ==
80
 
81
+ **1.6.0 [2020-02-20]**
82
+
83
+ * New: Now, able to create temporary login link that will expire on specific time after access.
84
+ * Fix: Conflict of Sweetalert JS
85
+
86
  **1.5.23 [2020-01-14]**
87
+
88
  * Fix: Incorrect temporary Login URL shows up while using iThemes Security plugin with Custom URL Login enabled
89
 
90
  **1.5.22 [2019-12-23]**
91
+
92
  * Update: Compatibility test with WordPress 5.3.2
93
 
94
  **1.5.21 [2019-11-04]**
95
+
96
  * Update: Make it compatible with iThemes Security (formerly Better WP Security) plugin with Custom URL Login enabled
97
 
98
  **1.5.20 [2019-09-09]**
99
+
100
  * Update: Add Temporary Super Admin to all sites
101
  * Fix: JS & CSS loading issue for WordPress Multi sites
102
  * New: Added Italian translation. (Thanks [@alessioangeloro](https://profiles.wordpress.org/alessioangeloro/) for providing Italian translation)
temporary-login-without-password.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Temporary Login Without Password
4
  * Plugin URI: http://www.storeapps.org/create-secure-login-without-password-for-wordpress/
5
  * Description: Create a temporary login link with any role using which one can access to your sytem without username and password for limited period of time.
6
- * Version: 1.5.23
7
  * Author: StoreApps
8
  * Author URI: https://storeapps.org
9
  * Requires at least: 3.0.1
@@ -25,8 +25,8 @@ if ( ! defined( 'WPINC' ) ) {
25
  /**
26
  * Define constants
27
  */
28
- define( 'WTLWP_PLUGIN_VERSION', '1.5.23' );
29
- define( 'WTLWP_FEEDBACK_VERSION', '1.0.16' );
30
  define( 'WTLWP_PLUGIN_DIR', dirname( __FILE__ ) );
31
  define( 'WTLWP_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
32
  define( 'WTLWP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
3
  * Plugin Name: Temporary Login Without Password
4
  * Plugin URI: http://www.storeapps.org/create-secure-login-without-password-for-wordpress/
5
  * Description: Create a temporary login link with any role using which one can access to your sytem without username and password for limited period of time.
6
+ * Version: 1.6.0
7
  * Author: StoreApps
8
  * Author URI: https://storeapps.org
9
  * Requires at least: 3.0.1
25
  /**
26
  * Define constants
27
  */
28
+ define( 'WTLWP_PLUGIN_VERSION', '1.6.0' );
29
+ define( 'WTLWP_FEEDBACK_VERSION', '1.1.0' );
30
  define( 'WTLWP_PLUGIN_DIR', dirname( __FILE__ ) );
31
  define( 'WTLWP_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
32
  define( 'WTLWP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );