Gutenberg Blocks – ACF Blocks Suite - Version 2.5.1

Version Description

  • Updated Freemius SDK
Download this release

Release Info

Developer munirkamal
Plugin Icon 128x128 Gutenberg Blocks – ACF Blocks Suite
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.5.0 to 2.5.1

Files changed (50) hide show
  1. acf-blocks.php +1 -1
  2. freemius/assets/css/admin/account.css +1 -1
  3. freemius/assets/css/admin/add-ons.css +1 -1
  4. freemius/config.php +4 -1
  5. freemius/includes/class-freemius.php +840 -105
  6. freemius/includes/class-fs-api.php +1 -1
  7. freemius/includes/class-fs-plugin-updater.php +49 -6
  8. freemius/includes/class-fs-storage.php +1 -0
  9. freemius/includes/customizer/class-fs-customizer-support-section.php +2 -2
  10. freemius/includes/entities/class-fs-payment.php +2 -2
  11. freemius/includes/entities/class-fs-plugin-license.php +7 -0
  12. freemius/includes/entities/class-fs-site.php +4 -1
  13. freemius/includes/fs-essential-functions.php +37 -20
  14. freemius/includes/fs-plugin-info-dialog.php +36 -23
  15. freemius/includes/i18n.php +2 -0
  16. freemius/includes/managers/class-fs-admin-menu-manager.php +6 -1
  17. freemius/includes/sdk/FreemiusBase.php +1 -1
  18. freemius/includes/sdk/FreemiusWordPress.php +20 -12
  19. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +1 -1
  20. freemius/languages/freemius-cs_CZ.mo +0 -0
  21. freemius/languages/freemius-da_DK.mo +0 -0
  22. freemius/languages/freemius-en.mo +0 -0
  23. freemius/languages/freemius-es_ES.mo +0 -0
  24. freemius/languages/freemius-fr_FR.mo +0 -0
  25. freemius/languages/freemius-he_IL.mo +0 -0
  26. freemius/languages/freemius-hu_HU.mo +0 -0
  27. freemius/languages/freemius-it_IT.mo +0 -0
  28. freemius/languages/freemius-ja.mo +0 -0
  29. freemius/languages/freemius-nl_NL.mo +0 -0
  30. freemius/languages/freemius-ru_RU.mo +0 -0
  31. freemius/languages/freemius-ta.mo +0 -0
  32. freemius/languages/freemius-zh_CN.mo +0 -0
  33. freemius/languages/freemius.pot +390 -358
  34. freemius/start.php +529 -521
  35. freemius/templates/account.php +84 -24
  36. freemius/templates/account/partials/addon.php +2 -2
  37. freemius/templates/account/payments.php +1 -1
  38. freemius/templates/add-ons.php +2 -2
  39. freemius/templates/auto-installation.php +1 -1
  40. freemius/templates/connect.php +12 -11
  41. freemius/templates/forms/affiliation.php +28 -5
  42. freemius/templates/forms/deactivation/form.php +18 -14
  43. freemius/templates/forms/license-activation.php +10 -8
  44. freemius/templates/forms/optout.php +17 -10
  45. freemius/templates/forms/subscription-cancellation.php +1 -1
  46. freemius/templates/forms/trial-start.php +1 -1
  47. freemius/templates/partials/index.php +2 -0
  48. freemius/templates/pricing.php +208 -176
  49. freemius/templates/secure-https-header.php +1 -1
  50. readme.txt +4 -1
acf-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
- * Version: 2.5.0
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
+ * Version: 2.5.1
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
freemius/assets/css/admin/account.css CHANGED
@@ -1 +1 @@
1
- label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
1
+ label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-notice[data-id="license_not_whitelabeled"].success,.fs-notice[data-id="license_whitelabeled"].success{color:inherit;border-left-color:#00a0d2}.fs-notice[data-id="license_not_whitelabeled"].success label.fs-plugin-title,.fs-notice[data-id="license_whitelabeled"].success label.fs-plugin-title{display:none}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
freemius/assets/css/admin/add-ons.css CHANGED
@@ -1,2 +1,2 @@
1
  .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;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)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
- #TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
1
  .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;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)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
+ #TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description iframe{max-width:100%}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
freemius/config.php CHANGED
@@ -385,4 +385,7 @@
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
- }
 
 
 
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
+ }
389
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
390
+ define( 'FS_SDK__SSLVERIFY', false );
391
+ }
freemius/includes/class-freemius.php CHANGED
@@ -351,6 +351,14 @@
351
  */
352
  private $is_whitelabeled;
353
 
 
 
 
 
 
 
 
 
354
  #region Uninstall Reasons IDs
355
 
356
  const REASON_NO_LONGER_NEEDED = 1;
@@ -369,6 +377,14 @@
369
  const REASON_DIDNT_WORK_AS_EXPECTED = 14;
370
  const REASON_TEMPORARY_DEACTIVATION = 15;
371
 
 
 
 
 
 
 
 
 
372
  #endregion
373
 
374
  /* Ctor
@@ -816,7 +832,11 @@
816
  return false;
817
  }
818
 
819
- if ( ! $is_tabs_visibility_check && $this->show_settings_with_tabs() ) {
 
 
 
 
820
  /**
821
  * wp.org themes are limited to a single submenu item, and
822
  * sub-submenu items are most likely not allowed (never verified).
@@ -1457,7 +1477,10 @@
1457
  if ( $this->is_plugin() &&
1458
  ! isset( $this->_storage->is_plugin_new_install )
1459
  ) {
1460
- $this->_storage->is_plugin_new_install = false;
 
 
 
1461
  }
1462
  }
1463
 
@@ -1480,6 +1503,13 @@
1480
  -1 < settings.url.indexOf('admin-ajax.php') &&
1481
  ! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
1482
  ) {
 
 
 
 
 
 
 
1483
  if (settings.url.indexOf('?') > 0) {
1484
  settings.url += '&';
1485
  } else {
@@ -1487,7 +1517,6 @@
1487
  }
1488
 
1489
  settings.url += '<?php echo $admin_param ?>=true';
1490
-
1491
  }
1492
  });
1493
  })(jQuery);
@@ -1505,7 +1534,7 @@
1505
  ?>
1506
  <script type="text/javascript">
1507
  (function ($) {
1508
- $('.fs-submenu-item.wp-support-forum').parent().attr('target', '_blank');
1509
  })(jQuery);
1510
  </script>
1511
  <?php
@@ -1601,6 +1630,7 @@
1601
  }
1602
 
1603
  add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
 
1604
  }
1605
 
1606
  if ( $this->is_plugin() ) {
@@ -1632,7 +1662,7 @@
1632
 
1633
  add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
1634
 
1635
- if ( $this->is_theme() ) {
1636
  add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
1637
  }
1638
 
@@ -1644,6 +1674,7 @@
1644
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1645
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1646
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
 
1647
 
1648
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1649
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
@@ -2006,6 +2037,10 @@
2006
  * @since 2.0.0
2007
  */
2008
  function _hook_action_links_and_register_account_hooks() {
 
 
 
 
2009
  $this->_add_tracking_links();
2010
 
2011
  if ( self::is_plugins_page() && $this->is_plugin() ) {
@@ -2186,6 +2221,12 @@
2186
  );
2187
 
2188
  $store_option = true;
 
 
 
 
 
 
2189
  }
2190
 
2191
  if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
@@ -4259,7 +4300,7 @@
4259
  )
4260
  ),
4261
  sprintf(
4262
- '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4263
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4264
  $install_previous_title,
4265
  $install_previous_desc
@@ -4366,7 +4407,7 @@
4366
  )
4367
  ),
4368
  sprintf(
4369
- '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4370
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4371
  $install_previous_title,
4372
  $install_previous_desc
@@ -4887,10 +4928,12 @@
4887
  } else {
4888
  $is_network_admin = fs_is_network_admin();
4889
 
4890
- if (
 
 
 
4891
  $this->_parent->is_registered() &&
4892
  ! $this->is_registered() &&
4893
- $this->has_free_plan() &&
4894
  /**
4895
  * If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
4896
  * * Network active and in network admin - network activate add-on account.
@@ -4904,16 +4947,40 @@
4904
  */
4905
  ( $this->is_network_active() || ! $is_network_admin )
4906
  ) {
4907
- // If parent plugin activated, automatically install add-on for the user.
4908
- $this->_activate_addon_account(
4909
- $this->_parent,
4910
- ( $this->is_network_active() && $is_network_admin ) ?
4911
- true :
4912
- get_current_blog_id()
4913
- );
4914
- } else if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
4915
- // If add-on activated and parent not, automatically install parent for the user.
4916
- $this->activate_parent_account( $this->_parent );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4917
  }
