Image Photo Gallery Final Tiles Grid - Version 3.3.57

Version Description

  • [Fix] Security fix
Download this release

Release Info

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

Code changes from version 3.3.46 to 3.3.57

Files changed (39) hide show
  1. FinalTilesGalleryLite.php +46 -27
  2. admin/scripts/final-tiles-gallery-admin.js +1 -1
  3. freemius/assets/css/admin/common.css +2 -2
  4. freemius/assets/css/admin/dialog-boxes.css +2 -2
  5. freemius/assets/scss/_colors.scss +11 -0
  6. freemius/assets/scss/admin/common.scss +5 -3
  7. freemius/assets/scss/admin/dialog-boxes.scss +3 -1
  8. freemius/includes/class-freemius.php +1305 -333
  9. freemius/includes/class-fs-api.php +14 -4
  10. freemius/includes/class-fs-plugin-updater.php +493 -68
  11. freemius/includes/class-fs-storage.php +2 -2
  12. freemius/includes/customizer/class-fs-customizer-upsell-control.php +1 -1
  13. freemius/includes/entities/class-fs-plugin.php +22 -0
  14. freemius/includes/entities/class-fs-site.php +6 -1
  15. freemius/includes/fs-core-functions.php +115 -91
  16. freemius/includes/fs-essential-functions.php +4 -2
  17. freemius/includes/fs-plugin-info-dialog.php +44 -11
  18. freemius/includes/i18n.php +3 -3
  19. freemius/includes/managers/class-fs-admin-menu-manager.php +17 -5
  20. freemius/includes/managers/class-fs-admin-notice-manager.php +74 -0
  21. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +2 -6
  22. freemius/languages/freemius-da_DK.mo +0 -0
  23. freemius/languages/freemius-da_DK.po +2431 -9
  24. freemius/languages/freemius-en.mo +0 -0
  25. freemius/languages/freemius-en.po +544 -429
  26. freemius/languages/freemius-es_ES.mo +0 -0
  27. freemius/languages/freemius-es_ES.po +620 -486
  28. freemius/languages/freemius-fr_FR.mo +0 -0
  29. freemius/languages/freemius-fr_FR.po +618 -484
  30. freemius/languages/freemius-he_IL.mo +0 -0
  31. freemius/languages/freemius-he_IL.po +616 -482
  32. freemius/languages/freemius-it_IT.mo +0 -0
  33. freemius/languages/freemius-it_IT.po +618 -483
  34. freemius/languages/freemius-ja_JP.mo +0 -0
  35. freemius/languages/freemius-ja_JP.po +619 -485
  36. freemius/languages/freemius-nl_NL.mo +0 -0
  37. freemius/languages/freemius-nl_NL.po +643 -508
  38. freemius/languages/freemius-ru_RU.mo +0 -0
  39. freemius/languages/freemius-ru_RU.po +399 -324
FinalTilesGalleryLite.php CHANGED
@@ -2,18 +2,36 @@
2
 
3
  /**
4
  * Plugin Name: Final Tiles Grid Gallery - Image Gallery
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.46
9
  * Author URI: https://www.greentreelabs.net
10
- *
11
- * @fs_premium_only /lightbox-pro/
12
  *
13
  */
14
- define( "FTGVERSION", "3.3.46" );
15
  /*
16
  Changelog:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  3.3.46
18
  Better compatibility with external lazy loading scripts
19
  3.3.45
@@ -325,6 +343,28 @@ if ( !function_exists( "ftg_fs" ) ) {
325
  return $ftg_fs;
326
  }
327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  // Init Freemius.
329
  ftg_fs();
330
  // Signal that SDK was initiated.
@@ -1610,6 +1650,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1610
  break;
1611
  case "image-lightbox":
1612
  wp_enqueue_script( 'image-lightbox_script' );
 
1613
  case "lightgallery":
1614
  wp_enqueue_style( 'lightgallery_stylesheet' );
1615
  wp_enqueue_script( 'lightgallery_script' );
@@ -1750,26 +1791,4 @@ if ( !function_exists( "ftg_admin_script" ) ) {
1750
  add_action( 'admin_enqueue_scripts', 'ftg_admin_script' );
1751
  }
1752
 
1753
- function activate_finaltilesgallery()
1754
- {
1755
- global $wpdb ;
1756
- include_once 'lib/install-db.php';
1757
- FinalTiles_Gallery::define_db_tables();
1758
- if ( !$installed_ver ) {
1759
- update_option( "FinalTiles_gallery_db_version", $ftg_db_version );
1760
- }
1761
- FinalTilesdb::updateConfiguration();
1762
-
1763
- if ( is_multisite() ) {
1764
- foreach ( $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ) as $blog_id ) {
1765
- switch_to_blog( $blog_id );
1766
- install_db();
1767
- restore_current_blog();
1768
- }
1769
- } else {
1770
- install_db();
1771
- }
1772
-
1773
- }
1774
-
1775
  register_activation_hook( __FILE__, 'activate_finaltilesgallery' );
2
 
3
  /**
4
  * Plugin Name: Final Tiles Grid Gallery - Image Gallery
5
+ * Plugin URI: https://www.final-tiles-gallery.com/wordpress
6
  * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
  * Author: Green Tree Labs
8
+ * Version: 3.3.57
9
  * Author URI: https://www.greentreelabs.net
10
+ *
 
11
  *
12
  */
13
+ define( "FTGVERSION", "3.3.57" );
14
  /*
15
  Changelog:
16
+ 3.3.57
17
+ Security fix
18
+ 3.3.56
19
+ Enhancement: SwipeBox shows captions on mobile
20
+ 3.3.55
21
+ Fix: fixed Safari loosing filters when editing a gallery
22
+ 3.3.54
23
+ Fix: fixed pre-selected filter "All" loosing "selected" class
24
+ Fix: fixed clickable hidden images
25
+ 3.3.53
26
+ Restored filters on premium versions
27
+ 3.3.52
28
+ Fixed database installation
29
+ 3.3.49
30
+ Fixed multisite activation
31
+ 3.3.48
32
+ Fixed mobile lightbox options
33
+ 3.3.47
34
+ Fixed issue when activating the premium version
35
  3.3.46
36
  Better compatibility with external lazy loading scripts
37
  3.3.45
343
  return $ftg_fs;
344
  }
345
 
346
+ function activate_finaltilesgallery()
347
+ {
348
+ global $wpdb ;
349
+ include_once 'lib/install-db.php';
350
+ FinalTiles_Gallery::define_db_tables();
351
+ if ( !$installed_ver ) {
352
+ update_option( "FinalTiles_gallery_db_version", $ftg_db_version );
353
+ }
354
+ FinalTilesdb::updateConfiguration();
355
+
356
+ if ( is_multisite() ) {
357
+ foreach ( $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ) as $blog_id ) {
358
+ switch_to_blog( $blog_id );
359
+ install_db();
360
+ restore_current_blog();
361
+ }
362
+ } else {
363
+ install_db();
364
+ }
365
+
366
+ }
367
+
368
  // Init Freemius.
369
  ftg_fs();
370
  // Signal that SDK was initiated.
1650
  break;
1651
  case "image-lightbox":
1652
  wp_enqueue_script( 'image-lightbox_script' );
1653
+ break;
1654
  case "lightgallery":
1655
  wp_enqueue_style( 'lightgallery_stylesheet' );
1656
  wp_enqueue_script( 'lightgallery_script' );
1791
  add_action( 'admin_enqueue_scripts', 'ftg_admin_script' );
1792
  }
1793
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1794
  register_activation_hook( __FILE__, 'activate_finaltilesgallery' );
admin/scripts/final-tiles-gallery-admin.js CHANGED
@@ -163,7 +163,7 @@ var FTG = function($) {
163
  },
164
  init_gallery: function() {
165
 
166
- var source = $('[name=ftg_source').val();
167
 
168
 
169
  /* Premium Code Stripped by Freemius */
