Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
}
[13000] Fix | Delete
[13001] Fix | Delete
if ( ! $updated_subscription ) {
[13002] Fix | Delete
$subscriptions[] = $subscription;
[13003] Fix | Delete
}
[13004] Fix | Delete
[13005] Fix | Delete
$this->_storage->subscriptions = $subscriptions;
[13006] Fix | Delete
}
[13007] Fix | Delete
[13008] Fix | Delete
/**
[13009] Fix | Delete
* @author Leo Fajardo (@leorw)
[13010] Fix | Delete
* @since 2.0.0
[13011] Fix | Delete
*/
[13012] Fix | Delete
function delete_unused_subscriptions() {
[13013] Fix | Delete
if ( ! isset( $this->_storage->subscriptions ) ||
[13014] Fix | Delete
empty( $this->_storage->subscriptions ) ||
[13015] Fix | Delete
// Clean up only if there are already at least 3 subscriptions.
[13016] Fix | Delete
( count( $this->_storage->subscriptions ) < 3 )
[13017] Fix | Delete
) {
[13018] Fix | Delete
return;
[13019] Fix | Delete
}
[13020] Fix | Delete
[13021] Fix | Delete
if ( ! is_multisite() ) {
[13022] Fix | Delete
// If not multisite, there should only be 1 subscription, so just clear the array.
[13023] Fix | Delete
$this->_storage->subscriptions = array();
[13024] Fix | Delete
[13025] Fix | Delete
return;
[13026] Fix | Delete
}
[13027] Fix | Delete
[13028] Fix | Delete
$subscriptions_to_keep_by_license_id_map = array();
[13029] Fix | Delete
$sites = self::get_sites();
[13030] Fix | Delete
foreach ( $sites as $site ) {
[13031] Fix | Delete
$blog_id = self::get_site_blog_id( $site );
[13032] Fix | Delete
$install = $this->get_install_by_blog_id( $blog_id );
[13033] Fix | Delete
[13034] Fix | Delete
if ( ! is_object( $install ) ||
[13035] Fix | Delete
! FS_Plugin_License::is_valid_id( $install->license_id )
[13036] Fix | Delete
) {
[13037] Fix | Delete
continue;
[13038] Fix | Delete
}
[13039] Fix | Delete
[13040] Fix | Delete
$subscriptions_to_keep_by_license_id_map[ $install->license_id ] = true;
[13041] Fix | Delete
}
[13042] Fix | Delete
[13043] Fix | Delete
if ( empty( $subscriptions_to_keep_by_license_id_map ) ) {
[13044] Fix | Delete
$this->_storage->subscriptions = array();
[13045] Fix | Delete
[13046] Fix | Delete
return;
[13047] Fix | Delete
}
[13048] Fix | Delete
[13049] Fix | Delete
foreach ( $this->_storage->subscriptions as $key => $subscription ) {
[13050] Fix | Delete
if ( ! isset( $subscriptions_to_keep_by_license_id_map[ $subscription->license_id ] ) ) {
[13051] Fix | Delete
unset( $this->_storage->subscriptions[ $key ] );
[13052] Fix | Delete
}
[13053] Fix | Delete
}
[13054] Fix | Delete
}
[13055] Fix | Delete
[13056] Fix | Delete
/**
[13057] Fix | Delete
* @author Vova Feldman (@svovaf)
[13058] Fix | Delete
* @since 1.0.2
[13059] Fix | Delete
*
[13060] Fix | Delete
* @param string $plan Plan name
[13061] Fix | Delete
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
[13062] Fix | Delete
*
[13063] Fix | Delete
* @return bool
[13064] Fix | Delete
*/
[13065] Fix | Delete
function is_plan( $plan, $exact = false ) {
[13066] Fix | Delete
$this->_logger->entrance();
[13067] Fix | Delete
[13068] Fix | Delete
if ( ! $this->is_registered() ) {
[13069] Fix | Delete
return false;
[13070] Fix | Delete
}
[13071] Fix | Delete
[13072] Fix | Delete
$plan = strtolower( $plan );
[13073] Fix | Delete
[13074] Fix | Delete
$current_plan_name = $this->get_plan_name();
[13075] Fix | Delete
[13076] Fix | Delete
if ( $current_plan_name === $plan ) {
[13077] Fix | Delete
// Exact plan.
[13078] Fix | Delete
return true;
[13079] Fix | Delete
} else if ( $exact ) {
[13080] Fix | Delete
// Required exact, but plans are different.
[13081] Fix | Delete
return false;
[13082] Fix | Delete
}
[13083] Fix | Delete
[13084] Fix | Delete
$current_plan_order = - 1;
[13085] Fix | Delete
$required_plan_order = PHP_INT_MAX;
[13086] Fix | Delete
for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
[13087] Fix | Delete
if ( $plan === $this->_plans[ $i ]->name ) {
[13088] Fix | Delete
$required_plan_order = $i;
[13089] Fix | Delete
} else if ( $current_plan_name === $this->_plans[ $i ]->name ) {
[13090] Fix | Delete
$current_plan_order = $i;
[13091] Fix | Delete
}
[13092] Fix | Delete
}
[13093] Fix | Delete
[13094] Fix | Delete
return ( $current_plan_order > $required_plan_order );
[13095] Fix | Delete
}
[13096] Fix | Delete
[13097] Fix | Delete
/**
[13098] Fix | Delete
* Check if module has only one plan.
[13099] Fix | Delete
*
[13100] Fix | Delete
* @author Vova Feldman (@svovaf)
[13101] Fix | Delete
* @since 1.2.1.7
[13102] Fix | Delete
*
[13103] Fix | Delete
* @param bool $double_check In some cases developers prefer to release their paid offering as premium-only, even though there is a free version. For those cases, looking at the 'is_premium_only' value isn't enough because the result will return false even when the product has only signle paid plan.
[13104] Fix | Delete
*
[13105] Fix | Delete
* @return bool
[13106] Fix | Delete
*/
[13107] Fix | Delete
function is_single_plan( $double_check = false ) {
[13108] Fix | Delete
$this->_logger->entrance();
[13109] Fix | Delete
[13110] Fix | Delete
if ( ! $this->is_registered() ||
[13111] Fix | Delete
! is_array( $this->_plans ) ||
[13112] Fix | Delete
0 === count( $this->_plans )
[13113] Fix | Delete
) {
[13114] Fix | Delete
return true;
[13115] Fix | Delete
}
[13116] Fix | Delete
[13117] Fix | Delete
$has_free_plan = $this->has_free_plan();
[13118] Fix | Delete
[13119] Fix | Delete
if ( ! $has_free_plan && $double_check ) {
[13120] Fix | Delete
foreach ( $this->_plans as $plan ) {
[13121] Fix | Delete
if ( $plan->is_free() ) {
[13122] Fix | Delete
$has_free_plan = true;
[13123] Fix | Delete
break;
[13124] Fix | Delete
}
[13125] Fix | Delete
}
[13126] Fix | Delete
}
[13127] Fix | Delete
[13128] Fix | Delete
return ( 1 === ( count( $this->_plans ) - ( $has_free_plan ? 1 : 0 ) ) );
[13129] Fix | Delete
}
[13130] Fix | Delete
[13131] Fix | Delete
/**
[13132] Fix | Delete
* Check if plan based on trial. If not in trial mode, should return false.
[13133] Fix | Delete
*
[13134] Fix | Delete
* @since 1.0.9
[13135] Fix | Delete
*
[13136] Fix | Delete
* @param string $plan Plan name
[13137] Fix | Delete
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
[13138] Fix | Delete
*
[13139] Fix | Delete
* @return bool
[13140] Fix | Delete
*/
[13141] Fix | Delete
function is_trial_plan( $plan, $exact = false ) {
[13142] Fix | Delete
$this->_logger->entrance();
[13143] Fix | Delete
[13144] Fix | Delete
if ( ! $this->is_registered() ) {
[13145] Fix | Delete
return false;
[13146] Fix | Delete
}
[13147] Fix | Delete
[13148] Fix | Delete
if ( ! $this->is_trial() ) {
[13149] Fix | Delete
return false;
[13150] Fix | Delete
}
[13151] Fix | Delete
[13152] Fix | Delete
$trial_plan = $this->get_trial_plan();
[13153] Fix | Delete
[13154] Fix | Delete
if ( $trial_plan->name === $plan ) {
[13155] Fix | Delete
// Exact plan.
[13156] Fix | Delete
return true;
[13157] Fix | Delete
} else if ( $exact ) {
[13158] Fix | Delete
// Required exact, but plans are different.
[13159] Fix | Delete
return false;
[13160] Fix | Delete
}
[13161] Fix | Delete
[13162] Fix | Delete
$current_plan_order = - 1;
[13163] Fix | Delete
$required_plan_order = - 1;
[13164] Fix | Delete
for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
[13165] Fix | Delete
if ( $plan === $this->_plans[ $i ]->name ) {
[13166] Fix | Delete
$required_plan_order = $i;
[13167] Fix | Delete
} else if ( $trial_plan->name === $this->_plans[ $i ]->name ) {
[13168] Fix | Delete
$current_plan_order = $i;
[13169] Fix | Delete
}
[13170] Fix | Delete
}
[13171] Fix | Delete
[13172] Fix | Delete
return ( $current_plan_order > $required_plan_order );
[13173] Fix | Delete
}
[13174] Fix | Delete
[13175] Fix | Delete
/**
[13176] Fix | Delete
* Check if plugin has any paid plans.
[13177] Fix | Delete
*
[13178] Fix | Delete
* @author Vova Feldman (@svovaf)
[13179] Fix | Delete
* @since 1.0.7
[13180] Fix | Delete
*
[13181] Fix | Delete
* @return bool
[13182] Fix | Delete
*/
[13183] Fix | Delete
function has_paid_plan() {
[13184] Fix | Delete
return $this->_has_paid_plans ||
[13185] Fix | Delete
FS_Plan_Manager::instance()->has_paid_plan( $this->_plans );
[13186] Fix | Delete
}
[13187] Fix | Delete
[13188] Fix | Delete
/**
[13189] Fix | Delete
* Check if plugin has any plan with a trail.
[13190] Fix | Delete
*
[13191] Fix | Delete
* @author Vova Feldman (@svovaf)
[13192] Fix | Delete
* @since 1.0.9
[13193] Fix | Delete
*
[13194] Fix | Delete
* @return bool
[13195] Fix | Delete
*/
[13196] Fix | Delete
function has_trial_plan() {
[13197] Fix | Delete
/**
[13198] Fix | Delete
* @author Vova Feldman(@svovaf)
[13199] Fix | Delete
* @since 1.2.1.5
[13200] Fix | Delete
*
[13201] Fix | Delete
* Allow setting a trial from the SDK without calling the API.
[13202] Fix | Delete
* But, if the user did opt-in, continue using the real data from the API.
[13203] Fix | Delete
*/
[13204] Fix | Delete
if ( $this->_trial_days >= 0 ) {
[13205] Fix | Delete
return true;
[13206] Fix | Delete
}
[13207] Fix | Delete
[13208] Fix | Delete
return $this->_storage->get( 'has_trial_plan', false );
[13209] Fix | Delete
}
[13210] Fix | Delete
[13211] Fix | Delete
/**
[13212] Fix | Delete
* Check if plugin has any free plan, or is it premium only.
[13213] Fix | Delete
*
[13214] Fix | Delete
* Note: If no plans configured, assume plugin is free.
[13215] Fix | Delete
*
[13216] Fix | Delete
* @author Vova Feldman (@svovaf)
[13217] Fix | Delete
* @since 1.0.7
[13218] Fix | Delete
*
[13219] Fix | Delete
* @return bool
[13220] Fix | Delete
*/
[13221] Fix | Delete
function has_free_plan() {
[13222] Fix | Delete
return ! $this->is_only_premium();
[13223] Fix | Delete
}
[13224] Fix | Delete
[13225] Fix | Delete
/**
[13226] Fix | Delete
* Displays a license activation dialog box when the user clicks on the "Activate License"
[13227] Fix | Delete
* or "Change License" link on the plugins
[13228] Fix | Delete
* page.
[13229] Fix | Delete
*
[13230] Fix | Delete
* @author Leo Fajardo (@leorw)
[13231] Fix | Delete
* @since 1.1.9
[13232] Fix | Delete
*/
[13233] Fix | Delete
function _add_license_activation_dialog_box() {
[13234] Fix | Delete
$vars = array(
[13235] Fix | Delete
'id' => $this->_module_id,
[13236] Fix | Delete
);
[13237] Fix | Delete
[13238] Fix | Delete
fs_require_template( 'forms/license-activation.php', $vars );
[13239] Fix | Delete
fs_require_template( 'forms/resend-key.php', $vars );
[13240] Fix | Delete
}
[13241] Fix | Delete
[13242] Fix | Delete
/**
[13243] Fix | Delete
* Displays an email address update dialog box when the user clicks on the email address "Edit" button on the "Account" page.
[13244] Fix | Delete
*
[13245] Fix | Delete
* @author Leo Fajardo (@leorw)
[13246] Fix | Delete
* @since 2.5.0
[13247] Fix | Delete
*/
[13248] Fix | Delete
function _add_email_address_update_dialog_box() {
[13249] Fix | Delete
$vars = array( 'id' => $this->_module_id );
[13250] Fix | Delete
[13251] Fix | Delete
fs_require_template( 'forms/email-address-update.php', $vars );
[13252] Fix | Delete
}
[13253] Fix | Delete
[13254] Fix | Delete
/**
[13255] Fix | Delete
* @author Leo Fajardo (@leorw)
[13256] Fix | Delete
* @since 2.5.0
[13257] Fix | Delete
*/
[13258] Fix | Delete
function _add_email_address_update_option() {
[13259] Fix | Delete
if ( ! $this->should_handle_user_change() ) {
[13260] Fix | Delete
return;
[13261] Fix | Delete
}
[13262] Fix | Delete
[13263] Fix | Delete
// Add email address update AJAX handler.
[13264] Fix | Delete
$this->add_ajax_action( 'update_email_address', array( &$this, '_email_address_update_ajax_handler' ) );
[13265] Fix | Delete
}
[13266] Fix | Delete
[13267] Fix | Delete
/**
[13268] Fix | Delete
* @author Leo Fajardo (@leorw)
[13269] Fix | Delete
* @since 2.5.0
[13270] Fix | Delete
*/
[13271] Fix | Delete
function _email_address_update_ajax_handler() {
[13272] Fix | Delete
$this->check_ajax_referer( 'update_email_address' );
[13273] Fix | Delete
[13274] Fix | Delete
$new_email_address = fs_request_get( 'email_address' );
[13275] Fix | Delete
$transfer_type = fs_request_get( 'transfer_type' );
[13276] Fix | Delete
[13277] Fix | Delete
$result = $this->update_email( $new_email_address );
[13278] Fix | Delete
[13279] Fix | Delete
if ( ! FS_Api::is_api_error( $result ) ) {
[13280] Fix | Delete
self::shoot_ajax_success();
[13281] Fix | Delete
}
[13282] Fix | Delete
[13283] Fix | Delete
$error = '';
[13284] Fix | Delete
[13285] Fix | Delete
if ( FS_Api::is_api_error_object( $result ) ) {
[13286] Fix | Delete
switch ( $result->error->code ) {
[13287] Fix | Delete
case 'user_exist':
[13288] Fix | Delete
case 'account_verification_required':
[13289] Fix | Delete
$error = array(
[13290] Fix | Delete
'code' => 'change_ownership',
[13291] Fix | Delete
'url' => $this->get_account_url( 'change_owner', array(
[13292] Fix | Delete
'state' => 'init',
[13293] Fix | Delete
'candidate_email' => $new_email_address,
[13294] Fix | Delete
'transfer_type' => $transfer_type,
[13295] Fix | Delete
) ),
[13296] Fix | Delete
);
[13297] Fix | Delete
[13298] Fix | Delete
break;
[13299] Fix | Delete
}
[13300] Fix | Delete
}
[13301] Fix | Delete
[13302] Fix | Delete
if ( empty( $error ) ) {
[13303] Fix | Delete
$error = is_object( $result ) ?
[13304] Fix | Delete
var_export( $result->error, true ) :
[13305] Fix | Delete
$result;
[13306] Fix | Delete
}
[13307] Fix | Delete
[13308] Fix | Delete
self::shoot_ajax_failure( $error );
[13309] Fix | Delete
}
[13310] Fix | Delete
[13311] Fix | Delete
/**
[13312] Fix | Delete
* Returns a collection of IDs of installs that are associated with the context product and its add-ons, and activated with foreign licenses.
[13313] Fix | Delete
*
[13314] Fix | Delete
* @author Leo Fajardo (@leorw)
[13315] Fix | Delete
* @since 2.3.2
[13316] Fix | Delete
*
[13317] Fix | Delete
* @return number[]
[13318] Fix | Delete
*/
[13319] Fix | Delete
function get_installs_ids_with_foreign_licenses() {
[13320] Fix | Delete
$installs = array();
[13321] Fix | Delete
[13322] Fix | Delete
if (
[13323] Fix | Delete
is_object( $this->_license ) &&
[13324] Fix | Delete
$this->_site->user_id != $this->_license->user_id
[13325] Fix | Delete
) {
[13326] Fix | Delete
$installs[] = $this->_site->id;
[13327] Fix | Delete
}
[13328] Fix | Delete
[13329] Fix | Delete
/**
[13330] Fix | Delete
* Also try to get foreign licenses for the context product's add-ons.
[13331] Fix | Delete
*/
[13332] Fix | Delete
$installs_by_slug_map = $this->get_parent_and_addons_installs_info();
[13333] Fix | Delete
[13334] Fix | Delete
foreach ( $installs_by_slug_map as $slug => $install_info ) {
[13335] Fix | Delete
if ( $slug == $this->get_slug() ) {
[13336] Fix | Delete
continue;
[13337] Fix | Delete
}
[13338] Fix | Delete
[13339] Fix | Delete
$install = $install_info['install'];
[13340] Fix | Delete
$license = $install_info['license'];
[13341] Fix | Delete
[13342] Fix | Delete
if (
[13343] Fix | Delete
is_object( $license ) &&
[13344] Fix | Delete
$install->user_id != $license->user_id
[13345] Fix | Delete
) {
[13346] Fix | Delete
$installs[] = $install->id;
[13347] Fix | Delete
}
[13348] Fix | Delete
}
[13349] Fix | Delete
[13350] Fix | Delete
return $installs;
[13351] Fix | Delete
}
[13352] Fix | Delete
[13353] Fix | Delete
/**
[13354] Fix | Delete
* Displays the "Change User" dialog box when the user clicks on the "Change User" button on the "Account" page.
[13355] Fix | Delete
*
[13356] Fix | Delete
* @author Leo Fajardo (@leorw)
[13357] Fix | Delete
* @since 2.3.2
[13358] Fix | Delete
*
[13359] Fix | Delete
* @param number[] $install_ids
[13360] Fix | Delete
*/
[13361] Fix | Delete
function _add_user_change_dialog_box( $install_ids ) {
[13362] Fix | Delete
$vars = array(
[13363] Fix | Delete
'id' => $this->_module_id,
[13364] Fix | Delete
'license_owners' => $this->fetch_installs_licenses_owners_data( $install_ids )
[13365] Fix | Delete
);
[13366] Fix | Delete
[13367] Fix | Delete
fs_require_template( 'forms/user-change.php', $vars );
[13368] Fix | Delete
}
[13369] Fix | Delete
[13370] Fix | Delete
/**
[13371] Fix | Delete
* @author Leo Fajardo (@leorw)
[13372] Fix | Delete
* @since 2.3.1
[13373] Fix | Delete
*/
[13374] Fix | Delete
function _add_data_debug_mode_dialog_box() {
[13375] Fix | Delete
$vars = array(
[13376] Fix | Delete
'id' => $this->_module_id,
[13377] Fix | Delete
);
[13378] Fix | Delete
[13379] Fix | Delete
fs_require_template( 'forms/data-debug-mode.php', $vars );
[13380] Fix | Delete
}
[13381] Fix | Delete
[13382] Fix | Delete
/**
[13383] Fix | Delete
* Displays a subscription cancellation dialog box when the user clicks on the "Deactivate License"
[13384] Fix | Delete
* link on the "Account" page or deactivates a plugin and there's an active subscription that is
[13385] Fix | Delete
* either associated with a non-lifetime single-site license or non-lifetime multisite license that
[13386] Fix | Delete
* is only activated on a single production site.
[13387] Fix | Delete
*
[13388] Fix | Delete
* @author Leo Fajardo (@leorw)
[13389] Fix | Delete
* @since 2.2.1
[13390] Fix | Delete
*
[13391] Fix | Delete
* @param bool $is_license_deactivation
[13392] Fix | Delete
*
[13393] Fix | Delete
* @return array
[13394] Fix | Delete
*/
[13395] Fix | Delete
function _get_subscription_cancellation_dialog_box_template_params( $is_license_deactivation = false ) {
[13396] Fix | Delete
if ( fs_is_network_admin() ) {
[13397] Fix | Delete
// Subscription cancellation dialog box is currently not supported for multisite networks.
[13398] Fix | Delete
return array();
[13399] Fix | Delete
}
[13400] Fix | Delete
[13401] Fix | Delete
if ( $this->is_whitelabeled() ) {
[13402] Fix | Delete
return array();
[13403] Fix | Delete
}
[13404] Fix | Delete
[13405] Fix | Delete
$license = $this->_get_license();
[13406] Fix | Delete
[13407] Fix | Delete
/**
[13408] Fix | Delete
* If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation.
[13409] Fix | Delete
*
[13410] Fix | Delete
* @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf)
[13411] Fix | Delete
* @since 2.2.1
[13412] Fix | Delete
*/
[13413] Fix | Delete
if ( ! is_object( $license ) ||
[13414] Fix | Delete
$license->is_lifetime() ||
[13415] Fix | Delete
( ! $license->is_single_site() && $license->activated > 1 )
[13416] Fix | Delete
) {
[13417] Fix | Delete
return array();
[13418] Fix | Delete
}
[13419] Fix | Delete
[13420] Fix | Delete
/**
[13421] Fix | Delete
* @var FS_Subscription $subscription
[13422] Fix | Delete
*/
[13423] Fix | Delete
$subscription = $this->_get_subscription( $license->id );
[13424] Fix | Delete
if ( ! is_object( $subscription ) || ! $subscription->is_active() ) {
[13425] Fix | Delete
return array();
[13426] Fix | Delete
}
[13427] Fix | Delete
[13428] Fix | Delete
return array(
[13429] Fix | Delete
'id' => $this->_module_id,
[13430] Fix | Delete
'license' => $license,
[13431] Fix | Delete
'has_trial' => $this->is_paid_trial(),
[13432] Fix | Delete
'is_license_deactivation' => $is_license_deactivation,
[13433] Fix | Delete
);
[13434] Fix | Delete
}
[13435] Fix | Delete
[13436] Fix | Delete
/**
[13437] Fix | Delete
* @author Leo Fajardo (@leorw)
[13438] Fix | Delete
* @since 2.0.2
[13439] Fix | Delete
*/
[13440] Fix | Delete
function _add_premium_version_upgrade_selection_dialog_box() {
[13441] Fix | Delete
$modules_update = get_site_transient( $this->is_theme() ? 'update_themes' : 'update_plugins' );
[13442] Fix | Delete
if ( ! isset( $modules_update->response[ $this->_plugin_basename ] ) ) {
[13443] Fix | Delete
return;
[13444] Fix | Delete
}
[13445] Fix | Delete
[13446] Fix | Delete
$vars = array(
[13447] Fix | Delete
'id' => $this->_module_id,
[13448] Fix | Delete
'new_version' => is_object( $modules_update->response[ $this->_plugin_basename ] ) ?
[13449] Fix | Delete
$modules_update->response[ $this->_plugin_basename ]->new_version :
[13450] Fix | Delete
$modules_update->response[ $this->_plugin_basename ]['new_version']
[13451] Fix | Delete
);
[13452] Fix | Delete
[13453] Fix | Delete
fs_require_template( 'forms/premium-versions-upgrade-metadata.php', $vars );
[13454] Fix | Delete
fs_require_once_template( 'forms/premium-versions-upgrade-handler.php', $vars );
[13455] Fix | Delete
}
[13456] Fix | Delete
[13457] Fix | Delete
/**
[13458] Fix | Delete
* Displays the opt-out dialog box when the user clicks on the "Opt Out" link on the "Plugins"
[13459] Fix | Delete
* page.
[13460] Fix | Delete
*
[13461] Fix | Delete
* @author Leo Fajardo (@leorw)
[13462] Fix | Delete
* @since 1.2.1.5
[13463] Fix | Delete
*/
[13464] Fix | Delete
function _add_optout_dialog() {
[13465] Fix | Delete
if ( $this->is_theme() ) {
[13466] Fix | Delete
$vars = null;
[13467] Fix | Delete
fs_require_once_template( '/js/jquery.content-change.php', $vars );
[13468] Fix | Delete
}
[13469] Fix | Delete
[13470] Fix | Delete
$vars = array( 'id' => $this->_module_id );
[13471] Fix | Delete
fs_require_template( 'forms/optout.php', $vars );
[13472] Fix | Delete
}
[13473] Fix | Delete
[13474] Fix | Delete
/**
[13475] Fix | Delete
* Prepare page to include all required UI and logic for the license activation dialog.
[13476] Fix | Delete
*
[13477] Fix | Delete
* @author Vova Feldman (@svovaf)
[13478] Fix | Delete
* @since 1.2.0
[13479] Fix | Delete
*/
[13480] Fix | Delete
function _add_license_activation() {
[13481] Fix | Delete
if ( $this->is_migration() ) {
[13482] Fix | Delete
return;
[13483] Fix | Delete
}
[13484] Fix | Delete
[13485] Fix | Delete
if ( ! $this->is_user_admin() ) {
[13486] Fix | Delete
// Only admins can activate a license.
[13487] Fix | Delete
return;
[13488] Fix | Delete
}
[13489] Fix | Delete
[13490] Fix | Delete
if ( ! $this->has_paid_plan() ) {
[13491] Fix | Delete
// Module doesn't have any paid plans.
[13492] Fix | Delete
return;
[13493] Fix | Delete
}
[13494] Fix | Delete
[13495] Fix | Delete
if (
[13496] Fix | Delete
$this->has_premium_version() &&
[13497] Fix | Delete
! $this->is_premium() &&
[13498] Fix | Delete
/**
[13499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function