4918
 
4919
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
@@ -5415,7 +5482,10 @@
5415
  * @return bool
5416
  */
5417
  function is_extensions_tracking_allowed() {
5418
- return (true === $this->_storage->get( 'is_extensions_tracking_allowed', true ) );
 
 
 
5419
  }
5420
 
5421
  /**
@@ -5601,6 +5671,7 @@
5601
  $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5602
  }
5603
  $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
 
5604
 
5605
  if ( ! empty( $plugin_info['trial'] ) ) {
5606
  $this->_trial_days = $this->get_numeric_option(
@@ -7078,6 +7149,8 @@
7078
  * @since 1.0.7
7079
  */
7080
  function _admin_init_action() {
 
 
7081
  /**
7082
  * Automatically redirect to connect/activation page after plugin activation.
7083
  *
@@ -7090,12 +7163,16 @@
7090
  /**
7091
  * Don't redirect if activating multiple plugins at once (bulk activation).
7092
  */
7093
- } else {
7094
  $this->_redirect_on_activation_hook();
7095
  return;
7096
  }
7097
  }
7098
 
 
 
 
 
7099
  if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) {
7100
  check_admin_referer( $this->get_unique_affix() . '_skip_activation' );
7101
 
@@ -7126,7 +7203,7 @@
7126
  )
7127
  ) {
7128
  if ( ! $this->is_pending_activation() ) {
7129
- if ( ! $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
7130
  /**
7131
  * If a user visits any other admin page before activating the premium-only theme with a valid
7132
  * license, reactivate the previous theme.
@@ -7660,7 +7737,10 @@
7660
  * @author Leo Fajardo (@leorw)
7661
  * @since 1.2.2
7662
  */
7663
- if ( is_plugin_active( $other_version_basename ) ) {
 
 
 
7664
  deactivate_plugins( $other_version_basename );
7665
  }
7666
  }
@@ -7769,8 +7849,17 @@
7769
  $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
7770
  }
7771
 
 
 
 
 
 
 
 
 
 
7772
  if ( ! $this->_anonymous_mode &&
7773
- $this->has_api_connectivity( WP_FS__DEV_MODE ) &&
7774
  ! $this->_isAutoInstall
7775
  ) {
7776
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
@@ -7803,11 +7892,20 @@
7803
  return;
7804
  }
7805
 
7806
- $license = $this->get_addon_active_parent_license();
7807
  if ( ! is_object( $license ) ) {
7808
  return;
7809
  }
7810
 
 
 
 
 
 
 
 
 
 
7811
  if ( ! $this->is_registered() ) {
7812
  // Opt in with a license key.
7813
  $this->opt_in(
@@ -7830,7 +7928,6 @@
7830
  }
7831
  }
7832
 
7833
-
7834
  /**
7835
  * @author Leo Fajardo (@leorw)
7836
  * @since 2.3.0
@@ -7846,12 +7943,21 @@
7846
 
7847
  $license = ( ! is_null( $license ) ) ?
7848
  $license :
7849
- $this->get_addon_active_parent_license();
7850
 
7851
  if ( ! is_object( $license ) ) {
7852
  return;
7853
  }
7854
 
 
 
 
 
 
 
 
 
 
7855
  if ( ! $this->is_network_registered() ) {
7856
  $sites = $this->get_sites_for_network_level_optin();
7857
 
@@ -7915,16 +8021,217 @@
7915
  }
7916
 
7917
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7918
  * @author Leo Fajardo (@leorw)
7919
  * @since 2.3.0
7920
  *
 
 
 
7921
  * @return FS_Plugin_License
7922
  */
7923
- private function get_addon_active_parent_license() {
7924
  $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
7925
- $parent_instance = $this->get_parent_instance();
7926
 
7927
- $foreign_licenses = $parent_instance->get_foreign_licenses_info(
 
 
 
 
 
 
 
 
 
 
7928
  self::get_all_licenses( $this->get_parent_id() )
7929
  );
7930
 
@@ -7938,7 +8245,7 @@
7938
  $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
7939
  }
7940
 
7941
- $result = $parent_instance->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, true );
7942
 
7943
  if (
7944
  ! $this->is_api_result_object( $result, 'licenses' ) ||
@@ -7948,9 +8255,24 @@
7948
  return null;
7949
  }
7950
 
7951
- $license = new FS_Plugin_License( $result->licenses[ 0 ] );
7952
 
7953
- return $license;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7954
  }
7955
 
7956
  /**
@@ -8703,12 +9025,25 @@
8703
  'is_uninstalled' => false,
8704
  );
8705
 
8706
- $plugins_update_data[] = $new_plugin;
8707
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
8708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8709
  if ( isset( $site_active_plugins[ $basename ] ) ) {
8710
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
8711
- $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
8712
  }
8713
  }
8714
  }
@@ -10108,6 +10443,10 @@
10108
 
10109
  $class_name = '';
10110
 
 
 
 
 
10111
  switch ( $option_name ) {
10112
  case 'plugins':
10113
  case 'themes':
@@ -10392,6 +10731,18 @@
10392
  return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() );
10393
  }
10394
 
 
 
 
 
 
 
 
 
 
 
 
 
10395
  /**
10396
  * @author Vova Feldman (@svovaf)
10397
  * @since 1.0.4
@@ -12675,6 +13026,10 @@
12675
  * @since 1.2.0
12676
  */
12677
  function _add_license_activation() {
 
 
 
 
12678
  if ( ! $this->is_user_admin() ) {
12679
  // Only admins can activate a license.
12680
  return;
@@ -12733,7 +13088,9 @@
12733
  return;
12734
  }
12735
 
12736
- if ( empty( $this->get_installs_ids_with_foreign_licenses() ) ) {
 
 
12737
  // Handle user change only when the parent product or one of its add-ons is activated with a foreign license.
12738
  return;
12739
  }
@@ -12790,6 +13147,61 @@
12790
  }
12791
  }
