Image Photo Gallery Final Tiles Grid - Version 3.3.22

Version Description

  • [Enhancement] Backend UI tweaks
Download this release

Release Info

Developer GreenTreeLabs
Plugin Icon 128x128 Image Photo Gallery Final Tiles Grid
Version 3.3.22
Comparing to
See all releases

Code changes from version 3.3.19 to 3.3.22

Files changed (2) hide show
  1. FinalTilesGalleryLite.php +147 -2
  2. readme.txt +3 -0
FinalTilesGalleryLite.php CHANGED
@@ -5,15 +5,21 @@
5
  * Plugin URI: https://www.final-tiles-gallery.com
6
  * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
  * Author: Green Tree Labs
8
- * Version: 3.3.19
9
  * Author URI: https://www.greentreelabs.net
10
  *
11
  * @fs_premium_only /lightbox-pro/
12
  *
13
  */
14
- define( 'FTGVERSION', '3.3.19' );
15
  /*
16
  Changelog:
 
 
 
 
 
 
17
  3.3.19
18
  Fixed ignored caption font size
19
  3.3.18
@@ -420,9 +426,148 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
420
  );
421
  add_action( 'wp_ajax_load_chunk', array( $this, 'load_chunk' ) );
422
  add_action( 'wp_ajax_nopriv_load_chunk', array( $this, 'load_chunk' ) );
 
 
 
 
 
 
 
 
 
 
 
 
423
  $this->resetFields();
424
  }
425
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  private function resetFields()
427
  {
428
  $keys = array(
5
  * Plugin URI: https://www.final-tiles-gallery.com
6
  * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
  * Author: Green Tree Labs
8
+ * Version: 3.3.22
9
  * Author URI: https://www.greentreelabs.net
10
  *
11
  * @fs_premium_only /lightbox-pro/
12
  *
13
  */
