Plugin Directory

Changeset 3203370


Ignore:
Timestamp:
12/06/2024 03:46:38 AM (16 months ago)
Author:
intoxstudio
Message:

3.21

Location:
content-aware-sidebars/trunk
Files:
25 added
1 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • content-aware-sidebars/trunk/app.php

    r3092858 r3203370  
    1212{
    1313    const PLUGIN_VERSION_KEY = 'cas_db_version';
    14     const PLUGIN_VERSION = '3.20';
     14    const PLUGIN_VERSION = '3.21';
    1515
    1616    /**
  • content-aware-sidebars/trunk/changelog.txt

    r3092858 r3203370  
     1= 3.19.3 =
     2
     3* [new] wordpress 6.4 support
     4* [new] minimum wordpress version 5.1
     5* [new] minimum php version 7.0
     6* [new] performance improvements
     7* [updated] wp-content-aware-engine library
     8
     9= 3.19.2 =
     10
     11* [new] wordpress 6.3 support
     12* [updated] freemius sdk
     13
     14**Pro Plan:**
     15
     16* [updated] sticky support for more themes
     17
     18= 3.19.1 =
     19
     20* [updated] freemius sdk
     21
     22= 3.19 =
     23
     24* [new] performance improvements
     25* [new] ui improvements
     26* [new] sidebar shortcode parameter for conditional display
     27* [new] wordpress 6.2 support
     28* [updated] freemius sdk
     29
     30**Pro Plan:**
     31
     32* [new] "random" display condition
     33* [new] widget revision support when updating via REST API or Block Editor
    134
    235= 3.18.1 =
  • content-aware-sidebars/trunk/content-aware-sidebars.php

    r3092858 r3203370  
    99 * Plugin URI:        https://dev.institute/wordpress-sidebars/
    1010 * Description:       Unlimited custom sidebars and widget areas for any post, page, category etc.
    11  * Version:           3.20
     11 * Version:           3.21
    1212 * Author:            DEV Institute
    1313 * Author URI:        https://dev.institute
  • content-aware-sidebars/trunk/freemius.php

    r3092858 r3203370  
    5757        );
    5858        $cas_fs->add_filter( 'show_affiliate_program_notice', '__return_false' );
    59         $cas_fs->add_filter( 'plugin_icon', 'cas_fs_get_plugin_icon' );
     59        $cas_fs->add_filter( 'plugin_icon', function () {
     60            return dirname( __FILE__ ) . '/assets/img/icon.png';
     61        } );
    6062        $cas_fs->add_filter( 'permission_extensions_default', '__return_true' );
    6163        $cas_fs->add_filter( 'hide_freemius_powered_by', '__return_true' );
     64        $cas_fs->add_filter( 'pricing/show_annual_in_monthly', '__return_false' );
     65        $cas_fs->add_filter( 'pricing/disable_single_package', '__return_true' );
    6266    }
    6367    return $cas_fs;
     
    8084        $freemius_link
    8185    );
    82 }
    83 
    84 function cas_fs_get_plugin_icon() {
    85     return dirname( __FILE__ ) . '/assets/img/icon.png';
    8686}
    8787
  • content-aware-sidebars/trunk/lib/freemius/assets/css/admin/account.css

    r3092858 r3203370  
    1 label.fs-tag,span.fs-tag{background:#ffba00;border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;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{border-left-color:#00a0d2;color:inherit}.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{border-bottom:1px solid #f1f1f1;font-size:1.3em;line-height:1.4;margin:0 0 12px;padding:12px 15px}#fs_account h3 .dashicons{font-size:1.3em;height:26px;width:26px}#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{font-size:.9em;position:absolute;right:15px;top:17px}#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:700}.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 code,.fs-key-value-table input[type=text],.fs-key-value-table var{background:none;color:#0073aa;font-size:16px}.fs-key-value-table input[type=text]{font-weight:700;width:100%}.fs-field-beta_program label{margin-left:7px}label.fs-tag{border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;vertical-align:baseline}label.fs-tag,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{border:1px solid #e5e5e5;max-height:200px;overflow:auto}#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{color:gray;text-align:right;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{white-space:nowrap;width:1px}#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{font-weight:700;text-align:left}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:700}#fs_billing_address{width:100%}#fs_billing_address tr td{padding:5px;width:50%}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:700}#fs_billing_address input,#fs_billing_address select{display:block;margin-top:5px;width:100%}#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{background:none;border-color:transparent;border-bottom:1px dashed #ccc;color:#777;padding-left:0}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{background:none;border-color:transparent;border-bottom:1px dashed #ccc;color:#777;padding-left:0}#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%}@media screen and (max-width:639px){#fs_account .fs-header-actions{margin:0 0 12px;padding:0 15px 12px;position:static}#fs_account .fs-header-actions li{display:inline-block;float:none}#fs_account #fs_account_details,#fs_account #fs_account_details tbody,#fs_account #fs_account_details td,#fs_account #fs_account_details th,#fs_account #fs_account_details tr{display:block}#fs_account #fs_account_details tr td:first-child{text-align:left}#fs_account #fs_account_details tr td:nth-child(2){padding:0 12px}#fs_account #fs_account_details tr td:nth-child(2) code{margin:0;padding:0}#fs_account #fs_account_details tr td:nth-child(2) label{margin-left:0}#fs_account #fs_account_details tr td:nth-child(3){text-align:left}#fs_account #fs_account_details tr.fs-field-plan td:nth-child(2) .button-group{float:none;margin:12px 0}}
     1label.fs-tag,span.fs-tag{background:#ffba00;border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;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{border-left-color:#00a0d2;color:inherit}.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{border-bottom:1px solid #f1f1f1;font-size:1.3em;line-height:1.4;margin:0 0 12px;padding:12px 15px}#fs_account h3 .dashicons{font-size:1.3em;height:26px;width:26px}#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{font-size:.9em;position:absolute;right:15px;top:17px}#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:700}.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 code,.fs-key-value-table input[type=text],.fs-key-value-table var{background:none;color:#0073aa;font-size:16px}.fs-key-value-table input[type=text]{font-weight:700;width:100%}.fs-field-beta_program label{margin-left:7px}label.fs-tag{border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;vertical-align:baseline}label.fs-tag,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{border:1px solid #e5e5e5;max-height:200px;overflow:auto}#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{color:gray;text-align:right;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{white-space:nowrap;width:1px}#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{font-weight:700;text-align:left}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:700}#fs_billing_address{width:100%}#fs_billing_address tr td{padding:5px;width:50%}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:700}#fs_billing_address input,#fs_billing_address select{display:block;margin-top:5px;width:100%}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent}#fs_billing_address input::placeholder,#fs_billing_address select::placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{background:none;border-color:transparent;border-bottom:1px dashed #ccc;color:#777;padding-left:0}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{background:none;border-color:transparent;border-bottom:1px dashed #ccc;color:#777;padding-left:0}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::placeholder,#fs_billing_address.fs-read-mode select::placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}@media screen and (max-width:639px){#fs_account .fs-header-actions{margin:0 0 12px;padding:0 15px 12px;position:static}#fs_account .fs-header-actions li{display:inline-block;float:none}#fs_account #fs_account_details,#fs_account #fs_account_details tbody,#fs_account #fs_account_details td,#fs_account #fs_account_details th,#fs_account #fs_account_details tr{display:block}#fs_account #fs_account_details tr td:first-child{text-align:left}#fs_account #fs_account_details tr td:nth-child(2){padding:0 12px}#fs_account #fs_account_details tr td:nth-child(2) code{margin:0;padding:0}#fs_account #fs_account_details tr td:nth-child(2) label{margin-left:0}#fs_account #fs_account_details tr td:nth-child(3){text-align:left}#fs_account #fs_account_details tr.fs-field-plan td:nth-child(2) .button-group{float:none;margin:12px 0}}
  • content-aware-sidebars/trunk/lib/freemius/assets/css/admin/checkout.css

    r3092858 r3203370  
    1 @media screen and (max-width:782px){#wpbody-content{padding-bottom:0!important}}
     1.fs-ajax-loader{height:20px;margin:auto;position:relative;width:170px}.fs-ajax-loader .fs-ajax-loader-bar{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;animation-name:bounce_ajaxLoader;background-color:#fff;height:20px;position:absolute;top:0;transform:scale(.3);width:20px}.fs-ajax-loader .fs-ajax-loader-bar-1{animation-delay:.6s;left:0}.fs-ajax-loader .fs-ajax-loader-bar-2{animation-delay:.75s;left:19px}.fs-ajax-loader .fs-ajax-loader-bar-3{animation-delay:.9s;left:38px}.fs-ajax-loader .fs-ajax-loader-bar-4{animation-delay:1.05s;left:57px}.fs-ajax-loader .fs-ajax-loader-bar-5{animation-delay:1.2s;left:76px}.fs-ajax-loader .fs-ajax-loader-bar-6{animation-delay:1.35s;left:95px}.fs-ajax-loader .fs-ajax-loader-bar-7{animation-delay:1.5s;left:114px}.fs-ajax-loader .fs-ajax-loader-bar-8{animation-delay:1.65s;left:133px}@keyframes bounce_ajaxLoader{0%{background-color:#0074a3;transform:scale(1)}to{background-color:#fff;transform:scale(.3)}}@media screen and (max-width:782px){#wpbody-content{padding-bottom:0!important}}.fs-checkout-process-redirect{padding:40px;text-align:center}
  • content-aware-sidebars/trunk/lib/freemius/assets/css/admin/common.css

    r3092858 r3203370  
    1 .fs-badge{background:#71ae00;border-radius:3px 0 0 3px;border-right:0;box-shadow:0 2px 1px -1px rgba(0,0,0,.3);color:#fff;font-weight:700;padding:5px 10px;position:absolute;right:0;text-transform:uppercase;top:10px}.theme-browser .theme .fs-premium-theme-badge-container{position:absolute;right:0;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge{margin-top:10px;position:relative;text-align:center;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-premium-theme-badge{font-size:1.1em}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-beta-theme-badge{background:#00a0d2}.fs-switch{background:#ececec;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.1),inset 0 1px 3px 0 rgba(0,0,0,.1);color:#ccc;cursor:pointer;display:inline-block;height:18px;padding:6px 6px 5px;position:relative;text-shadow:0 1px 1px hsla(0,0%,100%,.8)}.fs-switch span{display:inline-block;text-transform:uppercase;width:35px}.fs-switch .fs-toggle{background-color:#fff;background-image:linear-gradient(180deg,#ececec,#fff);border:1px solid rgba(0,0,0,.3);border-radius:4px;box-shadow:inset 0 1px 0 0 hsla(0,0%,100%,.5);height:25px;position:absolute;top:1px;transition:.4s cubic-bezier(.54,1.6,.5,1);width:37px;z-index:999}.fs-switch.fs-off .fs-toggle{left:2%}.fs-switch.fs-on .fs-toggle{left:54%}.fs-switch.fs-round{border-radius:24px;padding:4px 25px;top:8px}.fs-switch.fs-round .fs-toggle{border-radius:24px;height:24px;top:0;width:24px}.fs-switch.fs-round.fs-off .fs-toggle{left:-1px}.fs-switch.fs-round.fs-on{background:#0085ba}.fs-switch.fs-round.fs-on .fs-toggle{left:25px}.fs-switch.fs-small.fs-round{padding:1px 19px}.fs-switch.fs-small.fs-round .fs-toggle{border-radius:18px;height:18px;top:0;width:18px}.fs-switch.fs-small.fs-round.fs-on .fs-toggle{left:19px}body.fs-loading,body.fs-loading *{cursor:wait!important}#fs_frame{font-size:0;line-height:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media(max-width:600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px!important}.fs-notice.success{color:green}.fs-notice.promotion{background-color:#f2fcff!important;border-color:#00a0d2!important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{color:#aaa;cursor:pointer;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{display:inline-block;margin-top:7px}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,.3);border-radius:0 0 3px 3px;bottom:auto;color:#fff;cursor:auto;font-size:12px;font-weight:700;left:10px;padding:2px 10px;position:absolute;right:auto;top:100%}div.fs-notice.promotion,div.fs-notice.success,div.fs-notice.updated{display:block!important}#fs_connect .fs-error .fs-api-request-error-details,#fs_connect .fs-error .fs-api-request-error-show-details-link,#fs_connect .fs-error ol,.fs-modal .notice-error .fs-api-request-error-details,.fs-modal .notice-error .fs-api-request-error-show-details-link,.fs-modal .notice-error ol,.fs-notice.error .fs-api-request-error-details,.fs-notice.error .fs-api-request-error-show-details-link,.fs-notice.error ol{text-align:left}#fs_connect .fs-error ol,.fs-modal .notice-error ol,.fs-notice.error ol{list-style-type:disc}#fs_connect .fs-error .fs-api-request-error-show-details-link,.fs-modal .notice-error .fs-api-request-error-show-details-link,.fs-notice.error .fs-api-request-error-show-details-link{box-shadow:none;color:#2271b1;text-decoration:none}#fs_connect .fs-error .fs-api-request-error-details,.fs-modal .notice-error .fs-api-request-error-details,.fs-notice.error .fs-api-request-error-details{border:1px solid #ccc;max-height:150px;overflow:auto;padding:5px}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{background:#ebfdeb;box-shadow:0 2px 2px rgba(6,113,6,.3);color:green;filter:alpha(opacity=95);left:160px;opacity:.95;padding:10px 20px;position:fixed;right:0;top:32px;z-index:9999}.fs-secure-notice:hover{filter:alpha(opacity=100);opacity:1}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width:960px){.fs-secure-notice{left:36px}}@media screen and (max-width:600px){.fs-secure-notice{display:none}}@media screen and (max-width:1250px){#fs_promo_tab{display:none}}@media screen and (max-width:782px){.fs-secure-notice{left:0;text-align:center;top:46px}}span.fs-submenu-item.fs-sub:before{content:"↳";padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:"↲"}.fs-submenu-item.pricing.upgrade-mode{color:#adff2f}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{background:url(/wp-admin/images/wpspin_light-2x.gif);background-size:contain;border:0;display:inline-block;height:20px;margin-bottom:-2px;margin-right:5px;vertical-align:sub;width:20px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{background-color:#d54e21;border:0;color:#f9f9f9;margin-top:10px;padding:10px}
     1.fs-badge{background:#71ae00;border-radius:3px 0 0 3px;border-right:0;box-shadow:0 2px 1px -1px rgba(0,0,0,.3);color:#fff;font-weight:700;padding:5px 10px;position:absolute;right:0;text-transform:uppercase;top:10px}.theme-browser .theme .fs-premium-theme-badge-container{position:absolute;right:0;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge{margin-top:10px;position:relative;text-align:center;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-premium-theme-badge{font-size:1.1em}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-beta-theme-badge{background:#00a0d2}.fs-switch{background:#ececec;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);box-shadow:0 0 4px rgba(0,0,0,.1),inset 0 1px 3px 0 rgba(0,0,0,.1);color:#ccc;cursor:pointer;display:inline-block;height:18px;padding:6px 6px 5px;position:relative;text-shadow:0 1px 1px hsla(0,0%,100%,.8)}.fs-switch span{display:inline-block;text-transform:uppercase;width:35px}.fs-switch .fs-toggle{background-color:#fff;background-image:linear-gradient(180deg,#ececec,#fff);border:1px solid rgba(0,0,0,.3);border-radius:4px;box-shadow:inset 0 1px 0 0 hsla(0,0%,100%,.5);height:25px;position:absolute;top:1px;transition:.4s cubic-bezier(.54,1.6,.5,1);width:37px;z-index:999}.fs-switch.fs-off .fs-toggle{left:2%}.fs-switch.fs-on .fs-toggle{left:54%}.fs-switch.fs-round{border-radius:24px;padding:4px 25px;top:8px}.fs-switch.fs-round .fs-toggle{border-radius:24px;height:24px;top:0;width:24px}.fs-switch.fs-round.fs-off .fs-toggle{left:-1px}.fs-switch.fs-round.fs-on{background:#0085ba}.fs-switch.fs-round.fs-on .fs-toggle{left:25px}.fs-switch.fs-small.fs-round{padding:1px 19px}.fs-switch.fs-small.fs-round .fs-toggle{border-radius:18px;height:18px;top:0;width:18px}.fs-switch.fs-small.fs-round.fs-on .fs-toggle{left:19px}body.fs-loading,body.fs-loading *{cursor:wait!important}#fs_frame{font-size:0;line-height:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media(max-width:600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px!important}.fs-notice.success{color:green}.fs-notice.promotion{background-color:#f2fcff!important;border-color:#00a0d2!important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{color:#aaa;cursor:pointer;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{display:inline-block;margin-top:7px}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,.3);border-radius:0 0 3px 3px;bottom:auto;color:#fff;cursor:auto;font-size:12px;font-weight:700;left:10px;padding:2px 10px;position:absolute;right:auto;top:100%}div.fs-notice.promotion,div.fs-notice.success,div.fs-notice.updated{display:block!important}#fs_connect .fs-error .fs-api-request-error-details,#fs_connect .fs-error .fs-api-request-error-show-details-link,#fs_connect .fs-error ol,.fs-modal .notice-error .fs-api-request-error-details,.fs-modal .notice-error .fs-api-request-error-show-details-link,.fs-modal .notice-error ol,.fs-notice.error .fs-api-request-error-details,.fs-notice.error .fs-api-request-error-show-details-link,.fs-notice.error ol{text-align:left}#fs_connect .fs-error ol,.fs-modal .notice-error ol,.fs-notice.error ol{list-style-type:disc}#fs_connect .fs-error .fs-api-request-error-show-details-link,.fs-modal .notice-error .fs-api-request-error-show-details-link,.fs-notice.error .fs-api-request-error-show-details-link{box-shadow:none;color:#2271b1;text-decoration:none}#fs_connect .fs-error .fs-api-request-error-details,.fs-modal .notice-error .fs-api-request-error-details,.fs-notice.error .fs-api-request-error-details{border:1px solid #ccc;max-height:150px;overflow:auto;padding:5px}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{background:#ebfdeb;box-shadow:0 2px 2px rgba(6,113,6,.3);color:green;left:160px;opacity:.95;padding:10px 20px;position:fixed;right:0;top:32px;z-index:9989}.fs-secure-notice:hover{opacity:1}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width:960px){.fs-secure-notice{left:36px}}@media screen and (max-width:600px){.fs-secure-notice{display:none}}@media screen and (max-width:1250px){#fs_promo_tab{display:none}}@media screen and (max-width:782px){.fs-secure-notice{left:0;text-align:center;top:46px}}span.fs-submenu-item.fs-sub:before{content:"↳";padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:"↲"}.fs-submenu-item.pricing.upgrade-mode{color:#adff2f}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{background:url(/wp-admin/images/wpspin_light-2x.gif);background-size:contain;border:0;display:inline-block;height:20px;margin-bottom:-2px;margin-right:5px;vertical-align:sub;width:20px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{background-color:#d54e21;border:0;color:#f9f9f9;margin-top:10px;padding:10px}
  • content-aware-sidebars/trunk/lib/freemius/assets/css/admin/dialog-boxes.css

    r3092858 r3203370  
    1 .fs-modal{background:rgba(0,0,0,.6);display:none;height:100%;overflow:auto;position:fixed;top:0;width:100%;z-index:100000}@media(min-width:961px){.fs-modal{padding-left:160px}.rtl .fs-modal{padding-left:0;padding-right:160px}}.fs-modal .dashicons{vertical-align:middle}.fs-modal .fs-modal-dialog{background:transparent;left:50%;margin-left:-298px;padding-bottom:30px;position:absolute;top:-100%;width:596px;z-index:100001}@media(max-width:650px){.fs-modal .fs-modal-dialog{box-sizing:border-box;margin-left:-50%;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active,.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{background:#fefefe;border:0;padding:20px}.fs-modal .fs-modal-header{background:#fbfbfb;border-bottom:1px solid #eee;margin-bottom:-10px;padding:15px 20px;position:relative}.fs-modal .fs-modal-header h4{color:#cacaca;font-size:1.2em;font-weight:700;letter-spacing:.6px;margin:0;padding:0;text-shadow:1px 1px 1px #fff;text-transform:uppercase;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{border-radius:20px;color:#bbb;cursor:pointer;padding:3px;position:absolute;right:10px;top:12px;transition:all .2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{background:#aaa;color:#fff}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-size:20px;font-weight:700;margin-top:0}.fs-modal .fs-modal-footer{border-top:1px solid #eee;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:last-of-type{margin:0}.fs-modal .fs-modal-panel>.notice.inline{display:none;margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{left:20px;right:auto}.rtl .fs-modal .fs-modal-footer{text-align:left}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .internal-message,.fs-modal.fs-modal-deactivation-feedback .reason-input{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea,.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;display:none;padding:7px}@media(max-width:650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label,.fs-modal.fs-modal-deactivation-feedback .feedback-from-snooze-label{float:left;line-height:30px}.rtl .fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label,.rtl .fs-modal.fs-modal-deactivation-feedback .feedback-from-snooze-label{float:right}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0!important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{line-height:1.5em;margin-top:0}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:700;margin-bottom:0;padding:0 25px}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;position:relative;top:5px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-license-options-container table,.fs-license-options-container table .fs-available-license-key,.fs-license-options-container table select,.fs-modal.fs-modal-license-activation .fs-modal-body input.fs-license-key{width:100%}.fs-license-options-container table td:first-child{width:1%}.fs-license-options-container table .fs-other-license-key-container label{float:left;margin-right:5px;position:relative;top:6px}.fs-license-options-container table .fs-other-license-key-container div{display:block;height:30px;overflow:hidden;position:relative;top:2px;width:auto}.fs-license-options-container table .fs-other-license-key-container div input{margin:0}.fs-sites-list-container td{cursor:pointer}.fs-modal.fs-modal-user-change .fs-modal-body input#fs_other_email_address{width:100%}.fs-user-change-options-container table{border-collapse:collapse;width:100%}.fs-user-change-options-container table tr{display:block;margin-bottom:2px}.fs-user-change-options-container table .fs-email-address-container td{display:inline-block}.fs-user-change-options-container table .fs-email-address-container input[type=radio]{margin-bottom:0;margin-top:0}.fs-user-change-options-container table .fs-other-email-address-container{width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div{display:table;width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div label,.fs-user-change-options-container table .fs-other-email-address-container>div>div{display:table-cell}.fs-user-change-options-container table .fs-other-email-address-container>div label{padding-left:3px;padding-right:3px;width:1%}.fs-user-change-options-container table .fs-other-email-address-container>div>div{width:auto}.fs-modal.fs-modal-developer-license-debug-mode .fs-modal-body input.fs-license-or-user-key,.fs-user-change-options-container table .fs-other-email-address-container>div>div input{width:100%}.fs-multisite-options-container{border:1px solid #ccc;margin-top:20px;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:700}.fs-multisite-options-container.fs-apply-on-all-sites{border:0;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media(max-width:650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-left:0;margin-right:7px}a.show-license-resend-modal{display:inline-block;margin-top:4px}.fs-modal.fs-modal-email-address-update .fs-modal-body input[type=text]{width:100%}.fs-modal.fs-modal-email-address-update p{margin-bottom:0}.fs-modal.fs-modal-email-address-update ul{margin:1em .5em}.fs-modal.fs-modal-email-address-update ul li label span{float:left;margin-top:0}.fs-modal.fs-modal-email-address-update ul li label span:last-child{display:block;float:none;margin-left:20px}.fs-ajax-loader{height:20px;margin:auto;position:relative;width:170px}.fs-ajax-loader .fs-ajax-loader-bar{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;animation-name:bounce_ajaxLoader;background-color:#0074a3;height:20px;position:absolute;top:0;transform:.3;width:20px}.fs-ajax-loader .fs-ajax-loader-bar-1{animation-delay:.6s;-o-animation-delay:.6s;-ms-animation-delay:.6s;-webkit-animation-delay:.6s;-moz-animation-delay:.6s;left:0}.fs-ajax-loader .fs-ajax-loader-bar-2{animation-delay:.75s;-o-animation-delay:.75s;-ms-animation-delay:.75s;-webkit-animation-delay:.75s;-moz-animation-delay:.75s;left:19px}.fs-ajax-loader .fs-ajax-loader-bar-3{animation-delay:.9s;-o-animation-delay:.9s;-ms-animation-delay:.9s;-webkit-animation-delay:.9s;-moz-animation-delay:.9s;left:38px}.fs-ajax-loader .fs-ajax-loader-bar-4{animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s;left:57px}.fs-ajax-loader .fs-ajax-loader-bar-5{animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s;left:76px}.fs-ajax-loader .fs-ajax-loader-bar-6{animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s;left:95px}.fs-ajax-loader .fs-ajax-loader-bar-7{animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s;left:114px}.fs-ajax-loader .fs-ajax-loader-bar-8{animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s;left:133px}@keyframes bounce_ajaxLoader{0%{background-color:#0074a3;transform:scale(1)}to{background-color:#fff;transform:scale(.3)}}.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons,.fs-modal-auto-install #request-filesystem-credentials-form h2{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;max-width:100%;padding:10px 10px 5px;width:300px}.fs-modal-auto-install #request-filesystem-credentials-form fieldset,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form>div{display:block;margin:0 auto;max-width:100%;width:300px}.button-primary.warn{background:#f56a48;border-color:#ec6544 #d2593c #d2593c;box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{background:#e76444!important;border-color:#d85e40!important;color:#f5b3a1!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important}
     1.fs-modal{background:rgba(0,0,0,.6);display:none;height:100%;overflow:auto;position:fixed;top:0;width:100%;z-index:100000}@media(min-width:961px){.fs-modal{padding-left:160px}.rtl .fs-modal{padding-left:0;padding-right:160px}}.fs-modal .dashicons{vertical-align:middle}.fs-modal .fs-modal-dialog{background:transparent;left:50%;margin-left:-298px;padding-bottom:30px;position:absolute;top:-100%;width:596px;z-index:100001}@media(max-width:650px){.fs-modal .fs-modal-dialog{box-sizing:border-box;margin-left:-50%;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active,.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{background:#fefefe;border:0;padding:20px}.fs-modal .fs-modal-header{background:#fbfbfb;border-bottom:1px solid #eee;margin-bottom:-10px;padding:15px 20px;position:relative}.fs-modal .fs-modal-header h4{color:#cacaca;font-size:1.2em;font-weight:700;letter-spacing:.6px;margin:0;padding:0;text-shadow:1px 1px 1px #fff;text-transform:uppercase;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{border-radius:20px;color:#bbb;cursor:pointer;padding:3px;position:absolute;right:10px;top:12px;transition:all .2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{background:#aaa;color:#fff}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-size:20px;font-weight:700;margin-top:0}.fs-modal .fs-modal-footer{border-top:1px solid #eee;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:last-of-type{margin:0}.fs-modal .fs-modal-panel>.notice.inline{display:none;margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{left:20px;right:auto}.rtl .fs-modal .fs-modal-footer{text-align:left}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .internal-message,.fs-modal.fs-modal-deactivation-feedback .reason-input{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea,.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;display:none;padding:7px}@media(max-width:650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label,.fs-modal.fs-modal-deactivation-feedback .feedback-from-snooze-label{float:left;line-height:30px}.rtl .fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label,.rtl .fs-modal.fs-modal-deactivation-feedback .feedback-from-snooze-label{float:right}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0!important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{font-size:16px;line-height:1.5em;margin-bottom:0;margin-top:10px}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:700;margin-bottom:0;padding:0 25px}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;position:relative;top:5px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-license-options-container table,.fs-license-options-container table .fs-available-license-key,.fs-license-options-container table select,.fs-modal.fs-modal-license-activation .fs-modal-body input.fs-license-key{width:100%}.fs-license-options-container table td:first-child{width:1%}.fs-license-options-container table .fs-other-license-key-container label{float:left;margin-right:5px;position:relative;top:6px}.fs-license-options-container table .fs-other-license-key-container div{display:block;height:30px;overflow:hidden;position:relative;top:2px;width:auto}.fs-license-options-container table .fs-other-license-key-container div input{margin:0}.fs-sites-list-container td{cursor:pointer}.fs-modal.fs-modal-user-change .fs-modal-body input#fs_other_email_address{width:100%}.fs-user-change-options-container table{border-collapse:collapse;width:100%}.fs-user-change-options-container table tr{display:block;margin-bottom:2px}.fs-user-change-options-container table .fs-email-address-container td{display:inline-block}.fs-user-change-options-container table .fs-email-address-container input[type=radio]{margin-bottom:0;margin-top:0}.fs-user-change-options-container table .fs-other-email-address-container{width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div{display:table;width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div label,.fs-user-change-options-container table .fs-other-email-address-container>div>div{display:table-cell}.fs-user-change-options-container table .fs-other-email-address-container>div label{padding-left:3px;padding-right:3px;width:1%}.fs-user-change-options-container table .fs-other-email-address-container>div>div{width:auto}.fs-modal.fs-modal-developer-license-debug-mode .fs-modal-body input.fs-license-or-user-key,.fs-user-change-options-container table .fs-other-email-address-container>div>div input{width:100%}.fs-multisite-options-container{border:1px solid #ccc;margin-top:20px;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:700}.fs-multisite-options-container.fs-apply-on-all-sites{border:0;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media(max-width:650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-left:0;margin-right:7px}a.show-license-resend-modal{display:inline-block;margin-top:4px}.fs-modal.fs-modal-email-address-update .fs-modal-body input[type=text]{width:100%}.fs-modal.fs-modal-email-address-update p{margin-bottom:0}.fs-modal.fs-modal-email-address-update ul{margin:1em .5em}.fs-modal.fs-modal-email-address-update ul li label span{float:left;margin-top:0}.fs-modal.fs-modal-email-address-update ul li label span:last-child{display:block;float:none;margin-left:20px}.fs-ajax-loader{height:20px;margin:auto;position:relative;width:170px}.fs-ajax-loader .fs-ajax-loader-bar{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;animation-name:bounce_ajaxLoader;background-color:#fff;height:20px;position:absolute;top:0;transform:scale(.3);width:20px}.fs-ajax-loader .fs-ajax-loader-bar-1{animation-delay:.6s;left:0}.fs-ajax-loader .fs-ajax-loader-bar-2{animation-delay:.75s;left:19px}.fs-ajax-loader .fs-ajax-loader-bar-3{animation-delay:.9s;left:38px}.fs-ajax-loader .fs-ajax-loader-bar-4{animation-delay:1.05s;left:57px}.fs-ajax-loader .fs-ajax-loader-bar-5{animation-delay:1.2s;left:76px}.fs-ajax-loader .fs-ajax-loader-bar-6{animation-delay:1.35s;left:95px}.fs-ajax-loader .fs-ajax-loader-bar-7{animation-delay:1.5s;left:114px}.fs-ajax-loader .fs-ajax-loader-bar-8{animation-delay:1.65s;left:133px}@keyframes bounce_ajaxLoader{0%{background-color:#0074a3;transform:scale(1)}to{background-color:#fff;transform:scale(.3)}}.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons,.fs-modal-auto-install #request-filesystem-credentials-form h2{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;max-width:100%;padding:10px 10px 5px;width:300px}.fs-modal-auto-install #request-filesystem-credentials-form fieldset,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form>div{display:block;margin:0 auto;max-width:100%;width:300px}.button-primary.warn{background:#f56a48;border-color:#ec6544 #d2593c #d2593c;box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{background:#e76444!important;border-color:#d85e40!important;color:#f5b3a1!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important}
  • content-aware-sidebars/trunk/lib/freemius/includes/class-freemius.php

    r3092858 r3203370  
    109109         */
    110110        private $_enable_anonymous = true;
     111
     112        /**
     113         * @since 2.9.1
     114         * @var string|null Hints the SDK whether the plugin supports parallel activation mode, preventing the auto-deactivation of the free version when the premium version is activated, and vice versa.
     115         */
     116        private $_premium_plugin_basename_from_parallel_activation;
    111117
    112118        /**
     
    382388        /**
    383389         * @author Leo Fajardo (@leorw)
    384          * @since 2.3.1
    385          *
    386          * @var boolean|null
    387          */
    388         private $_use_external_pricing = null;
    389         /**
    390          * @author Leo Fajardo (@leorw)
    391390         * @since 2.4.2
    392391         *
     
    12581257         * @return bool
    12591258         */
    1260         private static function set_network_upgrade_mode( FS_Storage $storage ) {
     1259        public static function set_network_upgrade_mode( FS_Storage $storage ) {
    12611260            return $storage->is_network_activation = true;
    12621261        }
     
    13811380
    13821381        /**
    1383          * Opens the support forum subemenu item in a new browser page.
    1384          *
    1385          * @author Vova Feldman (@svovaf)
     1382         * Modifies all external links in the submenu by altering their href, and also opens them in new tab if needed.
     1383         *
     1384         * @author Vova Feldman (@svovaf)
     1385         * @author Swashata Ghosh (@swashata)
    13861386         * @since  2.1.4
    13871387         */
    1388         static function _open_support_forum_in_new_page() {
     1388        static function _handle_submenu_external_link() {
    13891389            ?>
    13901390            <script type="text/javascript">
    1391                 (function ($) {
    1392                     $('.fs-submenu-item.wp-support-forum').parent().attr( { target: '_blank', rel: 'noopener noreferrer' } );
    1393                 })(jQuery);
     1391                (function ( $ ) {
     1392                    $( '.fs-submenu-item' ).each( function () {
     1393                        var $this = $( this ),
     1394                            $parent = $this.parent(),
     1395                            externalLink = $this.data( 'fs-external-url' ),
     1396                            isOpensInNewTab = $this.data( 'fs-new-tab' );
     1397
     1398                        if ( externalLink ) {
     1399                            $parent.attr( 'href', externalLink );
     1400                        }
     1401
     1402                        if ( isOpensInNewTab ) {
     1403                            $parent.attr( { target: '_blank', rel: 'noopener noreferrer' } );
     1404                        }
     1405                    } );
     1406                } )( jQuery );
    13941407            </script>
    13951408            <?php
     
    14881501
    14891502                add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
    1490                 add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) );
     1503                add_action( 'init', array( &$this, '_add_pricing_ajax_handler' ) );
    14911504            }
    14921505
     
    15841597                add_action( 'admin_init', array( &$this, 'connect_again' ) );
    15851598            }
     1599
     1600            FS_DebugManager::register_hooks();
    15861601        }
    15871602
     
    16431658                }
    16441659            }
     1660
     1661            if (
     1662                $this->is_user_in_admin() &&
     1663                $this->is_parallel_activation() &&
     1664                $this->_premium_plugin_basename !== $this->premium_plugin_basename_from_parallel_activation
     1665            ) {
     1666                $this->_premium_plugin_basename = $this->premium_plugin_basename_from_parallel_activation;
     1667
     1668                register_activation_hook(
     1669                    dirname( $this->_plugin_dir_path ) . '/' . $this->_premium_plugin_basename,
     1670                    array( &$this, '_activate_plugin_event_hook' )
     1671                );
     1672            }
     1673        }
     1674
     1675        /**
     1676         * Determines if a plugin is running in parallel activation mode.
     1677         *
     1678         * @author Leo Fajardo (@leorw)
     1679         * @since 2.9.1
     1680         *
     1681         * @return bool
     1682         */
     1683        private function is_parallel_activation() {
     1684            return ! empty( $this->premium_plugin_basename_from_parallel_activation );
    16451685        }
    16461686
     
    27022742         * @since  2.4.3
    27032743         */
    2704         private static function reset_deactivation_snoozing( $period = 0 ) {
     2744        public static function reset_deactivation_snoozing( $period = 0 ) {
    27052745            $value = ( 0 === $period ) ? null : 'true';
    27062746
     
    34193459            self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );
    34203460
    3421             if ( ! WP_FS__DEMO_MODE ) {
    3422                 add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
    3423                     'Freemius',
    3424                     '_add_debug_section'
    3425                 ) );
    3426             }
    3427 
    3428             add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );
    3429 
    3430             self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );
    3431 
    3432             self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );
    3433 
    3434             self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );
     3461            FS_DebugManager::load_required_static();
    34353462
    34363463            if ( 0 == did_action( 'plugins_loaded' ) ) {
     
    34413468            add_action( 'init', array( $clone_manager, '_init' ) );
    34423469
    3443             add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );
     3470            add_action( 'admin_footer', array( 'Freemius', '_handle_submenu_external_link' ) );
    34443471
    34453472            if ( self::is_plugins_page() || self::is_themes_page() ) {
     
    34573484
    34583485            self::$_statics_loaded = true;
     3486        }
     3487
     3488        public static function get_static_logger() {
     3489            return self::$_static_logger;
     3490        }
     3491
     3492        public static function get_accounts() {
     3493            return self::$_accounts;
    34593494        }
    34603495
     
    36273662         * @since 2.1.3
    36283663         */
    3629         private static function migrate_options_to_network() {
     3664        public static function migrate_options_to_network() {
    36303665            self::migrate_accounts_to_network();
    36313666
     
    36633698                $fs_active_plugins->newest->sdk_path . '/languages/'
    36643699            );
    3665         }
    3666 
    3667         #endregion
    3668 
    3669         #----------------------------------------------------------------------------------
    3670         #region Debugging
    3671         #----------------------------------------------------------------------------------
    3672 
    3673         /**
    3674          * @author Vova Feldman (@svovaf)
    3675          * @since  1.0.8
    3676          */
    3677         static function _add_debug_section() {
    3678             if ( ! is_super_admin() ) {
    3679                 // Add debug page only for super-admins.
    3680                 return;
    3681             }
    3682 
    3683             self::$_static_logger->entrance();
    3684 
    3685             $title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
    3686 
    3687             if ( WP_FS__DEV_MODE ) {
    3688                 // Add top-level debug menu item.
    3689                 $hook = FS_Admin_Menu_Manager::add_page(
    3690                     $title,
    3691                     $title,
    3692                     'manage_options',
    3693                     'freemius',
    3694                     array( 'Freemius', '_debug_page_render' )
    3695                 );
    3696             } else {
    3697                 // Add hidden debug page.
    3698                 $hook = FS_Admin_Menu_Manager::add_subpage(
    3699                     '',
    3700                     $title,
    3701                     $title,
    3702                     'manage_options',
    3703                     'freemius',
    3704                     array( 'Freemius', '_debug_page_render' )
    3705                 );
    3706             }
    3707 
    3708             if ( ! empty( $hook ) ) {
    3709                 add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) );
    3710             }
    3711         }
    3712 
    3713         /**
    3714          * @author Vova Feldman (@svovaf)
    3715          * @since  1.1.7.3
    3716          */
    3717         static function _toggle_debug_mode() {
    3718             check_admin_referer( 'fs_toggle_debug_mode' );
    3719 
    3720             if ( ! is_super_admin() ) {
    3721                 return;
    3722             }
    3723 
    3724             $is_on = fs_request_get( 'is_on', false, 'post' );
    3725 
    3726             if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
    3727                 update_option( 'fs_debug_mode', $is_on );
    3728 
    3729                 // Turn on/off storage logging.
    3730                 FS_Logger::_set_storage_logging( ( 1 == $is_on ) );
    3731             }
    3732 
    3733             exit;
    3734         }
    3735 
    3736         /**
    3737          * @author Vova Feldman (@svovaf)
    3738          * @since  1.2.1.6
    3739          */
    3740         static function _get_debug_log() {
    3741             check_admin_referer( 'fs_get_debug_log' );
    3742 
    3743             if ( ! is_super_admin() ) {
    3744                 return;
    3745             }
    3746 
    3747             $limit  = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
    3748             $offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
    3749 
    3750             $logs = FS_Logger::load_db_logs(
    3751                 fs_request_get( 'filters', false, 'post' ),
    3752                 $limit,
    3753                 $offset
    3754             );
    3755 
    3756             self::shoot_ajax_success( $logs );
    3757         }
    3758 
    3759         /**
    3760          * @author Vova Feldman (@svovaf)
    3761          * @since  1.2.1.7
    3762          */
    3763         static function _get_db_option() {
    3764             check_admin_referer( 'fs_get_db_option' );
    3765 
    3766             $option_name = fs_request_get( 'option_name' );
    3767 
    3768             if ( ! is_super_admin() ||
    3769                  ! fs_starts_with( $option_name, 'fs_' )
    3770             ) {
    3771                 self::shoot_ajax_failure();
    3772             }
    3773 
    3774             $value = get_option( $option_name );
    3775 
    3776             $result = array(
    3777                 'name' => $option_name,
    3778             );
    3779 
    3780             if ( false !== $value ) {
    3781                 if ( ! is_string( $value ) ) {
    3782                     $value = json_encode( $value );
    3783                 }
    3784 
    3785                 $result['value'] = $value;
    3786             }
    3787 
    3788             self::shoot_ajax_success( $result );
    3789         }
    3790 
    3791         /**
    3792          * @author Vova Feldman (@svovaf)
    3793          * @since  1.2.1.7
    3794          */
    3795         static function _set_db_option() {
    3796             check_admin_referer( 'fs_set_db_option' );
    3797 
    3798             $option_name = fs_request_get( 'option_name' );
    3799 
    3800             if ( ! is_super_admin() ||
    3801                  ! fs_starts_with( $option_name, 'fs_' )
    3802             ) {
    3803                 self::shoot_ajax_failure();
    3804             }
    3805 
    3806             $option_value = fs_request_get_raw( 'option_value' );
    3807 
    3808             if ( ! empty( $option_value ) ) {
    3809                 update_option( $option_name, $option_value );
    3810             }
    3811 
    3812             self::shoot_ajax_success();
    3813         }
    3814 
    3815         /**
    3816          * @author Vova Feldman (@svovaf)
    3817          * @since  1.0.8
    3818          */
    3819         static function _debug_page_actions() {
    3820             self::_clean_admin_content_section();
    3821 
    3822             if ( fs_request_is_action( 'restart_freemius' ) ) {
    3823                 check_admin_referer( 'restart_freemius' );
    3824 
    3825                 if ( ! is_multisite() ) {
    3826                     // Clear accounts data.
    3827                     self::$_accounts->clear( null, true );
    3828                 } else {
    3829                     $sites = self::get_sites();
    3830                     foreach ( $sites as $site ) {
    3831                         $blog_id = self::get_site_blog_id( $site );
    3832                         self::$_accounts->clear( $blog_id, true );
    3833                     }
    3834 
    3835                     // Clear network level storage.
    3836                     self::$_accounts->clear( true, true );
    3837                 }
    3838 
    3839                 // Clear SDK reference cache.
    3840                 delete_option( 'fs_active_plugins' );
    3841             } else if ( fs_request_is_action( 'clear_updates_data' ) ) {
    3842                 check_admin_referer( 'clear_updates_data' );
    3843 
    3844                 if ( ! is_multisite() ) {
    3845                     set_site_transient( 'update_plugins', null );
    3846                     set_site_transient( 'update_themes', null );
    3847                 } else {
    3848                     $current_blog_id = get_current_blog_id();
    3849 
    3850                     $sites = self::get_sites();
    3851                     foreach ( $sites as $site ) {
    3852                         switch_to_blog( self::get_site_blog_id( $site ) );
    3853 
    3854                         set_site_transient( 'update_plugins', null );
    3855                         set_site_transient( 'update_themes', null );
    3856                     }
    3857 
    3858                     switch_to_blog( $current_blog_id );
    3859                 }
    3860             } else if ( fs_request_is_action( 'reset_deactivation_snoozing' ) ) {
    3861                 check_admin_referer( 'reset_deactivation_snoozing' );
    3862 
    3863                 self::reset_deactivation_snoozing();
    3864             } else if ( fs_request_is_action( 'simulate_trial' ) ) {
    3865                 check_admin_referer( 'simulate_trial' );
    3866 
    3867                 $fs = freemius( fs_request_get( 'module_id' ) );
    3868 
    3869                 // Update SDK install to at least 24 hours before.
    3870                 $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
    3871                 // Unset the trial shown timestamp.
    3872                 unset( $fs->_storage->trial_promotion_shown );
    3873             } else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) {
    3874                 check_admin_referer( 'simulate_network_upgrade' );
    3875 
    3876                 $fs = freemius( fs_request_get( 'module_id' ) );
    3877 
    3878                 self::set_network_upgrade_mode( $fs->_storage );
    3879             } else if ( fs_request_is_action( 'delete_install' ) ) {
    3880                 check_admin_referer( 'delete_install' );
    3881 
    3882                 self::_delete_site_by_slug(
    3883                     fs_request_get( 'slug' ),
    3884                     fs_request_get( 'module_type' ),
    3885                     true,
    3886                     fs_request_get( 'blog_id', null )
    3887                 );
    3888             } else if ( fs_request_is_action( 'delete_user' ) ) {
    3889                 check_admin_referer( 'delete_user' );
    3890 
    3891                 self::delete_user( fs_request_get( 'user_id' ) );
    3892             } else if ( fs_request_is_action( 'download_logs' ) ) {
    3893                 check_admin_referer( 'download_logs' );
    3894 
    3895                 $download_url = FS_Logger::download_db_logs(
    3896                     fs_request_get( 'filters', false, 'post' )
    3897                 );
    3898 
    3899                 if ( false === $download_url ) {
    3900                     wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' );
    3901                 }
    3902 
    3903                 fs_redirect( $download_url );
    3904             } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
    3905                 check_admin_referer( 'migrate_options_to_network' );
    3906 
    3907                 self::migrate_options_to_network();
    3908             }
    3909         }
    3910 
    3911         /**
    3912          * @author Leo Fajardo (@leorw)
    3913          * @since  2.5.0
    3914          *
    3915          * @return array
    3916          */
    3917         static function get_all_modules_sites() {
    3918             self::$_static_logger->entrance();
    3919 
    3920             $sites_by_type = array(
    3921                 WP_FS__MODULE_TYPE_PLUGIN => array(),
    3922                 WP_FS__MODULE_TYPE_THEME  => array(),
    3923             );
    3924 
    3925             $module_types = array_keys( $sites_by_type );
    3926 
    3927             if ( ! is_multisite() ) {
    3928                 foreach ( $module_types as $type ) {
    3929                     $sites_by_type[ $type ] = self::get_all_sites( $type );
    3930 
    3931                     foreach ( $sites_by_type[ $type ] as $slug => $install ) {
    3932                         $sites_by_type[ $type ][ $slug ] = array( $install );
    3933                     }
    3934                 }
    3935             } else {
    3936                 $sites = self::get_sites();
    3937 
    3938                 foreach ( $sites as $site ) {
    3939                     $blog_id = self::get_site_blog_id( $site );
    3940 
    3941                     foreach ( $module_types as $type ) {
    3942                         $installs = self::get_all_sites( $type, $blog_id );
    3943 
    3944                         foreach ( $installs as $slug => $install ) {
    3945                             if ( ! isset( $sites_by_type[ $type ][ $slug ] ) ) {
    3946                                 $sites_by_type[ $type ][ $slug ] = array();
    3947                             }
    3948 
    3949                             $install->blog_id = $blog_id;
    3950 
    3951                             $sites_by_type[ $type ][ $slug ][] = $install;
    3952                         }
    3953 
    3954                     }
    3955                 }
    3956             }
    3957 
    3958             return $sites_by_type;
    3959         }
    3960 
    3961         /**
    3962          * @author Vova Feldman (@svovaf)
    3963          * @since  1.0.8
    3964          */
    3965         static function _debug_page_render() {
    3966             self::$_static_logger->entrance();
    3967 
    3968             $all_modules_sites = self::get_all_modules_sites();
    3969 
    3970             $licenses_by_module_type = self::get_all_licenses_by_module_type();
    3971 
    3972             $vars = array(
    3973                 'plugin_sites'    => $all_modules_sites[ WP_FS__MODULE_TYPE_PLUGIN ],
    3974                 'theme_sites'     => $all_modules_sites[ WP_FS__MODULE_TYPE_THEME ],
    3975                 'users'           => self::get_all_users(),
    3976                 'addons'          => self::get_all_addons(),
    3977                 'account_addons'  => self::get_all_account_addons(),
    3978                 'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ],
    3979                 'theme_licenses'  => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ]
    3980             );
    3981 
    3982             fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
    3983             fs_require_once_template( 'debug.php', $vars );
    39843700        }
    39853701
     
    41753891                isset( $this->_storage->connectivity_test['is_active'] )
    41763892            ) {
    4177                 $is_active = $this->_storage->connectivity_test['is_active'];
     3893                $is_connected = isset( $this->_storage->connectivity_test['is_connected'] ) ?
     3894                    $this->_storage->connectivity_test['is_connected'] :
     3895                    null;
     3896                $is_active    = ( $this->_storage->connectivity_test['is_active'] || is_object( $this->_site ) );
    41783897            } else {
    4179                 $is_active = $this->should_turn_fs_on( $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ) );
    4180 
    4181                 $this->store_connectivity_info( (object) array( 'is_active' => $is_active ), null );
    4182             }
     3898                $is_connected = null;
     3899                $is_active    = $this->should_turn_fs_on( $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ) );
     3900            }
     3901
     3902            $this->store_connectivity_info( (object) array( 'is_active' => $is_active ), $is_connected );
    41833903
    41843904            if ( $is_active ) {
     
    54675187                new FS_Plugin();
    54685188
     5189            $is_premium     = $this->get_bool_option( $plugin_info, 'is_premium', true );
    54695190            $premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' );
     5191
     5192            $module_type = $this->get_option( $plugin_info, 'type', $this->_module_type );
     5193
     5194            $parallel_activation = $this->get_option( $plugin_info, 'parallel_activation' );
     5195
     5196            if (
     5197                ! $is_premium &&
     5198                is_array( $parallel_activation ) &&
     5199                ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ) &&
     5200                $this->get_bool_option( $parallel_activation, 'enabled' )
     5201            ) {
     5202                $premium_basename = $this->get_option( $parallel_activation, 'premium_version_basename' );
     5203
     5204                if ( empty( $premium_basename ) ) {
     5205                    throw new Exception('You need to specify the premium version basename to enable parallel version activation.');
     5206                }
     5207
     5208                $this->premium_plugin_basename_from_parallel_activation = $premium_basename;
     5209
     5210                if ( is_plugin_active( $premium_basename ) ) {
     5211                    $is_premium = true;
     5212                }
     5213            }
    54705214
    54715215            $plugin->update( array(
    54725216                'id'                   => $id,
    5473                 'type'                 => $this->get_option( $plugin_info, 'type', $this->_module_type ),
     5217                'type'                 => $module_type,
    54745218                'public_key'           => $public_key,
    54755219                'slug'                 => $this->_slug,
     
    54795223                'title'                => $this->get_plugin_name( $premium_suffix ),
    54805224                'file'                 => $this->_plugin_basename,
    5481                 'is_premium'           => $this->get_bool_option( $plugin_info, 'is_premium', true ),
     5225                'is_premium'           => $is_premium,
    54825226                'premium_suffix'       => $premium_suffix,
    54835227                'is_live'              => $this->get_bool_option( $plugin_info, 'is_live', true ),
     
    54855229                'bundle_id'            => $this->get_option( $plugin_info, 'bundle_id', null ),
    54865230                'bundle_public_key'    => $this->get_option( $plugin_info, 'bundle_public_key', null ),
    5487                 'opt_in_moderation'    => $this->get_option( $plugin_info, 'opt_in', null ),
     5231                'opt_in_moderation'    => $this->get_option(
     5232                    $plugin_info,
     5233                    'opt_in',
     5234                    // For backward compatibility, we support both parameter names: opt_in and opt_in_moderation.
     5235                    $this->get_option( $plugin_info, 'opt_in_moderation', null )
     5236                ),
    54885237            ) );
    54895238
     
    55435292            } else {
    55445293                $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
    5545                 $this->_anonymous_mode   = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
     5294                $this->_anonymous_mode   = (
     5295                    $this->get_bool_option( $plugin_info, 'anonymous_mode', false ) ||
     5296                    (
     5297                        $this->apply_filters( 'playground_anonymous_mode', true ) &&
     5298                        ! empty( $_SERVER['HTTP_HOST'] ) &&
     5299                        FS_Site::is_playground_wp_environment_by_host( $_SERVER['HTTP_HOST'] )
     5300                    )
     5301                );
    55465302            }
    55475303            $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
     
    57515507            if ( $this->is_registered() ) {
    57525508                // Schedule code type changes event.
    5753                 $this->schedule_install_sync();
     5509                $this->maybe_schedule_install_sync_cron();
    57545510            }
    57555511
     
    68156571
    68166572        /**
     6573         * Instead of running blocking install sync event, execute non blocking scheduled cron job.
     6574         *
     6575         * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding specified blog ID from being the cron job executor.
     6576         *
     6577         * @author Leo Fajardo (@leorw)
     6578         * @since  2.9.1
     6579         */
     6580        private function maybe_schedule_install_sync_cron( $except_blog_id = 0 ) {
     6581            if ( ! $this->is_user_in_admin() ) {
     6582                return;
     6583            }
     6584
     6585            if ( $this->is_clone() ) {
     6586                return;
     6587            }
     6588
     6589            if (
     6590                // The event has been properly scheduled, so no need to reschedule it.
     6591                is_numeric( $this->next_install_sync() )
     6592            ) {
     6593                return;
     6594            }
     6595
     6596            $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
     6597        }
     6598
     6599        /**
    68176600         * @author Vova Feldman (@svovaf)
    68186601         * @since  1.1.7.3
     
    69096692        private function get_install_sync_cron_blog_id() {
    69106693            return $this->get_cron_blog_id( 'install_sync' );
    6911         }
    6912 
    6913         /**
    6914          * Instead of running blocking install sync event, execute non blocking scheduled wp-cron.
    6915          *
    6916          * @author Vova Feldman (@svovaf)
    6917          * @since  1.1.7.3
    6918          *
    6919          * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
    6920          */
    6921         private function schedule_install_sync( $except_blog_id = 0 ) {
    6922             if ( $this->is_clone() ) {
    6923                 return;
    6924             }
    6925 
    6926             $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
    69276694        }
    69286695
     
    74757242
    74767243        /**
    7477          * Delete user.
    7478          *
    7479          * @author Vova Feldman (@svovaf)
    7480          * @since  2.0.0
    7481          *
    7482          * @param number $user_id
    7483          * @param bool   $store
    7484          *
    7485          * @return false|int The user ID if deleted. Otherwise, FALSE (when install not exist).
    7486          */
    7487         private static function delete_user( $user_id, $store = true ) {
    7488             $users = self::get_all_users();
    7489 
    7490             if ( ! is_array( $users ) || ! isset( $users[ $user_id ] ) ) {
    7491                 return false;
    7492             }
    7493 
    7494             unset( $users[ $user_id ] );
    7495 
    7496             self::$_accounts->set_option( 'users', $users, $store );
    7497 
    7498             return $user_id;
    7499         }
    7500 
    7501         /**
    75027244         * Delete plugin's plans information.
    75037245         *
     
    77437485                if (
    77447486                    is_plugin_active( $other_version_basename ) &&
    7745                     $this->apply_filters( 'deactivate_on_activation', true )
     7487                    $this->apply_filters( 'deactivate_on_activation', ! $this->is_parallel_activation() )
    77467488                ) {
    77477489                    deactivate_plugins( $other_version_basename );
     
    77577499                // Schedule re-activation event and sync.
    77587500//              $this->sync_install( array(), true );
    7759                 $this->schedule_install_sync();
     7501                $this->maybe_schedule_install_sync_cron();
    77607502
    77617503                // If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
     
    89488690            }
    89498691
    8950             $this->schedule_install_sync();
     8692            $this->maybe_schedule_install_sync_cron();
    89518693//          $this->sync_install( array(), true );
    89528694        }
     
    1063410376         * @return array[string]FS_Site
    1063510377         */
    10636         private static function get_all_sites(
     10378        public static function get_all_sites(
    1063710379            $module_type = WP_FS__MODULE_TYPE_PLUGIN,
    1063810380            $blog_id = null,
     
    1066310405         * @return mixed
    1066410406         */
    10665         private static function get_account_option( $option_name, $module_type = null, $network_level_or_blog_id = null ) {
     10407        public static function get_account_option( $option_name, $module_type = null, $network_level_or_blog_id = null ) {
    1066610408            if ( ! is_null( $module_type ) && WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) {
    1066710409                $option_name = $module_type . '_' . $option_name;
     
    1079810540         * @since  2.0.0
    1079910541         *
    10800          * @return array
    10801          */
    10802         private static function get_all_licenses_by_module_type() {
    10803             $licenses = self::get_account_option( 'all_licenses' );
    10804 
    10805             $licenses_by_module_type = array(
    10806                 WP_FS__MODULE_TYPE_PLUGIN => array(),
    10807                 WP_FS__MODULE_TYPE_THEME  => array()
    10808             );
    10809 
    10810             if ( ! is_array( $licenses ) ) {
    10811                 return $licenses_by_module_type;
    10812             }
    10813 
    10814             foreach ( $licenses as $module_id => $module_licenses ) {
    10815                 $fs = self::get_instance_by_id( $module_id );
    10816                 if ( false === $fs ) {
    10817                     continue;
    10818                 }
    10819 
    10820                 $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses );
    10821             }
    10822 
    10823             return $licenses_by_module_type;
    10824         }
    10825 
    10826         /**
    10827          * @author Leo Fajardo (@leorw)
    10828          * @since  2.0.0
    10829          *
    1083010542         * @param number      $module_id
    1083110543         * @param number|null $user_id
     
    1096610678         * @return array<number,FS_Plugin[]>|false
    1096710679         */
    10968         private static function get_all_addons() {
     10680        public static function get_all_addons() {
    1096910681            $addons = self::maybe_get_entities_account_option( 'addons', array() );
    1097010682
     
    1098210694         * @return number[]|false
    1098310695         */
    10984         private static function get_all_account_addons() {
     10696        public static function get_all_account_addons() {
    1098510697            $addons = self::$_accounts->get_option( 'account_addons', array() );
    1098610698
     
    1109710809        function get_site() {
    1109810810            return $this->_site;
     10811        }
     10812
     10813        /**
     10814         * @author Daniele Alessandra (@danielealessandra)
     10815         * @return FS_Storage
     10816         * @since  2.6.2
     10817         *
     10818         */
     10819        public function get_storage() {
     10820            return $this->_storage;
    1109910821        }
    1110010822
     
    1395513677        function get_pricing_js_path() {
    1395613678            if ( ! isset( $this->_pricing_js_path ) ) {
    13957                 $pricing_js_path = $this->apply_filters( 'freemius_pricing_js_path', '' );
    13958 
     13679                $default_path = WP_FS__DIR_JS . '/pricing/freemius-pricing.js';
     13680
     13681                $pricing_js_path = $this->apply_filters( 'freemius_pricing_js_path', $default_path );
     13682
     13683                // Backward compatibility for people who placed the freemius-pricing inside `includes` directory. Let it take more preference than the default path.
    1395913684                if ( empty( $pricing_js_path ) ) {
    1396013685                    global $fs_active_plugins;
     
    1397513700                }
    1397613701
     13702                // If it is still empty, load the default pricing JS.
     13703                if ( ! file_exists( $pricing_js_path ) ) {
     13704                    $pricing_js_path = $default_path;
     13705                }
     13706
    1397713707                $this->_pricing_js_path = $pricing_js_path;
    1397813708            }
     
    1398513715         * @since 2.3.1
    1398613716         *
     13717         * @deprecated Since v2.9.0 we have removed the iFrame based pricing. This will always return `false`.
     13718         *
    1398713719         * @return bool
    1398813720         */
    1398913721        function should_use_external_pricing() {
    13990             if ( is_null( $this->_use_external_pricing ) ) {
    13991                 $pricing_js_path = $this->get_pricing_js_path();
    13992 
    13993                 $this->_use_external_pricing = ( empty( $pricing_js_path ) || ! file_exists( $pricing_js_path ) );
    13994             }
    13995 
    13996             return $this->_use_external_pricing;
     13722            return false;
    1399713723        }
    1399813724
     
    1503314759                $this->_get_admin_page_url( 'pricing', $params );
    1503414760
     14761            return $this->get_pricing_url_with_filter( $url );
     14762        }
     14763
     14764        /**
     14765         * Retrieves the filtered pricing URL.
     14766         *
     14767         * @author Leo Fajardo (@leorw)
     14768         * @since  2.7.4
     14769         *
     14770         * @param string $url
     14771         *
     14772         * @return string
     14773         */
     14774        private function get_pricing_url_with_filter( $url ) {
    1503514775            return $this->apply_filters( 'pricing_url', $url );
    1503614776        }
     
    1630816048                 $context_blog_id == $this->get_install_sync_cron_blog_id()
    1630916049            ) {
    16310                 $this->schedule_install_sync( $context_blog_id );
     16050                $this->maybe_schedule_install_sync_cron( $context_blog_id );
    1631116051            }
    1631216052        }
     
    1834418084                     * @author Leo Fajardo (@leorw)
    1834518085                     */
     18086                    $user = $this->_user;
     18087
    1834618088                    $this->_user = null;
    1834718089
    1834818090                    fs_redirect( $this->get_activation_url( array( 'error' => $result->error->message ) ) );
     18091
     18092                    /**
     18093                     * Restore the user after the redirect, this is relevant when there are cases where the redirect will choose not to do anything.
     18094                     */
     18095                    $this->_user = $user;
    1834918096                }
    1835018097            }
     
    1911118858                if (! WP_FS__DEMO_MODE && ! $this->is_whitelabeled() ) {
    1911218859                    // Add contact page.
    19113                     $this->add_submenu_item(
    19114                         $this->get_text_inline( 'Contact Us', 'contact-us' ),
    19115                         array( &$this, '_contact_page_render' ),
    19116                         $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Contact Us', 'contact-us' ),
    19117                         'manage_options',
    19118                         'contact',
    19119                         'Freemius::_clean_admin_content_section',
    19120                         WP_FS__DEFAULT_PRIORITY,
    19121                         $this->is_submenu_item_visible( 'contact' )
    19122                     );
     18860                    if ( $this->is_premium() ) {
     18861                        $this->add_submenu_item(
     18862                            $this->get_text_inline( 'Contact Us', 'contact-us' ),
     18863                            array( &$this, '_contact_page_render' ),
     18864                            $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Contact Us', 'contact-us' ),
     18865                            'manage_options',
     18866                            'contact',
     18867                            'Freemius::_clean_admin_content_section',
     18868                            WP_FS__DEFAULT_PRIORITY,
     18869                            $this->is_submenu_item_visible( 'contact' )
     18870                        );
     18871                    } else {
     18872                        $this->add_submenu_link_item(
     18873                            $this->get_text_inline( 'Contact Us', 'contact-us' ),
     18874                            FS_Contact_Form_Manager::instance()->get_standalone_link( $this ),
     18875                            'contact',
     18876                            'manage_options',
     18877                            WP_FS__DEFAULT_PRIORITY,
     18878                            $this->is_submenu_item_visible( 'contact' ),
     18879                            'fs_external_contact',
     18880                            true
     18881                        );
     18882                    }
    1912318883                }
    1912418884
     
    1915918919                    }
    1916018920
    19161                     // Add upgrade/pricing page.
    19162                     $this->add_submenu_item(
    19163                         $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) ),
    19164                         array( &$this, '_pricing_page_render' ),
    19165                         $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
    19166                         'manage_options',
    19167                         'pricing',
    19168                         'Freemius::_clean_admin_content_section',
    19169                         WP_FS__LOWEST_PRIORITY,
    19170                         ( $add_submenu_items && $show_pricing ),
    19171                         $pricing_class
    19172                     );
     18921                    $custom_pricing_url        = $this->get_pricing_url_with_filter( null );
     18922                    $pricing_menu_title        = $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) );
     18923                    $show_pricing_submenu_item = ( $add_submenu_items && $show_pricing );
     18924
     18925                    // Add upgrade/pricing submenu item.
     18926                    if ( ! is_null( $custom_pricing_url ) ) {
     18927                        $this->add_submenu_link_item(
     18928                            $pricing_menu_title,
     18929                            $custom_pricing_url,
     18930                            'pricing',
     18931                            'manage_options',
     18932                            WP_FS__LOWEST_PRIORITY,
     18933                            $show_pricing_submenu_item,
     18934                            $pricing_class
     18935                        );
     18936                    } else {
     18937                        $this->add_submenu_item(
     18938                            $pricing_menu_title,
     18939                            array( &$this, '_pricing_page_render' ),
     18940                            $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
     18941                            'manage_options',
     18942                            'pricing',
     18943                            'Freemius::_clean_admin_content_section',
     18944                            WP_FS__LOWEST_PRIORITY,
     18945                            $show_pricing_submenu_item,
     18946                            $pricing_class
     18947                        );
     18948                    }
    1917318949                }
    1917418950            }
     
    1920618982         */
    1920718983        private function embed_submenu_items() {
    19208             $item_template = $this->_menu->is_top_level() ?
    19209                 '<span class="fs-submenu-item %s %s %s">%s</span>' :
    19210                 '<span class="fs-submenu-item fs-sub %s %s %s">%s</span>';
     18984            $item_classes = $this->_menu->is_top_level() ? 'fs-submenu-item' : 'fs-submenu-item fs-sub';
     18985
     18986            $item_template = '<span class="' . $item_classes . ' %1$s %2$s %3$s" data-fs-external-url="%5$s" data-fs-new-tab="%6$s">%4$s</span>';
    1921118987
    1921218988            $top_level_menu_capability = $this->get_top_level_menu_capability();
     
    1922519001                        $item['menu_slug'],
    1922619002                        ! empty( $item['class'] ) ? $item['class'] : '',
    19227                         $item['menu_title']
     19003                        $item['menu_title'],
     19004                        esc_attr( isset( $item['url'] ) ? $item['url'] : '' ),
     19005                        esc_attr( isset( $item['new_tab'] ) ? 'true' : 'false' )
    1922819006                    );
    1922919007
     
    1938119159                    null,
    1938219160                    50,
    19383                     $this->is_submenu_item_visible( 'support' )
     19161                    $this->is_submenu_item_visible( 'support' ),
     19162                    '',
     19163                    true
    1938419164                );
    1938519165            }
     
    1945919239         * @param int    $priority
    1946019240         * @param bool   $show_submenu
     19241         * @param string $class
     19242         * @param bool   $new_tab
    1946119243         */
    1946219244        function add_submenu_link_item(
     
    1946619248            $capability = 'read',
    1946719249            $priority = WP_FS__DEFAULT_PRIORITY,
    19468             $show_submenu = true
     19250            $show_submenu = true,
     19251            $class = '',
     19252            $new_tab = false
    1946919253        ) {
    1947019254            $this->_logger->entrance( 'Title = ' . $menu_title . '; Url = ' . $url );
     
    1948019264                        $capability,
    1948119265                        $priority,
    19482                         $show_submenu
     19266                        $show_submenu,
     19267                        $class,
     19268                        $new_tab
    1948319269                    );
    1948419270
     
    1950019286                'before_render_function' => '',
    1950119287                'show_submenu'           => $show_submenu,
     19288                'class'                  => $class,
     19289                'new_tab'                => $new_tab,
    1950219290            );
    1950319291        }
     
    2201121799         *
    2201221800         * @param bool|string $plan_name
     21801         * @param bool        $add_sticky_notice
    2201321802         *
    2201421803         * @return bool If trial was successfully started.
    2201521804         */
    22016         function start_trial( $plan_name = false ) {
     21805        function start_trial( $plan_name = false, $add_sticky_notice = false ) {
    2201721806            $this->_logger->entrance();
    2201821807
     
    2202521814                    sprintf( $this->get_text_inline( 'You are already running the %s in a trial mode.', 'in-trial-mode' ), $this->_module_type ),
    2202621815                    $oops_text,
    22027                     'error'
     21816                    'error',
     21817                    $add_sticky_notice
    2202821818                );
    2202921819
     
    2203121821            }
    2203221822
    22033             if ( $this->_site->is_trial_utilized() ) {
     21823            if ( $this->_site->is_trial_utilized() && ! $this->is_payments_sandbox() ) {
    2203421824                // Trial was already utilized.
    2203521825                $this->_admin_notices->add(
    2203621826                    $this->get_text_inline( 'You already utilized a trial before.', 'trial-utilized' ),
    2203721827                    $oops_text,
    22038                     'error'
     21828                    'error',
     21829                    $add_sticky_notice
    2203921830                );
    2204021831
     
    2205021841                        sprintf( $this->get_text_inline( 'Plan %s do not exist, therefore, can\'t start a trial.', 'trial-plan-x-not-exist' ), $plan_name ),
    2205121842                        $oops_text,
    22052                         'error'
     21843                        'error',
     21844                        $add_sticky_notice
    2205321845                    );
    2205421846
     
    2206121853                        sprintf( $this->get_text_inline( 'Plan %s does not support a trial period.', 'plan-x-no-trial' ), $plan_name ),
    2206221854                        $oops_text,
    22063                         'error'
     21855                        'error',
     21856                        $add_sticky_notice
    2206421857                    );
    2206521858
     
    2207221865                        sprintf( $this->get_text_inline( 'None of the %s\'s plans supports a trial period.', 'no-trials' ), $this->_module_type ),
    2207321866                        $oops_text,
    22074                         'error'
     21867                        'error',
     21868                        $add_sticky_notice
    2207521869                    );
    2207621870
     
    2208321877            }
    2208421878
    22085             $api  = $this->get_api_site_scope();
    22086             $plan = $api->call( "plans/{$plan->id}/trials.json", 'post' );
    22087 
    22088             if ( ! $this->is_api_result_entity( $plan ) ) {
     21879            $trial_params = array();
     21880
     21881            if ( $this->is_payments_sandbox() ) {
     21882                $trial_params['trial_timestamp'] = time();
     21883                $trial_params['trial_token']     = FS_Security::instance()->get_trial_token(
     21884                    $this->get_plugin(),
     21885                    $plan,
     21886                    $trial_params['trial_timestamp']
     21887                );
     21888            }
     21889
     21890            $api   = $this->get_api_site_scope();
     21891            $trial = $api->call( "plans/{$plan->id}/trials.json", 'post', $trial_params );
     21892
     21893            if ( ! $this->is_api_result_entity( $trial ) ) {
    2208921894                // Some API error while trying to start the trial.
    2209021895                $this->_admin_notices->add(
    22091                     $this->get_api_error_message( $plan ),
     21896                    $this->get_api_error_message( $trial ),
    2209221897                    $oops_text,
    22093                     'error'
     21898                    'error',
     21899                    $add_sticky_notice
    2209421900                );
    2209521901
     
    2233122137            if ( true === $fetch_readme ) {
    2233222138                $latest_version_endpoint = add_query_arg( 'readme', 'true', $latest_version_endpoint );
     22139
     22140                // Don't cache the API response when fetching readme information.
     22141                $expiration = null;
    2233322142            }
    2233422143
     
    2279322602
    2279422603            $remove_user       = true;
    22795             $all_modules_sites = self::get_all_modules_sites();
     22604            $all_modules_sites = FS_DebugManager::get_all_modules_sites();
    2279622605
    2279722606            foreach ( $all_modules_sites as $sites_by_module_type ) {
     
    2357223381            $this->_logger->entrance();
    2357323382
     23383            fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
     23384            fs_enqueue_local_style( 'fs_checkout', '/admin/checkout.css' );
     23385
    2357423386            $vars = array( 'id' => $this->_module_id );
    2357523387
     
    2358523397         * @since  2.3.1
    2358623398         */
    23587         function _maybe_add_pricing_ajax_handler() {
    23588             if ( ! $this->should_use_external_pricing() ) {
    23589                 $this->add_ajax_action( 'pricing_ajax_action', array( &$this, '_fs_pricing_ajax_action_handler' ) );
    23590             }
     23399        function _add_pricing_ajax_handler() {
     23400            $this->add_ajax_action( 'pricing_ajax_action', array( &$this, '_fs_pricing_ajax_action_handler' ) );
    2359123401        }
    2359223402
     
    2363823448                    break;
    2363923449                case 'start_trial':
    23640                     $result = $this->opt_in(
    23641                         false,
    23642                         false,
    23643                         false,
    23644                         false,
    23645                         false,
    23646                         fs_request_get( 'plan_id' )
    23647                     );
     23450                    $trial_plan_id = fs_request_get( 'plan_id' );
     23451
     23452                    if ( $this->is_registered() && $this->is_tracking_allowed() ) {
     23453                        $plan = $this->_get_plan_by_id( $trial_plan_id );
     23454
     23455                        if ( ! $plan ) {
     23456                            $this->shoot_ajax_failure( 'Invalid plan ID.' );
     23457                            return;
     23458                        }
     23459
     23460                        $result = $this->start_trial( $plan->name, true );
     23461                    } else {
     23462                        // @todo - This fails for sandbox trial at the moment if the trial was already utilized.
     23463                        $result = $this->opt_in(
     23464                            false,
     23465                            false,
     23466                            false,
     23467                            false,
     23468                            false,
     23469                            $trial_plan_id
     23470                        );
     23471                    }
    2364823472            }
    2364923473
     
    2488024704         * @since 2.1.0
    2488124705         *
    24882          * @param string $url
    24883          * @param array  $request
    24884          */
    24885         private static function enrich_request_for_debug( &$url, &$request ) {
    24886             if ( WP_FS__DEBUG_SDK || isset( $_COOKIE['XDEBUG_SESSION'] ) ) {
    24887                 $url = add_query_arg( 'XDEBUG_SESSION_START', rand( 0, 9999999 ), $url );
    24888                 $url = add_query_arg( 'XDEBUG_SESSION', 'PHPSTORM', $url );
    24889 
    24890                 $request['cookies'] = array(
    24891                     new WP_Http_Cookie( array(
    24892                         'name'  => 'XDEBUG_SESSION',
    24893                         'value' => 'PHPSTORM',
    24894                     ) )
    24895                 );
    24896             }
    24897         }
    24898 
    24899         /**
    24900          * @author Leo Fajardo (@leorw)
    24901          * @since 2.1.0
    24902          *
    2490324706         * @param string      $url
    2490424707         * @param array       $request
     
    2492624729            if ( false === $response ) {
    2492724730                if ( $maybe_enrich_request_for_debug ) {
    24928                     self::enrich_request_for_debug( $url, $request );
     24731                    FS_DebugManager::enrich_request_for_debug( $url, $request );
    2492924732                }
    2493024733
  • content-aware-sidebars/trunk/lib/freemius/includes/class-fs-api.php

    r3092858 r3203370  
    356356                }
    357357
    358                 self::$_cache->set( $cache_key, $result, $expiration );
     358                if ( is_numeric( $expiration ) ) {
     359                    self::$_cache->set( $cache_key, $result, $expiration );
     360                }
    359361
    360362                $cached_result = $result;
  • content-aware-sidebars/trunk/lib/freemius/includes/class-fs-logger.php

    r2835339 r3203370  
    3333        private static $_abspathLength;
    3434
     35        /**
     36         * @var FS_Logger[] $LOGGERS
     37         */
    3538        private static $LOGGERS = array();
    3639        private static $LOG = array();
     
    125128            self::hook_footer();
    126129        }
    127 
    128130        function echo_on() {
    129131            $this->on();
     
    321323            $table = "{$wpdb->prefix}fs_logger";
    322324
     325            /**
     326             * Drop logging table in any case.
     327             */
     328            $result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
     329
    323330            if ( $is_on ) {
    324331                /**
     
    330337                 * @link https://core.trac.wordpress.org/ticket/2695
    331338                 */
    332                 $result = $wpdb->query( "CREATE TABLE {$table} (
     339                $result = $wpdb->query( "CREATE TABLE IF NOT EXISTS {$table} (
    333340`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    334341`process_id` INT UNSIGNED NOT NULL,
     
    349356KEY `function` (`function` ASC),
    350357KEY `type` (`type` ASC))" );
    351             } else {
    352                 /**
    353                  * Drop logging table.
    354                  */
    355                 $result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
    356358            }
    357359
    358360            if ( false !== $result ) {
    359361                update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
     362                self::$_isStorageLoggingOn = $is_on;
    360363            }
    361364
  • content-aware-sidebars/trunk/lib/freemius/includes/class-fs-plugin-updater.php

    r3092858 r3203370  
    107107            if ( ! $this->_fs->has_any_active_valid_license() ) {
    108108                add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );
     109            } else {
     110                add_action( 'admin_footer', array( &$this, '_add_fs_allow_updater_and_dialog_request_param' ) );
    109111            }
    110112
     
    132134        /**
    133135         * @author Leo Fajardo (@leorw)
     136         * @since 2.7.4
     137         */
     138        function _add_fs_allow_updater_and_dialog_request_param() {
     139            if ( ! $this->is_plugin_information_dialog_for_plugin() ) {
     140                return;
     141            }
     142            ?>
     143            <script type="text/javascript">
     144                if ( typeof jQuery !== 'undefined' ) {
     145                    jQuery( document ).on( 'wp-plugin-updating', function( event, args ) {
     146                        if ( typeof args === 'object' && args.slug && typeof args.slug === 'string' ) {
     147                            if ( <?php echo json_encode( $this->_fs->get_slug() ) ?> === args.slug ) {
     148                                args.fs_allow_updater_and_dialog = true;
     149                            }
     150                        }
     151                    } );
     152                }
     153            </script>
     154            <?php
     155        }
     156
     157        /**
     158         * @author Leo Fajardo (@leorw)
     159         * @since 2.7.4
     160         *
     161         * @return bool
     162         */
     163        private function is_plugin_information_dialog_for_plugin() {
     164            return (
     165                'plugin-information' === fs_request_get( 'tab', false ) &&
     166                $this->_fs->get_slug() === fs_request_get_raw( 'plugin', false )
     167            );
     168        }
     169
     170        /**
     171         * @author Leo Fajardo (@leorw)
    134172         * @since 2.1.4
    135173         */
    136174        function catch_plugin_information_dialog_contents() {
    137             if (
    138                 'plugin-information' !== fs_request_get( 'tab', false ) ||
    139                 $this->_fs->get_slug() !== fs_request_get_raw( 'plugin', false )
    140             ) {
     175            if ( ! $this->is_plugin_information_dialog_for_plugin() ) {
    141176                return;
    142177            }
     
    617652            $slug = $this->_fs->get_slug();
    618653
    619             if ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() ) {
     654            if ( $this->can_fetch_data_from_wp_org() ) {
    620655                if ( ! isset( $this->_translation_updates ) ) {
    621656                    $this->_translation_updates = array();
     
    872907
    873908            return $res;
     909        }
     910
     911        /**
     912         * Returns true if the product can fetch data from WordPress.org.
     913         *
     914         * @author Leo Fajardo (@leorw)
     915         * @since  2.7.4
     916         */
     917        private function can_fetch_data_from_wp_org() {
     918            return ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() );
    874919        }
    875920
     
    10581103
    10591104            $plugin_in_repo = false;
    1060             if ( ! $is_addon ) {
     1105            if ( ! $is_addon && $this->can_fetch_data_from_wp_org() ) {
    10611106                // Try to fetch info from .org repository.
    10621107                $data = self::_fetch_plugin_info_from_repository( $action, $args );
  • content-aware-sidebars/trunk/lib/freemius/includes/class-fs-security.php

    r2934101 r3203370  
    8383            );
    8484        }
     85
     86        /**
     87         * Gets a sandbox trial token for a given plugin, plan, and trial timestamp.
     88         *
     89         * @param FS_Plugin      $plugin
     90         * @param FS_Plugin_Plan $plan
     91         * @param int            $trial_timestamp
     92         *
     93         * @return string
     94         */
     95        function get_trial_token( FS_Plugin $plugin, FS_Plugin_Plan $plan, $trial_timestamp ) {
     96            return md5(
     97                $plugin->secret_key . $plugin->public_key .
     98                $plan->trial_period .
     99                $plan->id .
     100                $trial_timestamp
     101            );
     102        }
    85103    }
  • content-aware-sidebars/trunk/lib/freemius/includes/class-fs-storage.php

    r3092858 r3203370  
    2121     * @property bool|null   $is_diagnostic_tracking_allowed
    2222     * @property object      $sync_cron
     23     * @property bool|int    $install_timestamp
    2324     */
    2425    class FS_Storage {
  • content-aware-sidebars/trunk/lib/freemius/includes/entities/class-fs-plugin-plan.php

    r3092858 r3203370  
    9393         */
    9494        public $is_hidden;
     95        /**
     96         * @var FS_Pricing[]
     97         */
     98        public $pricing;
     99        /**
     100         * @var object[]
     101         */
     102        public $features;
    95103
    96104        #endregion Properties
  • content-aware-sidebars/trunk/lib/freemius/includes/entities/class-fs-site.php

    r3092858 r3203370  
    183183                fs_ends_with( $subdomain, '.dev.wpengine.com' ) ||
    184184                fs_ends_with( $subdomain, '.wpengine.com' ) ||
     185                fs_ends_with( $subdomain, '.wpenginepowered.com' ) ||
    185186                // Pantheon
    186187                ( fs_ends_with( $subdomain, 'pantheonsite.io' ) &&
     
    190191                // Kinsta
    191192                (
    192                     ( fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) &&
     193                    ( fs_starts_with( $subdomain, 'stg-' ) ||  fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) &&
    193194                    ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) )
    194195                ) ||
     
    202203                ( fs_ends_with( $subdomain, '.websitepro-staging.com' ) || fs_ends_with( $subdomain, '.websitepro.hosting' ) ) ||
    203204                // InstaWP
    204                 fs_ends_with( $subdomain, '.instawp.xyz' )
     205                fs_ends_with( $subdomain, '.instawp.xyz' ) ||
     206                // 10Web Hosting
     207                ( fs_ends_with( $subdomain, '-dev.10web.site' ) || fs_ends_with( $subdomain, '-dev.10web.cloud' ) )
    205208            );
     209        }
     210
     211        /**
     212         * @author Leo Fajardo (@leorw)
     213         * @since  2.9.1
     214         *
     215         * @param string $host
     216         *
     217         * @return bool
     218         */
     219        static function is_playground_wp_environment_by_host( $host ) {
     220            // Services aimed at providing a WordPress sandbox environment.
     221            $sandbox_wp_environment_domains = array(
     222                // InstaWP
     223                'instawp.xyz',
     224
     225                // TasteWP
     226                'tastewp.com',
     227
     228                // WordPress Playground
     229                'playground.wordpress.net',
     230            );
     231
     232            foreach ( $sandbox_wp_environment_domains as $domain) {
     233                if (
     234                    fs_ends_with( $host, '.' . $domain ) ||
     235                    fs_ends_with( $host, '-' . $domain )
     236                ) {
     237                    return true;
     238                }
     239            }
     240
     241            return false;
    206242        }
    207243
  • content-aware-sidebars/trunk/lib/freemius/includes/managers/class-fs-clone-manager.php

    r2835339 r3203370  
    334334
    335335            if ( ! isset( $this->all_installs ) ) {
    336                 $this->all_installs = Freemius::get_all_modules_sites();
     336                $this->all_installs = FS_DebugManager::get_all_modules_sites();
    337337            }
    338338
  • content-aware-sidebars/trunk/lib/freemius/require.php

    r3092858 r3203370  
    2828    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-permission-manager.php';
    2929    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-cache-manager.php';
     30    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-checkout-manager.php';
     31    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-contact-form-manager.php';
    3032    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-notice-manager.php';
    3133    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-menu-manager.php';
     
    5153    require_once WP_FS__DIR_INCLUDES . '/class-fs-plugin-updater.php';
    5254    require_once WP_FS__DIR_INCLUDES . '/class-fs-security.php';
     55    require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-debug-manager.php';
    5356    require_once WP_FS__DIR_INCLUDES . '/class-fs-options.php';
    5457    require_once WP_FS__DIR_INCLUDES . '/class-fs-storage.php';
  • content-aware-sidebars/trunk/lib/freemius/start.php

    r3092858 r3203370  
    1616     * @var string
    1717     */
    18     $this_sdk_version = '2.7.2';
     18    $this_sdk_version = '2.10.0';
    1919
    2020    #region SDK Selection Logic --------------------------------------------------------------------
     
    3737    }
    3838
    39     /**
     39    /**
     40     * We updated the logic to support SDK loading from a subfolder of a theme as well as from a parent theme
     41     * If the SDK is found in the active theme, it sets the relative path accordingly.
     42     * If not, it checks the parent theme and sets the relative path if found there.
     43     * This allows the SDK to be loaded from composer dependencies or from a custom `vendor/freemius` folder.
     44     *
     45     * @author Daniele Alessandra (@DanieleAlessandra)
     46     * @since  2.9.0.5
     47     *
     48     *
    4049     * This complex logic fixes symlink issues (e.g. with Vargant). The logic assumes
    4150     * that if it's a file from an SDK running in a theme, the location of the SDK
     
    8493    $themes_directory         = get_theme_root( get_stylesheet() );
    8594    $themes_directory_name    = basename( $themes_directory );
    86     $theme_candidate_basename = basename( dirname( $fs_root_path ) ) . '/' . basename( $fs_root_path );
    87 
    88     if ( $file_path == fs_normalize_path( realpath( trailingslashit( $themes_directory ) . $theme_candidate_basename . '/' . basename( $file_path ) ) )
    89     ) {
    90         $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_candidate_basename;
    91         $is_theme               = true;
    92     } else {
    93         $this_sdk_relative_path = plugin_basename( $fs_root_path );
    94         $is_theme               = false;
    95     }
     95
     96    // This change ensures that the condition works even if the SDK is located in a subdirectory (e.g., vendor)
     97    $theme_candidate_sdk_basename = str_replace( $themes_directory . '/' . get_stylesheet() . '/', '', $fs_root_path );
     98
     99    // Check if the current file is part of the active theme.
     100    $is_current_sdk_from_active_theme = $file_path == $themes_directory . '/' . get_stylesheet() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path );
     101    $is_current_sdk_from_parent_theme = false;
     102
     103    // Check if the current file is part of the parent theme.
     104    if ( ! $is_current_sdk_from_active_theme ) {
     105        $theme_candidate_sdk_basename     = str_replace( $themes_directory . '/' . get_template() . '/',
     106            '',
     107            $fs_root_path );
     108        $is_current_sdk_from_parent_theme = $file_path == $themes_directory . '/' . get_template() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path );
     109    }
     110
     111    if ( $is_current_sdk_from_active_theme ) {
     112        $this_sdk_relative_path = '../' . $themes_directory_name . '/' . get_stylesheet() . '/' . $theme_candidate_sdk_basename;
     113        $is_theme               = true;
     114    } else if ( $is_current_sdk_from_parent_theme ) {
     115        $this_sdk_relative_path = '../' . $themes_directory_name . '/' . get_template() . '/' . $theme_candidate_sdk_basename;
     116        $is_theme               = true;
     117    } else {
     118        $this_sdk_relative_path = plugin_basename( $fs_root_path );
     119        $is_theme               = false;
     120    }
    96121
    97122    if ( ! isset( $fs_active_plugins ) ) {
     
    177202    ) {
    178203        if ( $is_theme ) {
    179             $plugin_path = basename( dirname( $this_sdk_relative_path ) );
     204            // Saving relative path and not only directory name as it could be a subfolder
     205            $plugin_path = $this_sdk_relative_path;
    180206        } else {
    181207            $plugin_path = plugin_basename( fs_find_direct_caller_plugin_file( $file_path ) );
     
    226252        $is_newest_sdk_type_theme = ( isset( $fs_newest_sdk->type ) && 'theme' === $fs_newest_sdk->type );
    227253
    228         if ( ! $is_newest_sdk_type_theme ) {
    229             $is_newest_sdk_plugin_active = is_plugin_active( $fs_newest_sdk->plugin_path );
    230         } else {
    231             $current_theme               = wp_get_theme();
    232             $is_newest_sdk_plugin_active = ( $current_theme->stylesheet === $fs_newest_sdk->plugin_path );
     254        /**
     255         * @var bool $is_newest_sdk_module_active
     256         * True if the plugin with the newest SDK is active.
     257         * True if the newest SDK is part of the current theme or current theme's parent.
     258         * False otherwise.
     259         */
     260        if ( ! $is_newest_sdk_type_theme ) {
     261            $is_newest_sdk_module_active = is_plugin_active( $fs_newest_sdk->plugin_path );
     262        } else {
     263            $current_theme = wp_get_theme();
     264            // Detect if current theme is the one registered as newer SDK
     265            $is_newest_sdk_module_active = (
     266                strpos(
     267                    $fs_newest_sdk->plugin_path,
     268                    '../' . $themes_directory_name . '/' . $current_theme->get_stylesheet() . '/'
     269                ) === 0
     270            );
    233271
    234272            $current_theme_parent = $current_theme->parent();
     
    238276             * from happening by keeping the SDK info stored in the `fs_active_plugins` option.
    239277             */
    240             if ( ! $is_newest_sdk_plugin_active && $current_theme_parent instanceof WP_Theme ) {
    241                 $is_newest_sdk_plugin_active = ( $fs_newest_sdk->plugin_path === $current_theme_parent->stylesheet );
     278            if ( ! $is_newest_sdk_module_active && $current_theme_parent instanceof WP_Theme ) {
     279                // Detect if current theme parent is the one registered as newer SDK
     280                $is_newest_sdk_module_active = (
     281                    strpos(
     282                        $fs_newest_sdk->plugin_path,
     283                        '../' . $themes_directory_name . '/' . $current_theme_parent->get_stylesheet() . '/'
     284                    ) === 0
     285                );
    242286            }
    243287        }
    244288
    245289        if ( $is_current_sdk_newest &&
    246              ! $is_newest_sdk_plugin_active &&
     290             ! $is_newest_sdk_module_active &&
    247291             ! $fs_active_plugins->newest->in_activation
    248292        ) {
     
    263307        }
    264308
    265         $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) && file_exists( $sdk_starter_path );
     309        $is_newest_sdk_path_valid = ( $is_newest_sdk_module_active || $fs_active_plugins->newest->in_activation ) && file_exists( $sdk_starter_path );
    266310
    267311        if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
     
    270314        }
    271315
    272         if ( ! ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) ||
     316        if ( ! ( $is_newest_sdk_module_active || $fs_active_plugins->newest->in_activation ) ||
    273317             ! $is_newest_sdk_path_valid ||
    274318             // Is newest SDK downgraded.
     
    285329            fs_fallback_to_newest_active_sdk();
    286330        } else {
    287             if ( $is_newest_sdk_plugin_active &&
     331            if ( $is_newest_sdk_module_active &&
    288332                 $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
    289333                 ( $fs_active_plugins->newest->in_activation ||
  • content-aware-sidebars/trunk/lib/freemius/templates/account.php

    r3092858 r3203370  
    511511                                            <tr class="fs-field-<?php echo esc_attr( $p['id'] ) ?><?php if ( $odd ) : ?> alternate<?php endif ?>">
    512512                                                <td>
    513                                                     <nobr><?php echo esc_attr( $p['title'] ) ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
     513                                                    <nobr><?php echo esc_html( $p['title'] ) ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
    514514                                                </td>
    515515                                                <td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>>
     
    11191119        $fs->_add_tabs_after_content();
    11201120    }
    1121 
    1122     $params = array(
    1123         'page'           => 'account',
    1124         'module_id'      => $fs->get_id(),
    1125         'module_type'    => $fs->get_module_type(),
    1126         'module_slug'    => $slug,
    1127         'module_version' => $fs->get_plugin_version(),
    1128     );
    1129     fs_require_template( 'powered-by.php', $params );
  • content-aware-sidebars/trunk/lib/freemius/templates/add-ons.php

    r2366248 r3203370  
    492492        $fs->_add_tabs_after_content();
    493493    }
    494 
    495     $params = array(
    496         'page'           => 'addons',
    497         'module_id'      => $fs->get_id(),
    498         'module_type'    => $fs->get_module_type(),
    499         'module_slug'    => $slug,
    500         'module_version' => $fs->get_plugin_version(),
    501     );
    502     fs_require_template( 'powered-by.php', $params );
  • content-aware-sidebars/trunk/lib/freemius/templates/checkout.php

    r3092858 r3203370  
    22    /**
    33     * @package     Freemius
    4      * @copyright   Copyright (c) 2015, Freemius, Inc.
     4     * @copyright   Copyright (c) 2024, Freemius, Inc.
    55     * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
    6      * @since       1.0.3
     6     * @since       2.9.0
    77     */
    8 
    9     /**
    10      * Note for WordPress.org Theme/Plugin reviewer:
    11      *  Freemius is an SDK for plugin and theme developers. Since the core
    12      *  of the SDK is relevant both for plugins and themes, for obvious reasons,
    13      *  we only develop and maintain one code base.
    14      *
    15      *  This code (and page) will not run for wp.org themes (only plugins).
    16      *
    17      *  In addition, this page loads an i-frame. We intentionally named it 'frame'
    18      *  so it will pass the "Theme Check" that is looking for the string "i" . "frame".
    19      *
    20      * UPDATE:
    21      *  After ongoing conversations with the WordPress.org TRT we received
    22      *  an official approval for including i-frames in the theme's WP Admin setting's
    23      *  page tab (the SDK will never add any i-frames on the sitefront). i-frames
    24      *  were never against the guidelines, but we wanted to get the team's blessings
    25      *  before we move forward. For the record, I got the final approval from
    26      *  Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
    27      *  Europe 2017 (June 16th, 2017).
    28      *
    29      * If you have any questions or need clarifications, please don't hesitate
    30      * pinging me on slack, my username is @svovaf.
    31      *
    32      * @author Vova Feldman (@svovaf)
    33      * @since 1.2.2
    34      */
    35 
    36     if ( ! defined( 'ABSPATH' ) ) {
    37         exit;
    38     }
    39 
    40     wp_enqueue_script( 'jquery' );
    41     wp_enqueue_script( 'json2' );
    42     fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
    43     fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
    44     fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
    45 
    46     fs_enqueue_local_style( 'fs_checkout', '/admin/checkout.css' );
    478
    489    /**
     
    5011     * @var Freemius $fs
    5112     */
    52     $fs   = freemius( $VARS['id'] );
    53     $slug = $fs->get_slug();
     13    $fs = freemius( $VARS['id'] );
    5414
    55     $timestamp = time();
     15    if ( fs_request_get_bool( 'redirect' ) ) {
     16        fs_require_template( 'checkout/redirect.php', $VARS );
     17    } else if ( fs_request_get_bool( 'process_redirect' ) ) {
     18        fs_require_template( 'checkout/process-redirect.php', $VARS );
     19    } else {
     20        $fs = freemius( $VARS['id'] );
    5621
    57     $context_params = array(
    58         'plugin_id'      => $fs->get_id(),
    59         'public_key'     => $fs->get_public_key(),
    60         'plugin_version' => $fs->get_plugin_version(),
    61         'mode'           => 'dashboard',
    62         'trial'          => fs_request_get_bool( 'trial' ),
    63         'is_ms'          => ( fs_is_network_admin() && $fs->is_network_active() ),
    64     );
    65 
    66     $plan_id = fs_request_get( 'plan_id' );
    67     if ( FS_Plugin_Plan::is_valid_id( $plan_id ) ) {
    68         $context_params['plan_id'] = $plan_id;
    69     }
    70 
    71     $licenses = fs_request_get( 'licenses' );
    72     if ( $licenses === strval( intval( $licenses ) ) && $licenses > 0 ) {
    73         $context_params['licenses'] = $licenses;
    74     }
    75 
    76     $plugin_id = fs_request_get( 'plugin_id' );
    77     if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) {
    78         $plugin_id = $fs->get_id();
    79     }
    80 
    81     if ( $plugin_id == $fs->get_id() ) {
    82         $is_premium = $fs->is_premium();
    83 
    84         $bundle_id = $fs->get_bundle_id();
    85         if ( ! is_null( $bundle_id ) ) {
    86             $context_params['bundle_id'] = $bundle_id;
    87         }
    88     } else {
    89         // Identify the module code version of the checkout context module.
    90         if ( $fs->is_addon_activated( $plugin_id ) ) {
    91             $fs_addon   = Freemius::get_instance_by_id( $plugin_id );
    92             $is_premium = $fs_addon->is_premium();
     22        if ( $fs->is_premium() ) {
     23            fs_require_template( 'checkout/frame.php', $VARS );
    9324        } else {
    94             // If add-on isn't activated assume the premium version isn't installed.
    95             $is_premium = false;
     25            fs_require_template( 'checkout/redirect.php', $VARS );
    9626        }
    9727    }
    98 
    99     // Get site context secure params.
    100     if ( $fs->is_registered() ) {
    101         $site = $fs->get_site();
    102 
    103         if ( $plugin_id != $fs->get_id() ) {
    104             if ( $fs->is_addon_activated( $plugin_id ) ) {
    105                 $fs_addon   = Freemius::get_instance_by_id( $plugin_id );
    106                 $addon_site = $fs_addon->get_site();
    107                 if ( is_object( $addon_site ) ) {
    108                     $site = $addon_site;
    109                 }
    110             }
    111         }
    112 
    113         $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
    114             $site,
    115             $timestamp,
    116             'checkout'
    117         ) );
    118     } else {
    119         $current_user = Freemius::_get_current_wp_user();
    120 
    121         // Add site and user info to the request, this information
    122         // is NOT being stored unless the user complete the purchase
    123         // and agrees to the TOS.
    124         $context_params = array_merge( $context_params, array(
    125             'user_firstname' => $current_user->user_firstname,
    126             'user_lastname'  => $current_user->user_lastname,
    127             'user_email'     => $current_user->user_email,
    128             'home_url'       => home_url(),
    129         ) );
    130 
    131         $fs_user = Freemius::_get_user_by_email( $current_user->user_email );
    132 
    133         if ( is_object( $fs_user ) && $fs_user->is_verified() ) {
    134             $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
    135                 $fs_user,
    136                 $timestamp,
    137                 'checkout'
    138             ) );
    139         }
    140     }
    141 
    142     if ( $fs->is_payments_sandbox() ) {
    143         // Append plugin secure token for sandbox mode authentication.
    144         $context_params['sandbox'] = FS_Security::instance()->get_secure_token(
    145             $fs->get_plugin(),
    146             $timestamp,
    147             'checkout'
    148         );
    149 
    150         /**
    151          * @since 1.1.7.3 Add security timestamp for sandbox even for anonymous user.
    152          */
    153         if ( empty( $context_params['s_ctx_ts'] ) ) {
    154             $context_params['s_ctx_ts'] = $timestamp;
    155         }
    156     }
    157 
    158     $return_url = $fs->_get_sync_license_url( $plugin_id );
    159 
    160     $can_user_install = (
    161         ( $fs->is_plugin() && current_user_can( 'install_plugins' ) ) ||
    162         ( $fs->is_theme() && current_user_can( 'install_themes' ) )
    163     );
    164 
    165     $query_params = array_merge( $context_params, $_GET, array(
    166         // Current plugin version.
    167         'plugin_version' => $fs->get_plugin_version(),
    168         'sdk_version'    => WP_FS__SDK_VERSION,
    169         'is_premium'     => $is_premium ? 'true' : 'false',
    170         'can_install'    => $can_user_install ? 'true' : 'false',
    171         'return_url'     => $return_url,
    172     ) );
    173 
    174     $xdebug_session = fs_request_get( 'XDEBUG_SESSION' );
    175     if ( false !== $xdebug_session ) {
    176         $query_params['XDEBUG_SESSION'] = $xdebug_session;
    177     }
    178 
    179     $view_params = array(
    180         'id'   => $VARS['id'],
    181         'page' => strtolower( $fs->get_text_inline( 'Checkout', 'checkout' ) ) . ' ' . $fs->get_text_inline( 'PCI compliant', 'pci-compliant' ),
    182     );
    183     fs_require_once_template('secure-https-header.php', $view_params);
    184 ?>
    185     <div id="fs_checkout" class="wrap fs-section fs-full-size-wrapper">
    186         <div id="fs_frame"></div>
    187         <script type="text/javascript">
    188             // http://stackoverflow.com/questions/4583703/jquery-post-request-not-ajax
    189             jQuery(function ($) {
    190                 $.extend({
    191                     form: function (url, data, method) {
    192                         if (method == null) method = 'POST';
    193                         if (data == null) data = {};
    194 
    195                         var form = $('<form>').attr({
    196                             method: method,
    197                             action: url
    198                         }).css({
    199                             display: 'none'
    200                         });
    201 
    202                         var addData = function (name, data) {
    203                             if ($.isArray(data)) {
    204                                 for (var i = 0; i < data.length; i++) {
    205                                     var value = data[i];
    206                                     addData(name + '[]', value);
    207                                 }
    208                             } else if (typeof data === 'object') {
    209                                 for (var key in data) {
    210                                     if (data.hasOwnProperty(key)) {
    211                                         addData(name + '[' + key + ']', data[key]);
    212                                     }
    213                                 }
    214                             } else if (data != null) {
    215                                 form.append($('<input>').attr({
    216                                     type : 'hidden',
    217                                     name : String(name),
    218                                     value: String(data)
    219                                 }));
    220                             }
    221                         };
    222 
    223                         for (var key in data) {
    224                             if (data.hasOwnProperty(key)) {
    225                                 addData(key, data[key]);
    226                             }
    227                         }
    228 
    229                         return form.appendTo('body');
    230                     }
    231                 });
    232             });
    233 
    234             (function ($) {
    235                 $(function () {
    236 
    237                     var
    238                         // Keep track of the i-frame height.
    239                         frame_height = 800,
    240                         base_url     = '<?php echo FS_CHECKOUT__ADDRESS ?>',
    241                         // Pass the parent page URL into the i-frame in a meaningful way (this URL could be
    242                         // passed via query string or hard coded into the child page, it depends on your needs).
    243                         src          = base_url + '/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
    244                         // Append the i-frame into the DOM.
    245                         frame        = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent; width: 1px; min-width: 100%;"><\/i' + 'frame>')
    246                             .appendTo('#fs_frame');
    247 
    248                     FS.PostMessage.init(base_url, [frame[0]]);
    249                     FS.PostMessage.receiveOnce('height', function (data) {
    250                         var h = data.height;
    251                         if (!isNaN(h) && h > 0 && h != frame_height) {
    252                             frame_height = h;
    253                             frame.height(frame_height + 'px');
    254 
    255                             FS.PostMessage.postScroll(frame[0]);
    256                         }
    257                     });
    258 
    259                     FS.PostMessage.receiveOnce('install', function (data) {
    260                         var requestData = {
    261                             user_id           : data.user.id,
    262                             user_secret_key   : data.user.secret_key,
    263                             user_public_key   : data.user.public_key,
    264                             install_id        : data.install.id,
    265                             install_secret_key: data.install.secret_key,
    266                             install_public_key: data.install.public_key
    267                         };
    268 
    269                         if (true === data.auto_install)
    270                             requestData.auto_install = true;
    271 
    272                         // Post data to activation URL.
    273                         $.form('<?php echo fs_nonce_url( $fs->_get_admin_page_url( 'account', array(
    274                             'fs_action' => $fs->get_unique_affix() . '_activate_new',
    275                             'plugin_id' => $plugin_id
    276                         ) ), $fs->get_unique_affix() . '_activate_new' ) ?>', requestData).submit();
    277                     });
    278 
    279                     FS.PostMessage.receiveOnce('pending_activation', function (data) {
    280                         var requestData = {
    281                             user_email           : data.user_email,
    282                             support_email_address: data.support_email_address
    283                         };
    284 
    285                         if (true === data.auto_install)
    286                             requestData.auto_install = true;
    287 
    288                         $.form('<?php echo fs_nonce_url( $fs->_get_admin_page_url( 'account', array(
    289                             'fs_action'           => $fs->get_unique_affix() . '_activate_new',
    290                             'plugin_id'           => $plugin_id,
    291                             'pending_activation'  => true,
    292                             'has_upgrade_context' => true,
    293                         ) ), $fs->get_unique_affix() . '_activate_new' ) ?>', requestData).submit();
    294                     });
    295 
    296                     FS.PostMessage.receiveOnce('get_context', function () {
    297                         console.debug('receiveOnce', 'get_context');
    298 
    299                         // If the user didn't connect his account with Freemius,
    300                         // once he accepts the Terms of Service and Privacy Policy,
    301                         // and then click the purchase button, the context information
    302                         // of the user will be shared with Freemius in order to complete the
    303                         // purchase workflow and activate the license for the right user.
    304                         <?php $install_data = array_merge( $fs->get_opt_in_params(),
    305                         array(
    306                             'activation_url' => fs_nonce_url( $fs->_get_admin_page_url( '',
    307                                 array(
    308                                     'fs_action' => $fs->get_unique_affix() . '_activate_new',
    309                                     'plugin_id' => $plugin_id,
    310 
    311                                 ) ),
    312                                 $fs->get_unique_affix() . '_activate_new' )
    313                         ) ) ?>
    314                         FS.PostMessage.post('context', <?php echo json_encode( $install_data ) ?>, frame[0]);
    315                     });
    316 
    317                     FS.PostMessage.receiveOnce('purchaseCompleted', <?php echo $fs->apply_filters('checkout/purchaseCompleted', 'function (data) {
    318                         console.log("checkout", "purchaseCompleted");
    319                     }') ?>);
    320 
    321                     FS.PostMessage.receiveOnce('get_dimensions', function (data) {
    322                         console.debug('receiveOnce', 'get_dimensions');
    323 
    324                         FS.PostMessage.post('dimensions', {
    325                             height   : $(document.body).height(),
    326                             scrollTop: $(document).scrollTop()
    327                         }, frame[0]);
    328                     });
    329 
    330                     var updateHeight = function () {
    331                         frame.css('min-height', $(document.body).height() + 'px');
    332                     };
    333 
    334                     $(document).ready(updateHeight);
    335 
    336                     $(window).resize(updateHeight);
    337                 });
    338             })(jQuery);
    339         </script>
    340     </div>
  • content-aware-sidebars/trunk/lib/freemius/templates/connect.php

    r2934101 r3203370  
    162162                fs_require_once_template( 'plugin-icon.php', $vars );
    163163            ?>
    164             <!--            <img class="fs-connect-logo" width="--><?php //echo $size ?><!--" height="--><?php //echo $size ?><!--" src="https://plugins.trac.wordpress.org//img.freemius.com/logo/connect.svg"/>-->
    165164        </div>
    166165        <div class="fs-box-container">
  • content-aware-sidebars/trunk/lib/freemius/templates/contact.php

    r3092858 r3203370  
    88
    99    /**
     10     * Update (October 9, 2024 by @swashata):
     11     *   Following request from the wp.org plugin review team, we have stopped
     12     *   embedding the contact form inside an i-frame for wp.org hosted free version
     13     *   of plugins. Now they will be opened in a new tab.
     14     *
    1015     * Note for WordPress.org Theme/Plugin reviewer:
    1116     *  Freemius is an SDK for plugin and theme developers. Since the core
     
    1318     *  we only develop and maintain one code base.
    1419     *
    15      *  This code (and page) will not run for wp.org themes (only plugins).
     20     *  This code (and page) will not run for wp.org themes or plugins. It will
     21     *   run only for premium version of the plugin/theme that is using the SDK.
    1622     *
    17      *  In addition, this page loads an i-frame. We intentionally named it 'frame'
     23     *  In addition, when this page loads an i-frame. We intentionally named it 'frame'
    1824     *  so it will pass the "Theme Check" that is looking for the string "i" . "frame".
    1925     *
     
    5157    $slug = $fs->get_slug();
    5258
    53     $context_params = array(
    54         'plugin_id'         => $fs->get_id(),
    55         'plugin_public_key' => $fs->get_public_key(),
    56         'plugin_version'    => $fs->get_plugin_version(),
    57     );
    58 
    59 
    60     // Get site context secure params.
    61     if ( $fs->is_registered() ) {
    62         $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
    63             $fs->get_site(),
    64             time(),
    65             'contact'
    66         ) );
    67     }
    68 
    69     $query_params = array_merge( $_GET, array_merge( $context_params, array(
    70         'plugin_version' => $fs->get_plugin_version(),
    71         'wp_login_url'   => wp_login_url(),
    72         'site_url'       => Freemius::get_unfiltered_site_url(),
    73 //      'wp_admin_css' => get_bloginfo('wpurl') . "/wp-admin/load-styles.php?c=1&load=buttons,wp-admin,dashicons",
    74     ) ) );
     59    $query_params = FS_Contact_Form_Manager::instance()->get_query_params( $fs );
    7560
    7661    $view_params = array(
     
    118103        $fs->_add_tabs_after_content();
    119104    }
    120 
    121     $params = array(
    122         'page'           => 'contact',
    123         'module_id'      => $fs->get_id(),
    124         'module_type'    => $fs->get_module_type(),
    125         'module_slug'    => $slug,
    126         'module_version' => $fs->get_plugin_version(),
    127     );
    128     fs_require_template( 'powered-by.php', $params );
  • content-aware-sidebars/trunk/lib/freemius/templates/debug.php

    r2904931 r3203370  
    1818    $on_text  = fs_text_x_inline( 'On', 'as turned on' );
    1919
     20    // For some reason css was missing
     21    fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
     22
    2023    $has_any_active_clone = false;
    2124
    2225    $is_multisite = is_multisite();
     26
     27    $auto_off_timestamp = wp_next_scheduled( 'fs_debug_turn_off_logging_hook' ) * 1000;
    2328?>
    2429<h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
    2530<div>
    2631    <!-- Debugging Switch -->
    27     <?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
    2832    <span class="fs-switch-label"><?php fs_esc_html_echo_x_inline( 'Debugging', 'as code debugging' ) ?></span>
    2933
     
    3135        <div class="fs-toggle"></div>
    3236    </div>
     37
     38    <span class="auto-off-debug-countdown hidden"><?php echo fs_esc_html_echo_x_inline( 'Auto off in:', 'timer for auto-disabling debug' ); ?> <span class="time">23:59:59</span>
     39
    3340    <script type="text/javascript">
    3441        (function ($) {
     
    4047                        .toggleClass( 'fs-off' );
    4148
     49                    var is_on = ($(this).hasClass( 'fs-on' ) ? 1 : 0);
     50
    4251                    $.post( <?php echo Freemius::ajax_url() ?>, {
    4352                        action: 'fs_toggle_debug_mode',
    4453                        // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
    4554                        _wpnonce   : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
    46                         is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
    47                     }, function ( response ) {
     55                        is_on
     56                    }, function (response) {
     57                        if (is_on) {
     58                            startCountdownManually();
     59                        } else {
     60                            stopCountdownManually();
     61                        }
     62
    4863                        if ( 1 == response ) {
    4964                            // Refresh page on success.
     
    5267                    });
    5368                });
     69
     70                // Countdown
     71                var countdownElement = document.querySelector('.auto-off-debug-countdown');
     72                var timeElement = countdownElement.querySelector('.time');
     73                var targetTime = <?php echo wp_json_encode( $auto_off_timestamp ); ?>;
     74                var countdownTimeout;
     75
     76                function updateCountdown() {
     77                    var currentTime = new Date().getTime();
     78                    var remainingTimeInMs = targetTime - currentTime;
     79                    var hours = Math.floor((remainingTimeInMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
     80                    var minutes = Math.floor((remainingTimeInMs % (1000 * 60 * 60)) / (1000 * 60));
     81                    var seconds = Math.floor((remainingTimeInMs % (1000 * 60)) / 1000);
     82
     83
     84                    if (remainingTimeInMs < 1000) {
     85                        countdownElement.classList.add('hidden');
     86                        countdownTimeout = null;
     87                    } else {
     88                        timeElement.innerHTML = hours + ":"
     89                            + minutes.toString().padStart(2, '0') + ":"
     90                            + seconds.toString().padStart(2, '0');
     91                        countdownElement.classList.remove('hidden');
     92
     93                        if (countdownTimeout) {
     94                            clearTimeout(countdownTimeout);
     95                        }
     96                        countdownTimeout = setTimeout(updateCountdown, 1000);
     97                    }
     98                }
     99
     100                function startCountdownManually() {
     101                    targetTime = ( new Date().getTime() ) + (24 * 60 * 60 * 1000) - 1;
     102                    updateCountdown();
     103                }
     104
     105                function stopCountdownManually() {
     106                    targetTime = new Date().getTime();
     107                    updateCountdown();
     108                }
     109
     110                updateCountdown();
     111                // End countdown
     112
    54113            });
    55114        }(jQuery));
  • content-aware-sidebars/trunk/lib/freemius/templates/forms/affiliation.php

    r3092858 r3203370  
    509509        $fs->_add_tabs_after_content();
    510510    }
    511 
    512     $params = array(
    513         'page'           => 'affiliation',
    514         'module_id'      => $module_id,
    515         'module_slug'    => $slug,
    516         'module_version' => $fs->get_plugin_version(),
    517     );
    518     fs_require_template( 'powered-by.php', $params );
  • content-aware-sidebars/trunk/lib/freemius/templates/forms/license-activation.php

    r3092858 r3203370  
    570570                    } else {
    571571                        if ( ! hasLicensesDropdown ) {
    572                             licenseID = $availableLicenseKey.data( 'id' );
     572                            licenseID = $availableLicenseKey.data( 'id' ).toString();
    573573                        } else {
    574574                            licenseID = $licensesDropdown.val();
  • content-aware-sidebars/trunk/lib/freemius/templates/pricing.php

    r3092858 r3203370  
    55     * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
    66     * @since       1.0.3
    7      */
    8 
    9     /**
    10      * Note for WordPress.org Theme/Plugin reviewer:
    11      *  Freemius is an SDK for plugin and theme developers. Since the core
    12      *  of the SDK is relevant both for plugins and themes, for obvious reasons,
    13      *  we only develop and maintain one code base.
    14      *
    15      *  This code (and page) will not run for wp.org themes (only plugins).
    16      *
    17      *  In addition, this page loads an i-frame. We intentionally named it 'frame'
    18      *  so it will pass the "Theme Check" that is looking for the string "i" . "frame".
    19      *
    20      * UPDATE:
    21      *  After ongoing conversations with the WordPress.org TRT we received
    22      *  an official approval for including i-frames in the theme's WP Admin setting's
    23      *  page tab (the SDK will never add any i-frames on the sitefront). i-frames
    24      *  were never against the guidelines, but we wanted to get the team's blessings
    25      *  before we move forward. For the record, I got the final approval from
    26      *  Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
    27      *  Europe 2017 (June 16th, 2017).
    28      *
    29      * If you have any questions or need clarifications, please don't hesitate
    30      * pinging me on slack, my username is @svovaf.
    31      *
    32      * @author Vova Feldman (@svovaf)
    33      * @since 1.2.2
    347     */
    358
     
    9366    ) );
    9467
    95     $use_external_pricing = $fs->should_use_external_pricing();
     68    $pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
    9669
    97     if ( ! $use_external_pricing ) {
    98         $pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
    99         wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
    100     } else {
    101         if ( ! $fs->is_registered() ) {
    102             $template_data = array(
    103                 'id' => $fs->get_id(),
    104             );
    105             fs_require_template( 'forms/trial-start.php', $template_data);
    106         }
     70    wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
    10771
    108         $view_params = array(
    109             'id'   => $VARS['id'],
    110             'page' => strtolower( $fs->get_text_x_inline( 'Pricing', 'noun', 'pricing' ) ),
    111         );
    112         fs_require_once_template('secure-https-header.php', $view_params);
     72    $pricing_css_path = $fs->apply_filters( 'pricing/css_path', null );
     73    if ( is_string( $pricing_css_path ) ) {
     74        wp_enqueue_style( 'freemius-pricing', fs_asset_url( $pricing_css_path ) );
    11375    }
    11476
     
    12082?>
    12183    <div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
    122         <?php if ( ! $use_external_pricing ) : ?>
    12384        <div id="fs_pricing_wrapper" data-public-url="<?php echo trailingslashit( dirname( $pricing_js_url ) ) ?>"></div>
    12485        <?php
     
    139100            'unique_affix'           => $fs->get_unique_affix(),
    140101            'show_annual_in_monthly' => $fs->apply_filters( 'pricing/show_annual_in_monthly', true ),
     102            'license'                => $fs->has_active_valid_license() ? $fs->_get_license() : null,
     103            'plugin_icon'            => $fs->get_local_icon_url(),
     104            'disable_single_package' => $fs->apply_filters( 'pricing/disable_single_package', false ),
    141105        ), $query_params );
    142106
    143107        wp_add_inline_script( 'freemius-pricing', 'Freemius.pricing.new( ' . json_encode( $pricing_config ) . ' )' );
    144108        ?>
    145         <?php else : ?>
    146         <div id="fs_frame"></div>
    147         <form action="" method="POST">
    148             <input type="hidden" name="user_id"/>
    149             <input type="hidden" name="user_email"/>
    150             <input type="hidden" name="site_id"/>
    151             <input type="hidden" name="public_key"/>
    152             <input type="hidden" name="secret_key"/>
    153             <input type="hidden" name="action" value="account"/>
    154         </form>
    155 
    156         <script type="text/javascript">
    157             (function ($, undef) {
    158                 $(function () {
    159                     var
    160                     // Keep track of the i-frame height.
    161                     frame_height = 800,
    162                     base_url     = '<?php echo WP_FS__ADDRESS ?>',
    163                     // Pass the parent page URL into the i-frame in a meaningful way (this URL could be
    164                     // passed via query string or hard coded into the child page, it depends on your needs).
    165                     src          = base_url + '/pricing/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
    166 
    167                     // Append the I-frame into the DOM.
    168                     frame = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent; width: 1px; min-width: 100%;"><\/i' + 'frame>')
    169                         .appendTo('#fs_frame');
    170 
    171                     FS.PostMessage.init(base_url, [frame[0]]);
    172 
    173                     FS.PostMessage.receive('height', function (data) {
    174                         var h = data.height;
    175                         if (!isNaN(h) && h > 0 && h != frame_height) {
    176                             frame_height = h;
    177                             frame.height(frame_height + 'px');
    178 
    179                             FS.PostMessage.postScroll(frame[0]);
    180                         }
    181                     });
    182 
    183                     FS.PostMessage.receive('get_dimensions', function (data) {
    184                         FS.PostMessage.post('dimensions', {
    185                             height   : $(document.body).height(),
    186                             scrollTop: $(document).scrollTop()
    187                         }, frame[0]);
    188                     });
    189 
    190                     FS.PostMessage.receive('start_trial', function (data) {
    191                         openTrialConfirmationModal(data);
    192                     });
    193                 });
    194             })(jQuery);
    195         </script>
    196         <?php endif ?>
    197109    </div>
    198110<?php
     
    200112        $fs->_add_tabs_after_content();
    201113    }
    202 
    203     $params = array(
    204         'page'           => 'pricing',
    205         'module_id'      => $fs->get_id(),
    206         'module_type'    => $fs->get_module_type(),
    207         'module_slug'    => $slug,
    208         'module_version' => $fs->get_plugin_version(),
    209     );
    210     fs_require_template( 'powered-by.php', $params );
  • content-aware-sidebars/trunk/lib/wp-content-aware-engine/bootstrap.php

    r3092858 r3203370  
    1313 * @var string
    1414 */
    15 $this_wpca_version = '16.0';
     15$this_wpca_version = '17.0';
    1616
    1717/**
  • content-aware-sidebars/trunk/lib/wp-content-aware-engine/module/bp_member.php

    r3092858 r3203370  
    2727    public function __construct()
    2828    {
    29         parent::__construct('bp_member', __('BuddyPress Profiles', WPCA_DOMAIN));
     29        $label = sprintf(
     30            __('%s Profile Sections'),
     31            defined('BP_PLATFORM_VERSION')
     32                ? __('BuddyBoss', 'buddyboss')
     33                : __('BuddyPress', 'buddypress')
     34        );
     35        parent::__construct('bp_member', $label);
    3036        $this->default_value = 0;
    3137        $this->placeholder = __('All Sections', WPCA_DOMAIN);
  • content-aware-sidebars/trunk/lib/wp-pointer-tour/assets/js/pointers.js

    r2835339 r3203370  
    8282            .css("z-index",1001)
    8383            .pointer('open');
     84            //bluehost-wordpress-plugin sets global .wp-pointer{display:none;}, so override that
     85            $widget.pointer('widget')[0].style.setProperty("display", "block", "important");
    8486
    8587            $('html, body').animate({
  • content-aware-sidebars/trunk/lib/wp-pointer-tour/wp-pointer-tour.php

    r2028305 r3203370  
    3333    private $_enqueued = false;
    3434
    35     public function __construct($meta_key, $pointers = array())
     35    public function __construct($meta_key, $pointers = [])
    3636    {
    37 
    3837        //todo: consider singleton pattern or refactor script localize
    3938
     
    4342        add_action(
    4443            'wp_loaded',
    45             array($this,'initiate_tour')
     44            [$this,'initiate_tour']
    4645        );
    4746    }
     
    5857            add_action(
    5958                'admin_enqueue_scripts',
    60                 array($this,'enqueue_scripts')
     59                [$this,'enqueue_scripts']
    6160            );
    6261            add_action(
    6362                'wp_ajax_cas_finish_tour',
    64                 array($this,'finish_tour')
     63                [$this,'finish_tour']
    6564            );
    6665        }
     
    135134    public function finish_tour()
    136135    {
    137 
    138136        //Verify nonce
    139137        if (!check_ajax_referer($this->_meta_key, 'nonce', false)) {
     
    164162    public function enqueue_scripts($hook = '')
    165163    {
    166 
    167164        //scripts can be enqueued manually
    168165        //so do not do it twice
    169166        if ($this->_pointers && !$this->_enqueued) {
    170167            $this->_enqueued = true;
    171             wp_enqueue_script('cas/pointers', plugins_url('assets/js/pointers.js', __FILE__), array('wp-pointer'), self::VERSION, true);
     168            wp_enqueue_script('cas/pointers', plugins_url('assets/js/pointers.js', __FILE__), ['wp-pointer'], self::VERSION, true);
    172169            wp_enqueue_style('wp-pointer');
    173170
    174             wp_localize_script('cas/pointers', 'WP_PT', array(
     171            wp_localize_script('cas/pointers', 'WP_PT', [
    175172                'pointers' => $this->_pointers,
    176173                'nonce'    => wp_create_nonce($this->_meta_key),
    177                 'close'    => __('Close', "content-aware-sidebars"),
     174                'close'    => __('Close', 'content-aware-sidebars'),
    178175                'prev'     => __('Previous', 'content-aware-sidebars'),
    179                 'next'     => __('Next', "content-aware-sidebars")
    180             ));
     176                'next'     => __('Next', 'content-aware-sidebars')
     177            ]);
    181178        }
    182179    }
  • content-aware-sidebars/trunk/readme.txt

    r3186862 r3203370  
    22Contributors: intoxstudio, devinstitute, freemius
    33Donate link: #
    4 Tags: custom sidebars, sidebar, classic widgets, widget, bbpress, buddypress, sidebar manager
     4Tags: custom sidebars, sidebar, classic widgets, widget, bbpress
    55Requires at least: 5.5
    66Requires PHP: 7.1
    77Tested up to: 6.7
    8 Stable tag: 3.20
     8Stable tag: 3.21
    99License: GPLv3
    1010
     
    194194####Highlights
    195195
     196= 3.21 =
     197
     198* [new] performance improvements
     199* [new] ui improvements
     200* [new] wordpress 6.7 support
     201* [fixed] stop bluehost-wordpress-plugin from breaking the plugin
     202* [updated] wp-content-aware-engine library
     203* [updated] freemius sdk
     204
     205**Pro Plan:**
     206
     207* [fixed] buddypress group visibility
     208
    196209= 3.20 =
    197210
     
    202215* [new] minimum php version 7.1
    203216* [fixed] improved compatibility with wpml plugin
     217* [updated] buddypress 12 compatibility
    204218* [updated] wp-content-aware-engine library
    205219* [updated] freemius sdk
     
    209223* [updated] more themes supported by sticky option
    210224
    211 = 3.19.3 =
    212 
    213 * [new] wordpress 6.4 support
    214 * [new] minimum wordpress version 5.1
    215 * [new] minimum php version 7.0
    216 * [new] performance improvements
    217 * [updated] wp-content-aware-engine library
    218 
    219 = 3.19.2 =
    220 
    221 * [new] wordpress 6.3 support
    222 * [updated] freemius sdk
    223 
    224 **Pro Plan:**
    225 
    226 * [updated] sticky support for more themes
    227 
    228 = 3.19.1 =
    229 
    230 * [updated] freemius sdk
    231 
    232 = 3.19 =
    233 
    234 * [new] performance improvements
    235 * [new] ui improvements
    236 * [new] sidebar shortcode parameter for conditional display
    237 * [new] wordpress 6.2 support
    238 * [updated] freemius sdk
    239 
    240 **Pro Plan:**
    241 
    242 * [new] "random" display condition
    243 * [new] widget revision support when updating via REST API or Block Editor
    244 
    245225See changelog.txt for previous changes.
  • content-aware-sidebars/trunk/sidebar.php

    r3092858 r3203370  
    791791    public function filter_shortcode_visibility($retval, $id)
    792792    {
    793         if ($retval) {
    794             $metadata = $this->metadata()->get('visibility');
    795 
    796             //temporary filter until WPCACore allows filtering
    797             $user_visibility = is_user_logged_in() ? [-1] : [];
    798             $user_visibility = apply_filters('cas/user_visibility', $user_visibility);
    799 
    800             $visibility = $metadata->get_data($id, true, false);
    801 
    802             // Check visibility
    803             if ($visibility && !array_intersect($visibility, $user_visibility)) {
    804                 $retval = false;
    805             }
    806         }
     793        if (!$retval) {
     794            return $retval;
     795        }
     796
     797        $metadata = $this->metadata()->get('visibility');
     798        $visibility = $metadata->get_data($id, true, false);
     799
     800        if (!$visibility) {
     801            return $retval;
     802        }
     803
     804        //temporary filter until WPCACore allows filtering
     805        $user_visibility = is_user_logged_in() ? [-1] : [];
     806        $user_visibility = apply_filters('cas/user_visibility', $user_visibility);
     807
     808        // Check visibility
     809        if (!array_intersect($visibility, $user_visibility)) {
     810            $retval = false;
     811        }
     812
    807813        return $retval;
    808814    }
Note: See TracChangeset for help on using the changeset viewer.