12792
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12793
  /**
12794
  * @author Leo Fajardo (@leorw)
12795
  * @since 2.3.0
@@ -12869,11 +13281,13 @@
12869
  exit;
12870
  }
12871
 
 
 
 
 
12872
  $result = $this->activate_license(
12873
  $license_key,
12874
- fs_is_network_admin() ?
12875
- fs_request_get( 'sites', array(), 'post' ) :
12876
- array(),
12877
  fs_request_get_bool( 'is_marketing_allowed', null ),
12878
  fs_request_get( 'blog_id', null ),
12879
  fs_request_get( 'module_id', null, 'post' ),
@@ -12881,6 +13295,16 @@
12881
  fs_request_get_bool( 'is_extensions_tracking_allowed', true )
12882
  );
12883
 
 
 
 
 
 
 
 
 
 
 
12884
  echo json_encode( $result );
12885
 
12886
  exit;
@@ -12967,6 +13391,46 @@
12967
  }
12968
 
12969
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12970
  * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license.
12971
  *
12972
  * @author Vova Feldman (@svovaf)
@@ -12975,6 +13439,8 @@
12975
  * @param string $license_key
12976
  * @param null|bool $is_marketing_allowed
12977
  * @param null|number $plugin_id
 
 
12978
  *
12979
  * @return array {
12980
  * @var bool $success
@@ -12987,17 +13453,19 @@
12987
  function activate_migrated_license(
12988
  $license_key,
12989
  $is_marketing_allowed = null,
12990
- $plugin_id = null
 
 
12991
  ) {
12992
  $this->_logger->entrance();
12993
 
12994
  $result = $this->activate_license(
12995
  $license_key,
12996
- $this->is_network_active() ?
12997
  $this->get_sites_for_network_level_optin() :
12998
- array(),
12999
  $is_marketing_allowed,
13000
- null,
13001
  $plugin_id
13002
  );
13003
 
@@ -13007,6 +13475,32 @@
13007
  return $result;
13008
  }
13009
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13010
  /**
13011
  * The implementation of this method was previously in `_activate_license_ajax_action()`.
13012
  *
@@ -13039,7 +13533,12 @@
13039
 
13040
  $license_key = trim( $license_key );
13041
 
13042
- if ( ! fs_is_network_admin() ) {
 
 
 
 
 
13043
  // If the license activation is executed outside the context of a network admin, ignore the sites collection.
13044
  $sites = array();
13045
  }
@@ -13068,8 +13567,17 @@
13068
  $user = $fs->get_current_or_network_user();
13069
  }
13070
 
 
 
 
 
 
 
 
 
 
13071
  if ( is_object( $user ) ) {
13072
- if ( fs_is_network_admin() && ! $has_valid_blog_id ) {
13073
  // If no specific blog ID was provided, activate the license for all sites in the network.
13074
  $blog_2_install_map = array();
13075
  $site_ids = array();
@@ -13108,16 +13616,6 @@
13108
  }
13109
  }
13110
  } else {
13111
- if ( $has_valid_blog_id ) {
13112
- /**
13113
- * If a specific blog ID was provided, activate the license only for the install that is
13114
- * associated with the given blog ID.
13115
- *
13116
- * @author Leo Fajardo (@leorw)
13117
- */
13118
- $fs->switch_to_blog( $blog_id );
13119
- }
13120
-
13121
  if ( $fs->is_registered() ) {
13122
  $params = array(
13123
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
@@ -13172,13 +13670,19 @@
13172
  if ( empty( $error ) ) {
13173
  $fs->network_upgrade_mode_completed();
13174
 
 
 
 
 
 
 
13175
  $fs->_sync_license( true, $has_valid_blog_id );
13176
 
13177
  $this->maybe_sync_install_user();
13178
 
13179
  $next_page = $fs->is_addon() ?
13180
  $fs->get_parent_instance()->get_account_url() :
13181
- $fs->get_account_url();
13182
  }
13183
  } else {
13184
  $next_page = $fs->opt_in(
@@ -13196,7 +13700,7 @@
13196
  if ( isset( $next_page->error ) ) {
13197
  $error = $next_page->error;
13198
  } else {
13199
- if ( fs_is_network_admin() ) {
13200
  /**
13201
  * Get the list of sites that were just opted-in (and license activated).
13202
  * This is an optimization for the next part below saving some DB queries.
@@ -14310,7 +14814,12 @@
14310
  * @return bool
14311
  */
14312
  function is_user_in_admin() {
14313
- return is_admin() && ! self::is_ajax() && ! self::is_cron();
 
 
 
 
 
14314
  }
14315
 
14316
  /**
@@ -14622,9 +15131,18 @@
14622
  if ( function_exists( 'get_sites' ) ) {
14623
  // For WP 4.6 and above.
14624
  return get_sites( $args );
14625
- } else if ( function_exists( 'wp_get_sites' ) ) {
14626
  // For WP 3.7 to WP 4.5.
14627
- return wp_get_sites( $args );
 
 
 
 
 
 
 
 
 
14628
  } else {
14629
  // For WP 3.6 and below.
14630
  return get_blog_list( 0, 'all' );
@@ -14801,7 +15319,7 @@
14801
  * @return bool Since 2.3.1 returns if a switch was made.
14802
  */
14803
  function switch_to_blog( $blog_id, FS_Site $install = null ) {
14804
- if ( $blog_id == $this->_context_is_network_or_blog_id ) {
14805
  return false;
14806
  }
14807
 
@@ -16188,6 +16706,8 @@
16188
  'http' => 402
16189
  );
16190
 
 
 
16191
  return $result;
16192
  }
16193
 
@@ -17034,10 +17554,15 @@
17034
  * @author Vova Feldman (@svovaf)
17035
  * @since 1.0.6
17036
  *
17037
- * @param Freemius $parent_fs
17038
- * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network.
 
17039
  */
17040
- private function _activate_addon_account( Freemius $parent_fs, $network_level_or_blog_id = null ) {
 
 
 
 
17041
  if ( $this->is_registered() ) {
17042
  // Already activated.
17043
  return;
@@ -17076,6 +17601,10 @@
17076
  }
17077
  }
17078
 
 
 
 
 
17079
  // Activate add-on with parent plugin credentials.
17080
  $result = $parent_fs->get_api_site_scope()->call(
17081
  "/addons/{$this->_plugin->id}/installs.json",
@@ -17084,16 +17613,25 @@
17084
  );
17085
 
17086
  if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
17087
- $error_message = FS_Api::is_api_error_object( $result ) ?
17088
- $result->error->message :
17089
- $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' );
 
 
 
 
 
 
 
 
17090
 
17091
- $this->_admin_notices->add(
17092
- sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
17093
- $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $error_message . '</b>',
17094
- $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17095
- 'error'
17096
- );
 
17097
 
17098
  return;
17099
  }
@@ -17126,21 +17664,29 @@
17126
 
17127
  if ( ! fs_is_network_admin() ) {
17128
  // Try to activate premium license.
17129
- $this->_activate_license( true );
17130
- } else {
17131
- $license_id = fs_request_get( 'license_id' );
17132
 
17133
- if ( is_object( $this->_site ) &&
17134
- FS_Plugin_License::is_valid_id( $license_id ) &&
17135
- $license_id == $this->_site->license_id
17136
- ) {
17137
- // License is already activated.
17138
- return;
17139
  }
 
 
 
 
 
17140
 
17141
- $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ?
17142
- $this->_get_license_by_id( $license_id ) :
17143
- $this->_get_available_premium_license();
 
 
 
 
 
 
 
 
 
17144
 
17145
  if ( is_object( $premium_license ) ) {
17146
  $this->maybe_network_activate_addon_license( $premium_license );
@@ -19438,9 +19984,11 @@
19438
  *
19439
  * @author Vova Feldman (@svovaf)
19440
  * @since 1.2.1
 
 
19441
  */
19442
- function has_active_valid_license() {
19443
- return self::is_active_valid_license( $this->_license );
19444
  }
19445
 
19446
  /**
@@ -19532,15 +20080,16 @@
19532
  * @since 2.1.3
19533
  *
19534
  * @param FS_Plugin_License $license
 
19535
  *
19536
  * @return bool
19537
  */
19538
- private static function is_active_valid_license( $license ) {
19539
  return (
19540
  is_object( $license ) &&
19541
  FS_Plugin_License::is_valid_id( $license->id ) &&
19542
  $license->is_active() &&
19543
- $license->is_valid()
19544
  );
19545
  }
19546
 
@@ -19594,6 +20143,22 @@
19594
  );
19595
  }
19596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19597
  /**
19598
  * Check if user is a trial or have feature enabled license.
19599
  *
@@ -20186,6 +20751,13 @@
20186
  }
20187
 
20188
  if ( 'none' !== $plan_change ) {
 
 
 
 
 
 
 
20189
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20190
  }
20191
  }
@@ -20909,7 +21481,7 @@
20909
  */
20910
  private function get_latest_download_link( $label, $plugin_id = false ) {
20911
  return sprintf(
20912
- '<a target="_blank" href="%s">%s</a>',
20913
  $this->_get_latest_download_local_url( $plugin_id ),
20914
  $label
20915
  );
@@ -20980,7 +21552,7 @@
20980
  $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ),
20981
  $update->version,
20982
  sprintf(
20983
- '<a href="%s" target="_blank">%s</a>',
20984
  $this->get_account_url( 'download_latest' ),
20985
  sprintf(
20986
  /* translators: %s: plan name (e.g. latest "Professional" version) */
@@ -21467,7 +22039,7 @@
21467
  $this->get_plugin_title(),
21468
  fs_strip_url_protocol( get_site_url( $blog_id ) ),
21469
  sprintf(
21470
- '<a href="%s" target="_blank">%s</a>',
21471
  'https://freemius.com',
21472
  'freemius.com'
21473
  )
@@ -21566,6 +22138,18 @@
21566
 
21567
  if ( is_object( $fs ) ) {
21568
  $fs->_activate_license();
 
 
 
 
 
 
 
 
 
 
 
 
21569
  }
21570
 
21571
  return;
@@ -21788,6 +22372,26 @@
21788
 
21789
  $this->_handle_account_edits();
21790
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21791
  $this->do_action( 'account_page_load_before_departure' );
21792
  }
21793
 
@@ -21924,6 +22528,86 @@
21924
  }
21925
  }
21926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21927
  #----------------------------------------------------------------------------------
21928
  #region Contact Us
21929
  #----------------------------------------------------------------------------------
@@ -22152,6 +22836,43 @@
22152
  $this->get_api_plugin_scope();
22153
  }
22154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22155
  /**
22156
  * Show trial promotional notice (if any trial exist).
22157
  *
@@ -22705,14 +23426,18 @@
22705
  return;
22706
  }
22707
 
22708
- if ( $this->is_registered() && $this->is_tracking_allowed() ) {
22709
- if ( ! $this->is_enable_anonymous() ) {
22710
- // If opted in and tracking is allowed, don't allow to opt out if anonymous mode is disabled.
22711
- return;
22712
- }
 
 
 
22713
 
22714
- if ( ! $this->is_free_plan() ) {
22715
- // Don't allow to opt out if running in paid plan.
 
22716
  return;
22717
  }
22718
  }
@@ -22792,7 +23517,7 @@
22792
  if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
22793
  if ( $this->is_network_registered() ) {
22794
  $page = 'account';
22795
- } else if ( $this->is_network_anonymous() ) {
22796
  $this->maybe_set_slug_and_network_menu_exists_flag();
22797
  }
22798
  }
@@ -22827,10 +23552,12 @@
22827
  * @since 1.0.3
22828
  */
22829
  function _redirect_on_activation_hook() {
22830
- $url = $this->get_after_plugin_activation_redirect_url();
 
22831
 
22832
- if ( is_string( $url ) ) {
22833
- fs_redirect( $url );
 
22834
  }
22835
  }
22836
 
@@ -22870,7 +23597,7 @@
22870
 
22871
  foreach ( $this->_action_links as $new_links ) {
22872
  foreach ( $new_links as $link ) {
22873
- $before_deactivate[ $link['key'] ] = '<a href="' . $link['href'] . '"' . ( $link['external'] ? ' target="_blank"' : '' ) . '>' . $link['label'] . '</a>';
22874
  }
22875
  }
22876
 
@@ -22990,7 +23717,7 @@
22990
  '';
22991
 
22992
  return sprintf(
22993
- ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
22994
  $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
22995
  ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
22996
  $this->get_latest_download_link( sprintf(
@@ -23243,6 +23970,14 @@
23243
  */
23244
  function set_plugin_upgrade_complete() {
23245
  $this->_storage->plugin_upgrade_mode = false;
 
 
 
 
 
 
 
 
23246
  }
23247
 
23248
  #endregion
351
  */
352
  private $is_whitelabeled;
353
 
354
+ /**
355
+ * @author Leo Fajardo (@leorw)
356
+ * @since 2.4.0
357
+ *
358
+ * @var bool
359
+ */
360
+ private $_is_bundle_license_auto_activation_enabled = false;
361
+
362
  #region Uninstall Reasons IDs
363
 
364
  const REASON_NO_LONGER_NEEDED = 1;
377
  const REASON_DIDNT_WORK_AS_EXPECTED = 14;
378
  const REASON_TEMPORARY_DEACTIVATION = 15;
379
 
380
+ /**
381
+ * @author Leo Fajardo (@leorw)
382
+ * @since 2.3.1
383
+ *
384
+ * @var boolean|null
385
+ */
386
+ private $_use_external_pricing = null;
387
+
388
  #endregion
389
 
390
  /* Ctor
832
  return false;
833
  }
834
 
835
+ if (
836
+ ! $is_tabs_visibility_check &&
837
+ $this->is_org_repo_compliant() &&
838
+ $this->show_settings_with_tabs()
839
+ ) {
840
  /**
841
  * wp.org themes are limited to a single submenu item, and
842
  * sub-submenu items are most likely not allowed (never verified).
1477
  if ( $this->is_plugin() &&
1478
  ! isset( $this->_storage->is_plugin_new_install )
1479
  ) {
1480
+ $this->_storage->is_plugin_new_install = (
1481
+ ! is_plugin_active( $this->_plugin_basename ) &&
1482
+ empty( $this->_storage->plugin_last_version )
1483
+ );
1484
  }
1485
  }
1486
 
1503
  -1 < settings.url.indexOf('admin-ajax.php') &&
1504
  ! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
1505
  ) {
1506
+ if (
1507
+ 'string' === typeof settings.data &&
1508
+ settings.data.indexOf( 'action=heartbeat' ) > 0
1509
+ ) {
1510
+ return;
1511
+ }
1512
+
1513
  if (settings.url.indexOf('?') > 0) {
1514
  settings.url += '&';
1515
  } else {
1517
  }
1518
 
1519
  settings.url += '<?php echo $admin_param ?>=true';
 
1520
  }
1521
  });
1522
  })(jQuery);
1534
  ?>
1535
  <script type="text/javascript">
1536
  (function ($) {
1537
+ $('.fs-submenu-item.wp-support-forum').parent().attr( { target: '_blank', rel: 'noopener noreferrer' } );
1538
  })(jQuery);
1539
  </script>
1540
  <?php
1630
  }
1631
 
1632
  add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
1633
+ add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) );
1634
  }
1635
 
1636
  if ( $this->is_plugin() ) {
1662
 
1663
  add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
1664
 
1665
+ if ( $this->is_theme() && ! $this->is_migration() ) {
1666
  add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
1667
  }
1668
 
1674
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1675
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1676
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
1677
+ $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
1678
 
1679
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1680
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
2037
  * @since 2.0.0
2038
  */
2039
  function _hook_action_links_and_register_account_hooks() {
2040
+ if ( $this->is_migration() ) {
2041
+ return;
2042
+ }
2043
+
2044
  $this->_add_tracking_links();
2045
 
2046
  if ( self::is_plugins_page() && $this->is_plugin() ) {
2221
  );
2222
 
2223
  $store_option = true;
2224
+ } else if (
2225
+ isset( $id_slug_type_path_map[ $module_id ]['slug'] ) &&
2226
+ $slug !== $id_slug_type_path_map[ $module_id ]['slug']
2227
+ ) {
2228
+ $id_slug_type_path_map[ $module_id ]['slug'] = $slug;
2229
+ $store_option = true;
2230
  }
2231
 
2232
  if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
4300
  )
4301
  ),
4302
  sprintf(
4303
+ '<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
4304
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4305
  $install_previous_title,
4306
  $install_previous_desc
4407
  )
4408
  ),
4409
  sprintf(
4410
+ '<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
4411
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4412
  $install_previous_title,
4413
  $install_previous_desc
4928
  } else {
4929
  $is_network_admin = fs_is_network_admin();
4930
 
4931
+ if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
4932
+ // If add-on activated and parent not, automatically install parent for the user.
4933
+ $this->activate_parent_account( $this->_parent );
4934
+ } else if (
4935
  $this->_parent->is_registered() &&
4936
  ! $this->is_registered() &&
 
4937
  /**
4938
  * If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
4939
  * * Network active and in network admin - network activate add-on account.
4947
  */
4948
  ( $this->is_network_active() || ! $is_network_admin )
4949
  ) {
4950
+ $premium_license = null;
4951
+
4952
+ if (
4953
+ ! $this->has_free_plan() &&
4954
+ $this->is_bundle_license_auto_activation_enabled() &&
4955
+ $this->_parent->is_activated_with_bundle_license()
4956
+ ) {
4957
+ /**
4958
+ * If the add-on has no free plan, try to activate the account only when there's a bundle license.
4959
+ *
4960
+ * @author Leo Fajardo (@leorw)
4961
+ * @since 2.4.0
4962
+ */
4963
+ $bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false );
4964
+
4965
+ if (
4966
+ is_object( $bundle_license ) &&
4967
+ ! empty( $bundle_license->products ) &&
4968
+ in_array( $this->get_id(), $bundle_license->products )
4969
+ ) {
4970
+ $premium_license = $bundle_license;
4971
+ }
4972
+ }
4973
+
4974
+ if ( $this->has_free_plan() || is_object( $premium_license) ) {
4975
+ // If parent plugin activated, automatically install add-on for the user.
4976
+ $this->_activate_addon_account(
4977
+ $this->_parent,
4978
+ ( $this->is_network_active() && $is_network_admin ) ?
4979
+ true :
4980
+ get_current_blog_id(),
4981
+ $premium_license
4982
+ );
4983
+ }
4984
  }
