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
self::shoot_ajax_failure(
[14500] Fix | Delete
isset( $next_page->error ) ?
[14501] Fix | Delete
$next_page->error->message :
[14502] Fix | Delete
var_export( $next_page, true )
[14503] Fix | Delete
);
[14504] Fix | Delete
}
[14505] Fix | Delete
[14506] Fix | Delete
$this->shoot_ajax_success( array(
[14507] Fix | Delete
'next_page' => $next_page,
[14508] Fix | Delete
) );
[14509] Fix | Delete
}
[14510] Fix | Delete
[14511] Fix | Delete
/**
[14512] Fix | Delete
* @author Leo Fajardo (@leorw)
[14513] Fix | Delete
* @since 1.2.0
[14514] Fix | Delete
*/
[14515] Fix | Delete
function _resend_license_key_ajax_action() {
[14516] Fix | Delete
$this->_logger->entrance();
[14517] Fix | Delete
[14518] Fix | Delete
$this->check_ajax_referer( 'resend_license_key' );
[14519] Fix | Delete
[14520] Fix | Delete
$email_address = sanitize_email( trim( fs_request_get( 'email', '', 'post' ) ) );
[14521] Fix | Delete
[14522] Fix | Delete
if ( empty( $email_address ) ) {
[14523] Fix | Delete
exit;
[14524] Fix | Delete
}
[14525] Fix | Delete
[14526] Fix | Delete
$error = false;
[14527] Fix | Delete
[14528] Fix | Delete
$api = $this->get_api_plugin_scope();
[14529] Fix | Delete
$result = $api->call( '/licenses/resend.json', 'post',
[14530] Fix | Delete
array(
[14531] Fix | Delete
'email' => $email_address,
[14532] Fix | Delete
'url' => home_url(),
[14533] Fix | Delete
)
[14534] Fix | Delete
);
[14535] Fix | Delete
[14536] Fix | Delete
if ( is_object( $result ) && isset( $result->error ) ) {
[14537] Fix | Delete
$error = $result->error;
[14538] Fix | Delete
[14539] Fix | Delete
if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) {
[14540] Fix | Delete
$error = $this->get_text_inline( "We couldn't find your email address in the system, are you sure it's the right address?", 'email-not-found' );
[14541] Fix | Delete
} else if ( 'no_license' === $error->code ) {
[14542] Fix | Delete
$error = $this->get_text_inline( "We can't see any active licenses associated with that email address, are you sure it's the right address?", 'no-active-licenses' );
[14543] Fix | Delete
} else {
[14544] Fix | Delete
$error = $error->message;
[14545] Fix | Delete
}
[14546] Fix | Delete
}
[14547] Fix | Delete
[14548] Fix | Delete
$licenses = array(
[14549] Fix | Delete
'success' => ( false === $error )
[14550] Fix | Delete
);
[14551] Fix | Delete
[14552] Fix | Delete
if ( false !== $error ) {
[14553] Fix | Delete
$licenses['error'] = sprintf( '%s... %s', $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), strtolower( $error ) );
[14554] Fix | Delete
}
[14555] Fix | Delete
[14556] Fix | Delete
echo json_encode( $licenses );
[14557] Fix | Delete
[14558] Fix | Delete
exit;
[14559] Fix | Delete
}
[14560] Fix | Delete
[14561] Fix | Delete
/**
[14562] Fix | Delete
* @author Vova Feldman (@svovaf)
[14563] Fix | Delete
* @since 1.2.1.8
[14564] Fix | Delete
*
[14565] Fix | Delete
* @var string
[14566] Fix | Delete
*/
[14567] Fix | Delete
private static $_pagenow;
[14568] Fix | Delete
[14569] Fix | Delete
/**
[14570] Fix | Delete
* Get current page or the referer if executing a WP AJAX request.
[14571] Fix | Delete
*
[14572] Fix | Delete
* @author Vova Feldman (@svovaf)
[14573] Fix | Delete
* @since 1.2.1.8
[14574] Fix | Delete
*
[14575] Fix | Delete
* @return string
[14576] Fix | Delete
*/
[14577] Fix | Delete
static function get_current_page() {
[14578] Fix | Delete
if ( ! isset( self::$_pagenow ) ) {
[14579] Fix | Delete
global $pagenow;
[14580] Fix | Delete
if ( empty( $pagenow ) && is_admin() && is_multisite() ) {
[14581] Fix | Delete
/**
[14582] Fix | Delete
* It appears that `$pagenow` is not yet initialized in some network admin pages when this method
[14583] Fix | Delete
* is called, so initialize it here using some pieces of code from `wp-includes/vars.php`.
[14584] Fix | Delete
*
[14585] Fix | Delete
* @author Leo Fajardo (@leorw)
[14586] Fix | Delete
* @since 2.2.3
[14587] Fix | Delete
*/
[14588] Fix | Delete
if ( is_network_admin() ) {
[14589] Fix | Delete
preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
[14590] Fix | Delete
} else if ( is_user_admin() ) {
[14591] Fix | Delete
preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
[14592] Fix | Delete
} else {
[14593] Fix | Delete
preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
[14594] Fix | Delete
}
[14595] Fix | Delete
[14596] Fix | Delete
$pagenow = $self_matches[1];
[14597] Fix | Delete
$pagenow = trim( $pagenow, '/' );
[14598] Fix | Delete
$pagenow = preg_replace( '#\?.*?$#', '', $pagenow );
[14599] Fix | Delete
if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
[14600] Fix | Delete
$pagenow = 'index.php';
[14601] Fix | Delete
} else {
[14602] Fix | Delete
preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );
[14603] Fix | Delete
$pagenow = strtolower( $self_matches[1] );
[14604] Fix | Delete
if ( '.php' !== substr($pagenow, -4, 4) )
[14605] Fix | Delete
$pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
[14606] Fix | Delete
}
[14607] Fix | Delete
}
[14608] Fix | Delete
[14609] Fix | Delete
self::$_pagenow = $pagenow;
[14610] Fix | Delete
[14611] Fix | Delete
if ( self::is_ajax() &&
[14612] Fix | Delete
'admin-ajax.php' === $pagenow
[14613] Fix | Delete
) {
[14614] Fix | Delete
$referer = fs_get_raw_referer();
[14615] Fix | Delete
[14616] Fix | Delete
if ( is_string( $referer ) ) {
[14617] Fix | Delete
$parts = explode( '?', $referer );
[14618] Fix | Delete
[14619] Fix | Delete
self::$_pagenow = basename( $parts[0] );
[14620] Fix | Delete
}
[14621] Fix | Delete
}
[14622] Fix | Delete
}
[14623] Fix | Delete
[14624] Fix | Delete
return self::$_pagenow;
[14625] Fix | Delete
}
[14626] Fix | Delete
[14627] Fix | Delete
/**
[14628] Fix | Delete
* Helper method to check if user in the plugins page.
[14629] Fix | Delete
*
[14630] Fix | Delete
* @author Vova Feldman (@svovaf)
[14631] Fix | Delete
* @since 1.2.1.5
[14632] Fix | Delete
*
[14633] Fix | Delete
* @return bool
[14634] Fix | Delete
*/
[14635] Fix | Delete
static function is_plugins_page() {
[14636] Fix | Delete
return ( 'plugins.php' === self::get_current_page() );
[14637] Fix | Delete
}
[14638] Fix | Delete
[14639] Fix | Delete
/**
[14640] Fix | Delete
* @author Leo Fajardo (@leorw)
[14641] Fix | Delete
* @since 2.2.3
[14642] Fix | Delete
*
[14643] Fix | Delete
* @return bool
[14644] Fix | Delete
*/
[14645] Fix | Delete
static function is_plugin_install_page() {
[14646] Fix | Delete
return ( 'plugin-install.php' === self::get_current_page() );
[14647] Fix | Delete
}
[14648] Fix | Delete
[14649] Fix | Delete
/**
[14650] Fix | Delete
* @author Leo Fajardo (@leorw)
[14651] Fix | Delete
* @since 2.0.2
[14652] Fix | Delete
*
[14653] Fix | Delete
* @return bool
[14654] Fix | Delete
*/
[14655] Fix | Delete
static function is_updates_page() {
[14656] Fix | Delete
return ( 'update-core.php' === self::get_current_page() );
[14657] Fix | Delete
}
[14658] Fix | Delete
[14659] Fix | Delete
/**
[14660] Fix | Delete
* Helper method to check if user in the themes page.
[14661] Fix | Delete
*
[14662] Fix | Delete
* @author Vova Feldman (@svovaf)
[14663] Fix | Delete
* @since 1.2.2.6
[14664] Fix | Delete
*
[14665] Fix | Delete
* @return bool
[14666] Fix | Delete
*/
[14667] Fix | Delete
static function is_themes_page() {
[14668] Fix | Delete
return ( 'themes.php' === self::get_current_page() );
[14669] Fix | Delete
}
[14670] Fix | Delete
[14671] Fix | Delete
#----------------------------------------------------------------------------------
[14672] Fix | Delete
#region Affiliation
[14673] Fix | Delete
#----------------------------------------------------------------------------------
[14674] Fix | Delete
[14675] Fix | Delete
/**
[14676] Fix | Delete
* @author Leo Fajardo (@leorw)
[14677] Fix | Delete
* @since 1.2.3
[14678] Fix | Delete
*
[14679] Fix | Delete
* @return bool
[14680] Fix | Delete
*/
[14681] Fix | Delete
function has_affiliate_program() {
[14682] Fix | Delete
if ( ! is_object( $this->_plugin ) ) {
[14683] Fix | Delete
return false;
[14684] Fix | Delete
}
[14685] Fix | Delete
[14686] Fix | Delete
return $this->_plugin->has_affiliate_program();
[14687] Fix | Delete
}
[14688] Fix | Delete
[14689] Fix | Delete
/**
[14690] Fix | Delete
* Get Plugin ID under which we will track affiliate application.
[14691] Fix | Delete
*
[14692] Fix | Delete
* This could either be the Bundle ID or the main plugin ID.
[14693] Fix | Delete
*
[14694] Fix | Delete
* @return number Bundle ID if developer has provided one, else the main plugin ID.
[14695] Fix | Delete
*/
[14696] Fix | Delete
private function get_plugin_id_for_affiliate_terms() {
[14697] Fix | Delete
return $this->has_bundle_context() ?
[14698] Fix | Delete
$this->get_bundle_id() :
[14699] Fix | Delete
$this->_plugin->id;
[14700] Fix | Delete
}
[14701] Fix | Delete
[14702] Fix | Delete
/**
[14703] Fix | Delete
* @author Leo Fajardo (@leorw)
[14704] Fix | Delete
* @since 1.2.4
[14705] Fix | Delete
*/
[14706] Fix | Delete
private function fetch_affiliate_terms() {
[14707] Fix | Delete
if ( ! is_object( $this->plugin_affiliate_terms ) ) {
[14708] Fix | Delete
/**
[14709] Fix | Delete
* In case we have a bundle set in SDK configuration, we would like to use that for affiliates, not the main plugin.
[14710] Fix | Delete
*/
[14711] Fix | Delete
$plugins_api = $this->has_bundle_context() ?
[14712] Fix | Delete
$this->get_api_bundle_scope() :
[14713] Fix | Delete
$this->get_api_plugin_scope();
[14714] Fix | Delete
[14715] Fix | Delete
$affiliate_terms = $plugins_api->get( '/aff.json?type=affiliation', false );
[14716] Fix | Delete
[14717] Fix | Delete
/**
[14718] Fix | Delete
* At this point, we intentionally don't fallback to the main plugin, because the developer has chosen to use bundle. So it makes sense the affiliate program should be in context to the bundle too.
[14719] Fix | Delete
*/
[14720] Fix | Delete
if ( ! $this->is_api_result_entity( $affiliate_terms ) ) {
[14721] Fix | Delete
return;
[14722] Fix | Delete
}
[14723] Fix | Delete
[14724] Fix | Delete
$this->plugin_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms );
[14725] Fix | Delete
}
[14726] Fix | Delete
}
[14727] Fix | Delete
[14728] Fix | Delete
/**
[14729] Fix | Delete
* @author Leo Fajardo (@leorw)
[14730] Fix | Delete
* @since 1.2.4
[14731] Fix | Delete
*/
[14732] Fix | Delete
private function fetch_affiliate_and_custom_terms() {
[14733] Fix | Delete
if ( ! empty( $this->_storage->affiliate_application_data ) ) {
[14734] Fix | Delete
$application_data = $this->_storage->affiliate_application_data;
[14735] Fix | Delete
$flush = ( ! isset( $application_data['status'] ) || 'pending' === $application_data['status'] );
[14736] Fix | Delete
[14737] Fix | Delete
$plugin_id_for_affiliate = $this->get_plugin_id_for_affiliate_terms();
[14738] Fix | Delete
[14739] Fix | Delete
$users_api = $this->get_api_user_scope();
[14740] Fix | Delete
$result = $users_api->get( "/plugins/{$plugin_id_for_affiliate}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json", $flush );
[14741] Fix | Delete
if ( $this->is_api_result_object( $result, 'affiliates' ) ) {
[14742] Fix | Delete
if ( ! empty( $result->affiliates ) ) {
[14743] Fix | Delete
$affiliate = new FS_Affiliate( $result->affiliates[0] );
[14744] Fix | Delete
[14745] Fix | Delete
if ( ! isset( $application_data['status'] ) || $application_data['status'] !== $affiliate->status ) {
[14746] Fix | Delete
$application_data['status'] = $affiliate->status;
[14747] Fix | Delete
$this->_storage->affiliate_application_data = $application_data;
[14748] Fix | Delete
}
[14749] Fix | Delete
[14750] Fix | Delete
if ( $affiliate->is_using_custom_terms ) {
[14751] Fix | Delete
$affiliate_terms = $users_api->get( "/plugins/{$this->_plugin->id}/affiliates/{$affiliate->id}/aff/{$affiliate->custom_affiliate_terms_id}.json", $flush );
[14752] Fix | Delete
if ( $this->is_api_result_entity( $affiliate_terms ) ) {
[14753] Fix | Delete
$this->custom_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms );
[14754] Fix | Delete
}
[14755] Fix | Delete
}
[14756] Fix | Delete
[14757] Fix | Delete
$this->affiliate = $affiliate;
[14758] Fix | Delete
}
[14759] Fix | Delete
}
[14760] Fix | Delete
}
[14761] Fix | Delete
}
[14762] Fix | Delete
[14763] Fix | Delete
/**
[14764] Fix | Delete
* @author Leo Fajardo (@leorw)
[14765] Fix | Delete
* @since 1.2.3
[14766] Fix | Delete
*/
[14767] Fix | Delete
private function fetch_affiliate_and_terms() {
[14768] Fix | Delete
$this->_logger->entrance();
[14769] Fix | Delete
[14770] Fix | Delete
$this->fetch_affiliate_terms();
[14771] Fix | Delete
$this->fetch_affiliate_and_custom_terms();
[14772] Fix | Delete
}
[14773] Fix | Delete
[14774] Fix | Delete
/**
[14775] Fix | Delete
* @author Leo Fajardo (@leorw)
[14776] Fix | Delete
* @since 1.2.3
[14777] Fix | Delete
*
[14778] Fix | Delete
* @return FS_Affiliate
[14779] Fix | Delete
*/
[14780] Fix | Delete
function get_affiliate() {
[14781] Fix | Delete
return $this->affiliate;
[14782] Fix | Delete
}
[14783] Fix | Delete
[14784] Fix | Delete
[14785] Fix | Delete
/**
[14786] Fix | Delete
* @author Leo Fajardo (@leorw)
[14787] Fix | Delete
* @since 1.2.3
[14788] Fix | Delete
*
[14789] Fix | Delete
* @return FS_AffiliateTerms
[14790] Fix | Delete
*/
[14791] Fix | Delete
function get_affiliate_terms() {
[14792] Fix | Delete
return is_object( $this->custom_affiliate_terms ) ?
[14793] Fix | Delete
$this->custom_affiliate_terms :
[14794] Fix | Delete
$this->plugin_affiliate_terms;
[14795] Fix | Delete
}
[14796] Fix | Delete
[14797] Fix | Delete
/**
[14798] Fix | Delete
* @author Leo Fajardo (@leorw)
[14799] Fix | Delete
* @since 1.2.3
[14800] Fix | Delete
*/
[14801] Fix | Delete
function _submit_affiliate_application() {
[14802] Fix | Delete
$this->_logger->entrance();
[14803] Fix | Delete
[14804] Fix | Delete
$this->check_ajax_referer( 'submit_affiliate_application' );
[14805] Fix | Delete
[14806] Fix | Delete
if ( ! $this->is_user_admin() ) {
[14807] Fix | Delete
// Only for admins.
[14808] Fix | Delete
self::shoot_ajax_failure();
[14809] Fix | Delete
}
[14810] Fix | Delete
[14811] Fix | Delete
$affiliate = fs_request_get( 'affiliate' );
[14812] Fix | Delete
[14813] Fix | Delete
if ( empty( $affiliate['promotion_methods'] ) ) {
[14814] Fix | Delete
unset( $affiliate['promotion_methods'] );
[14815] Fix | Delete
}
[14816] Fix | Delete
[14817] Fix | Delete
if ( ! empty( $affiliate['additional_domains'] ) ) {
[14818] Fix | Delete
$affiliate['additional_domains'] = array_unique( $affiliate['additional_domains'] );
[14819] Fix | Delete
}
[14820] Fix | Delete
[14821] Fix | Delete
if ( ! $this->is_registered() ) {
[14822] Fix | Delete
$email_address = isset( $affiliate['email'] ) ? $affiliate['email'] : '';
[14823] Fix | Delete
[14824] Fix | Delete
if ( ! is_email( $email_address ) ) {
[14825] Fix | Delete
self::shoot_ajax_failure('Invalid email address.');
[14826] Fix | Delete
}
[14827] Fix | Delete
[14828] Fix | Delete
// Opt in but don't track usage.
[14829] Fix | Delete
$next_page = $this->opt_in(
[14830] Fix | Delete
$email_address,
[14831] Fix | Delete
false,
[14832] Fix | Delete
false,
[14833] Fix | Delete
false,
[14834] Fix | Delete
false,
[14835] Fix | Delete
false,
[14836] Fix | Delete
true
[14837] Fix | Delete
);
[14838] Fix | Delete
[14839] Fix | Delete
if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) {
[14840] Fix | Delete
self::shoot_ajax_failure(
[14841] Fix | Delete
isset( $next_page->error ) ?
[14842] Fix | Delete
$next_page->error->message :
[14843] Fix | Delete
var_export( $next_page, true )
[14844] Fix | Delete
);
[14845] Fix | Delete
} else if ( $this->is_pending_activation() ) {
[14846] Fix | Delete
self::shoot_ajax_failure( $this->get_text_inline( 'Account is pending activation. Please check your email and click the link to activate your account and then submit the affiliate form again.', 'account-is-pending-activation' ) );
[14847] Fix | Delete
}
[14848] Fix | Delete
}
[14849] Fix | Delete
[14850] Fix | Delete
$this->fetch_affiliate_terms();
[14851] Fix | Delete
[14852] Fix | Delete
$plugin_id_for_affiliate = $this->get_plugin_id_for_affiliate_terms();
[14853] Fix | Delete
[14854] Fix | Delete
$api = $this->get_api_user_scope();
[14855] Fix | Delete
$result = $api->call(
[14856] Fix | Delete
( "/plugins/{$plugin_id_for_affiliate}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json" ),
[14857] Fix | Delete
'post',
[14858] Fix | Delete
$affiliate
[14859] Fix | Delete
);
[14860] Fix | Delete
[14861] Fix | Delete
if ( $this->is_api_error( $result ) ) {
[14862] Fix | Delete
self::shoot_ajax_failure(
[14863] Fix | Delete
isset( $result->error ) ?
[14864] Fix | Delete
$result->error->message :
[14865] Fix | Delete
var_export( $result, true )
[14866] Fix | Delete
);
[14867] Fix | Delete
} else {
[14868] Fix | Delete
if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) {
[14869] Fix | Delete
$this->_admin_notices->remove_sticky( 'affiliate_program' );
[14870] Fix | Delete
}
[14871] Fix | Delete
[14872] Fix | Delete
$affiliate_application_data = array(
[14873] Fix | Delete
'status' => 'pending',
[14874] Fix | Delete
'stats_description' => $affiliate['stats_description'],
[14875] Fix | Delete
'promotion_method_description' => $affiliate['promotion_method_description'],
[14876] Fix | Delete
);
[14877] Fix | Delete
[14878] Fix | Delete
if ( ! empty( $affiliate['promotion_methods'] ) ) {
[14879] Fix | Delete
$affiliate_application_data['promotion_methods'] = $affiliate['promotion_methods'];
[14880] Fix | Delete
}
[14881] Fix | Delete
[14882] Fix | Delete
if ( ! empty( $affiliate['domain'] ) ) {
[14883] Fix | Delete
$affiliate_application_data['domain'] = $affiliate['domain'];
[14884] Fix | Delete
}
[14885] Fix | Delete
[14886] Fix | Delete
if ( ! empty( $affiliate['additional_domains'] ) ) {
[14887] Fix | Delete
$affiliate_application_data['additional_domains'] = $affiliate['additional_domains'];
[14888] Fix | Delete
}
[14889] Fix | Delete
[14890] Fix | Delete
$this->_storage->affiliate_application_data = $affiliate_application_data;
[14891] Fix | Delete
}
[14892] Fix | Delete
[14893] Fix | Delete
// Purge cached affiliate.
[14894] Fix | Delete
$api->purge_cache( 'affiliate.json' );
[14895] Fix | Delete
[14896] Fix | Delete
self::shoot_ajax_success( $result );
[14897] Fix | Delete
}
[14898] Fix | Delete
[14899] Fix | Delete
/**
[14900] Fix | Delete
* @author Leo Fajardo (@leorw)
[14901] Fix | Delete
* @since 1.2.3
[14902] Fix | Delete
*
[14903] Fix | Delete
* @return array|null
[14904] Fix | Delete
*/
[14905] Fix | Delete
function get_affiliate_application_data() {
[14906] Fix | Delete
if ( empty( $this->_storage->affiliate_application_data ) ) {
[14907] Fix | Delete
return null;
[14908] Fix | Delete
}
[14909] Fix | Delete
[14910] Fix | Delete
return $this->_storage->affiliate_application_data;
[14911] Fix | Delete
}
[14912] Fix | Delete
[14913] Fix | Delete
#endregion Affiliation ------------------------------------------------------------
[14914] Fix | Delete
[14915] Fix | Delete
#----------------------------------------------------------------------------------
[14916] Fix | Delete
#region URL Generators
[14917] Fix | Delete
#----------------------------------------------------------------------------------
[14918] Fix | Delete
[14919] Fix | Delete
/**
[14920] Fix | Delete
* Alias to pricing_url().
[14921] Fix | Delete
*
[14922] Fix | Delete
* @author Vova Feldman (@svovaf)
[14923] Fix | Delete
* @since 1.0.2
[14924] Fix | Delete
*
[14925] Fix | Delete
* @uses pricing_url()
[14926] Fix | Delete
*
[14927] Fix | Delete
* @param string $period Billing cycle
[14928] Fix | Delete
* @param bool $is_trial
[14929] Fix | Delete
*
[14930] Fix | Delete
* @return string
[14931] Fix | Delete
*/
[14932] Fix | Delete
function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) {
[14933] Fix | Delete
return $this->pricing_url( $period, $is_trial );
[14934] Fix | Delete
}
[14935] Fix | Delete
[14936] Fix | Delete
/**
[14937] Fix | Delete
* @author Vova Feldman (@svovaf)
[14938] Fix | Delete
* @since 1.0.9
[14939] Fix | Delete
*
[14940] Fix | Delete
* @uses get_upgrade_url()
[14941] Fix | Delete
*
[14942] Fix | Delete
* @return string
[14943] Fix | Delete
*/
[14944] Fix | Delete
function get_trial_url() {
[14945] Fix | Delete
return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true );
[14946] Fix | Delete
}
[14947] Fix | Delete
[14948] Fix | Delete
/**
[14949] Fix | Delete
* @author Leo Fajardo (@leorw)
[14950] Fix | Delete
* @since 2.1.4
[14951] Fix | Delete
*
[14952] Fix | Delete
* @param string $new_version
[14953] Fix | Delete
*
[14954] Fix | Delete
* @return string
[14955] Fix | Delete
*/
[14956] Fix | Delete
function version_upgrade_checkout_link( $new_version ) {
[14957] Fix | Delete
if ( ! is_object( $this->_license ) ) {
[14958] Fix | Delete
$url = $this->pricing_url();
[14959] Fix | Delete
[14960] Fix | Delete
$purchase_license_text = $this->get_text_inline( 'Buy a license now', 'buy-license-now' );
[14961] Fix | Delete
} else {
[14962] Fix | Delete
$subscription = $this->_get_subscription( $this->_license->id );
[14963] Fix | Delete
[14964] Fix | Delete
$url = $this->checkout_url(
[14965] Fix | Delete
is_object( $subscription ) ?
[14966] Fix | Delete
( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) :
[14967] Fix | Delete
WP_FS__PERIOD_LIFETIME,
[14968] Fix | Delete
false,
[14969] Fix | Delete
array( 'licenses' => $this->_license->quota )
[14970] Fix | Delete
);
[14971] Fix | Delete
[14972] Fix | Delete
$purchase_license_text = $this->get_text_inline( 'Renew your license now', 'renew-license-now' );
[14973] Fix | Delete
}
[14974] Fix | Delete
[14975] Fix | Delete
return sprintf(
[14976] Fix | Delete
$this->get_text_inline( '%s to access version %s security & feature updates, and support.', 'x-for-updates-and-support' ),
[14977] Fix | Delete
sprintf(
[14978] Fix | Delete
'<a href="%s">%s</a>',
[14979] Fix | Delete
$this->apply_filters( 'update_notice_checkout_url', $url ),
[14980] Fix | Delete
$purchase_license_text
[14981] Fix | Delete
),
[14982] Fix | Delete
$new_version
[14983] Fix | Delete
);
[14984] Fix | Delete
}
[14985] Fix | Delete
[14986] Fix | Delete
/**
[14987] Fix | Delete
* Plugin's pricing URL.
[14988] Fix | Delete
*
[14989] Fix | Delete
* @author Vova Feldman (@svovaf)
[14990] Fix | Delete
* @since 1.0.4
[14991] Fix | Delete
*
[14992] Fix | Delete
* @param string $billing_cycle Billing cycle
[14993] Fix | Delete
*
[14994] Fix | Delete
* @param bool $is_trial
[14995] Fix | Delete
*
[14996] Fix | Delete
* @return string
[14997] Fix | Delete
*/
[14998] Fix | Delete
function pricing_url( $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) {
[14999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function