Photo Gallery by Envira – Responsive Image Gallery for WordPress - Version 1.6.1.7

Version Description

  • Fix: Minor bug fixes
Download this release

Release Info

Developer griffinjt
Plugin Icon 128x128 Photo Gallery by Envira – Responsive Image Gallery for WordPress
Version 1.6.1.7
Comparing to
See all releases

Code changes from version 1.6.1.5 to 1.6.1.7

envira-gallery-lite.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
6
  * Author: Envira Gallery Team
7
  * Author URI: http://enviragallery.com
8
- * Version: 1.6.1.5
9
  * Text Domain: envira-gallery
10
  *
11
  * Envira Gallery is free software: you can redistribute it and/or modify
@@ -53,7 +53,7 @@ class Envira_Gallery_Lite {
53
  *
54
  * @var string
55
  */
56
- public $version = '1.6.1.5';
57
 
58
  /**
59
  * The name of the plugin.
@@ -132,6 +132,11 @@ class Envira_Gallery_Lite {
132
  // Load admin only components.
133
  if ( is_admin() ) {
134
  $this->require_admin();
 
 
 
 
 
135
  }
136
 
137
  // Load global components.
@@ -162,6 +167,7 @@ class Envira_Gallery_Lite {
162
  require plugin_dir_path( __FILE__ ) . 'includes/admin/posttype.php';
163
  require plugin_dir_path( __FILE__ ) . 'includes/admin/table.php';
164
  require plugin_dir_path( __FILE__ ) . 'includes/admin/review.php';
 
165
 
166
  }
167
 
5
  * Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
6
  * Author: Envira Gallery Team
7
  * Author URI: http://enviragallery.com
8
+ * Version: 1.6.1.7
9
  * Text Domain: envira-gallery
10
  *
11
  * Envira Gallery is free software: you can redistribute it and/or modify
53
  *
54
  * @var string
55
  */
56
+ public $version = '1.6.1.7';
57
 
58
  /**
59
  * The name of the plugin.
132
  // Load admin only components.
133
  if ( is_admin() ) {
134
  $this->require_admin();
135
+
136
+ if ( class_exists( 'AM_Notification' ) ){
137
+ $notifications = new AM_Notification( 'envira-lite', $this->version );
138
+ }
139
+
140
  }
141
 
142
  // Load global components.
167
  require plugin_dir_path( __FILE__ ) . 'includes/admin/posttype.php';
168
  require plugin_dir_path( __FILE__ ) . 'includes/admin/table.php';
169
  require plugin_dir_path( __FILE__ ) . 'includes/admin/review.php';
170
+ require plugin_dir_path( __FILE__ ) . 'includes/admin/am-notifications.php';
171
 
172
  }
173
 
includes/admin/am-notifications.php ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'AM_Notification' ) ) {
3
+ /**
4
+ * Awesome Motive Notifications
5
+ *
6
+ * This creates a custom post type (if it doesn't exist) and calls the API to
7
+ * retrieve notifications for this product.
8
+ *
9
+ * @package AwesomeMotive
10
+ * @author Benjamin Rojas
11
+ * @license GPL-2.0+
12
+ * @copyright Copyright (c) 2017, Retyp LLC
13
+ * @version 1.0.0
14
+ */
15
+ class AM_Notification {
16
+ /**
17
+ * The api url we are calling.
18
+ *
19
+ * @since 1.0.0
20
+ *
21
+ * @var string
22
+ */
23
+ public $api_url = 'https://api.awesomemotive.com/v1/notification/';
24
+
25
+ /**
26
+ * A unique slug for this plugin.
27
+ * (Not the WordPress plugin slug)
28
+ *
29
+ * @since 1.0.0
30
+ *
31
+ * @var string
32
+ */
33
+ public $plugin;
34
+
35
+ /**
36
+ * The current plugin version.
37
+ *
38
+ * @since 1.0.0
39
+ *
40
+ * @var string
41
+ */
42
+ public $plugin_version;
43
+
44
+ /**
45
+ * The list of installed plugins.
46
+ *
47
+ * @since 1.0.0
48
+ *
49
+ * @var array
50
+ */
51
+ public $plugin_list = array();
52
+
53
+ /**
54
+ * The list of installed themes.
55
+ *
56
+ * @since 1.0.0
57
+ *
58
+ * @var string
59
+ */
60
+ public $theme_list = array();
61
+
62
+ /**
63
+ * Flag if a notice has been registered.
64
+ *
65
+ * @since 1.0.0
66
+ *
67
+ * @var bool
68
+ */
69
+ public static $registered = false;
70
+
71
+ /**
72
+ * Construct.
73
+ *
74
+ * @since 1.0.0
75
+ *
76
+ * @param string $plugin The plugin slug.
77
+ * @param mixed $version The version of the plugin.
78
+ */
79
+ public function __construct( $plugin = '', $version = 0 ) {
80
+ $this->plugin = $plugin;
81
+ $this->plugin_version = $version;
82
+
83
+ add_action( 'init', array( $this, 'custom_post_type' ) );
84
+ add_action( 'admin_init', array( $this, 'get_remote_notifications' ), 100 );
85
+ add_action( 'admin_notices', array( $this, 'display_notifications' ) );
86
+ add_action( 'wp_ajax_am_notification_dismiss', array( $this, 'dismiss_notification' ) );
87
+ }
88
+
89
+ /**
90
+ * Registers a custom post type.
91
+ *
92
+ * @since 1.0.0
93
+ */
94
+ public function custom_post_type() {
95
+ register_post_type( 'amn_' . $this->plugin, array(
96
+ 'supports' => false,
97
+ ) );
98
+ }
99
+
100
+ /**
101
+ * Retrieve the remote notifications if the time has expired.
102
+ *
103
+ * @since 1.0.0
104
+ */
105
+ public function get_remote_notifications() {
106
+ if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
107
+ return;
108
+ }
109
+
110
+ $last_checked = get_option( '_amn_' . $this->plugin . '_last_checked', strtotime( '-1 week' ) );
111
+
112
+ if ( $last_checked < strtotime( 'today midnight' ) ) {
113
+ $plugin_notifications = $this->get_plugin_notifications( 1 );
114
+ $notification_id = null;
115
+
116
+ if ( ! empty( $plugin_notifications ) ) {
117
+ // Unset it from the array.
118
+ $notification = $plugin_notifications[0];
119
+ $notification_id = get_post_meta( $notification->ID, 'notification_id', true );
120
+ }
121
+
122
+ $response = wp_remote_retrieve_body( wp_remote_post( $this->api_url, array(
123
+ 'body' => array(
124
+ 'slug' => $this->plugin,
125
+ 'version' => $this->plugin_version,
126
+ 'last_notification' => $notification_id,
127
+ 'plugins' => $this->get_plugins_list(),
128
+ 'themes' => $this->get_themes_list(),
129
+ ),
130
+ ) ) );
131
+
132
+ $data = json_decode( $response );
133
+
134
+ if ( ! empty( $data->id ) ) {
135
+ $notifications = array();
136
+
137
+ foreach ( (array) $data->slugs as $slug ) {
138
+ $notifications = array_merge(
139
+ $notifications,
140
+ (array) get_posts(
141
+ array(
142
+ 'post_type' => 'amn_' . $slug,
143
+ 'post_status' => 'all',
144
+ 'meta_key' => 'notification_id',
145
+ 'meta_value' => $data->id,
146
+ )
147
+ )
148
+ );
149
+ }
150
+
151
+ if ( empty( $notifications ) ) {
152
+ $new_notification_id = wp_insert_post( array(
153
+ 'post_content' => wp_kses_post( $data->content ),
154
+ 'post_type' => 'amn_' . $this->plugin,
155
+ ) );
156
+
157
+ update_post_meta( $new_notification_id, 'notification_id', absint( $data->id ) );
158
+ update_post_meta( $new_notification_id, 'type', sanitize_text_field( trim( $data->type ) ) );
159
+ update_post_meta( $new_notification_id, 'dismissable', (bool) $data->dismissible ? 1 : 0 );
160
+ update_post_meta( $new_notification_id, 'location', function_exists( 'wp_json_encode' ) ? wp_json_encode( $data->location ) : json_encode( $data->location ) );
161
+ update_post_meta( $new_notification_id, 'plugins', function_exists( 'wp_json_encode' ) ? wp_json_encode( $data->plugins ) : json_encode( $data->plugins ) );
162
+ update_post_meta( $new_notification_id, 'theme', sanitize_text_field( trim( $data->theme ) ) );
163
+ update_post_meta( $new_notification_id, 'version', sanitize_text_field( trim( $data->version ) ) );
164
+ update_post_meta( $new_notification_id, 'viewed', 0 );
165
+ update_post_meta( $new_notification_id, 'expiration', $data->expiration ? absint( $data->expiration ) : false );
166
+ update_post_meta( $new_notification_id, 'plans', function_exists( 'wp_json_encode' ) ? wp_json_encode( $data->plans ) : json_encode( $data->plans ) );
167
+ }
168
+ }
169
+
170
+ // Possibly revoke notifications.
171
+ if ( ! empty( $data->revoked ) ) {
172
+ $this->revoke_notifications( $data->revoked );
173
+ }
174
+
175
+ // Set the option now so we can't run this again until after 24 hours.
176
+ update_option( '_amn_' . $this->plugin . '_last_checked', strtotime( 'today midnight' ) );
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Get local plugin notifications that have already been set.
182
+ *
183
+ * @since 1.0.0
184
+ *
185
+ * @param integer $limit Set the limit for how many posts to retrieve.
186
+ * @param array $args Any top-level arguments to add to the array.
187
+ *
188
+ * @return WP_Post[] WP_Post that match the query.
189
+ */
190
+ public function get_plugin_notifications( $limit = -1, $args = array() ) {
191
+ return get_posts(
192
+ array(
193
+ 'showposts' => $limit,
194
+ 'post_type' => 'amn_' . $this->plugin,
195
+ ) + $args
196
+ );
197
+ }
198
+
199
+ /**
200
+ * Retrieve a list of plugins that are currently installed.
201
+ *
202
+ * @since 1.0.0
203
+ *
204
+ * @return array An array of plugins that are currently installed.
205
+ */
206
+ public function get_plugins_list() {
207
+ if ( ! empty( $this->plugin_list ) ) {
208
+ return $this->plugin_list;
209
+ }
210
+
211
+ if ( ! function_exists( 'get_plugins' ) ) {
212
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
213
+ }
214
+
215
+ $plugins = get_plugins();
216
+
217
+ foreach ( $plugins as $slug => $plugin ) {
218
+ $this->plugin_list[ $slug ] = array(
219
+ 'slug' => $slug,
220
+ 'name' => $plugin['Name'],
221
+ 'version' => $plugin['Version'],
222
+ 'active' => is_plugin_active( $slug ),
223
+ );
224
+ }
225
+
226
+ return $this->plugin_list;
227
+ }
228
+
229
+ /**
230
+ * Retrieve a list of themes that are currently installed.
231
+ *
232
+ * @since 1.0.0
233
+ *
234
+ * @return array An array of themes that are currently installed.
235
+ */
236
+ public function get_themes_list() {
237
+ if ( ! empty( $this->theme_list ) ) {
238
+ return $this->theme_list;
239
+ }
240
+
241
+ $themes = wp_get_themes();
242
+
243
+ foreach ( $themes as $slug => $theme ) {
244
+ $this->theme_list[ $slug ] = array(
245
+ 'slug' => $slug,
246
+ 'name' => $theme->Name,
247
+ 'version' => $theme->Version,
248
+ 'active' => (string) wp_get_theme() === $theme->Name,
249
+ );
250
+ }
251
+
252
+ return $this->theme_list;
253
+ }
254
+
255
+ /**
256
+ * Display any notifications that should be displayed.
257
+ *
258
+ * @since 1.0.0
259
+ */
260
+ public function display_notifications() {
261
+ if ( ! current_user_can( apply_filters( 'am_notifications_display', 'manage_options' ) ) ) {
262
+ return;
263
+ }
264
+
265
+ $plugin_notifications = $this->get_plugin_notifications( -1, array(
266
+ 'post_status' => 'all',
267
+ 'meta_key' => 'viewed',
268
+ 'meta_value' => '0',
269
+ ) );
270
+
271
+ $plugin_notifications = $this->validate_notifications( $plugin_notifications );
272
+
273
+ if ( ! empty( $plugin_notifications ) && ! self::$registered ) {
274
+ foreach ( $plugin_notifications as $notification ) {
275
+ $dismissable = get_post_meta( $notification->ID, 'dismissable', true );
276
+ $type = get_post_meta( $notification->ID, 'type', true );
277
+ ?>
278
+ <div class="am-notification am-notification-<?php echo $notification->ID; ?> notice notice-<?php echo $type; ?><?php echo $dismissable ? ' is-dismissible' : ''; ?>">
279
+ <?php echo $notification->post_content; ?>
280
+ </div>
281
+ <script type="text/javascript">
282
+ jQuery(document).ready(function ($) {
283
+ $(document).on('click', '.am-notification-<?php echo $notification->ID; ?> button.notice-dismiss', function (event) {
284
+ $.post(ajaxurl, {
285
+ action: 'am_notification_dismiss',
286
+ notification_id: '<?php echo $notification->ID; ?>'
287
+ });
288
+ });
289
+ });
290
+ </script>
291
+ <?php
292
+ }
293
+
294
+ self::$registered = true;
295
+ }
296
+ }
297
+
298
+ /**
299
+ * Validate the notifications before displaying them.
300
+ *
301
+ * @since 1.0.0
302
+ *
303
+ * @param array $plugin_notifications An array of plugin notifications.
304
+ *
305
+ * @return array A filtered array of plugin notifications.
306
+ */
307
+ public function validate_notifications( $plugin_notifications ) {
308
+ global $pagenow;
309
+
310
+ foreach ( $plugin_notifications as $key => $notification ) {
311
+ // Location validation.
312
+ $location = (array) json_decode( get_post_meta( $notification->ID, 'location', true ) );
313
+ $continue = false;
314
+ if ( ! in_array( 'everywhere', $location, true ) ) {
315
+ if ( in_array( 'index.php', $location, true ) && 'index.php' === $pagenow ) {
316
+ $continue = true;
317
+ }
318
+
319
+ if ( in_array( 'plugins.php', $location, true ) && 'plugins.php' === $pagenow ) {
320
+ $continue = true;
321
+ }
322
+
323
+ if ( ! $continue ) {
324
+ unset( $plugin_notifications[ $key ] );
325
+ }
326
+ }
327
+
328
+ // Plugin validation (OR conditional).
329
+ $plugins = (array) json_decode( get_post_meta( $notification->ID, 'plugins', true ) );
330
+ $continue = false;
331
+ if ( ! empty( $plugins ) ) {
332
+ foreach ( $plugins as $plugin ) {
333
+ if ( is_plugin_active( $plugin ) ) {
334
+ $continue = true;
335
+ }
336
+ }
337
+
338
+ if ( ! $continue ) {
339
+ unset( $plugin_notifications[ $key ] );
340
+ }
341
+ }
342
+
343
+ // Theme validation.
344
+ $theme = get_post_meta( $notification->ID, 'theme', true );
345
+ $continue = (string) wp_get_theme() === $theme;
346
+
347
+ if ( ! empty( $theme ) && ! $continue ) {
348
+ unset( $plugin_notifications[ $key ] );
349
+ }
350
+
351
+ // Version validation.
352
+ $version = get_post_meta( $notification->ID, 'version', true );
353
+ $continue = false;
354
+ if ( ! empty( $version ) ) {
355
+ if ( version_compare( $this->plugin_version, $version, '<=' ) ) {
356
+ $continue = true;
357
+ }
358
+
359
+ if ( ! $continue ) {
360
+ unset( $plugin_notifications[ $key ] );
361
+ }
362
+ }
363
+
364
+ // Expiration validation.
365
+ $expiration = get_post_meta( $notification->ID, 'expiration', true );
366
+ $continue = false;
367
+ if ( ! empty( $expiration ) ) {
368
+ if ( $expiration > time() ) {
369
+ $continue = true;
370
+ }
371
+
372
+ if ( ! $continue ) {
373
+ unset( $plugin_notifications[ $key ] );
374
+ }
375
+ }
376
+
377
+ // Plan validation.
378
+ $plans = (array) json_decode( get_post_meta( $notification->ID, 'plans', true ) );
379
+ $continue = false;
380
+ if ( ! empty( $plans ) ) {
381
+ $level = $this->get_plan_level();
382
+ if ( in_array( $level, $plans, true ) ) {
383
+ $continue = true;
384
+ }
385
+
386
+ if ( ! $continue ) {
387
+ unset( $plugin_notifications[ $key ] );
388
+ }
389
+ }
390
+ }
391
+
392
+ return $plugin_notifications;
393
+ }
394
+
395
+ /**
396
+ * Grab the current plan level.
397
+ *
398
+ * @since 1.0.0
399
+ *
400
+ * @return string The current plan level.
401
+ */
402
+ public function get_plan_level() {
403
+ // Prepare variables.
404
+ $key = '';
405
+ $level = '';
406
+ $option = false;
407
+ switch ( $this->plugin ) {
408
+ case 'wpforms' :
409
+ $option = get_option( 'wpforms_license' );
410
+ $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
411
+ $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
412
+
413
+ // Possibly check for a constant.
414
+ if ( empty( $key ) && defined( 'WPFORMS_LICENSE_KEY' ) ) {
415
+ $key = WPFORMS_LICENSE_KEY;
416
+ }
417
+ break;
418
+ case 'mi' :
419
+ $option = get_option( 'monsterinsights_license' );
420
+ $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
421
+ $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
422
+
423
+ // Possibly check for a constant.
424
+ if ( empty( $key ) && defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {
425
+ $key = MONSTERINSIGHTS_LICENSE_KEY;
426
+ }
427
+ break;
428
+ case 'sol' :
429
+ $option = get_option( 'soliloquy' );
430
+ $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
431
+ $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
432
+
433
+ // Possibly check for a constant.
434
+ if ( empty( $key ) && defined( 'SOLILOQUY_LICENSE_KEY' ) ) {
435
+ $key = SOLILOQUY_LICENSE_KEY;
436
+ }
437
+ break;
438
+ case 'envira' :
439
+ $option = get_option( 'envira_gallery' );
440
+ $key = is_array( $option ) && isset( $option['key'] ) ? $option['key'] : '';
441
+ $level = is_array( $option ) && isset( $option['type'] ) ? $option['type'] : '';
442
+
443
+ // Possibly check for a constant.
444
+ if ( empty( $key ) && defined( 'ENVIRA_LICENSE_KEY' ) ) {
445
+ $key = ENVIRA_LICENSE_KEY;
446
+ }
447
+ break;
448
+ case 'om' :
449
+ $option = get_option( 'optin_monster_api' );
450
+ $key = is_array( $option ) && isset( $option['api']['apikey'] ) ? $option['api']['apikey'] : '';
451
+
452
+ // Possibly check for a constant.
453
+ if ( empty( $key ) && defined( 'OPTINMONSTER_REST_API_LICENSE_KEY' ) ) {
454
+ $key = OPTINMONSTER_REST_API_LICENSE_KEY;
455
+ }
456
+
457
+ // If the key is still empty, check for the old legacy key.
458
+ if ( empty( $key ) ) {
459
+ $key = is_array( $option ) && isset( $option['api']['key'] ) ? $option['api']['key'] : '';
460
+ }
461
+ break;
462
+ }
463
+
464
+ // Possibly set the level to 'none' if the key is empty and no level has been set.
465
+ if ( empty( $key ) && empty( $level ) ) {
466
+ $level = 'none';
467
+ }
468
+
469
+ // Normalize the level.
470
+ switch ( $level ) {
471
+ case 'bronze' :
472
+ case 'personal' :
473
+ $level = 'basic';
474
+ break;
475
+ case 'silver' :
476
+ case 'multi' :
477
+ $level = 'plus';
478
+ break;
479
+ case 'gold' :
480
+ case 'developer' :
481
+ $level = 'pro';
482
+ break;
483
+ case 'platinum' :
484
+ case 'master' :
485
+ $level = 'ultimate';
486
+ break;
487
+ }
488
+
489
+ // Return the plan level.
490
+ return $level;
491
+ }
492
+
493
+ /**
494
+ * Dismiss the notification via AJAX.
495
+ *
496
+ * @since 1.0.0
497
+ */
498
+ public function dismiss_notification() {
499
+ $notification_id = intval( $_POST['notification_id'] );
500
+ update_post_meta( $notification_id, 'viewed', 1 );
501
+ die;
502
+ }
503
+
504
+ /**
505
+ * Revokes notifications.
506
+ *
507
+ * @since 1.0.0
508
+ *
509
+ * @param array $ids An array of notification IDs to revoke.
510
+ */
511
+ public function revoke_notifications( $ids ) {
512
+ // Loop through each of the IDs and find the post that has it as meta.
513
+ foreach ( (array) $ids as $id ) {
514
+ $notifications = $this->get_plugin_notifications( -1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) );
515
+ if ( $notifications ) {
516
+ foreach ( $notifications as $notification ) {
517
+ update_post_meta( $notification->ID, 'viewed', 1 );
518
+ }
519
+ }
520
+ }
521
+ }
522
+ }
523
+ }
includes/global/shortcode.php CHANGED
@@ -393,7 +393,7 @@ class Envira_Gallery_Shortcode {
393
  $gallery_theme = $this->get_config( 'columns', $data ) == 0 ? ' envira-' . $this->get_config( 'justified_gallery_theme', $data ) : '';
394
 
395
  // Build the image and allow filtering
396
- // Update: how we build the html depends on the lazy load script
397
 
398
  // Check if user has lazy loading on - if so, we add the css class
399
 
@@ -789,12 +789,11 @@ class Envira_Gallery_Shortcode {
789
 
790
  <?php if ( $this->get_config( 'lazy_loading', $data ) ) { ?>
791
 
792
- /* console.log ('load_images for ' + $id);
793
- // responsivelyLazy.setGalleryClass('#envira-gallery-<?php echo $data['id']; ?>'); */
794
  responsivelyLazy.run('#envira-gallery-'+ $id);
795
 
796
  <?php } else { ?>
797
- console.log ('load_images was pinged, but lazy load turned off');
 
798
  <?php } ?>
799
 
800
  }
@@ -931,7 +930,6 @@ class Envira_Gallery_Shortcode {
931
 
932
  $('#envira-gallery-<?php echo $data["id"]; ?>').on( 'layoutComplete',
933
  function( event, laidOutItems ) {
934
- /* console.log( 'Isotope layout completed on ' + laidOutItems.length + ' items' ); */
935
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
936
  $(window).scroll(function(event){
937
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
@@ -942,7 +940,6 @@ class Envira_Gallery_Shortcode {
942
  $( document ).on( "envira_pagination_ajax_load_completed", function() {
943
  $('#envira-gallery-<?php echo $data["id"]; ?>').on( 'layoutComplete',
944
  function( event, laidOutItems ) {
945
- /* console.log( 'Isotope layout completed on ' + laidOutItems.length + ' items' ); */
946
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
947
  $(window).scroll(function(event){
948
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
@@ -1373,7 +1370,6 @@ class Envira_Gallery_Shortcode {
1373
  if ( $theme !== $data['value'] ) {
1374
  continue;
1375
  }
1376
-
1377
  if ( file_exists( plugin_dir_path( $data['file'] ) . 'themes/' . $theme . '/style.css' ) ) {
1378
  wp_enqueue_style( $this->base->plugin_slug . $theme . '-theme', plugins_url( 'themes/' . $theme . '/style.css', $data['file'] ), array( $this->base->plugin_slug . '-style' ) );
1379
  }
393
  $gallery_theme = $this->get_config( 'columns', $data ) == 0 ? ' envira-' . $this->get_config( 'justified_gallery_theme', $data ) : '';
394
 
395
  // Build the image and allow filtering
396
+ // How we build the html depends on the lazy load script
397
 
398
  // Check if user has lazy loading on - if so, we add the css class
399
 
789
 
790
  <?php if ( $this->get_config( 'lazy_loading', $data ) ) { ?>
791
 
 
 
792
  responsivelyLazy.run('#envira-gallery-'+ $id);
793
 
794
  <?php } else { ?>
795
+ /* to do: enable ENVIRA DEBUG to display this and other errors */
796
+ /* console.log ('load_images was pinged, but lazy load turned off'); */
797
  <?php } ?>
798
 
799
  }
930
 
931
  $('#envira-gallery-<?php echo $data["id"]; ?>').on( 'layoutComplete',
932
  function( event, laidOutItems ) {
 
933
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
934
  $(window).scroll(function(event){
935
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
940
  $( document ).on( "envira_pagination_ajax_load_completed", function() {
941
  $('#envira-gallery-<?php echo $data["id"]; ?>').on( 'layoutComplete',
942
  function( event, laidOutItems ) {
 
943
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
944
  $(window).scroll(function(event){
945
  envira_album_lazy_load_image(<?php echo $data['id']; ?>);
1370
  if ( $theme !== $data['value'] ) {
1371
  continue;
1372
  }
 
1373
  if ( file_exists( plugin_dir_path( $data['file'] ) . 'themes/' . $theme . '/style.css' ) ) {
1374
  wp_enqueue_style( $this->base->plugin_slug . $theme . '-theme', plugins_url( 'themes/' . $theme . '/style.css', $data['file'] ), array( $this->base->plugin_slug . '-style' ) );
1375
  }
readme.txt CHANGED
@@ -1,35 +1,35 @@
1
- === Gallery by Envira - Responsive Photo Gallery for WordPress ===
2
  Contributors: griffinjt, smub
3
  Tags: gallery, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, album, content gallery, fancy gallery, fullscreen gallery, gallery lightbox, gallery plugin, gallery slider, gallery slideshow, gallery widget, grid gallery, masonry gallery, media gallery, mosaic gallery, photo album, polaroid gallery, portfolio gallery, post gallery, thumbnail gallery, video gallery, wordpress gallery, youtube gallery
4
  Requires at least: 4.0
5
- Tested up to: 4.7
6
  Stable tag: trunk
7
  License: GNU General Public License v2.0 or later
8
 
9
- The best WordPress gallery plugin. Drag & Drop photo gallery builder that helps you create beautiful image gallery with just a few clicks.
10
 
11
  == Description ==
12
 
13
- = WordPress Gallery Plugin =
14
 
15
- Here at **Envira Gallery**, we believe that you shouldn't have to hire a developer to create a WordPress gallery. That's why we built <a href="http://enviragallery.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="Envira Gallery">Envira Gallery</a>, a drag & drop **photo gallery plugin** that's both EASY and POWERFUL.
16
 
17
  **Envira Gallery** allows you to create beautiful responsive photo gallery and video gallery for your WordPress site in minutes, not hours!
18
 
19
  At Envira Gallery, user experience is our #1 priority. That's why we put in extra effort to ensure that Envira is the best responsive **photo gallery** for WordPress. This means that your image gallery will always look great on all devices (mobile, tablet, laptop, and desktop).
20
 
21
- Envira Gallery is highly optimized for web and server performance because we understand the importance of speed when it comes to SEO and conversion. We can honestly say that Envira Gallery is the **fastest WordPress gallery plugin** in the market.
22
 
23
  > <strong>Envira Gallery Pro</strong><br />
24
- > This plugin is the lite version of the popular Envira Gallery plugin that comes with all the gallery features you will ever need including albums, tags, social media integration, gallery templates, deeplinking, pagination, ecommerce, image proofing, and tons more. <a href="http://enviragallery.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="Envira Gallery">Click here to purchase the best premium WordPress gallery plugin now!</a>
25
 
26
- **Gallery by Envira** has been downloaded over 500,000 times. Here's why smart photographers, designers, and developers love Envira Gallery, and you will too!
27
 
28
  https://www.youtube.com/watch?v=4jHG3LOmV-c&w=532&rel=0
29
 
30
  = Drag & Drop Photo Gallery Builder =
31
 
32
- We were tired with the bloated and buggy image gallery plugins. That's why we built Envira Gallery to adapt to your workflow and allow you to create responsive WordPress galleries in minutes. By using our easy to use <a href="http://enviragallery.com/features/drag-drop-builder/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">drag and drop builder</a>, you can upload your photos, rearrange them, and basically create an image gallery in 5 minutes or less.
33
 
34
  But don't just take our word. See what one of the WordPress experts are saying:
35
 
@@ -66,10 +66,10 @@ See why one of the leading WordPress developers love Envira:
66
 
67
  = Full Envira Gallery Feature List =
68
 
69
- * Drag & Drop Gallery Builder
70
- * 100% Responsive Gallery - Mobile Friendly
71
- * Beautiful Gallery Templates for Customization
72
- * <a href="http://enviragallery.com/addons/albums-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Albums</a> - Easily organize your galleries, choose cover photos, and more.
73
  * <a href="http://enviragallery.com/addons/social-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Social Sharing</a> - Share your photos on Facebook, Twitter, Pinterest, and Google+
74
  * <a href="http://enviragallery.com/addons/videos-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Video Galleries</a> - Not just for photos! You can add YouTube, Vimeo, Wistia, and other videos in your **video gallery**.
75
  * <a href="http://enviragallery.com/addons/watermarking-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Watermarking</a> - Protect your images from theft with watermarking.
@@ -95,18 +95,18 @@ See why one of the leading WordPress developers love Envira:
95
  * <a href="http://enviragallery.com/addons/nextgen-importer-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">NextGen Importer</a> - Not a fan of NextGen Gallery? Want to switch from NextGen Gallery? You can do that in few simple clicks.
96
  * Want us to add something else? Suggest a feature and we'll get it added!
97
 
98
- After reading this feature list, you can probably imagine why Envira is the best WordPress gallery plugin in the market.
99
 
100
  But don't just take our word. See what one of the expert WordPress consultants and core contributor is saying:
101
 
102
  > When it comes to WordPress gallery plugins, <strong>Envira has no equal</strong>. Solid enough to do the job right, while flexible enough to handle any situation you can throw at it.<br>
103
  > Andrew Norcross - Expert WordPress Consultant
104
 
105
- = WordPress Gallery Demo =
106
 
107
  Envira Gallery is truly the perfect combination of Easy and Powerful.
108
 
109
- While Envira offers tons of features, below are some of the most requested gallery demos.
110
 
111
  * <a href="http://enviragallery.com/demo/lightbox-gallery-demo/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">WordPress Lightbox Gallery Demo</a>
112
  * <a href="http://enviragallery.com/demo/masonry-gallery-demo/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">WordPress Masonry Gallery Demo</a>
@@ -229,6 +229,14 @@ Also, I'm an <a href="https://thomasgriffin.io" rel="me" title="WordPress Develo
229
 
230
  == Changelog ==
231
 
 
 
 
 
 
 
 
 
232
  = 1.6.1.5 =
233
 
234
  * Fix: Minor bug fixes
1
+ === Photo Gallery by Envira - Responsive Image Gallery for WordPress ===
2
  Contributors: griffinjt, smub
3
  Tags: gallery, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, album, content gallery, fancy gallery, fullscreen gallery, gallery lightbox, gallery plugin, gallery slider, gallery slideshow, gallery widget, grid gallery, masonry gallery, media gallery, mosaic gallery, photo album, polaroid gallery, portfolio gallery, post gallery, thumbnail gallery, video gallery, wordpress gallery, youtube gallery
4
  Requires at least: 4.0
5
+ Tested up to: 4.8.1
6
  Stable tag: trunk
7
  License: GNU General Public License v2.0 or later
8
 
9
+ The best WordPress image gallery plugin. Drag & Drop photo gallery builder that helps you create beautiful photo galleries with just a few clicks.
10
 
11
  == Description ==
12
 
13
+ = WordPress Photo Gallery Plugin =
14
 
15
+ Here at **Envira Gallery**, we believe that you shouldn't have to hire a developer to create a WordPress image gallery. That's why we built <a href="http://enviragallery.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="Envira Gallery">Envira Gallery</a>, a drag & drop **photo gallery plugin** that's both EASY and POWERFUL.
16
 
17
  **Envira Gallery** allows you to create beautiful responsive photo gallery and video gallery for your WordPress site in minutes, not hours!
18
 
19
  At Envira Gallery, user experience is our #1 priority. That's why we put in extra effort to ensure that Envira is the best responsive **photo gallery** for WordPress. This means that your image gallery will always look great on all devices (mobile, tablet, laptop, and desktop).
20
 
21
+ Envira Gallery is highly optimized for web and server performance because we understand the importance of speed when it comes to SEO and conversion. We can honestly say that Envira Gallery is the **fastest WordPress photo gallery plugin** in the market.
22
 
23
  > <strong>Envira Gallery Pro</strong><br />
24
+ > Photo Gallery by Envira is the lite version of the popular Envira Gallery plugin that comes with all the photo gallery features you will ever need including albums, tags, social media integration, gallery templates, deeplinking, pagination, ecommerce, image proofing, and tons more. <a href="http://enviragallery.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend" title="Envira Gallery">Click here to purchase the best premium WordPress gallery plugin now!</a>
25
 
26
+ **Photo Gallery by Envira** has been downloaded over 900,000 times. Here's why smart photographers, designers, and developers love Envira Gallery, and you will too!
27
 
28
  https://www.youtube.com/watch?v=4jHG3LOmV-c&w=532&rel=0
29
 
30
  = Drag & Drop Photo Gallery Builder =
31
 
32
+ We were tired with the bloated and buggy image gallery plugins. That's why we built Envira Gallery to adapt to your workflow and allow you to create responsive WordPress photo galleries in minutes. By using our easy to use <a href="http://enviragallery.com/features/drag-drop-builder/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">drag and drop builder</a>, you can upload your photos, rearrange them, and basically create an image gallery in 5 minutes or less.
33
 
34
  But don't just take our word. See what one of the WordPress experts are saying:
35
 
66
 
67
  = Full Envira Gallery Feature List =
68
 
69
+ * Drag & Drop Photo Gallery Builder
70
+ * 100% Responsive Photo Gallery - Mobile Friendly
71
+ * Beautiful Photo Gallery Templates for Customization
72
+ * <a href="http://enviragallery.com/addons/albums-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Albums</a> - Easily organize your photo galleries, choose cover photos, and more.
73
  * <a href="http://enviragallery.com/addons/social-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Social Sharing</a> - Share your photos on Facebook, Twitter, Pinterest, and Google+
74
  * <a href="http://enviragallery.com/addons/videos-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Video Galleries</a> - Not just for photos! You can add YouTube, Vimeo, Wistia, and other videos in your **video gallery**.
75
  * <a href="http://enviragallery.com/addons/watermarking-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">Watermarking</a> - Protect your images from theft with watermarking.
95
  * <a href="http://enviragallery.com/addons/nextgen-importer-addon/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">NextGen Importer</a> - Not a fan of NextGen Gallery? Want to switch from NextGen Gallery? You can do that in few simple clicks.
96
  * Want us to add something else? Suggest a feature and we'll get it added!
97
 
98
+ After reading this feature list, you can probably imagine why Envira is the best WordPress photo gallery plugin in the market.
99
 
100
  But don't just take our word. See what one of the expert WordPress consultants and core contributor is saying:
101
 
102
  > When it comes to WordPress gallery plugins, <strong>Envira has no equal</strong>. Solid enough to do the job right, while flexible enough to handle any situation you can throw at it.<br>
103
  > Andrew Norcross - Expert WordPress Consultant
104
 
105
+ = WordPress Photo Gallery Demo =
106
 
107
  Envira Gallery is truly the perfect combination of Easy and Powerful.
108
 
109
+ While Envira offers tons of features, below are some of the most requested photo gallery demos.
110
 
111
  * <a href="http://enviragallery.com/demo/lightbox-gallery-demo/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">WordPress Lightbox Gallery Demo</a>
112
  * <a href="http://enviragallery.com/demo/masonry-gallery-demo/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion" rel="friend">WordPress Masonry Gallery Demo</a>
229
 
230
  == Changelog ==
231
 
232
+
233
+ = 1.6.1.7 =
234
+
235
+ * Fix: Minor bug fixes
236
+
237
+ = 1.6.1.6 =
238
+
239
+ * Fix: Minor bug fixes
240
  = 1.6.1.5 =
241
 
242
  * Fix: Minor bug fixes