4985
 
4986
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
5482
  * @return bool
5483
  */
5484
  function is_extensions_tracking_allowed() {
5485
+ return ( true === $this->apply_filters(
5486
+ 'is_extensions_tracking_allowed',
5487
+ $this->_storage->get( 'is_extensions_tracking_allowed', true )
5488
+ ) );
5489
  }
5490
 
5491
  /**
5671
  $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5672
  }
5673
  $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
5674
+ $this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false );
5675
 
5676
  if ( ! empty( $plugin_info['trial'] ) ) {
5677
  $this->_trial_days = $this->get_numeric_option(
7149
  * @since 1.0.7
7150
  */
7151
  function _admin_init_action() {
7152
+ $is_migration = $this->is_migration();
7153
+
7154
  /**
7155
  * Automatically redirect to connect/activation page after plugin activation.
7156
  *
7163
  /**
7164
  * Don't redirect if activating multiple plugins at once (bulk activation).
7165
  */
7166
+ } else if ( ! $is_migration ) {
7167
  $this->_redirect_on_activation_hook();
7168
  return;
7169
  }
7170
  }
7171
 
7172
+ if ( $is_migration ) {
7173
+ return;
7174
+ }
7175
+
7176
  if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) {
7177
  check_admin_referer( $this->get_unique_affix() . '_skip_activation' );
7178
 
7203
  )