163
  },
164
  init_gallery: function() {
165
 
166
+ var source = $('[name="ftg_source"]').val();
167
 
168
 
169
  /* Premium Code Stripped by Freemius */
freemius/assets/css/admin/common.css CHANGED
@@ -1,2 +1,2 @@
1
- .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
- .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
1
+ .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#fs_frame{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
+ .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px}
freemius/assets/css/admin/dialog-boxes.css CHANGED
@@ -1,2 +1,2 @@
1
- .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}#license_options_container table,#license_options_container table select,#license_options_container table #available_license_key{width:100%}#license_options_container table td:first-child{width:1%}#license_options_container table #other_license_key_container label{position:relative;top:6px;float:left;margin-right:5px}#license_options_container table #other_license_key_container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}#license_options_container table #other_license_key_container div input{margin:0}#sites_list_container td{cursor:pointer}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
- .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:bold;padding:0 25px;margin-bottom:0}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;top:5px;position:relative}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}#license_options_container table,#license_options_container table select,#license_options_container table #available_license_key{width:100%}#license_options_container table td:first-child{width:1%}#license_options_container table #other_license_key_container label{position:relative;top:6px;float:left;margin-right:5px}#license_options_container table #other_license_key_container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}#license_options_container table #other_license_key_container div input{margin:0}#sites_list_container td{cursor:pointer}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
+ .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}.button-primary.warn{box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c;background:#f56a48;border-color:#ec6544 #d2593c #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{color:#f5b3a1 !important;background:#e76444 !important;border-color:#d85e40 !important;text-shadow:0 -1px 0 rgba(0,0,0,0.1) !important}
freemius/assets/scss/_colors.scss CHANGED
@@ -44,6 +44,17 @@ $button-secondary-bkg: #333;
44
  $button-secondary-color: $fms-white;
45
  $featured-color: #6bc406;
46
  $wp-selected-color: #0074a3;
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  $wordpress_color: #01749A;
49
  $blogger_color: #ff8100;
44
  $button-secondary-color: $fms-white;
45
  $featured-color: #6bc406;
46
  $wp-selected-color: #0074a3;
47
+ $wp-button-alert-border-color: #d2593c;
48
+ $wp-button-alert-border-top-color: #ec6544;
49
+ $wp-button-alert-shadow-color: #d2593c;
50
+ $wp-button-alert-focused-shadow1-color: #dd6041;
51
+ $wp-button-alert-focused-shadow2-color: #e4a796;
52
+ $wp-button-alert-background-color: #f56a48;
53
+ $wp-button-alert-hovered-background-color: #fd6d4a;
54
+ $wp-button-alert-active-background-color: #dd6041;
55
+ $wp-button-alert-disabled-color: #f5b3a1;
56
+ $wp-button-alert-disabled-background-color: #e76444;
57
+ $wp-button-alert-disabled-border-color: #d85e40;
58
 
59
  $wordpress_color: #01749A;
60
  $blogger_color: #ff8100;
freemius/assets/scss/admin/common.scss CHANGED
@@ -1,7 +1,7 @@
1
  @import "../start";
2
  @import "themes";
3
 
4
- #iframe
5
  {
6
  line-height: 0;
7
  font-size: 0;
@@ -207,7 +207,7 @@ span.fs-submenu-item.fs-sub:before
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
- background: url('../../../../../../../wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
@@ -215,4 +215,6 @@ span.fs-submenu-item.fs-sub:before
215
  h2 {
216
  text-align: left;
217
  }
218
- }
 
 
1
  @import "../start";
2
  @import "themes";
3
 
4
+ #fs_frame
5
  {
6
  line-height: 0;
7
  font-size: 0;
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
+ background: url('/wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
215
  h2 {
216
  text-align: left;
217
  }
218
+ }
219
+
220
+ @import "plugin-upgrade-notice";
freemius/assets/scss/admin/dialog-boxes.scss CHANGED
@@ -1,8 +1,10 @@
1
  @import "../start";
2
  @import "modal-common";
3
  @import "deactivation-feedback";
 
4
  @import "license-activation";
5
  @import "multisite-options";
6
  @import "license-key-resend";
7
  @import "ajax-loader";
8
- @import "auto-install";
 
1
  @import "../start";
2
  @import "modal-common";
3
  @import "deactivation-feedback";
4
+ @import "subscription-cancellation";
5
  @import "license-activation";
6
  @import "multisite-options";
7
  @import "license-key-resend";
8
  @import "ajax-loader";
9
+ @import "auto-install";
10
+ @import "buttons";
freemius/includes/class-freemius.php CHANGED
@@ -33,6 +33,12 @@
33
  * @var string
34
  */
35
  private $_plugin_basename;
 
 
 
 
 
 
36
  /**
37
  * @since 1.0.0
38
  *
@@ -671,11 +677,12 @@
671
  version_compare( $sdk_version, '1.2.3', '>=' )
672
  ) {
673
  /**
674
- * Starting from version 1.2.3, paths are stored as relative paths and not absolute paths; so when upgrading to 1.2.3, make paths relative.
 
675
  *
676
  * @author Leo Fajardo (@leorw)
677
  */
678
- $this->make_paths_relative();
679
  }
680
 
681
  if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
@@ -699,6 +706,25 @@
699
 
700
  }
701
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  }
703
 
704
  /**
@@ -824,30 +850,12 @@
824
  }
825
 
826
  /**
827
- * Makes paths relative.
828
  *
829
  * @author Leo Fajardo (@leorw)
830
  * @since 1.2.3
831
  */
