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/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
*
[24000] Fix | Delete
* @author Vova Feldman (@svovaf)
[24001] Fix | Delete
* @since 1.0.9
[24002] Fix | Delete
*
[24003] Fix | Delete
* @return bool If trial notice added.
[24004] Fix | Delete
*/
[24005] Fix | Delete
function _add_trial_notice() {
[24006] Fix | Delete
if ( ! $this->is_user_admin() ) {
[24007] Fix | Delete
return false;
[24008] Fix | Delete
}
[24009] Fix | Delete
[24010] Fix | Delete
if ( ! $this->is_user_in_admin() ) {
[24011] Fix | Delete
return false;
[24012] Fix | Delete
}
[24013] Fix | Delete
[24014] Fix | Delete
if ( $this->_is_network_active ) {
[24015] Fix | Delete
if ( fs_is_network_admin() ) {
[24016] Fix | Delete
// Network level trial is disabled at the moment.
[24017] Fix | Delete
return false;
[24018] Fix | Delete
}
[24019] Fix | Delete
[24020] Fix | Delete
if ( ! $this->is_delegated_connection() ) {
[24021] Fix | Delete
// Only delegated sites should support trials.
[24022] Fix | Delete
return false;
[24023] Fix | Delete
}
[24024] Fix | Delete
}
[24025] Fix | Delete
[24026] Fix | Delete
// Check if trial message is already shown.
[24027] Fix | Delete
if ( $this->is_in_trial_promotion() ) {
[24028] Fix | Delete
add_action( 'admin_footer', array( &$this, '_fix_start_trial_menu_item_url' ) );
[24029] Fix | Delete
[24030] Fix | Delete
$this->_menu->add_counter_to_menu_item( 1, 'fs-trial' );
[24031] Fix | Delete
[24032] Fix | Delete
return false;
[24033] Fix | Delete
}
[24034] Fix | Delete
[24035] Fix | Delete
if ( $this->is_premium() && ! WP_FS__DEV_MODE ) {
[24036] Fix | Delete
// Don't show trial if running the premium code, unless running in DEV mode.
[24037] Fix | Delete
return false;
[24038] Fix | Delete
}
[24039] Fix | Delete
[24040] Fix | Delete
if ( ! $this->has_trial_plan() ) {
[24041] Fix | Delete
// No plans with trial.
[24042] Fix | Delete
return false;
[24043] Fix | Delete
}
[24044] Fix | Delete
[24045] Fix | Delete
if ( ! $this->apply_filters( 'show_trial', true ) ) {
[24046] Fix | Delete
// Developer explicitly asked not to show the trial promo.
[24047] Fix | Delete
return false;
[24048] Fix | Delete
}
[24049] Fix | Delete
[24050] Fix | Delete
if ( $this->is_registered() ) {
[24051] Fix | Delete
// Check if trial already utilized.
[24052] Fix | Delete
if ( $this->_site->is_trial_utilized() ) {
[24053] Fix | Delete
return false;
[24054] Fix | Delete
}
[24055] Fix | Delete
[24056] Fix | Delete
if ( $this->is_paying_or_trial() ) {
[24057] Fix | Delete
// Don't show trial if paying or already in trial.
[24058] Fix | Delete
return false;
[24059] Fix | Delete
}
[24060] Fix | Delete
}
[24061] Fix | Delete
[24062] Fix | Delete
if ( $this->is_activation_mode() || $this->is_pending_activation() ) {
[24063] Fix | Delete
// If not yet opted-in/skipped, or pending activation, don't show trial.
[24064] Fix | Delete
return false;
[24065] Fix | Delete
}
[24066] Fix | Delete
[24067] Fix | Delete
$last_time_trial_promotion_shown = $this->_storage->get( 'trial_promotion_shown', false );
[24068] Fix | Delete
$was_promotion_shown_before = ( false !== $last_time_trial_promotion_shown );
[24069] Fix | Delete
[24070] Fix | Delete
// Show promotion if never shown before and 24 hours after initial activation with FS.
[24071] Fix | Delete
if ( ! $was_promotion_shown_before &&
[24072] Fix | Delete
$this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) )
[24073] Fix | Delete
) {
[24074] Fix | Delete
return false;
[24075] Fix | Delete
}
[24076] Fix | Delete
[24077] Fix | Delete
// OR if promotion was shown before, try showing it every 30 days.
[24078] Fix | Delete
if ( $was_promotion_shown_before &&
[24079] Fix | Delete
$this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown
[24080] Fix | Delete
) {
[24081] Fix | Delete
return false;
[24082] Fix | Delete
}
[24083] Fix | Delete
[24084] Fix | Delete
$trial_period = $this->_trial_days;
[24085] Fix | Delete
$require_payment = $this->_is_trial_require_payment;
[24086] Fix | Delete
$trial_url = $this->get_trial_url();
[24087] Fix | Delete
$plans_string = strtolower( $this->get_text_inline( 'Awesome', 'awesome' ) );
[24088] Fix | Delete
[24089] Fix | Delete
if ( $this->is_registered() ) {
[24090] Fix | Delete
// If opted-in, override trial with up to date data from API.
[24091] Fix | Delete
$trial_plans = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans );
[24092] Fix | Delete
$trial_plans_count = count( $trial_plans );
[24093] Fix | Delete
[24094] Fix | Delete
if ( 0 === $trial_plans_count ) {
[24095] Fix | Delete
// If there's no plans with a trial just exit.
[24096] Fix | Delete
return false;
[24097] Fix | Delete
}
[24098] Fix | Delete
[24099] Fix | Delete
/**
[24100] Fix | Delete
* @var FS_Plugin_Plan $paid_plan
[24101] Fix | Delete
*/
[24102] Fix | Delete
$paid_plan = $trial_plans[0];
[24103] Fix | Delete
$require_payment = $paid_plan->is_require_subscription;
[24104] Fix | Delete
$trial_period = $paid_plan->trial_period;
[24105] Fix | Delete
[24106] Fix | Delete
$total_paid_plans = count( $this->_plans ) - ( FS_Plan_Manager::instance()->has_free_plan( $this->_plans ) ? 1 : 0 );
[24107] Fix | Delete
[24108] Fix | Delete
if ( $total_paid_plans !== $trial_plans_count ) {
[24109] Fix | Delete
// Not all paid plans have a trial - generate a string of those that have it.
[24110] Fix | Delete
for ( $i = 0; $i < $trial_plans_count; $i ++ ) {
[24111] Fix | Delete
$plans_string .= sprintf(
[24112] Fix | Delete
' <a href="%s">%s</a>',
[24113] Fix | Delete
$trial_url,
[24114] Fix | Delete
$trial_plans[ $i ]->title
[24115] Fix | Delete
);
[24116] Fix | Delete
[24117] Fix | Delete
if ( $i < $trial_plans_count - 2 ) {
[24118] Fix | Delete
$plans_string .= ', ';
[24119] Fix | Delete
} else if ( $i == $trial_plans_count - 2 ) {
[24120] Fix | Delete
$plans_string .= ' and ';
[24121] Fix | Delete
}
[24122] Fix | Delete
}
[24123] Fix | Delete
}
[24124] Fix | Delete
}
[24125] Fix | Delete
[24126] Fix | Delete
$message = sprintf(
[24127] Fix | Delete
$this->get_text_x_inline( 'Hey', 'exclamation', 'hey' ) . '! ' . $this->get_text_inline( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'trial-x-promotion-message' ),
[24128] Fix | Delete
sprintf( '<b>%s</b>', $this->get_plugin_name() ),
[24129] Fix | Delete
$plans_string,
[24130] Fix | Delete
$trial_period
[24131] Fix | Delete
);
[24132] Fix | Delete
[24133] Fix | Delete
// "No Credit-Card Required" or "No Commitment for N Days".
[24134] Fix | Delete
$cc_string = $require_payment ?
[24135] Fix | Delete
sprintf( $this->get_text_inline( 'No commitment for %s days - cancel anytime!', 'no-commitment-for-x-days' ), $trial_period ) :
[24136] Fix | Delete
$this->get_text_inline( 'No credit card required', 'no-cc-required' ) . '!';
[24137] Fix | Delete
[24138] Fix | Delete
[24139] Fix | Delete
// Start trial button.
[24140] Fix | Delete
$button = ' ' . sprintf(
[24141] Fix | Delete
'<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>',
[24142] Fix | Delete
$trial_url,
[24143] Fix | Delete
$this->get_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial' )
[24144] Fix | Delete
);
[24145] Fix | Delete
[24146] Fix | Delete
$this->_admin_notices->add_sticky(
[24147] Fix | Delete
$this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string} {$button}" ),
[24148] Fix | Delete
'trial_promotion',
[24149] Fix | Delete
'',
[24150] Fix | Delete
'promotion'
[24151] Fix | Delete
);
[24152] Fix | Delete
[24153] Fix | Delete
$this->_storage->trial_promotion_shown = WP_FS__SCRIPT_START_TIME;
[24154] Fix | Delete
[24155] Fix | Delete
return true;
[24156] Fix | Delete
}
[24157] Fix | Delete
[24158] Fix | Delete
/**
[24159] Fix | Delete
* Lets users/customers know that the product has an affiliate program.
[24160] Fix | Delete
*
[24161] Fix | Delete
* @author Leo Fajardo (@leorw)
[24162] Fix | Delete
* @since 1.2.2.11
[24163] Fix | Delete
*
[24164] Fix | Delete
* @return bool Returns true if the notice has been added.
[24165] Fix | Delete
*/
[24166] Fix | Delete
function _add_affiliate_program_notice() {
[24167] Fix | Delete
if ( ! $this->is_user_admin() ) {
[24168] Fix | Delete
return false;
[24169] Fix | Delete
}
[24170] Fix | Delete
[24171] Fix | Delete
if ( ! $this->is_user_in_admin() ) {
[24172] Fix | Delete
return false;
[24173] Fix | Delete
}
[24174] Fix | Delete
[24175] Fix | Delete
// Check if the notice is already shown.
[24176] Fix | Delete
if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) {
[24177] Fix | Delete
return false;
[24178] Fix | Delete
}
[24179] Fix | Delete
[24180] Fix | Delete
if (
[24181] Fix | Delete
// Product has no affiliate program.
[24182] Fix | Delete
! $this->has_affiliate_program() ||
[24183] Fix | Delete
// User has applied for an affiliate account.
[24184] Fix | Delete
! empty( $this->_storage->affiliate_application_data )
[24185] Fix | Delete
) {
[24186] Fix | Delete
return false;
[24187] Fix | Delete
}
[24188] Fix | Delete
[24189] Fix | Delete
if ( ! $this->apply_filters( 'show_affiliate_program_notice', true ) ) {
[24190] Fix | Delete
// Developer explicitly asked not to show the notice about the affiliate program.
[24191] Fix | Delete
return false;
[24192] Fix | Delete
}
[24193] Fix | Delete
[24194] Fix | Delete
if ( $this->is_activation_mode() || $this->is_pending_activation() ) {
[24195] Fix | Delete
// If not yet opted in/skipped, or pending activation, don't show the notice.
[24196] Fix | Delete
return false;
[24197] Fix | Delete
}
[24198] Fix | Delete
[24199] Fix | Delete
$last_time_notice_was_shown = $this->_storage->get( 'affiliate_program_notice_shown', false );
[24200] Fix | Delete
$was_notice_shown_before = ( false !== $last_time_notice_was_shown );
[24201] Fix | Delete
[24202] Fix | Delete
/**
[24203] Fix | Delete
* Do not show the notice if it was already shown before or less than 30 days have passed since the initial
[24204] Fix | Delete
* activation with FS.
[24205] Fix | Delete
*/
[24206] Fix | Delete
if ( $was_notice_shown_before ||
[24207] Fix | Delete
$this->_storage->install_timestamp > ( time() - ( WP_FS__TIME_24_HOURS_IN_SEC * 30 ) )
[24208] Fix | Delete
) {
[24209] Fix | Delete
return false;
[24210] Fix | Delete
}
[24211] Fix | Delete
[24212] Fix | Delete
if ( ! $this->is_paying() &&
[24213] Fix | Delete
FS_Plugin::AFFILIATE_MODERATION_CUSTOMERS == $this->_plugin->affiliate_moderation
[24214] Fix | Delete
) {
[24215] Fix | Delete
// If the user is not a customer and the affiliate program is only for customers, don't show the notice.
[24216] Fix | Delete
return false;
[24217] Fix | Delete
}
[24218] Fix | Delete
[24219] Fix | Delete
$message = sprintf(
[24220] Fix | Delete
$this->get_text_inline( 'Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!', 'become-an-ambassador-admin-notice' ),
[24221] Fix | Delete
sprintf( '<strong>%s</strong>', $this->get_plugin_name() ),
[24222] Fix | Delete
$this->get_module_label( true )
[24223] Fix | Delete
);
[24224] Fix | Delete
[24225] Fix | Delete
// HTML code for the "Learn more..." button.
[24226] Fix | Delete
$button = ' ' . sprintf(
[24227] Fix | Delete
'<a style="display: block; margin-top: 10px;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>',
[24228] Fix | Delete
$this->_get_admin_page_url( 'affiliation' ),
[24229] Fix | Delete
$this->get_text_inline( 'Learn more', 'learn-more' ) . '...'
[24230] Fix | Delete
);
[24231] Fix | Delete
[24232] Fix | Delete
$this->_admin_notices->add_sticky(
[24233] Fix | Delete
$this->apply_filters( 'affiliate_program_notice', "{$message} {$button}" ),
[24234] Fix | Delete
'affiliate_program',
[24235] Fix | Delete
'',
[24236] Fix | Delete
'promotion'
[24237] Fix | Delete
);
[24238] Fix | Delete
[24239] Fix | Delete
$this->_storage->affiliate_program_notice_shown = WP_FS__SCRIPT_START_TIME;
[24240] Fix | Delete
[24241] Fix | Delete
return true;
[24242] Fix | Delete
}
[24243] Fix | Delete
[24244] Fix | Delete
/**
[24245] Fix | Delete
* @author Vova Feldman (@svovaf)
[24246] Fix | Delete
* @since 1.2.1.5
[24247] Fix | Delete
*/
[24248] Fix | Delete
function _enqueue_common_css() {
[24249] Fix | Delete
if ( $this->has_paid_plan() && ! $this->is_paying() ) {
[24250] Fix | Delete
// Add basic CSS for admin-notices and menu-item colors.
[24251] Fix | Delete
fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
[24252] Fix | Delete
}
[24253] Fix | Delete
}
[24254] Fix | Delete
[24255] Fix | Delete
/**
[24256] Fix | Delete
* @author Leo Fajardo (@leorw)
[24257] Fix | Delete
* @since 1.2.2
[24258] Fix | Delete
*/
[24259] Fix | Delete
function _show_theme_activation_optin_dialog() {
[24260] Fix | Delete
fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
[24261] Fix | Delete
[24262] Fix | Delete
add_action( 'admin_footer', array( &$this, '_add_fs_theme_activation_dialog' ) );
[24263] Fix | Delete
}
[24264] Fix | Delete
[24265] Fix | Delete
/**
[24266] Fix | Delete
* @author Leo Fajardo (@leorw)
[24267] Fix | Delete
* @since 1.2.2
[24268] Fix | Delete
*/
[24269] Fix | Delete
function _add_fs_theme_activation_dialog() {
[24270] Fix | Delete
global $pagenow;
[24271] Fix | Delete
[24272] Fix | Delete
if ( 'themes.php' !== $pagenow ) {
[24273] Fix | Delete
return;
[24274] Fix | Delete
}
[24275] Fix | Delete
[24276] Fix | Delete
$vars = array( 'id' => $this->_module_id );
[24277] Fix | Delete
fs_require_once_template( 'connect.php', $vars );
[24278] Fix | Delete
}
[24279] Fix | Delete
[24280] Fix | Delete
/* Action Links
[24281] Fix | Delete
------------------------------------------------------------------------------------------------------------------*/
[24282] Fix | Delete
private $_action_links_hooked = false;
[24283] Fix | Delete
private $_action_links = array();
[24284] Fix | Delete
[24285] Fix | Delete
/**
[24286] Fix | Delete
* Hook to plugin action links filter.
[24287] Fix | Delete
*
[24288] Fix | Delete
* @author Vova Feldman (@svovaf)
[24289] Fix | Delete
* @since 1.0.0
[24290] Fix | Delete
*/
[24291] Fix | Delete
private function hook_plugin_action_links() {
[24292] Fix | Delete
$this->_logger->entrance();
[24293] Fix | Delete
[24294] Fix | Delete
$this->_action_links_hooked = true;
[24295] Fix | Delete
[24296] Fix | Delete
$this->_logger->log( 'Adding action links hooks.' );
[24297] Fix | Delete
[24298] Fix | Delete
// Add action link to settings page.
[24299] Fix | Delete
add_filter( 'plugin_action_links_' . $this->_plugin_basename, array(
[24300] Fix | Delete
&$this,
[24301] Fix | Delete
'_modify_plugin_action_links_hook'
[24302] Fix | Delete
), WP_FS__DEFAULT_PRIORITY, 2 );
[24303] Fix | Delete
add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array(
[24304] Fix | Delete
&$this,
[24305] Fix | Delete
'_modify_plugin_action_links_hook'
[24306] Fix | Delete
), WP_FS__DEFAULT_PRIORITY, 2 );
[24307] Fix | Delete
}
[24308] Fix | Delete
[24309] Fix | Delete
/**
[24310] Fix | Delete
* Add plugin action link.
[24311] Fix | Delete
*
[24312] Fix | Delete
* @author Vova Feldman (@svovaf)
[24313] Fix | Delete
* @since 1.0.0
[24314] Fix | Delete
*
[24315] Fix | Delete
* @param $label
[24316] Fix | Delete
* @param $url
[24317] Fix | Delete
* @param bool $external
[24318] Fix | Delete
* @param int $priority
[24319] Fix | Delete
* @param bool $key
[24320] Fix | Delete
*/
[24321] Fix | Delete
function add_plugin_action_link( $label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false ) {
[24322] Fix | Delete
$this->_logger->entrance();
[24323] Fix | Delete
[24324] Fix | Delete
if ( ! isset( $this->_action_links[ $priority ] ) ) {
[24325] Fix | Delete
$this->_action_links[ $priority ] = array();
[24326] Fix | Delete
}
[24327] Fix | Delete
[24328] Fix | Delete
if ( false === $key ) {
[24329] Fix | Delete
$key = preg_replace( "/[^A-Za-z0-9 ]/", '', strtolower( $label ) );
[24330] Fix | Delete
}
[24331] Fix | Delete
[24332] Fix | Delete
$this->_action_links[ $priority ][] = array(
[24333] Fix | Delete
'label' => $label,
[24334] Fix | Delete
'href' => $url,
[24335] Fix | Delete
'key' => $key,
[24336] Fix | Delete
'external' => $external
[24337] Fix | Delete
);
[24338] Fix | Delete
}
[24339] Fix | Delete
[24340] Fix | Delete
/**
[24341] Fix | Delete
* Adds Upgrade and Add-Ons links to the main Plugins page link actions collection.
[24342] Fix | Delete
*
[24343] Fix | Delete
* @author Vova Feldman (@svovaf)
[24344] Fix | Delete
* @since 1.0.0
[24345] Fix | Delete
*/
[24346] Fix | Delete
function _add_upgrade_action_link() {
[24347] Fix | Delete
$this->_logger->entrance();
[24348] Fix | Delete
[24349] Fix | Delete
$is_activation_mode = $this->is_activation_mode();
[24350] Fix | Delete
[24351] Fix | Delete
$add_action_links = $this->should_add_submenu_or_action_links( $is_activation_mode );
[24352] Fix | Delete
[24353] Fix | Delete
/**
[24354] Fix | Delete
* The following logic is based on the logic in `add_submenu_items()` method that decides when the "Upgrade"
[24355] Fix | Delete
* and "Add-Ons" menus should be added.
[24356] Fix | Delete
*
[24357] Fix | Delete
* @author Leo Fajardo (@leorw)
[24358] Fix | Delete
* @since 2.3.0
[24359] Fix | Delete
*/
[24360] Fix | Delete
$add_upgrade_link = (
[24361] Fix | Delete
$add_action_links ||
[24362] Fix | Delete
( $is_activation_mode && $this->is_only_premium() )
[24363] Fix | Delete
) && ! WP_FS__DEMO_MODE && ( ! $this->is_whitelabeled() );
[24364] Fix | Delete
[24365] Fix | Delete
$add_addons_link = ( $add_action_links && $this->has_addons() );
[24366] Fix | Delete
[24367] Fix | Delete
if ( ! $add_upgrade_link && ! $add_addons_link ) {
[24368] Fix | Delete
return;
[24369] Fix | Delete
}
[24370] Fix | Delete
[24371] Fix | Delete
if (
[24372] Fix | Delete
$add_upgrade_link &&
[24373] Fix | Delete
$this->is_pricing_page_visible() &&
[24374] Fix | Delete
$this->is_submenu_item_visible( 'pricing' )
[24375] Fix | Delete
) {
[24376] Fix | Delete
$this->add_plugin_action_link(
[24377] Fix | Delete
$this->get_text_inline( 'Upgrade', 'upgrade' ),
[24378] Fix | Delete
$this->get_upgrade_url(),
[24379] Fix | Delete
false,
[24380] Fix | Delete
7,
[24381] Fix | Delete
'upgrade'
[24382] Fix | Delete
);
[24383] Fix | Delete
}
[24384] Fix | Delete
[24385] Fix | Delete
if (
[24386] Fix | Delete
$add_addons_link &&
[24387] Fix | Delete
$this->has_addons() &&
[24388] Fix | Delete
$this->is_submenu_item_visible( 'addons' )
[24389] Fix | Delete
) {
[24390] Fix | Delete
$this->add_plugin_action_link(
[24391] Fix | Delete
$this->get_text_inline( 'Add-Ons', 'add-ons' ),
[24392] Fix | Delete
$this->_get_admin_page_url( 'addons' ),
[24393] Fix | Delete
false,
[24394] Fix | Delete
9,
[24395] Fix | Delete
'addons'
[24396] Fix | Delete
);
[24397] Fix | Delete
}
[24398] Fix | Delete
}
[24399] Fix | Delete
[24400] Fix | Delete
/**
[24401] Fix | Delete
* Adds "Activate License" or "Change License" link to the main Plugins page link actions collection.
[24402] Fix | Delete
*
[24403] Fix | Delete
* @author Leo Fajardo (@leorw)
[24404] Fix | Delete
* @since 1.1.9
[24405] Fix | Delete
*/
[24406] Fix | Delete
function _add_license_action_link() {
[24407] Fix | Delete
$this->_logger->entrance();
[24408] Fix | Delete
[24409] Fix | Delete
if ( ! self::is_ajax() ) {
[24410] Fix | Delete
// Inject license activation dialog UI and client side code.
[24411] Fix | Delete
add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
[24412] Fix | Delete
}
[24413] Fix | Delete
[24414] Fix | Delete
$link_text = $this->is_free_plan() ?
[24415] Fix | Delete
$this->get_text_inline( 'Activate License', 'activate-license' ) :
[24416] Fix | Delete
$this->get_text_inline( 'Change License', 'change-license' );
[24417] Fix | Delete
[24418] Fix | Delete
$this->add_plugin_action_link(
[24419] Fix | Delete
$link_text,
[24420] Fix | Delete
'#',
[24421] Fix | Delete
false,
[24422] Fix | Delete
11,
[24423] Fix | Delete
( 'activate-license ' . $this->get_unique_affix() )
[24424] Fix | Delete
);
[24425] Fix | Delete
}
[24426] Fix | Delete
[24427] Fix | Delete
/**
[24428] Fix | Delete
* @author Leo Fajardo (@leorw)
[24429] Fix | Delete
* @since 2.0.2
[24430] Fix | Delete
*/
[24431] Fix | Delete
function _add_premium_version_upgrade_selection_action() {
[24432] Fix | Delete
$this->_logger->entrance();
[24433] Fix | Delete
[24434] Fix | Delete
if ( ! self::is_ajax() ) {
[24435] Fix | Delete
add_action( 'admin_footer', array( &$this, '_add_premium_version_upgrade_selection_dialog_box' ) );
[24436] Fix | Delete
}
[24437] Fix | Delete
}
[24438] Fix | Delete
[24439] Fix | Delete
/**
[24440] Fix | Delete
* Adds "Opt In" or "Opt Out" link to the main "Plugins" page link actions collection.
[24441] Fix | Delete
*
[24442] Fix | Delete
* @author Leo Fajardo (@leorw)
[24443] Fix | Delete
* @since 1.2.1.5
[24444] Fix | Delete
*/
[24445] Fix | Delete
function _add_tracking_links() {
[24446] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[24447] Fix | Delete
return;
[24448] Fix | Delete
}
[24449] Fix | Delete
[24450] Fix | Delete
$this->_logger->entrance();
[24451] Fix | Delete
[24452] Fix | Delete
if ( $this->is_only_premium() && $this->is_free_plan() ) {
[24453] Fix | Delete
// Don't add tracking links for premium-only products that were opted-in by relation (add-on or a parent product) before activating any license.
[24454] Fix | Delete
return;
[24455] Fix | Delete
}
[24456] Fix | Delete
[24457] Fix | Delete
if (
[24458] Fix | Delete
$this->is_addon() &&
[24459] Fix | Delete
! $this->is_only_premium()
[24460] Fix | Delete
) {
[24461] Fix | Delete
$parent = $this->get_parent_instance();
[24462] Fix | Delete
[24463] Fix | Delete
if ( is_object( $parent ) && $parent->is_anonymous() ) {
[24464] Fix | Delete
return;
[24465] Fix | Delete
}
[24466] Fix | Delete
}
[24467] Fix | Delete
[24468] Fix | Delete
if ( fs_is_network_admin() ) {
[24469] Fix | Delete
if ( ! $this->_is_network_active ) {
[24470] Fix | Delete
// Don't add tracking links when browsing the network WP Admin and the plugin is not network active.
[24471] Fix | Delete
return;
[24472] Fix | Delete
} else if ( $this->is_network_delegated_connection() ) {
[24473] Fix | Delete
// Don't add tracking links when browsing the network WP Admin and the activation has been delegated to site admins.
[24474] Fix | Delete
return;
[24475] Fix | Delete
}
[24476] Fix | Delete
} else {
[24477] Fix | Delete
if ( $this->_is_network_active && ! $this->is_delegated_connection() ) {
[24478] Fix | Delete
// Don't add tracking links when browsing the sub-site WP Admin, the plugin is network active, and the connection was not delegated.
[24479] Fix | Delete
return;
[24480] Fix | Delete
}
[24481] Fix | Delete
}
[24482] Fix | Delete
[24483] Fix | Delete
if ( fs_request_is_action_secure( $this->get_unique_affix() . '_reconnect' ) ) {
[24484] Fix | Delete
if ( ! $this->is_registered() && $this->is_anonymous() ) {
[24485] Fix | Delete
$this->connect_again();
[24486] Fix | Delete
[24487] Fix | Delete
return;
[24488] Fix | Delete
}
[24489] Fix | Delete
}
[24490] Fix | Delete
[24491] Fix | Delete
if ( ( $this->is_plugin() && ! self::is_plugins_page() ) ||
[24492] Fix | Delete
( $this->is_theme() && ! self::is_themes_page() )
[24493] Fix | Delete
) {
[24494] Fix | Delete
// Only show tracking links on the plugins and themes pages.
[24495] Fix | Delete
return;
[24496] Fix | Delete
}
[24497] Fix | Delete
[24498] Fix | Delete
if (
[24499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function