7204
  ) {
7205
  if ( ! $this->is_pending_activation() ) {
7206
+ if ( ! $this->is_activation_page() ) {
7207
  /**
7208
  * If a user visits any other admin page before activating the premium-only theme with a valid
7209
  * license, reactivate the previous theme.
7737
  * @author Leo Fajardo (@leorw)
7738
  * @since 1.2.2
7739
  */
7740
+ if (
7741
+ is_plugin_active( $other_version_basename ) &&
7742
+ $this->apply_filters( 'deactivate_on_activation', true )
7743
+ ) {
7744
  deactivate_plugins( $other_version_basename );
7745
  }
7746
  }
7849
  $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
7850
  }
7851
 
7852
+ /**
7853
+ * Also flush when activating the premium version so that even if Freemius was off before, the API
7854
+ * connectivity test can be run again.
7855
+ *
7856
+ * @author Leo Fajardo (@leorw)
7857
+ * @since 2.2.3.1
7858
+ */
7859
+ $has_api_connectivity = $this->has_api_connectivity( WP_FS__DEV_MODE || $is_premium_version_activation );
7860
+
7861
  if ( ! $this->_anonymous_mode &&
7862
+ $has_api_connectivity &&
7863
  ! $this->_isAutoInstall
7864
  ) {
7865
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
7892
  return;
7893
  }
7894
 
7895
+ $license = $this->get_active_parent_license();
7896
  if ( ! is_object( $license ) ) {
7897
  return;
7898
  }
7899
 
7900
+ if (
7901
+ $this->is_bundle_license_auto_activation_enabled() &&
7902
+ ! empty( $license->products )
7903
+ ) {
7904
+ $this->activate_bundle_license( $license );
7905
+
7906
+ return;
7907
+ }
7908
+
7909
  if ( ! $this->is_registered() ) {
7910
  // Opt in with a license key.
7911
  $this->opt_in(
7928
  }
7929
  }
7930
 
 
7931
  /**
7932
  * @author Leo Fajardo (@leorw)
7933
  * @since 2.3.0
7943
 
7944
  $license = ( ! is_null( $license ) ) ?
7945
  $license :
7946
+ $this->get_active_parent_license();
7947
 
7948
  if ( ! is_object( $license ) ) {
7949
  return;
7950
  }
7951
 
7952
+ if (
7953
+ $this->is_bundle_license_auto_activation_enabled() &&
7954
+ ! empty( $license->products )
7955
+ ) {
7956
+ $this->activate_bundle_license( $license );
7957
+
7958
+ return;
7959
+ }
7960
+
7961
  if ( ! $this->is_network_registered() ) {
7962
  $sites = $this->get_sites_for_network_level_optin();
7963
 
8021
  }
8022
 
8023
  /**
8024
+ * Tries to activate a bundle license for all supported products if the current product is activated with a bundle license. This is called after activating an available license (not via the license activation dialog but by clicking on a license activation button) for a product via its "Account" page.
8025
+ *
8026
+ * @author Leo Fajardo (@leorw)
8027
+ * @since 2.4.0
8028
+ *
8029
+ * @param FS_Plugin_License $license
8030
+ * @param array $sites
8031
+ * @param int $blog_id
8032
+ */
8033
+ private function maybe_activate_bundle_license( FS_Plugin_License $license = null, $sites = array(), $blog_id = 0 ) {
8034
+ if ( ! is_object( $license ) && $this->has_active_valid_license() ) {
8035
+ $license = $this->_license;
8036
+ }
8037
+
8038
+ if ( ! is_object( $license ) ) {
8039
+ return;
8040
+ }
8041
+
8042
+ $parent_license = ( ! empty( $license->products ) ) ?
8043
+ $license :
8044
+ $this->get_active_parent_license( $license->secret_key );
8045
+
8046
+ if ( is_object( $parent_license ) ) {
8047
+ $this->activate_bundle_license( $parent_license, $sites, $blog_id );
8048
+ }
8049
+ }
8050
+
8051
+ /**
8052
+ * Try to activate a bundle license for all the bundle products installed on the site.
8053
+ * (1) If a child product install already has a license, the bundle license won't be activated.
8054
+ * (2) On multi-site networks, if the attempt to activate the bundle license is triggered from the network admin, the bundle license activation will only work for non-delegated sites and only if none of them is associated with a license. Even if one of the sites has the product installed with a license key, skip the bundle license activation for the product.
8055
+ * (3) On multi-site networks, if the attempt to activate the bundle license is triggered from a site-level admin, only activate the license if the product is site-level activated or delegated, and the product installation is not yet associated with a license.
8056
+ *
8057
+ * @author Leo Fajardo (@leorw)
8058
+ * @since 2.4.0
8059
+ *
8060
+ * @param FS_Plugin_License $license
8061
+ * @param array $sites
8062
+ * @param int $current_blog_id
8063
+ */
8064
+ private function activate_bundle_license( $license, $sites = array(), $current_blog_id = 0 ) {
8065
+ $is_network_admin = fs_is_network_admin();
8066
+
8067
+ $installs_by_blog_map = array();
8068
+ $site_info_by_blog_map = array();
8069
+
8070
+ /**
8071
+ * Try to activate the license for all supported products.
8072
+ *
8073
+ * @author Leo Fajardo
8074
+ */
8075
+ foreach ( $license->products as $product_id ) {
8076
+ $fs = self::get_instance_by_id( $product_id );
8077
+
8078
+ if ( ! is_object( $fs ) ) {
8079
+ continue;
8080
+ }
8081
+
8082
+ if ( ! $fs->has_paid_plan() ) {
8083
+ continue;
8084
+ }
8085
+
8086
+ if (
8087
+ ! $fs->is_addon() &&
8088
+ ! FS_Plan_Manager::instance()->has_paid_plan( $fs->_plans )
8089
+ ) {
8090
+ /**
8091
+ * The parent product can be free-only but can have its `has_paid_plan` flag set to `true` when
8092
+ * there is a context bundle.
8093
+ */
8094
+ continue;
8095
+ }
8096
+
8097
+ if ( $current_blog_id > 0 ) {
8098
+ $fs->switch_to_blog( $current_blog_id );
8099
+ }
8100
+
8101
+ if ( $fs->has_active_valid_license() ) {
8102
+ continue;
8103
+ }
8104
+
8105
+ if ( ! $is_network_admin || $current_blog_id > 0 ) {
8106
+ if ( $fs->is_network_active() && ! $fs->is_delegated_connection( $current_blog_id ) ) {
8107
+ // Do not try to activate the license in the site level if the product is network active and the connection was not delegated.
8108
+ continue;
8109
+ }
8110
+ } else {
8111
+ if ( ! $fs->is_network_active() ) {
8112
+ // Do not try to activate the license in the network level if the product is not network active.
8113
+ continue;
8114
+ }
8115
+
8116
+ if ( $fs->is_network_delegated_connection() ) {
8117
+ // Do not try to activate the license in the network level if the activation has been delegated to site admins.
8118
+ continue;
8119
+ }
8120
+
8121
+ $has_install_with_license = false;
8122
+
8123
+ // Collection of sites that have an install entity that is not activated with a license or non-delegated sites that have no install entity, or both types of site.
8124
+ $filtered_sites = array();
8125
+
8126
+ if ( empty( $sites ) ) {
8127
+ $all_sites = self::get_sites();
8128
+
8129
+ foreach ( $all_sites as $site ) {
8130
+ $sites[] = array( 'blog_id' => self::get_site_blog_id( $site ) );
8131
+ }
8132
+ } else {
8133
+ // Populate the map here to avoid calling `$fs->get_site_info( $site );` in the other `for` loop below.
8134
+ foreach ( $sites as $site ) {
8135
+ if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
8136
+ continue;
8137
+ }
8138
+
8139
+ $site_info_by_blog_map[ $site['blog_id'] ] = $site;
8140
+ }
8141
+ }
8142
+
8143
+ foreach ( $sites as $site ) {
8144
+ if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
8145
+ continue;
8146
+ }
8147
+
8148
+ $blog_id = $site['blog_id'];
8149
+
8150
+ if ( ! isset( $installs_by_blog_map[ $blog_id ] ) ) {
8151
+ $installs_by_blog_map[ $blog_id ] = self::get_all_sites( $fs->get_module_type(), $blog_id );
8152
+ }
8153
+
8154
+ $installs = $installs_by_blog_map[ $blog_id ];
8155
+ $install = null;
8156
+
8157
+ if ( isset( $installs[ $fs->get_slug() ] ) ) {
8158
+ $install = $installs[ $fs->get_slug() ];
8159
+
8160
+ if (
8161
+ is_object( $install ) &&
8162
+ (
8163
+ ! FS_Site::is_valid_id( $install->id ) ||
8164
+ ! FS_User::is_valid_id( $install->user_id ) ||
8165
+ ! FS_Plugin_Plan::is_valid_id( $install->plan_id )
8166
+ )
8167
+ ) {
8168
+ $install = null;
8169
+ }
8170
+ }
8171
+
8172
+ if (
8173
+ is_object( $install ) &&
8174
+ FS_Plugin_License::is_valid_id( $install->license_id )
8175
+ ) {
8176
+ $has_install_with_license = true;
8177
+ break;
8178
+ }
8179
+
8180
+ if ( $fs->is_site_delegated_connection( $blog_id ) ) {
8181
+ // Site activation delegated, don't activate bundle license on the site in the network admin.
8182
+ continue;
8183
+ }
8184
+
8185
+ if ( ! isset( $site_info_by_blog_map[ $blog_id ] ) ) {
8186
+ $site_info_by_blog_map[ $blog_id ] = $fs->get_site_info( $site );
8187
+ }
8188
+
8189
+ $filtered_sites[] = $site_info_by_blog_map[ $blog_id ];
8190
+ }
8191
+
8192
+ if ( $has_install_with_license || empty( $filtered_sites ) ) {
8193
+ // Do not try to activate the license at the network level if there's any install with a license or there's no site to activate the license on.
8194
+ continue;
8195
+ }
8196
+
8197
+ $sites = $filtered_sites;
8198
+ }
8199
+
8200
+ $fs->activate_migrated_license(
8201
+ $license->secret_key,
8202
+ null,
8203
+ null,
8204
+ $sites,
8205
+ ( $current_blog_id > 0 ? $current_blog_id : null )
8206
+ );
8207
+ }
8208
+ }
8209
+
8210
+ /**
8211
+ * Returns a parent license that can be activated for the context product.
8212
+ *
8213
  * @author Leo Fajardo (@leorw)
8214
  * @since 2.3.0
8215
  *
8216
+ * @param string|null $license_key
8217
+ * @param bool $flush
8218
+ *
8219
  * @return FS_Plugin_License
8220
  */