14
+ define( 'FTGVERSION', '3.3.22' );
15
  /*
16
  Changelog:
17
+ 3.3.22
18
+ Added "ask for review" functionality
19
+ 3.3.21
20
+ Fixed disabled hover rotation field
21
+ 3.3.20
22
+ Fixed disabled caption behaviour field
23
  3.3.19
24
  Fixed ignored caption font size
25
  3.3.18
426
  );
427
  add_action( 'wp_ajax_load_chunk', array( $this, 'load_chunk' ) );
428
  add_action( 'wp_ajax_nopriv_load_chunk', array( $this, 'load_chunk' ) );
429
+
430
+ if ( ftg_fs()->is_not_paying() ) {
431
+ add_action( 'admin_notices', array( $this, 'review' ) );
432
+ add_action( 'wp_ajax_ftg_dismiss_review', array( $this, 'dismiss_review' ) );
433
+ add_filter(
434
+ 'admin_footer_text',
435
+ array( $this, 'admin_footer' ),
436
+ 1,
437
+ 2
438
+ );
439
+ }
440
+
441
  $this->resetFields();
442
  }
443
 
444
+ public function review()
445
+ {
446
+ // Verify that we can do a check for reviews.
447
+ $review = get_option( 'ftg_review' );
448
+ $time = time();
449
+ $load = false;
450
+ $there_was_review = false;
451
+
452
+ if ( !$review ) {
453
+ $review = array(
454
+ 'time' => $time,
455
+ 'dismissed' => false,
456
+ );
457
+ $load = true;
458
+ $there_was_review = false;
459
+ } else {
460
+ // Check if it has been dismissed or not.
461
+ if ( isset( $review['dismissed'] ) && !$review['dismissed'] && (isset( $review['time'] ) && $review['time'] + DAY_IN_SECONDS <= $time) ) {
462
+ $load = true;
463
+ }
464
+ }
465
+
466
+ // If we cannot load, return early.
467
+ if ( !$load ) {
468
+ return;
469
+ }
470
+ // Update the review option now.
471
+ update_option( 'ftg_review', $review );
472
+ // Run through optins on the site to see if any have been loaded for more than a week.
473
+ $valid = false;
474
+ $galleries = $this->FinalTilesdb->getGalleries();
475
+ if ( !$galleries ) {
476
+ return;
477
+ }
478
+ $with_date = false;
479
+ foreach ( $galleries as $gallery ) {
480
+ if ( !isset( $gallery->date ) ) {
481
+ continue;
482
+ }
483
+ $with_date = true;
484
+ $data = $gallery->date;
485
+ // Check the creation date of the local optin. It must be at least one week after.
486
+ $created = ( isset( $data ) ? strtotime( $data ) + 7 * DAY_IN_SECONDS : false );
487
+ if ( !$created ) {
488
+ continue;
489
+ }
490
+
491
+ if ( $created <= $time ) {
492
+ $valid = true;
493
+ break;
494
+ }
495
+
496
+ }
497
+ if ( !$with_date && count( $galleries ) > 0 && !$there_was_review ) {
498
+ $valid = true;
499
+ }
500
+ // If we don't have a valid optin yet, return.
501
+ if ( !$valid ) {
502
+ return;
503
+ }
504
+ ?>
505
+ <div class="notice notice-info is-dismissible ftg-review-notice">
506
+ <p><?php
507
+ _e( 'Hey, I noticed you created a photo gallery with Final Tiles - that’s awesome! Would you mind give it a 5-star rating on WordPress to help us spread the word and boost our motivation for new featrues?', 'final-tiles-gallery-lite' );
508
+ ?>
509
+ </p>
510
+ <p><strong><?php
511
+ _e( 'Diego Imbriani<br>Founder of GreenTreeLabs', 'final-tiles-gallery' );
512
+ ?>
513
+ </strong></p>
514
+ <p>
515
+ <a href="https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/?filter=5#new-post" class="ftg-dismiss-review-notice ftg-review-out" target="_blank" rel="noopener"><?php
516
+ _e( 'Ok, you deserve it', 'final-tiles-gallery-lite' );
517
+ ?>
518
+ </a><br>
519
+ <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
520
+ _e( 'Nope, maybe later', 'final-tiles-gallery' );
521
+ ?>
522
+ </a><br>
523
+ <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
524
+ _e( 'I already did', 'final-tiles-gallery' );
525
+ ?>
526
+ </a><br>
527
+ </p>
528
+ </div>
529
+ <script type="text/javascript">
530
+ jQuery(document).ready( function($) {
531
+ $(document).on('click', '.ftg-dismiss-review-notice, .ftg-review-notice button', function( event ) {
532
+ if ( ! $(this).hasClass('ftg-review-out') ) {
533
+ event.preventDefault();
534
+ }
535
+
536
+ $.post( ajaxurl, {
537
+ action: 'ftg_dismiss_review'
538
+ });
539
+
540
+ $('.ftg-review-notice').remove();
541
+ });
542
+ });
543
+ </script>
544
+ <?php
545
+ }
546
+
547
+ public function dismiss_review()
548
+ {
549
+ $review = get_option( 'ftg_review' );
550
+ if ( !$review ) {
551
+ $review = array();
552
+ }
553
+ $review['time'] = time();
554
+ $review['dismissed'] = true;
555
+ update_option( 'ftg_review', $review );
556
+ die;
557
+ }
558
+
559
+ public function admin_footer( $text )
560
+ {
561
+ global $current_screen ;
562
+
563
+ if ( !empty($current_screen->id) && strpos( $current_screen->id, 'ftg' ) !== false ) {
564
+ $url = 'https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/?filter=5#new-post';
565
+ $text = sprintf( __( 'Please rate <strong>Final Tiles Gallery</strong> <a href="%s" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href="%s" target="_blank">WordPress.org</a> to help us spread the word. Thank you from the Final Tiles Gallery team!', 'wpforms' ), $url, $url );
566
+ }
567
+
568
+ return $text;
569
+ }
570
+
571
  private function resetFields()
572
  {
573
  $keys = array(
readme.txt CHANGED
@@ -135,6 +135,9 @@ Currently galleries made with Envira, FooGallery, Instagram, NextGen, JetPack, M
135
 
136
  == Changelog ==
137
 
 
 
 
138
  = 3.3.19 =
139
  * [Fix] Fixed ignored caption font size
140
 
135
 
136
  == Changelog ==
137
 
138
+ = 3.3.22 =
139
+ * [Enhancement] Backend UI tweaks
140
+
141
  = 3.3.19 =
142
  * [Fix] Fixed ignored caption font size
143