832
- private function make_paths_relative() {
833
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
834
-
835
- if ( isset( $id_slug_type_path_map[ $this->_module_id ]['path'] ) ) {
836
- $id_slug_type_path_map[ $this->_module_id ]['path'] = $this->get_relative_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
837
-
838
- self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
839
- }
840
-
841
- if ( isset( $this->_storage->plugin_main_file ) ) {
842
- $plugin_main_file = $this->_storage->plugin_main_file;
843
-
844
- if ( isset( $plugin_main_file->path ) ) {
845
- $this->_storage->plugin_main_file->path = $this->get_relative_path( $this->_storage->plugin_main_file->path );
846
- } else if ( isset( $plugin_main_file->prev_path ) ) {
847
- $this->_storage->plugin_main_file->prev_path = $this->get_relative_path( $this->_storage->plugin_main_file->prev_path );
848
- }
849
- }
850
-
851
  // Remove invalid path that is still associated with the current slug if there's any.
852
  $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
853
  foreach ( $file_slug_map as $plugin_basename => $slug ) {
@@ -1230,6 +1238,22 @@
1230
  <?php
1231
  }
1232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
  /**
1234
  * @author Vova Feldman (@svovaf)
1235
  * @since 1.0.9
@@ -1241,6 +1265,26 @@
1241
  add_action( 'plugins_loaded', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
1242
 
1243
  if ( $this->is_plugin() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
1245
 
1246
  /**
@@ -1348,7 +1392,10 @@
1348
  add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1349
  }
1350
 
1351
- if ( $this->is_theme() && self::is_customizer() ) {
 
 
 
1352
  // Register customizer upsell.
1353
  add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1354
  }
@@ -1405,6 +1452,84 @@
1405
  }
1406
  }
1407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1408
  /**
1409
  * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
1410
  * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
@@ -1425,23 +1550,37 @@
1425
 
1426
  /**
1427
  * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
 
 
1428
  */
1429
- private function clear_module_main_file_cache() {
1430
  if ( ! isset( $this->_storage->plugin_main_file ) ||
1431
- empty( $this->_storage->plugin_main_file->path )
1432
  ) {
1433
  return;
1434
  }
1435
 
1436
- $plugin_main_file = clone $this->_storage->plugin_main_file;
 
 
 
 
 
 
 
 
 
 
 
1437
 
1438
- // Store cached path (2nd layer cache).
1439
- $plugin_main_file->prev_path = $plugin_main_file->path;
1440
 
1441
- // Clear cached path.
1442
- unset( $plugin_main_file->path );
1443
 
1444
- $this->_storage->plugin_main_file = $plugin_main_file;
 
1445
 
1446
  /**
1447
  * Clear global cached path.
@@ -1488,12 +1627,10 @@
1488
  array( &$this, '_submit_uninstall_reason_action' )
1489
  );
1490
 
1491
- if ( $this->is_theme() && $this->is_premium() && ! $this->has_active_valid_license() ) {
1492
- $this->add_ajax_action(
1493
- 'delete_theme_update_data',
1494
- array( &$this, '_delete_theme_update_data_action' )
1495
- );
1496
- }
1497
 
1498
  if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
1499
  if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
@@ -1619,7 +1756,7 @@
1619
 
1620
  return fs_normalize_path( trailingslashit( $is_plugin ?
1621
  WP_PLUGIN_DIR :
1622
- get_theme_root() ) );
1623
  }
1624
 
1625
  /**
@@ -1684,11 +1821,11 @@
1684
  private function get_caller_main_file_and_type() {
1685
  self::require_plugin_essentials();
1686
 
1687
- $all_plugins = get_plugins();
1688
  $all_plugins_paths = array();
1689
 
1690
  // Get active plugin's main files real full names (might be symlinks).
1691
- foreach ( $all_plugins as $relative_path => &$data ) {
1692
  if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
1693
  /**
1694
  * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
@@ -1706,7 +1843,7 @@
1706
  $caller_file_candidate = false;
1707
  $caller_map = array();
1708
  $module_type = WP_FS__MODULE_TYPE_PLUGIN;
1709
- $themes_dir = fs_normalize_path( get_theme_root() );
1710
 
1711
  for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
1712
  if ( empty( $bt[ $i ]['file'] ) ) {
@@ -1726,7 +1863,10 @@
1726
  'requir' . 'e_once',
1727
  'requir' . 'e',
1728
  'includ' . 'e_once',
1729
- 'includ' . 'e'
 
 
 
1730
  ) )
1731
  ) {
1732
  // Ignore call stack hooks and files inclusion.
@@ -2062,6 +2202,51 @@
2062
  exit;
2063
  }
2064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2065
  /**
2066
  * @author Leo Fajardo (@leorw)
2067
  * @since 2.0.2
@@ -2138,16 +2323,18 @@
2138
  * @since 1.2.2
2139
  *
2140
  * @param string|number $id_or_slug
 
2141
  *
2142
  * @return number|false
2143
  */
2144
- private static function get_module_id( $id_or_slug ) {
2145
  if ( is_numeric( $id_or_slug ) ) {
2146
  return $id_or_slug;
2147
  }
2148
 
2149
  foreach ( self::$_instances as $instance ) {
2150
- if ( $instance->is_plugin() && ( $id_or_slug === $instance->get_slug() ) ) {
 
2151
  return $instance->get_id();
2152
  }
2153
  }
@@ -2174,15 +2361,16 @@
2174
  * @author Vova Feldman (@svovaf)
2175
  * @since 1.0.1
2176
  *
2177
- * @param $plugin_file
 
2178
  *
2179
  * @return false|Freemius
2180
  */
2181
- static function get_instance_by_file( $plugin_file ) {
2182
  $slug = self::find_slug_by_basename( $plugin_file );
2183
 
2184
  return ( false !== $slug ) ?
2185
- self::instance( self::get_module_id( $slug ) ) :
2186
  false;
2187
  }
2188
 
@@ -2296,10 +2484,13 @@
2296
  function is_site_activation_mode( $and_on = true ) {
2297
  return (
2298
  ( $this->is_on() || ! $and_on ) &&
2299
- ( ! $this->is_registered() ||
2300
- ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
2301
- ( ! $this->is_enable_anonymous() ||
2302
- ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
 
 
 
2303
  );
2304
  }
2305
 
@@ -2334,7 +2525,7 @@
2334
  return false;
2335
  }
2336
 
2337
- if ( $this->is_network_anonymous() ) {
2338
  // Super-admin skipped the connection network wide -> not activation mode.
2339
  return false;
2340
  }
@@ -2455,7 +2646,7 @@
2455
  self::require_plugin_essentials();
2456
 
2457
  $active_plugin = array();
2458
- $all_plugins = get_plugins();
2459
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2460
 
2461
  foreach ( $active_plugins_basenames as $plugin_basename ) {
@@ -2481,6 +2672,11 @@
2481
  get_option( 'active_plugins' );
2482
 
2483
  $active = array();
 
 
 
 
 
2484
  foreach ( $active_basenames as $basename ) {
2485
  $active[ $basename ] = array(
2486
  'is_active' => true,
@@ -2505,7 +2701,7 @@
2505
  private static function get_all_plugins( $blog_id = 0 ) {
2506
  self::require_plugin_essentials();
2507
 
2508
- $all_plugins = get_plugins();
2509
 
2510
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2511
 
@@ -2537,7 +2733,7 @@
2537
  private static function get_network_plugins() {
2538
  self::require_plugin_essentials();
2539
 
2540
- $all_plugins = get_plugins();
2541
 
2542
  $network_active_basenames = is_multisite() ?
2543
  get_site_option( 'active_sitewide_plugins' ) :
@@ -2634,26 +2830,28 @@
2634
  self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
2635
 
2636
  if ( is_multisite() ) {
 
 
 
 
 
 
 
2637
  /**
2638
- * If the id_slug_type_path_map exists on the site level but doesn't exist on the
2639
  * network level storage, it means that we need to process the storage with migration.
2640
  *
2641
- * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, id_slug_type_path_map will be already set in the network level storage.
2642
  *
2643
  * @author Vova Feldman (@svovaf)
2644
  * @since 2.0.0
2645
  */
2646
- if ( null === self::$_accounts->get_option( 'id_slug_type_path_map', null, true ) &&
2647
- null !== self::$_accounts->get_option( 'id_slug_type_path_map', null, false )
 
 
2648
  ) {
2649
- self::migrate_accounts_to_network();
2650
-
2651
- // Migrate API options from site level to network level.
2652
- $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
2653
- $api_network_options->migrate_to_network();
2654
-
2655
- // Migrate API cache to network level storage.
2656
- FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
2657
  }
2658
  }
2659
 
@@ -2679,10 +2877,30 @@
2679
  }
2680
 
2681
  add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
 
 
2682
 
2683
  self::$_statics_loaded = true;
2684
  }
2685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
  #----------------------------------------------------------------------------------
2687
  #region Localization
2688
  #----------------------------------------------------------------------------------
@@ -2759,6 +2977,10 @@
2759
  * @since 1.1.7.3
2760
  */
2761
  static function _toggle_debug_mode() {
 
 
 
 
2762
  $is_on = fs_request_get( 'is_on', false, 'post' );
2763
 
2764
  if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
@@ -2790,8 +3012,16 @@
2790
  * @since 1.2.1.7
2791
  */
2792
  static function _get_db_option() {
 
 
2793
  $option_name = fs_request_get( 'option_name' );
2794
 
 
 
 
 
 
 
2795
  $value = get_option( $option_name );
2796
 
2797
  $result = array(
@@ -2814,7 +3044,16 @@
2814
  * @since 1.2.1.7
2815
  */
2816
  static function _set_db_option() {
2817
- $option_name = fs_request_get( 'option_name' );
 
 
 
 
 
 
 
 
 
2818
  $option_value = fs_request_get( 'option_value' );
2819
 
2820
  if ( ! empty( $option_value ) ) {
@@ -2909,6 +3148,10 @@
2909
  }
2910
 
2911
  fs_redirect( $download_url );
 
 
 
 
2912
  }
2913
  }
2914
 
@@ -3961,6 +4204,13 @@
3961
 
3962
  $this->parse_settings( $plugin_info );
3963
 
 
 
 
 
 
 
 
3964
  if ( ! self::is_ajax() ) {
3965
  if ( ! $this->is_addon() || $this->is_only_premium() ) {
3966
  add_action(
@@ -4041,14 +4291,16 @@
4041
  * @author Vova Feldman (@svovaf)
4042
  */
4043
  if ( $this->is_user_in_admin() &&
4044
- ! $this->is_addon() &&
4045
- $this->has_addons() &&
4046
- 'plugin-information' === fs_request_get( 'tab', false ) &&
4047
- $this->get_id() == fs_request_get( 'parent_plugin_id', false )
 
 
4048
  ) {
4049
  require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
4050
 
4051
- new FS_Plugin_Info_Dialog( $this );
4052
  }
4053
 
4054
  // Check if Freemius is on for the current plugin.
@@ -4162,7 +4414,21 @@
4162
  * @author Vova Feldman
4163
  * @since 1.2.1.6
4164
  */
4165
- if ( $this->is_premium() && $this->has_release_on_freemius() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4166
  FS_Plugin_Updater::instance( $this );
4167
  }
4168
 
@@ -4205,6 +4471,26 @@
4205
  }
4206
  }
4207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4208
  /**
4209
  * @author Leo Fajardo (@leorw)
4210
  *
@@ -4641,16 +4927,20 @@
4641
  $this->_plugin :
4642
  new FS_Plugin();
4643
 
 
 
4644
  $plugin->update( array(
4645
  'id' => $id,
4646
  'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
4647
  'public_key' => $public_key,
4648
  'slug' => $this->_slug,
 
4649
  'parent_plugin_id' => $parent_id,
4650
  'version' => $this->get_plugin_version(),
4651
- 'title' => $this->get_plugin_name(),
4652
  'file' => $this->_plugin_basename,
4653
  'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
 
4654
  'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
4655
  'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
4656
  ) );
@@ -5031,7 +5321,7 @@
5031
  }
5032
 
5033
  $addon = $this->get_addon( $addon_id );
5034
- $premium_basename = "{$addon->slug}-premium/{$addon->slug}.php";
5035
 
5036
  if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
5037
  return $premium_basename;
@@ -5039,9 +5329,9 @@
5039
 
5040
  $all_plugins = $this->get_all_plugins();
5041
 
5042
- foreach ( $all_plugins as $basename => &$data ) {
5043
  if ( $addon->slug === $data['slug'] ||
5044
- $addon->slug . '-premium' === $data['slug']
5045
  ) {
5046
  return $basename;
5047
  }
@@ -5281,7 +5571,7 @@
5281
  if ( ! isset( $this->_is_anonymous ) ) {
5282
  if ( $this->is_network_anonymous() ) {
5283
  $this->_is_anonymous = true;
5284
- } else {
5285
  if ( ! isset( $this->_storage->is_anonymous ) ) {
5286
  // Not skipped.
5287
  $this->_is_anonymous = false;
@@ -5472,6 +5762,20 @@
5472
  $this->_storage->store( "{$name}_timestamp", time() );
5473
  }
5474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5475
  /**
5476
  * Check if cron was executed in the last $period of seconds.
5477
  *
@@ -5486,7 +5790,7 @@
5486
  private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
5487
  $this->_logger->entrance( $name );
5488
 
5489
- $last_execution = $this->set_cron_execution_timestamp( $name );
5490
 
5491
  if ( ! is_numeric( $last_execution ) ) {
5492
  return false;
@@ -5747,12 +6051,14 @@
5747
  }
5748
  }
5749
 
 
 
5750
  foreach ( $users_2_blog_ids as $user_id => $blog_ids ) {
5751
  if ( 0 < $blog_ids[0] ) {
5752
  $this->switch_to_blog( $blog_ids[0] );
5753
  }
5754
 
5755
- call_user_func_array( $callable, array( $blog_ids ) );
5756
 
5757
  foreach ( $blog_ids as $blog_id ) {
5758
  $this->do_action( "after_{$name}_cron", $blog_id );
@@ -5760,6 +6066,8 @@
5760
  }
5761
 
5762
  if ( is_multisite() ) {
 
 
5763
  $this->do_action( "after_{$name}_cron_multisite" );
5764
  }
5765
  }
@@ -5831,13 +6139,16 @@
5831
  * @author Vova Feldman (@svovaf)
5832
  * @since 2.0.0
5833
  *
5834
- * @param int[] $blog_ids
 
 
 
5835
  */
5836
- function _sync_cron_method( array $blog_ids ) {
5837
  if ( $this->is_registered() ) {
5838
  if ( $this->has_paid_plan() ) {
5839
  // Initiate background plan sync.
5840
- $this->_sync_license( true );
5841
 
5842
  if ( $this->is_paying() ) {
5843
  // Check for premium plugin updates.
@@ -5984,7 +6295,7 @@
5984
  * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
5985
  */
5986
  private function schedule_install_sync( $except_blog_id = 0 ) {
5987
- $this->schedule_cron( 'install_sync', 'install_sync', 'single', 0, false, $except_blog_id );
5988
  }
5989
 
5990
  /**
@@ -6052,9 +6363,10 @@
6052
  * @author Vova Feldman (@svovaf)
6053
  * @since 2.0.0
6054
  *
6055
- * @param int[] $blog_ids
 
6056
  */
6057
- function _sync_install_cron_method( array $blog_ids ) {
6058
  if ( $this->is_registered() ) {
6059
  if ( 1 < count( $blog_ids ) ) {
6060
  $this->sync_installs( array(), true );
@@ -6158,6 +6470,7 @@
6158
  if ( ! $this->is_addon() &&
6159
  ! ( ! $this->_is_network_active && fs_is_network_admin() ) &&
6160
  (
 
6161
  // Not registered nor anonymous.
6162
  ( ! $this->is_registered() && ! $this->is_anonymous() ) ||
6163
  // OR, network level and in network upgrade mode.
@@ -6174,14 +6487,18 @@
6174
  * @since 1.2.2
6175
  */
6176
  if ( $this->is_theme()
6177
- && $this->is_only_premium()
6178
  && ! $this->has_settings_menu()
6179
  && ! isset( $_REQUEST['fs_action'] )
6180
  && $this->can_activate_previous_theme()
6181
  ) {
6182
- $this->activate_previous_theme();
 
 
 
6183
 
6184
- return;
 
 
6185
  }
6186
 
6187
  if ( ! fs_is_network_admin() &&
@@ -6192,19 +6509,21 @@
6192
  }
6193
 
6194
  if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
6195
- // Show notice for new plugin installations.
6196
- $this->_admin_notices->add(
6197
- sprintf(
6198
- $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
6199
- sprintf( '<b><a href="%s">%s</a></b>',
6200
- $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
6201
- sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
6202
- '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
6203
- )
6204
- ),
6205
- '',
6206
- 'update-nag'
6207
- );
 
 
6208
  } else {
6209
  if ( $this->should_add_sticky_optin_notice() ) {
6210
  $this->add_sticky_optin_admin_notice();
@@ -6279,7 +6598,7 @@
6279
  $this->_module_type,
6280
  sprintf( '<b><a href="%s">%s</a></b>',
6281
  $this->get_activation_url(),
6282
- sprintf( $this->get_text_inline( 'Opt in to make "%s" Better!', 'optin-x-now' ), $this->get_plugin_name() )
6283
  )
6284
  ),
6285
  'connect_account',
@@ -6741,6 +7060,20 @@
6741
  }
6742
  }
6743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6744
  if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
6745
  /**
6746
  * If no previous version of plugin's version exist, it means that it's either
@@ -7010,7 +7343,7 @@
7010
  private function remove_sdk_reference() {
7011
  global $fs_active_plugins;
7012
 
7013
- foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
7014
  if ( $this->_plugin_basename == $data->plugin_path ) {
7015
  unset( $fs_active_plugins->plugins[ $sdk_path ] );
7016
  break;
@@ -7192,6 +7525,23 @@
7192
  }
7193
  }
7194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7195
  /**
7196
  * Clears the anonymous mode and redirects to the opt-in screen.
7197
  *
@@ -7205,6 +7555,8 @@
7205
 
7206
  $this->reset_anonymous_mode( fs_is_network_admin() );
7207
 
 
 
7208
  fs_redirect( $this->get_activation_url() );
7209
  }
7210
 
@@ -7644,39 +7996,43 @@
7644
  $include_plugins = true,
7645
  $include_themes = true
7646
  ) {
7647
- /**
7648
- * @since 1.1.8 Also send plugin updates.
7649
- */
7650
- if ( $include_plugins && ! isset( $override['plugins'] ) ) {
7651
- $plugins = $this->get_plugins_data_for_api();
7652
- if ( ! empty( $plugins ) ) {
7653
- $override['plugins'] = $plugins;
 
 
7654
  }
7655
  }
7656
- /**
7657
- * @since 1.1.8 Also send themes updates.
7658
- */
7659
- if ( $include_themes && ! isset( $override['themes'] ) ) {
7660
- $themes = $this->get_themes_data_for_api();
7661
- if ( ! empty( $themes ) ) {
7662
- $override['themes'] = $themes;
 
 
 
7663
  }
7664
  }
7665
 
7666
- return array_merge( array(
7667
- 'version' => $this->get_plugin_version(),
7668
- 'is_premium' => $this->is_premium(),
7669
- 'language' => get_bloginfo( 'language' ),
7670
- 'charset' => get_bloginfo( 'charset' ),
7671
- 'platform_version' => get_bloginfo( 'version' ),
7672
- 'sdk_version' => $this->version,
7673
- 'programming_language_version' => phpversion(),
7674
- 'title' => get_bloginfo( 'name' ),
7675
- 'url' => get_site_url(),
7676
  // Special params.
7677
- 'is_active' => true,
7678
- 'is_disconnected' => $this->is_tracking_prohibited(),
7679
- 'is_uninstalled' => false,
7680
  ), $override );
7681
  }
7682
 
@@ -7721,12 +8077,10 @@
7721
  // }
7722
 
7723
  // Common properties.
7724
- $common = array_merge( array(
7725
- 'version' => $this->get_plugin_version(),
7726
- 'is_premium' => $this->is_premium(),
7727
- 'sdk_version' => $this->version,
7728
- 'programming_language_version' => phpversion(),
7729
- 'platform_version' => get_bloginfo( 'version' ),
7730
  ), $override );
7731
 
7732
 
@@ -7880,28 +8234,56 @@
7880
  $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override );
7881
  }
7882
 
7883
- if ( 0 < count( $params ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7884
  if ( ! is_multisite() ) {
7885
  // Update last install sync timestamp.
7886
  $this->set_cron_execution_timestamp( 'install_sync' );
7887
  }
7888
 
7889
  $params['uid'] = $this->get_anonymous_id();
 
7890
 
7891
- // Send updated values to FS.
7892
- $site = $this->get_api_site_scope()->call( '/', 'put', $params );
7893
 
7894
- if ( $this->is_api_result_entity( $site ) ) {
7895
- if ( ! is_multisite() ) {
7896
- // I successfully sent install update, clear scheduled sync if exist.
7897
- $this->clear_install_sync_cron();
7898
- }
7899
- }
7900
 
7901
- return $site;
 
 
 
 
 
 
 
 
 
 
7902
  }
7903
 
7904
- return false;
7905
  }
7906
 
7907
  /**
@@ -7920,24 +8302,70 @@
7920
 
7921
  $installs_data = $this->get_installs_data_for_api( $override, ! $flush );
7922
 
 
7923
  if ( empty( $installs_data ) ) {
7924
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7925
  }
7926
 
7927
- // Update last install sync timestamp.
7928
- $this->set_cron_execution_timestamp( 'install_sync' );
 
 
 
 
 
 
 
 
 
 
7929
 
7930
  // Send updated values to FS.
7931
  $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data );
7932
 
7933
- if ( $this->is_api_result_object( $result, 'installs' ) ) {
7934
- // I successfully sent installs update, clear scheduled sync if exist.
7935
  $this->clear_install_sync_cron();
7936
  }
7937
 
7938
  return $result;
7939
  }
7940
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7941
  /**
7942
  * Update install only if changed.
7943
  *
@@ -8142,14 +8570,59 @@
8142
  // @todo Decide if we want to delete plugin information from db.
8143
  }
8144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8145
  /**
8146
  * @author Vova Feldman (@svovaf)
8147
  * @since 1.1.1
 
8148
  *
8149
  * @return string
8150
  */
8151
  function premium_plugin_basename() {
8152
- return "{$this->_slug}-premium/" . basename( $this->_free_plugin_basename );
 
 
 
 
 
 
 
8153
  }
8154
 
8155
  /**
@@ -8288,13 +8761,29 @@
8288
  }
8289
 
8290
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8291
  * @author Vova Feldman (@svovaf)
8292
  * @since 1.2.1.7
8293
  *
8294
  * @return string Plugin slug.
8295
  */
8296
  function get_target_folder_name() {
8297
- return $this->_slug . ( $this->can_use_premium_code() ? '-premium' : '' );
 
 
8298
  }
8299
 
8300
  /**
@@ -8365,31 +8854,63 @@
8365
  * @author Vova Feldman (@svovaf)
8366
  * @since 1.0.9
8367
  *
 
 
8368
  * @return string
8369
  */
8370
- function get_plugin_name() {
8371
  $this->_logger->entrance();
8372
 
 
 
 
 
 
8373
  if ( ! isset( $this->_plugin_name ) ) {
8374
- $plugin_data = $this->get_plugin_data();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8375
 
8376
- // Get name.
8377
- $this->_plugin_name = $plugin_data['Name'];
8378
 
8379
- // Check if plugin name contains "(Premium)" suffix and remove it.
8380
- $suffix = ' (premium)';
8381
- $suffix_len = strlen( $suffix );
8382
 
8383
- if ( strlen( $plugin_data['Name'] ) > $suffix_len &&
8384
- $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len )
8385
- ) {
8386
- $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len );
8387
- }
8388
 
8389
- $this->_logger->departure( 'Name = ' . $this->_plugin_name );
 
 
 
 
 
8390
  }
8391
 
8392
- return $this->_plugin_name;
8393
  }
8394
 
8395
  /**
@@ -9095,7 +9616,16 @@
9095
  * @return bool
9096
  */
9097
  function is_premium() {
9098
- return $this->_plugin->is_premium;
 
 
 
 
 
 
 
 
 
9099
  }
9100
 
9101
  /**
@@ -10485,6 +11015,56 @@
10485
  fs_require_template( 'forms/resend-key.php', $vars );
10486
  }
10487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10488
  /**
10489
  * @author Leo Fajardo (@leorw)
10490
  * @since 2.0.2
@@ -10569,7 +11149,7 @@
10569
  return;
10570
  }
10571
 
10572
- if ( ! $this->is_premium() || $this->has_active_valid_license() ) {
10573
  // This is relevant only to the free versions and premium versions without an active license.
10574
  return;
10575
  }
@@ -10669,7 +11249,7 @@
10669
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
10670
  );
10671
 
10672
- $install = $api->call( '/', 'put', $params );
10673
 
10674
  if ( FS_Api::is_api_error( $install ) ) {
10675
  $error = FS_Api::is_api_error_object( $install ) ?
@@ -10762,6 +11342,10 @@
10762
  }
10763
  }
10764
 
 
 
 
 
10765
  $result = array(
10766
  'success' => ( false === $error )
10767
  );
@@ -11016,6 +11600,34 @@
11016
  static function get_current_page() {
11017
  if ( ! isset( self::$_pagenow ) ) {
11018
  global $pagenow;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11019
 
11020
  self::$_pagenow = $pagenow;
11021
 
@@ -11047,6 +11659,16 @@
11047
  return ( 'plugins.php' === self::get_current_page() );
11048
  }
11049
 
 
 
 
 
 
 
 
 
 
 
11050
  /**
11051
  * @author Leo Fajardo (@leorw)
11052
  * @since 2.0.2
@@ -11314,6 +11936,40 @@
11314
  return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true );
11315
  }
11316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11317
  /**
11318
  * Plugin's pricing URL.
11319
  *
@@ -11948,7 +12604,13 @@
11948
  * @author Vova Feldman (@svovaf)
11949
  */
11950
  $args = array(
11951
- 'public' => 1,
 
 
 
 
 
 
11952
  'archived' => 0,
11953
  'mature' => 0,
11954
  'spam' => 0,
@@ -12144,7 +12806,7 @@
12144
 
12145
  self::$_accounts->set_site_blog_context( $blog_id );
12146
  $this->_storage->set_site_blog_context( $blog_id );
12147
- $this->_storage->set_network_active( true, $this->is_delegated_connection( $blog_id ) );
12148
 
12149
  $this->_site = is_object( $install ) ?
12150
  $install :
@@ -13093,6 +13755,12 @@
13093
  }
13094
  }
13095
 
 
 
 
 
 
 
13096
  if ( $this->is_theme() ) {
13097
  $this->_register_account_hooks();
13098
  }
@@ -13158,6 +13826,30 @@
13158
 
13159
  }
13160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13161
  /**
13162
  * @author Vova Feldman (@svovaf)
13163
  * @since 1.1.7.4
@@ -13179,7 +13871,9 @@
13179
  // Return to the module's main page.
13180
  $this->get_after_activation_url( 'after_connect_url', array( 'fs_action' => $activation_action ) );
13181
 
13182
- $params = array(
 
 
13183
  'user_firstname' => $current_user->user_firstname,
13184
  'user_lastname' => $current_user->user_lastname,
13185
  'user_nickname' => $current_user->user_nicename,
@@ -13194,13 +13888,10 @@
13194
  'account',
13195
  array( 'fs_action' => 'sync_user' )
13196
  ), 'sync_user' ),
13197
- 'platform_version' => get_bloginfo( 'version' ),
13198
- 'sdk_version' => $this->version,
13199
- 'programming_language_version' => phpversion(),
13200
  'is_premium' => $this->is_premium(),
13201
  'is_active' => true,
13202
  'is_uninstalled' => false,
13203
- );
13204
 
13205
  if ( true === $network_level_or_blog_id ) {
13206
  if ( ! isset( $override_with['sites'] ) ) {
@@ -13386,7 +14077,7 @@
13386
  'timeout' => WP_FS__DEBUG_SDK ? 60 : 30,
13387
  );
13388
 
13389
- $url = WP_FS__ADDRESS . '/action/service/user/install/';
13390
  $response = self::safe_remote_post( $url, $request );
13391
 
13392
  if ( is_wp_error( $response ) ) {
@@ -14543,7 +15234,7 @@
14543
 
14544
  $hook = false;
14545
 
14546
- if ( ! $this->_menu->has_menu() ) {
14547
  // Add the opt-in page without a menu item.
14548
  $hook = FS_Admin_Menu_Manager::add_subpage(
14549
  null,
@@ -14756,13 +15447,15 @@
14756
  private function add_submenu_items() {
14757
  $this->_logger->entrance();
14758
 
 
 
14759
  if ( $this->is_addon() ) {
14760
  // No submenu items for add-ons.
14761
  $add_submenu_items = false;
14762
  } else if ( $this->is_free_wp_org_theme() && ! fs_is_network_admin() ) {
14763
  // Also add submenu items when running in a free .org theme so the tabs will be visible.
14764
  $add_submenu_items = true;
14765
- } else if ( $this->is_activation_mode() && ! $this->is_free_wp_org_theme() ) {
14766
  $add_submenu_items = false;
14767
  } else if ( fs_is_network_admin() ) {
14768
  /**
@@ -14793,7 +15486,15 @@
14793
  $this->is_submenu_item_visible( 'affiliation' )
14794
  );
14795
  }
 
14796
 
 
 
 
 
 
 
 
14797
  if ( ! WP_FS__DEMO_MODE && $this->is_registered() ) {
14798
  $show_account = (
14799
  $this->is_submenu_item_visible( 'account' ) &&
@@ -14812,10 +15513,12 @@
14812
  'account',
14813
  array( &$this, '_account_page_load' ),
14814
  WP_FS__DEFAULT_PRIORITY,
14815
- $show_account
14816
  );
14817
  }
 
14818
 
 
14819
  // Add contact page.
14820
  $this->add_submenu_item(
14821
  $this->get_text_inline( 'Contact Us', 'contact-us' ),
@@ -14840,7 +15543,11 @@
14840
  $this->is_submenu_item_visible( 'addons' )
14841
  );
14842
  }
 
14843
 
 
 
 
14844
  if ( ! WP_FS__DEMO_MODE ) {
14845
  $show_pricing = (
14846
  $this->is_submenu_item_visible( 'pricing' ) &&
@@ -14862,28 +15569,38 @@
14862
 
14863
  // Add upgrade/pricing page.
14864
  $this->add_submenu_item(
14865
- $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' ),
14866
  array( &$this, '_pricing_page_render' ),
14867
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
14868
  'manage_options',
14869
  'pricing',
14870
  'Freemius::_clean_admin_content_section',
14871
  WP_FS__LOWEST_PRIORITY,
14872
- $show_pricing,
14873
  $pricing_class
14874
  );
14875
  }
14876
  }
14877
 
14878
- if ( 0 < count( $this->_menu_items ) ) {
14879
- if ( ! $this->_menu->is_top_level() ) {
14880
- fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
 
 
 
 
 
 
 
 
 
14881
 
14882
- // Append submenu items right after the plugin's submenu item.
14883
- $this->order_sub_submenu_items();
14884
- } else {
14885
- // Append submenu items.
14886
- $this->embed_submenu_items();
 
14887
  }
14888
  }
14889
  }
@@ -14909,16 +15626,6 @@
14909
 
14910
  foreach ( $this->_menu_items as $priority => $items ) {
14911
  foreach ( $items as $item ) {
14912
- if ( $item['show_submenu'] && $is_first_submenu_item ) {
14913
- if ( $this->_is_network_active && ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
14914
- $item['menu_slug'] = '';
14915
-
14916
- $this->_menu->override_menu_item( $item['render_function'] );
14917
- }
14918
-
14919
- $is_first_submenu_item = false;
14920
- }
14921
-
14922
  $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability );
14923
 
14924
  $menu_item = sprintf(
@@ -14929,12 +15636,13 @@
14929
  $item['menu_title']
14930
  );
14931
 
14932
- $menu_slug = $this->_menu->get_slug( $item['menu_slug'] );
 
14933
 
14934
  if ( ! isset( $item['url'] ) ) {
14935
  $hook = FS_Admin_Menu_Manager::add_subpage(
14936
  $item['show_submenu'] ?
14937
- $this->get_top_level_menu_slug() :
14938
  null,
14939
  $item['page_title'],
14940
  $menu_item,
@@ -14949,7 +15657,7 @@
14949
  } else {
14950
  FS_Admin_Menu_Manager::add_subpage(
14951
  $item['show_submenu'] ?
14952
- $this->get_top_level_menu_slug() :
14953
  null,
14954
  $item['page_title'],
14955
  $menu_item,
@@ -14958,6 +15666,24 @@
14958
  array( $this, '' )
14959
  );
14960
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14961
  }
14962
  }
14963
  }
@@ -15569,7 +16295,8 @@
15569
  return;
15570
  }
15571
 
15572
- $encrypted_site = clone ( is_object( $site ) ? $site : $this->_site );
 
15573
 
15574
  $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15575
 
@@ -15937,7 +16664,7 @@
15937
  /**
15938
  * @since 1.2.3 When running in DEV mode, retrieve pending plans as well.
15939
  */
15940
- $result = $api->get( "/plugins/{$this->_module_id}/plans.json?show_pending=" . ( $this->has_secret_key() ? 'true' : 'false' ), true );
15941
 
15942
  if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
15943
  for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
@@ -16199,11 +16926,12 @@
16199
  * @param bool|number $plugin_id
16200
  * @param bool $flush Since 1.1.7.3
16201
  * @param int $expiration Since 1.2.2.7
 
16202
  *
16203
  * @return object|false New plugin tag info if exist.
16204
  */
16205
- private function _fetch_newer_version( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
16206
- $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush, $expiration );
16207
 
16208
  if ( ! is_object( $latest_tag ) ) {
16209
  return false;
@@ -16228,17 +16956,18 @@
16228
  * @param bool|number $plugin_id
16229
  * @param bool $flush Since 1.1.7.3
16230
  * @param int $expiration Since 1.2.2.7
 
16231
  *
16232
  * @return bool|FS_Plugin_Tag
16233
  */
16234
- function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
16235
  $this->_logger->entrance();
16236
 
16237
  if ( ! is_numeric( $plugin_id ) ) {
16238
  $plugin_id = $this->_plugin->id;
16239
  }
16240
 
16241
- $this->check_updates( true, $plugin_id, $flush, $expiration );
16242
  $updates = $this->get_all_updates();
16243
 
16244
  return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false;
@@ -16267,14 +16996,62 @@
16267
  * @since 1.2.1
16268
  */
16269
  function has_active_valid_license() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16270
  return (
16271
- is_object( $this->_license ) &&
16272
- is_numeric( $this->_license->id ) &&
16273
- $this->_license->is_active() &&
16274
- $this->_license->is_valid()
16275
  );
16276
  }
16277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16278
  /**
16279
  * Check if site assigned with license with enabled features.
16280
  *
@@ -16343,8 +17120,11 @@
16343
  * the admin.
16344
  * @param bool $is_context_single_site @since 2.0.0. This is used when syncing a license for a single install from the
16345
  * network-level "Account" page.
 
 
 
16346
  */
16347
- private function _sync_license( $background = false, $is_context_single_site = false ) {
16348
  $this->_logger->entrance();
16349
 
16350
  $plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
@@ -16354,7 +17134,7 @@
16354
  if ( $is_addon_sync ) {
16355
  $this->_sync_addon_license( $plugin_id, $background );
16356
  } else {
16357
- $this->_sync_plugin_license( $background, true, $is_context_single_site );
16358
  }
16359
 
16360
  $this->do_action( 'after_account_plan_sync', $this->get_plan_name() );
@@ -16405,7 +17185,7 @@
16405
  $this->_update_licenses( $licenses, $addon->id );
16406
 
16407
  if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) {
16408
- $plans_result = $this->get_api_site_or_plugin_scope()->get( "/addons/{$addon_id}/plans.json" );
16409
 
16410
  if ( ! isset( $plans_result->error ) ) {
16411
  $plans = array();
@@ -16444,11 +17224,15 @@
16444
  * @param bool $is_context_single_site Since 2.0.0. This is used when sending an update for a single install and
16445
  * syncing its license from the network-level "Account" page (e.g.: after
16446
  * activating a license only for the single install).
 
 
 
16447
  */
16448
  private function _sync_plugin_license(
16449
  $background = false,
16450
  $send_installs_update = true,
16451
- $is_context_single_site = false
 
16452
  ) {
16453
  $this->_logger->entrance();
16454
 
@@ -16465,6 +17249,16 @@
16465
  * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version.
16466
  */
16467
  if ( $is_site_level_sync ) {
 
 
 
 
 
 
 
 
 
 
16468
  $result = $this->send_install_update( array(), true );
16469
  $is_valid = $this->is_api_result_entity( $result );
16470
  } else {
@@ -16733,6 +17527,7 @@
16733
  'trial_promotion',
16734
  'trial_expired',
16735
  'activation_complete',
 
16736
  ) );
16737
  break;
16738
  case 'changed':
@@ -16973,6 +17768,18 @@
16973
  $api = $this->get_api_site_scope();
16974
  $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' );
16975
 
 
 
 
 
 
 
 
 
 
 
 
 
16976
  if ( isset( $license->error ) ) {
16977
  $this->_admin_notices->add(
16978
  $this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '<br> ' .
@@ -16993,7 +17800,7 @@
16993
  }
16994
  }
16995
 
16996
- // Updated site plan to default.
16997
  $this->_sync_plans();
16998
  $this->_site->plan_id = $this->_plans[0]->id;
16999
  // Unlink license from site.
@@ -17020,13 +17827,17 @@
17020
  * @author Vova Feldman (@svovaf)
17021
  * @since 1.0.4
17022
  *
 
 
17023
  * @uses FS_Api
17024
  */
17025
  private function _downgrade_site() {
17026
  $this->_logger->entrance();
17027
 
 
 
17028
  $api = $this->get_api_site_scope();
17029
- $site = $api->call( 'downgrade.json', 'put' );
17030
 
17031
  $plan_downgraded = false;
17032
  $plan = false;
@@ -17044,29 +17855,47 @@
17044
  ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() );
17045
  } else {
17046
  // handle different error cases.
17047
-
 
 
 
17048
  }
17049
 
17050
- if ( $plan_downgraded ) {
17051
- // Remove previous sticky message about upgrade (if exist).
17052
- $this->_admin_notices->remove_sticky( 'plan_upgraded' );
17053
-
17054
- $this->_admin_notices->add(
17055
- sprintf( $this->get_text_inline( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ),
17056
- $plan->title,
17057
- human_time_diff( time(), strtotime( $this->_license->expiration ) )
17058
  )
17059
  );
 
17060
 
17061
- // Store site updates.
17062
- $this->_store_site();
17063
- } else {
17064
- $this->_admin_notices->add(
17065
- $this->get_text_inline( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.', 'plan-downgraded-failure-message' ),
17066
- $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17067
- 'error'
17068
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17069
  }
 
 
17070
  }
17071
 
17072
  /**
@@ -17173,22 +18002,19 @@
17173
  * @author Vova Feldman (@svovaf)
17174
  * @since 1.0.9
17175
  *
 
 
17176
  * @uses FS_Api
17177
  */
17178
  private function _cancel_trial() {
17179
  $this->_logger->entrance();
17180
 
17181
- // Alias.
17182
- $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...';
17183
-
17184
  if ( ! $this->is_trial() ) {
17185
- $this->_admin_notices->add(
17186
- $this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' ),
17187
- $oops_text,
17188
- 'error'
17189
  );
17190
-
17191
- return;
17192
  }
17193
 
17194
  $trial_plan = $this->get_trial_plan();
@@ -17219,31 +18045,33 @@
17219
  // @todo handle different error cases.
17220
  }
17221
 
17222
- if ( $trial_cancelled ) {
17223
- // Remove previous sticky messages about upgrade or trial (if exist).
17224
- $this->_admin_notices->remove_sticky( array(
17225
- 'trial_started',
17226
- 'trial_promotion',
17227
- 'plan_upgraded',
17228
- ) );
17229
 
17230
- // Store site updates.
17231
- $this->_store_site();
 
 
 
 
17232
 
17233
- if ( ! $this->is_addon() ||
17234
- ! $this->deactivate_premium_only_addon_without_license( true )
17235
- ) {
17236
- $this->_admin_notices->add(
17237
- sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $trial_plan->title )
17238
- );
17239
- }
17240
- } else {
17241
  $this->_admin_notices->add(
17242
- $this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' ),
17243
- $oops_text,
17244
- 'error'
17245
  );
17246
  }
 
 
17247
  }
17248
 
17249
  /**
@@ -17267,7 +18095,7 @@
17267
  * @return bool
17268
  */
17269
  private function _can_download_premium() {
17270
- return $this->has_active_valid_license() ||
17271
  ( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
17272
  }
17273
 
@@ -17314,15 +18142,19 @@
17314
  * @since 1.0.4
17315
  *
17316
  * @param bool|number $addon_id
17317
- * @param bool $flush Since 1.1.7.3
17318
- * @param int $expiration Since 1.2.2.7
 
 
17319
  *
17320
  * @return object|false Plugin latest tag info.
17321
  */
17322
  function _fetch_latest_version(
17323
  $addon_id = false,
17324
  $flush = true,
17325
- $expiration = WP_FS__TIME_24_HOURS_IN_SEC
 
 
17326
  ) {
17327
  $this->_logger->entrance();
17328
 
@@ -17373,8 +18205,18 @@
17373
  $this->switch_to_blog( $switch_to_blog_id );
17374
  }
17375
 
 
 
 
 
 
 
 
 
 
 
17376
  $tag = $this->get_api_site_or_plugin_scope()->get(
17377
- $this->_get_latest_version_endpoint( $addon_id, 'json' ),
17378
  $flush,
17379
  $expiration
17380
  );
@@ -17510,17 +18352,19 @@
17510
  * @param bool|number $plugin_id
17511
  * @param bool $flush Since 1.1.7.3
17512
  * @param int $expiration Since 1.2.2.7
 
17513
  */
17514
  private function check_updates(
17515
  $background = false,
17516
  $plugin_id = false,
17517
  $flush = true,
17518
- $expiration = WP_FS__TIME_24_HOURS_IN_SEC
 
17519
  ) {
17520
  $this->_logger->entrance();
17521
 
17522
  // Check if there's a newer version for download.
17523
- $new_version = $this->_fetch_newer_version( $plugin_id, $flush, $expiration );
17524
 
17525
  $update = null;
17526
  if ( is_object( $new_version ) ) {
@@ -17570,19 +18414,21 @@
17570
 
17571
  $api = $this->get_api_site_or_plugin_scope();
17572
 
 
 
17573
  /**
17574
  * @since 1.2.1
17575
  *
17576
  * If there's a cached version of the add-ons and not asking
17577
  * for a flush, just use the currently stored add-ons.
17578
  */
17579
- if ( ! $flush && $api->is_cached( '/addons.json?enriched=true' ) ) {
17580
  $addons = self::get_all_addons();
17581
 
17582
  return $addons[ $this->_plugin->id ];
17583
  }
17584
 
17585
- $result = $api->get( '/addons.json?enriched=true', $flush );
17586
 
17587
  $addons = array();
17588
  if ( $this->is_api_result_object( $result, 'plugins' ) &&
@@ -17874,7 +18720,9 @@
17874
  */
17875
  function get_after_activation_url( $filter, $params = array(), $network = null ) {
17876
  if ( $this->is_free_wp_org_theme() &&
17877
- fs_request_has( 'pending_activation' )
 
 
17878
  ) {
17879
  $first_time_path = '';
17880
  } else {
@@ -18006,6 +18854,8 @@
18006
  $this->_site = null;
18007
  $this->_user = null;
18008
 
 
 
18009
  fs_redirect( $this->get_activation_url() );
18010
  } else {
18011
  if ( $this->is_addon_activated( $plugin_id ) ) {
@@ -18025,15 +18875,23 @@
18025
  check_admin_referer( $action );
18026
  }
18027
 
18028
- if ( $plugin_id == $this->get_id() ) {
18029
- $this->_downgrade_site();
 
 
 
18030
 
18031
- if ( is_numeric( $blog_id ) ) {
18032
- $this->switch_to_blog( $this->_storage->network_install_blog_id );
18033
- }
18034
- } else if ( $this->is_addon_activated( $plugin_id ) ) {
18035
- $fs_addon = self::get_instance_by_id( $plugin_id );
18036
- $fs_addon->_downgrade_site();
 
 
 
 
 
18037
  }
18038
 
18039
  return;
@@ -18065,7 +18923,11 @@
18065
  $this->_site = null;
18066
  $this->_user = null;
18067
 
18068
- fs_redirect( $this->get_activation_url() );
 
 
 
 
18069
  }
18070
  } else {
18071
  if ( $this->is_addon_activated( $plugin_id ) ) {
@@ -18163,13 +19025,13 @@
18163
  #region Actions that might be called from external links (e.g. email)
18164
 
18165
  case 'cancel_trial':
18166
- if ( $plugin_id == $this->get_id() ) {
18167
- $this->_cancel_trial();
18168
- } else {
18169
- if ( $this->is_addon_activated( $plugin_id ) ) {
18170
- $fs_addon = self::get_instance_by_id( $plugin_id );
18171
- $fs_addon->_cancel_trial();
18172
- }
18173
  }
18174
 
18175
  return;
@@ -18398,9 +19260,9 @@
18398
  $vars = array( 'id' => $this->_module_id );
18399
 
18400
  if ( 'true' === fs_request_get( 'checkout', false ) ) {
18401
- fs_require_once_template( 'checkout.php', $vars );
18402
  } else {
18403
- fs_require_once_template( 'pricing.php', $vars );
18404
  }
18405
  }
18406
 
@@ -18418,7 +19280,15 @@
18418
  $this->_logger->entrance();
18419
 
18420
  $vars = array( 'id' => $this->_module_id );
18421
- fs_require_once_template( 'contact.php', $vars );
 
 
 
 
 
 
 
 
18422
  }
18423
 
18424
  #endregion ------------------------------------------------------------------------
@@ -18515,7 +19385,9 @@
18515
  * @return FS_Api
18516
  */
18517
  private function get_current_or_network_user_api_scope( $flush = false ) {
18518
- if ( ! $this->_is_network_active || isset( $this->_user ) ) {
 
 
18519
  return $this->get_api_user_scope( $flush );
18520
  }
18521
 
@@ -18603,9 +19475,19 @@
18603
  * @author Vova Feldman (@svovaf)
18604
  * @since 1.0.9
18605
  *
18606
- * @param $plans
18607
  */
18608
  function _check_for_trial_plans( $plans ) {
 
 
 
 
 
 
 
 
 
 
18609
  $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans );
18610
  }
18611
 
@@ -18712,14 +19594,14 @@
18712
 
18713
  // Show promotion if never shown before and 24 hours after initial activation with FS.
18714
  if ( ! $was_promotion_shown_before &&
18715
- $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
18716
  ) {
18717
  return false;
18718
  }
18719
 
18720
  // OR if promotion was shown before, try showing it every 30 days.
18721
  if ( $was_promotion_shown_before &&
18722
- 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
18723
  ) {
18724
  return false;
18725
  }
@@ -19145,11 +20027,23 @@
19145
 
19146
  if ( ! $this->is_addon() || ! $this->has_free_plan() ) {
19147
  $first_time_path = $this->_menu->get_first_time_path();
19148
- $url = $this->is_activation_mode() ?
19149
- $this->get_activation_url() :
19150
- ( empty( $first_time_path ) ?
19151
- $this->_get_admin_page_url() :
19152
- $first_time_path );
 
 
 
 
 
 
 
 
 
 
 
 
19153
  } else {
19154
  $plugin_fs = false;
19155
 
@@ -19269,6 +20163,21 @@
19269
  $this->_admin_notices->add_sticky( $message, $id, $title, $type );
19270
  }
19271