8221
+ function get_active_parent_license( $license_key = null, $flush = true ) {
8222
  $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
 
8223
 
8224
+ $fs = $this;
8225
+
8226
+ if ( $this->is_addon() ) {
8227
+ $parent_instance = $this->get_parent_instance();
8228
+
8229
+ if ( is_object( $parent_instance ) && $parent_instance->is_registered() ) {
8230
+ $fs = $parent_instance;
8231
+ }
8232
+ }
8233
+
8234
+ $foreign_licenses = $fs->get_foreign_licenses_info(
8235
  self::get_all_licenses( $this->get_parent_id() )
8236
  );
8237
 
8245
  $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
8246
  }
8247
 
8248
+ $result = $fs->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, $flush );
8249
 
8250
  if (
8251
  ! $this->is_api_result_object( $result, 'licenses' ) ||
8255
  return null;
8256
  }
8257
 
8258
+ $parent_license = null;
8259
 
8260
+ if ( empty( $license_key ) ) {
8261
+ $parent_license = $result->licenses[0];
8262
+ } else {
8263
+ foreach ( $result->licenses as $license ) {
8264
+ if ( $license_key === $license->secret_key ) {
8265
+ $parent_license = $license;
8266
+ break;
8267
+ }
8268
+ }
8269
+ }
8270
+
8271
+ if ( ! is_null( $parent_license ) ) {
8272
+ $parent_license = new FS_Plugin_License( $parent_license );
8273
+ }
8274
+
8275
+ return $parent_license;
8276
  }
8277
 
8278
  /**
9025
  'is_uninstalled' => false,
9026
  );
9027
 
 
9028
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
9029
 
9030
+ $is_site_level_active = (
9031
+ isset( $site_active_plugins[ $basename ] ) &&
9032
+ $site_active_plugins[ $basename ]['is_active']
9033
+ );
9034
+
9035
+ /**
9036
+ * If not network active, set the activity status based on the site-level plugin status.
9037
+ */
9038
+ if ( ! $new_plugin['is_active'] ) {
9039
+ $new_plugin['is_active'] = $is_site_level_active;
9040
+ }
9041
+
9042
+ $plugins_update_data[] = $new_plugin;
9043
+
9044
  if ( isset( $site_active_plugins[ $basename ] ) ) {
9045
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
9046
+ $site_active_plugins_cache->plugins[ $basename ]['is_active'] = $is_site_level_active;
9047
  }
9048
  }
9049
  }
10443
 
10444
  $class_name = '';
10445
 
10446
+ if ( fs_starts_with( $option_name, WP_FS__MODULE_TYPE_THEME . '_' ) ) {
10447
+ $option_name = str_replace( WP_FS__MODULE_TYPE_THEME . '_', '', $option_name );
10448
+ }
10449
+
10450
  switch ( $option_name ) {
10451
  case 'plugins':
10452
  case 'themes':
10731
  return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() );
10732
  }
10733
 
10734
+ /**
10735
+ * @author Leo Fajardo (@leorw)
10736
+ * @since 2.4.0
10737
+ *
10738
+ * @return bool
10739
+ */
10740
+ function is_bundle_license_auto_activation_enabled() {
10741
+ return $this->is_addon() ?
10742
+ ( is_object( $this->_parent ) && $this->_parent->is_bundle_license_auto_activation_enabled() ) :
10743
+ $this->_is_bundle_license_auto_activation_enabled;
10744
+ }
10745
+
10746
  /**
10747
  * @author Vova Feldman (@svovaf)
10748
  * @since 1.0.4
13026
  * @since 1.2.0
13027
  */
13028
  function _add_license_activation() {
13029
+ if ( $this->is_migration() ) {
13030
+ return;
13031
+ }
13032
+
13033
  if ( ! $this->is_user_admin() ) {
13034
  // Only admins can activate a license.
13035
  return;
13088
  return;
13089
  }
13090
 
13091
+ $installs_ids_with_foreign_licenses = $this->get_installs_ids_with_foreign_licenses();
13092
+
13093
+ if ( empty( $installs_ids_with_foreign_licenses ) ) {
13094
  // Handle user change only when the parent product or one of its add-ons is activated with a foreign license.
13095
  return;
13096
  }
13147
  }
13148
  }
13149
 
13150
+ /**
13151
+ * @author Edgar Melkonyan
13152
+ * @since 2.4.1
13153
+ *
13154
+ * @throws Freemius_Exception
13155
+ */
13156
+ function _toggle_whitelabel_mode_ajax_handler() {
13157
+ $this->_logger->entrance();
13158
+
13159
+ $this->check_ajax_referer( 'toggle_whitelabel_mode' );
13160
+
13161
+ if ( ! $this->is_user_admin() ) {
13162
+ // Only for admins.
13163
+ self::shoot_ajax_failure();
13164
+ }
13165
+
13166
+ $license = $this->get_api_user_scope()->call(
13167
+ "/licenses/{$this->_site->license_id}.json",
13168
+ 'put',
13169
+ array( 'is_whitelabeled' => ! $this->_license->is_whitelabeled )
13170
+ );
13171
+
13172
+ if ( ! $this->is_api_result_entity( $license ) ) {
13173
+ self::shoot_ajax_failure(
13174
+ FS_Api::is_api_error_object( $license ) ?
13175
+ $license->error->message :
13176
+ fs_text_inline( "An unknown error has occurred while trying to toggle the license's white-label mode.", 'unknown-error-occurred', $this->get_slug() )
13177
+ );
13178
+ }
13179
+
13180
+ $this->_license->is_whitelabeled = $license->is_whitelabeled;
13181
+ $this->_store_licenses();
13182
+
13183
+ $this->_sync_license();
13184
+
13185
+ if ( ! $license->is_whitelabeled ) {
13186
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
13187
+ } else {
13188
+ $this->_admin_notices->add_sticky(
13189
+ sprintf(
13190
+ $this->get_text_inline(
13191
+ 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.',
13192
+ 'license_whitelabeled'
13193
+ ),
13194
+ "<strong>{$this->get_plugin_title()}</strong>",
13195
+ sprintf( '<a href="https://users.freemius.com" target="_blank">%s</a>', $this->get_text_inline( 'User Dashboard', 'user-dashboard' ) ),
13196
+ sprintf( '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>', $this->get_text_inline( 'revert it now', 'revert-it-now' ) )
13197
+ ),
13198
+ 'license_whitelabeled'
13199
+ );
13200
+ }
13201
+
13202
+ self::shoot_ajax_response( array( 'success' => true ) );
13203
+ }
13204
+
13205
  /**
13206
  * @author Leo Fajardo (@leorw)
13207
  * @since 2.3.0
13281
  exit;
13282
  }
13283
 
13284
+ $sites = fs_is_network_admin() ?
13285
+ fs_request_get( 'sites', array(), 'post' ) :
13286
+ array();
13287
+
13288
  $result = $this->activate_license(
13289
  $license_key,
13290
+ $sites,
 
 
13291
  fs_request_get_bool( 'is_marketing_allowed', null ),
13292
  fs_request_get( 'blog_id', null ),
13293
  fs_request_get( 'module_id', null, 'post' ),
13295
  fs_request_get_bool( 'is_extensions_tracking_allowed', true )
13296
  );
13297
 
13298
+ if (
13299
+ $result['success'] &&
13300
+ $this->is_bundle_license_auto_activation_enabled()
13301
+ ) {
13302
+ $license = new FS_Plugin_License();
13303
+ $license->secret_key = $license_key;
13304
+
13305
+ $this->maybe_activate_bundle_license( $license, $sites );
13306
+ }
13307
+
13308
  echo json_encode( $result );
13309
 
13310
  exit;
13391
  }
13392
 
13393
  /**
13394
+ * @author Leo Fajardo (@leorw)
13395
+ * @since 2.3.2.14
13396
+ */
13397
+ function starting_migration() {
13398
+ if ( ! empty( $this->_storage->license_migration ) ) {
13399
+ // Do not overwrite the data if already set.
13400
+ return;
13401
+ }
13402
+
13403
+ $this->_storage->license_migration = array(
13404
+ 'is_migrating' => true,
13405
+ 'start_timestamp' => time()
13406
+ );
13407
+ }
13408
+
13409
+ /**
13410
+ * @author Leo Fajardo (@leorw)
13411
+ * @since 2.3.2.14
13412
+ */
13413
+ function is_migration() {
13414
+ if ( $this->is_addon() ) {
13415
+ return $this->get_parent_instance()->is_migration();
13416
+ }
13417
+
13418
+ if ( empty( $this->_storage->license_migration ) ) {
13419
+ return false;
13420
+ }
13421
+
13422
+ if ( ! $this->_storage->license_migration['is_migrating'] ) {
13423
+ return false;
13424
+ }
13425
+
13426
+ return (
13427
+ // Return `true` if the migration is within 5 minutes from the starting time.
13428
+ ( time() - $this->_storage->license_migration['start_timestamp'] ) <= WP_FS__TIME_5_MIN_IN_SEC
13429
+ );
13430
+ }
13431
+
13432
+ /**
13433
+ *
13434
  * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license.
13435
  *
13436
  * @author Vova Feldman (@svovaf)
13439
  * @param string $license_key
13440
  * @param null|bool $is_marketing_allowed
13441
  * @param null|number $plugin_id
13442
+ * @param array $sites
13443
+ * @param int $blog_id
13444
  *
13445
  * @return array {
13446
  * @var bool $success
13453
  function activate_migrated_license(
13454
  $license_key,
13455
  $is_marketing_allowed = null,
13456
+ $plugin_id = null,
13457
+ $sites = array(),
13458
+ $blog_id = null
13459
  ) {
13460
  $this->_logger->entrance();
13461
 
13462
  $result = $this->activate_license(
13463
  $license_key,
13464
+ ( empty( $sites ) && is_null( $blog_id ) && $this->is_network_active() ) ?
13465
  $this->get_sites_for_network_level_optin() :
13466
+ $sites,
13467
  $is_marketing_allowed,
13468
+ $blog_id,
13469
  $plugin_id
13470
  );
13471
 
13475
  return $result;
13476
  }
13477
 
13478
+ /**
13479
+ * @author Leo Fajardo (@leorw)
13480
+ * @since 2.3.1
13481
+ *
13482
+ * @return string
13483
+ */
13484
+ function get_pricing_js_path() {
13485
+ return $this->apply_filters( 'freemius_pricing_js_path', WP_FS__DIR_INCLUDES . '/freemius-pricing/freemius-pricing.js' );
13486
+ }
13487
+
13488
+ /**
13489
+ * @author Leo Fajardo (@leorw)
13490
+ * @since 2.3.1
13491
+ *
13492
+ * @return bool
13493
+ */
13494
+ function should_use_external_pricing() {
13495
+ if ( is_null( $this->_use_external_pricing ) ) {
13496
+ $pricing_js_path = $this->get_pricing_js_path();
13497
+
13498
+ $this->_use_external_pricing = ( empty( $pricing_js_path ) || ! file_exists( $pricing_js_path ) );
13499
+ }
13500
+
13501
+ return $this->_use_external_pricing;
13502
+ }
13503
+
13504
  /**
13505
  * The implementation of this method was previously in `_activate_license_ajax_action()`.
13506
  *
13533
 
13534
  $license_key = trim( $license_key );
13535
 
13536
+ $is_network_activation_or_migration = (
13537
+ fs_is_network_admin() ||
13538
+ ( ! empty( $sites ) && $this->is_migration() )
13539
+ );
13540
+
13541
+ if ( ! $is_network_activation_or_migration ) {
13542
  // If the license activation is executed outside the context of a network admin, ignore the sites collection.
13543
  $sites = array();
13544
  }
13567
  $user = $fs->get_current_or_network_user();
13568
  }
13569
 
13570
+ if ( $has_valid_blog_id ) {
13571
+ /**
13572
+ * If a specific blog ID was provided, activate the license only on the specific blog that is associated with the given blog ID.
13573
+ *
13574
+ * @author Leo Fajardo (@leorw)
13575
+ */
13576
+ $fs->switch_to_blog( $blog_id );
13577
+ }
13578
+
13579
  if ( is_object( $user ) ) {
13580
+ if ( $is_network_activation_or_migration && ! $has_valid_blog_id ) {
13581
  // If no specific blog ID was provided, activate the license for all sites in the network.
13582
  $blog_2_install_map = array();
13583
  $site_ids = array();
13616
  }
13617
  }
13618
  } else {
 
 
 
 
 
 
 
 
 
 
13619
  if ( $fs->is_registered() ) {
13620
  $params = array(
13621
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
13670
  if ( empty( $error ) ) {
13671
  $fs->network_upgrade_mode_completed();
13672
 
13673
+ $fs->_user = $user;
13674
+
13675
+ if ( fs_is_network_admin() && ! $has_valid_blog_id ) {
13676
+ $fs->_site = $fs->get_network_install();
13677
+ }
13678
+
13679
  $fs->_sync_license( true, $has_valid_blog_id );
13680
 
13681
  $this->maybe_sync_install_user();
13682
 
13683
  $next_page = $fs->is_addon() ?
13684
  $fs->get_parent_instance()->get_account_url() :
13685
+ $fs->get_after_activation_url( 'after_connect_url' );
13686
  }
13687
  } else {
13688
  $next_page = $fs->opt_in(
13700
  if ( isset( $next_page->error ) ) {
13701
  $error = $next_page->error;
13702
  } else {
13703
+ if ( $is_network_activation_or_migration ) {
13704
  /**
13705
  * Get the list of sites that were just opted-in (and license activated).
13706
  * This is an optimization for the next part below saving some DB queries.
14814
  * @return bool
14815
  */
14816
  function is_user_in_admin() {
14817
+ return (
14818
+ is_admin() &&
14819
+ ! self::is_ajax() &&
14820
+ ! self::is_cron() &&
14821
+ ( 'admin-post.php' !== self::get_current_page() )
14822
+ );
14823
  }
14824
 
14825
  /**
15131
  if ( function_exists( 'get_sites' ) ) {
15132
  // For WP 4.6 and above.
15133
  return get_sites( $args );
15134
+ } else if ( function_exists( 'wp_' . 'get_sites' ) ) {
15135
  // For WP 3.7 to WP 4.5.
15136
+ /**
15137
+ * This is a hack suggested previously proposed by the TRT. Our SDK is compliant with older WP versions and we'd like to keep it that way.
15138
+ *
15139
+ * @todo Remove this hack once this false-positive error is removed from the Theme Sniffer.
15140
+ *
15141
+ * @since 2.3.3
15142
+ * @author Vova Feldman (@svovaf)
15143
+ */
15144
+ $fn = 'wp_' . 'get_sites';
15145
+ return $fn( $args );
15146
  } else {
15147
  // For WP 3.6 and below.
15148
  return get_blog_list( 0, 'all' );
15319
  * @return bool Since 2.3.1 returns if a switch was made.
15320
  */
15321
  function switch_to_blog( $blog_id, FS_Site $install = null ) {
15322
+ if ( ! is_numeric( $blog_id ) || $blog_id == $this->_context_is_network_or_blog_id ) {
15323
  return false;
15324
  }
15325
 
16706
  'http' => 402
16707
  );
16708
 
16709
+ $this->maybe_modify_api_curl_error_message( $result );
16710
+
16711
  return $result;
16712
  }
16713
 
17554
  * @author Vova Feldman (@svovaf)
17555
  * @since 1.0.6
17556
  *
17557
+ * @param Freemius $parent_fs
17558
+ * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network.
17559
+ * @param FS_Plugin_License $bundle_license Since 2.4.0. If provided, this license will be activated for the add-on.
17560
  */
17561
+ private function _activate_addon_account(
17562
+ Freemius $parent_fs,
17563
+ $network_level_or_blog_id = null,
17564
+ FS_Plugin_License $bundle_license = null
17565
+ ) {
17566
  if ( $this->is_registered() ) {
17567
  // Already activated.
17568
  return;
17601
  }
17602
  }
17603
 
17604
+ if ( is_object( $bundle_license ) ) {
17605
+ $params['license_key'] = $bundle_license->secret_key;
17606
+ }
17607
+
17608
  // Activate add-on with parent plugin credentials.
17609
  $result = $parent_fs->get_api_site_scope()->call(
17610
  "/addons/{$this->_plugin->id}/installs.json",
17613
  );
17614
 
17615
  if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
17616
+ if ( is_object( $bundle_license ) ) {
17617
+ /**
17618
+ * When a license object is provided, it's an attempt by the SDK to activate a bundle license and not a user-initiated action, therefore, do not show any admin notice to avoid confusion (e.g.: the notice will show up just above the opt-in link). If the license activation fails, the admin will see an opt-in link instead.
17619
+ *
17620
+ * @author Leo Fajardo (@leorw)
17621
+ * @since 2.4.0
17622
+ */
17623
+ } else {
17624
+ $error_message = FS_Api::is_api_error_object( $result ) ?
17625
+ $result->error->message :
17626
+ $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' );
17627
 
17628
+ $this->_admin_notices->add(
17629
+ sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
17630
+ $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $error_message . '</b>',
17631
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17632
+ 'error'
17633
+ );
17634
+ }
17635
 
17636
  return;
17637
  }
17664
 
17665
  if ( ! fs_is_network_admin() ) {
17666
  // Try to activate premium license.
17667
+ $this->_activate_license( true, $bundle_license );
 
 
17668
 
17669
+ if ( is_object( $bundle_license ) ) {
17670
+ $this->maybe_activate_bundle_license( $bundle_license );
 
 
 
 
17671
  }
17672
+ } else {
17673
+ if ( is_object( $bundle_license ) ) {
17674
+ $premium_license = $bundle_license;
17675
+ } else {
17676
+ $license_id = fs_request_get( 'license_id' );
17677
 
17678
+ if ( is_object( $this->_site ) &&
17679
+ FS_Plugin_License::is_valid_id( $license_id ) &&
17680
+ $license_id == $this->_site->license_id
17681
+ ) {
17682
+ // License is already activated.
17683
+ return;
17684
+ }
17685
+
17686
+ $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ?
17687
+ $this->_get_license_by_id( $license_id ) :
17688
+ $this->_get_available_premium_license();
17689
+ }
17690
 
17691
  if ( is_object( $premium_license ) ) {
17692
  $this->maybe_network_activate_addon_license( $premium_license );
19984
  *
19985
  * @author Vova Feldman (@svovaf)
19986
  * @since 1.2.1
19987
+ *
19988
+ * @param bool $check_expiration
19989
  */
19990
+ function has_active_valid_license( $check_expiration = true ) {
19991
+ return self::is_active_valid_license( $this->_license, $check_expiration );
19992
  }
19993
 
19994
  /**
20080
  * @since 2.1.3
20081
  *
20082
  * @param FS_Plugin_License $license
20083
+ * @param bool $check_expiration
20084
  *
20085
  * @return bool
20086
  */
20087
+ private static function is_active_valid_license( $license, $check_expiration = true ) {
20088
  return (
20089
  is_object( $license ) &&
20090
  FS_Plugin_License::is_valid_id( $license->id ) &&
20091
  $license->is_active() &&
20092
+ ( ! $check_expiration || $license->is_valid() )
20093
  );
20094
  }
20095
 
20143
  );
20144
  }
20145
 
20146
+ /**
20147
+ * Checks if the product is activated with a bundle license.
20148
+ *
20149
+ * @author Leo Fajardo (@leorw)
20150
+ * @since 2.4.0
20151
+ *
20152
+ * @return bool
20153
+ */
20154
+ function is_activated_with_bundle_license() {
20155
+ if ( ! $this->has_features_enabled_license() ) {
20156
+ return false;
20157
+ }
20158
+
20159
+ return FS_Plugin_License::is_valid_id( $this->_license->parent_license_id );
20160
+ }
20161
+
20162
  /**
20163
  * Check if user is a trial or have feature enabled license.
20164
  *
20751
  }
20752
 
20753
  if ( 'none' !== $plan_change ) {
20754
+ if (
20755
+ ! is_object( $this->_license ) ||
20756
+ ! $this->_license->is_whitelabeled
20757
+ ) {
20758
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
20759
+ }
20760
+
20761
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20762
  }
20763
  }
21481
  */
21482
  private function get_latest_download_link( $label, $plugin_id = false ) {
21483
  return sprintf(
21484
+ '<a target="_blank" rel="noopener" href="%s">%s</a>',
21485
  $this->_get_latest_download_local_url( $plugin_id ),
21486
  $label
21487
  );
21552
  $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ),
21553
  $update->version,
21554
  sprintf(
21555
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
21556
  $this->get_account_url( 'download_latest' ),
21557
  sprintf(
21558
  /* translators: %s: plan name (e.g. latest "Professional" version) */
22039
  $this->get_plugin_title(),
22040
  fs_strip_url_protocol( get_site_url( $blog_id ) ),
22041
  sprintf(
22042
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
22043
  'https://freemius.com',
22044
  'freemius.com'
22045
  )
22138
 
22139
  if ( is_object( $fs ) ) {
22140
  $fs->_activate_license();
22141
+
22142
+ /**
22143
+ * Remove the product ID from `$_REQUEST` so that the syncing of the license for the other products will work properly.
22144
+ *
22145
+ * @author Leo Fajardo (@leorw)
22146
+ * @since 2.4.0
22147
+ */
22148
+ unset( $_REQUEST['plugin_id'] );
22149
+
22150
+ if ( $this->is_bundle_license_auto_activation_enabled() ) {
22151
+ $fs->maybe_activate_bundle_license( null, array(), is_numeric( $blog_id ) ? $blog_id : 0 );
22152
+ }
22153
  }
22154
 
22155
  return;
22372
 
22373
  $this->_handle_account_edits();
22374
 
22375
+ if (
22376
+ is_object( $this->_license ) &&
22377
+ $this->_license->user_id == $this->_user->id &&
22378
+ ! $this->is_whitelabeled( true )
22379
+ ) {
22380
+ $this->_admin_notices->add(
22381
+ sprintf(
22382
+ $this->get_text_inline( "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin.", 'license_not_whitelabeled' ),
22383
+ sprintf(
22384
+ '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>',
22385
+ $this->get_text_inline( 'Click here', 'click-here' )
22386
+ )
22387
+ ),
22388
+ '',
22389
+ 'success',
22390
+ false,
22391
+ 'license_not_whitelabeled'
22392
+ );
22393
+ }
22394
+
22395
  $this->do_action( 'account_page_load_before_departure' );
22396
  }
22397
 
22528
  }
22529
  }
22530
 
22531
+ /**
22532
+ * @author Leo Fajardo (@leorw)
22533
+ * @since 2.3.1
22534
+ */
22535
+ function _maybe_add_pricing_ajax_handler() {
22536
+ if ( ! $this->should_use_external_pricing() ) {
22537
+ $this->add_ajax_action( 'pricing_ajax_action', array( &$this, '_fs_pricing_ajax_action_handler' ) );
22538
+ }
22539
+ }
22540
+
22541
+ /**
22542
+ * @author Leo Fajardo (@leorw)
22543
+ * @since 2.3.1
22544
+ */
22545
+ function _fs_pricing_ajax_action_handler() {
22546
+ $this->check_ajax_referer( 'pricing_ajax_action' );
22547
+
22548
+ $result = null;
22549
+ $pricing_action = fs_request_get( 'pricing_action' );
22550
+
22551
+ switch ( $pricing_action ) {
22552
+ case 'fetch_pricing_data':
22553
+ $params = array(
22554
+ 'is_enriched' => true,
22555
+ 'trial' => fs_request_get_bool( 'trial' ),
22556
+ 'sandbox' => fs_request_get( 'sandbox' ),
22557
+ 's_ctx_type' => fs_request_get( 's_ctx_type' ),
22558
+ 's_ctx_id' => fs_request_get( 's_ctx_id' ),
22559
+ 's_ctx_ts' => fs_request_get( 's_ctx_