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
$current_section = $default_sections[ $section_id ];
[4500] Fix | Delete
[4501] Fix | Delete
// Replace the current section's title if a custom section title exists.
[4502] Fix | Delete
if ( isset( $custom_section['title'] ) ) {
[4503] Fix | Delete
$current_section['title'] = $custom_section['title'];
[4504] Fix | Delete
}
[4505] Fix | Delete
[4506] Fix | Delete
// Insert new rows under the current section or replace the default rows.
[4507] Fix | Delete
if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) {
[4508] Fix | Delete
foreach ( $custom_section['rows'] as $row_id => $row ) {
[4509] Fix | Delete
$current_section['rows'][ $row_id ] = $row;
[4510] Fix | Delete
}
[4511] Fix | Delete
}
[4512] Fix | Delete
[4513] Fix | Delete
$default_sections[ $section_id ] = $current_section;
[4514] Fix | Delete
}
[4515] Fix | Delete
}
[4516] Fix | Delete
}
[4517] Fix | Delete
[4518] Fix | Delete
$vars = array( 'sections' => $default_sections );
[4519] Fix | Delete
$message = fs_get_template( 'email.php', $vars );
[4520] Fix | Delete
[4521] Fix | Delete
// Set the type of email to HTML.
[4522] Fix | Delete
$headers[] = 'Content-type: text/html; charset=UTF-8';
[4523] Fix | Delete
[4524] Fix | Delete
$header_string = implode( "\r\n", $headers );
[4525] Fix | Delete
[4526] Fix | Delete
return wp_mail(
[4527] Fix | Delete
$to_address,
[4528] Fix | Delete
$subject,
[4529] Fix | Delete
$message,
[4530] Fix | Delete
$header_string
[4531] Fix | Delete
);
[4532] Fix | Delete
}
[4533] Fix | Delete
[4534] Fix | Delete
/**
[4535] Fix | Delete
* Generates the data for the sections of the email content.
[4536] Fix | Delete
*
[4537] Fix | Delete
* @author Leo Fajardo (@leorw)
[4538] Fix | Delete
* @since 1.1.2
[4539] Fix | Delete
*
[4540] Fix | Delete
* @return array
[4541] Fix | Delete
*/
[4542] Fix | Delete
private function get_email_sections() {
[4543] Fix | Delete
// Retrieve the current user's information so that we can get the user's email, first name, and last name below.
[4544] Fix | Delete
$current_user = self::_get_current_wp_user();
[4545] Fix | Delete
[4546] Fix | Delete
// Retrieve the cURL version information so that we can get the version number below.
[4547] Fix | Delete
$curl_version_information = curl_version();
[4548] Fix | Delete
[4549] Fix | Delete
$active_plugin = self::get_active_plugins();
[4550] Fix | Delete
[4551] Fix | Delete
// Generate the list of active plugins separated by new line.
[4552] Fix | Delete
$active_plugin_string = '';
[4553] Fix | Delete
foreach ( $active_plugin as $plugin ) {
[4554] Fix | Delete
$active_plugin_string .= sprintf(
[4555] Fix | Delete
'<a href="%s">%s</a> [v%s]<br>',
[4556] Fix | Delete
$plugin['PluginURI'],
[4557] Fix | Delete
$plugin['Name'],
[4558] Fix | Delete
$plugin['Version']
[4559] Fix | Delete
);
[4560] Fix | Delete
}
[4561] Fix | Delete
[4562] Fix | Delete
$server_ip = WP_FS__REMOTE_ADDR;
[4563] Fix | Delete
[4564] Fix | Delete
// Add PHP info for deeper investigation.
[4565] Fix | Delete
ob_start();
[4566] Fix | Delete
phpinfo();
[4567] Fix | Delete
$php_info = ob_get_clean();
[4568] Fix | Delete
[4569] Fix | Delete
$api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 );
[4570] Fix | Delete
[4571] Fix | Delete
// Generate the default email sections.
[4572] Fix | Delete
$sections = array(
[4573] Fix | Delete
'sdk' => array(
[4574] Fix | Delete
'title' => 'SDK',
[4575] Fix | Delete
'rows' => array(
[4576] Fix | Delete
'fs_version' => array( 'FS Version', $this->version ),
[4577] Fix | Delete
'curl_version' => array( 'cURL Version', $curl_version_information['version'] )
[4578] Fix | Delete
)
[4579] Fix | Delete
),
[4580] Fix | Delete
'plugin' => array(
[4581] Fix | Delete
'title' => ucfirst( $this->get_module_type() ),
[4582] Fix | Delete
'rows' => array(
[4583] Fix | Delete
'name' => array( 'Name', $this->get_plugin_name() ),
[4584] Fix | Delete
'version' => array( 'Version', $this->get_plugin_version() )
[4585] Fix | Delete
)
[4586] Fix | Delete
),
[4587] Fix | Delete
'api' => array(
[4588] Fix | Delete
'title' => 'API Subdomain',
[4589] Fix | Delete
'rows' => array(
[4590] Fix | Delete
'dns' => array(
[4591] Fix | Delete
'DNS_CNAME',
[4592] Fix | Delete
function_exists( 'dns_get_record' ) ?
[4593] Fix | Delete
var_export( dns_get_record( $api_domain, DNS_CNAME ), true ) :
[4594] Fix | Delete
'dns_get_record() disabled/blocked'
[4595] Fix | Delete
),
[4596] Fix | Delete
'ip' => array(
[4597] Fix | Delete
'IP',
[4598] Fix | Delete
function_exists( 'gethostbyname' ) ?
[4599] Fix | Delete
gethostbyname( $api_domain ) :
[4600] Fix | Delete
'gethostbyname() disabled/blocked'
[4601] Fix | Delete
),
[4602] Fix | Delete
),
[4603] Fix | Delete
),
[4604] Fix | Delete
'site' => array(
[4605] Fix | Delete
'title' => 'Site',
[4606] Fix | Delete
'rows' => array(
[4607] Fix | Delete
'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ),
[4608] Fix | Delete
'address' => array( 'Address', site_url() ),
[4609] Fix | Delete
'host' => array(
[4610] Fix | Delete
'HTTP_HOST',
[4611] Fix | Delete
( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' )
[4612] Fix | Delete
),
[4613] Fix | Delete
'hosting' => array(
[4614] Fix | Delete
'Hosting Company' => fs_request_has( 'hosting_company' ) ?
[4615] Fix | Delete
fs_request_get( 'hosting_company' ) :
[4616] Fix | Delete
'Unknown',
[4617] Fix | Delete
),
[4618] Fix | Delete
'server_addr' => array(
[4619] Fix | Delete
'SERVER_ADDR',
[4620] Fix | Delete
'<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'
[4621] Fix | Delete
)
[4622] Fix | Delete
)
[4623] Fix | Delete
),
[4624] Fix | Delete
'user' => array(
[4625] Fix | Delete
'title' => 'User',
[4626] Fix | Delete
'rows' => array(
[4627] Fix | Delete
'email' => array( 'Email', $current_user->user_email ),
[4628] Fix | Delete
'first' => array( 'First', $current_user->user_firstname ),
[4629] Fix | Delete
'last' => array( 'Last', $current_user->user_lastname )
[4630] Fix | Delete
)
[4631] Fix | Delete
),
[4632] Fix | Delete
'plugins' => array(
[4633] Fix | Delete
'title' => 'Plugins',
[4634] Fix | Delete
'rows' => array(
[4635] Fix | Delete
'active_plugins' => array( 'Active Plugins', $active_plugin_string )
[4636] Fix | Delete
)
[4637] Fix | Delete
),
[4638] Fix | Delete
'php_info' => array(
[4639] Fix | Delete
'title' => 'PHP Info',
[4640] Fix | Delete
'rows' => array(
[4641] Fix | Delete
'info' => array( $php_info )
[4642] Fix | Delete
),
[4643] Fix | Delete
)
[4644] Fix | Delete
);
[4645] Fix | Delete
[4646] Fix | Delete
// Allow the sections to be modified by other code.
[4647] Fix | Delete
$sections = $this->apply_filters( 'email_template_sections', $sections );
[4648] Fix | Delete
[4649] Fix | Delete
return $sections;
[4650] Fix | Delete
}
[4651] Fix | Delete
[4652] Fix | Delete
#endregion
[4653] Fix | Delete
[4654] Fix | Delete
#----------------------------------------------------------------------------------
[4655] Fix | Delete
#region Initialization
[4656] Fix | Delete
#----------------------------------------------------------------------------------
[4657] Fix | Delete
[4658] Fix | Delete
/**
[4659] Fix | Delete
* Init plugin's Freemius instance.
[4660] Fix | Delete
*
[4661] Fix | Delete
* @author Vova Feldman (@svovaf)
[4662] Fix | Delete
* @since 1.0.1
[4663] Fix | Delete
*
[4664] Fix | Delete
* @param number $id
[4665] Fix | Delete
* @param string $public_key
[4666] Fix | Delete
* @param bool $is_live
[4667] Fix | Delete
* @param bool $is_premium
[4668] Fix | Delete
*/
[4669] Fix | Delete
function init( $id, $public_key, $is_live = true, $is_premium = true ) {
[4670] Fix | Delete
$this->_logger->entrance();
[4671] Fix | Delete
[4672] Fix | Delete
$this->dynamic_init( array(
[4673] Fix | Delete
'id' => $id,
[4674] Fix | Delete
'public_key' => $public_key,
[4675] Fix | Delete
'is_live' => $is_live,
[4676] Fix | Delete
'is_premium' => $is_premium,
[4677] Fix | Delete
) );
[4678] Fix | Delete
}
[4679] Fix | Delete
[4680] Fix | Delete
/**
[4681] Fix | Delete
* Dynamic initiator, originally created to support initiation
[4682] Fix | Delete
* with parent_id for add-ons.
[4683] Fix | Delete
*
[4684] Fix | Delete
* @author Vova Feldman (@svovaf)
[4685] Fix | Delete
* @since 1.0.6
[4686] Fix | Delete
*
[4687] Fix | Delete
* @param array $plugin_info
[4688] Fix | Delete
*
[4689] Fix | Delete
* @throws Freemius_Exception
[4690] Fix | Delete
*/
[4691] Fix | Delete
function dynamic_init( array $plugin_info ) {
[4692] Fix | Delete
$this->_logger->entrance();
[4693] Fix | Delete
[4694] Fix | Delete
$this->parse_settings( $plugin_info );
[4695] Fix | Delete
[4696] Fix | Delete
$this->register_after_settings_parse_hooks();
[4697] Fix | Delete
[4698] Fix | Delete
/**
[4699] Fix | Delete
* If anonymous but there's already a user entity and the user's site is associated with a valid license or trial period, update the anonymous mode accordingly.
[4700] Fix | Delete
*
[4701] Fix | Delete
* @todo Remove this entire `if` block after several releases as starting from this version, the anonymous mode will already be updated accordingly after a purchase.
[4702] Fix | Delete
*/
[4703] Fix | Delete
if ( $this->is_anonymous() ) {
[4704] Fix | Delete
$is_network_level = ( $this->_is_network_active && fs_is_network_admin() );
[4705] Fix | Delete
[4706] Fix | Delete
if (
[4707] Fix | Delete
! $is_network_level ||
[4708] Fix | Delete
FS_Site::is_valid_id( $this->_storage->network_install_blog_id )
[4709] Fix | Delete
) {
[4710] Fix | Delete
if ( $this->is_paying_or_trial() ) {
[4711] Fix | Delete
$this->reset_anonymous_mode( $is_network_level );
[4712] Fix | Delete
}
[4713] Fix | Delete
} else {
[4714] Fix | Delete
$network = get_network();
[4715] Fix | Delete
[4716] Fix | Delete
if ( is_object( $network ) ) {
[4717] Fix | Delete
$main_blog_id = $network->site_id;
[4718] Fix | Delete
$first_install = $this->get_install_by_blog_id( $main_blog_id );
[4719] Fix | Delete
[4720] Fix | Delete
if ( is_object( $first_install ) ) {
[4721] Fix | Delete
$this->_storage->network_install_blog_id = $main_blog_id;
[4722] Fix | Delete
$this->_storage->network_user_id = $first_install->user_id;
[4723] Fix | Delete
}
[4724] Fix | Delete
}
[4725] Fix | Delete
}
[4726] Fix | Delete
}
[4727] Fix | Delete
[4728] Fix | Delete
if ( $this->should_stop_execution() ) {
[4729] Fix | Delete
return;
[4730] Fix | Delete
}
[4731] Fix | Delete
[4732] Fix | Delete
if ( ! $this->is_registered() ) {
[4733] Fix | Delete
if ( $this->is_anonymous() ) {
[4734] Fix | Delete
// If user skipped, no need to test connectivity.
[4735] Fix | Delete
$this->_has_api_connection = true;
[4736] Fix | Delete
$this->_is_on = true;
[4737] Fix | Delete
} else {
[4738] Fix | Delete
if ( false === $this->has_api_connectivity() ) {
[4739] Fix | Delete
return;
[4740] Fix | Delete
} else {
[4741] Fix | Delete
if ( $this->_anonymous_mode ) {
[4742] Fix | Delete
// Simulate anonymous mode.
[4743] Fix | Delete
$this->_is_anonymous = true;
[4744] Fix | Delete
}
[4745] Fix | Delete
}
[4746] Fix | Delete
}
[4747] Fix | Delete
}
[4748] Fix | Delete
[4749] Fix | Delete
/**
[4750] Fix | Delete
* This should be executed even if Freemius is off for the core module,
[4751] Fix | Delete
* otherwise, the add-ons dialog box won't work properly. This is especially
[4752] Fix | Delete
* relevant when the developer decided to turn FS off for existing users.
[4753] Fix | Delete
*
[4754] Fix | Delete
* @author Vova Feldman (@svovaf)
[4755] Fix | Delete
*/
[4756] Fix | Delete
if ( $this->is_user_in_admin() &&
[4757] Fix | Delete
'plugin-information' === fs_request_get( 'tab', false ) &&
[4758] Fix | Delete
$this->should_use_freemius_updater_and_dialog() &&
[4759] Fix | Delete
(
[4760] Fix | Delete
( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) ||
[4761] Fix | Delete
( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) )
[4762] Fix | Delete
)
[4763] Fix | Delete
) {
[4764] Fix | Delete
require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
[4765] Fix | Delete
[4766] Fix | Delete
new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this );
[4767] Fix | Delete
}
[4768] Fix | Delete
[4769] Fix | Delete
// Check if Freemius is on for the current plugin.
[4770] Fix | Delete
// This MUST be executed after all the plugin variables has been loaded.
[4771] Fix | Delete
if ( ! $this->is_registered() && ! $this->is_on() ) {
[4772] Fix | Delete
return;
[4773] Fix | Delete
}
[4774] Fix | Delete
[4775] Fix | Delete
if ( $this->has_api_connectivity() ) {
[4776] Fix | Delete
if ( self::is_cron() ) {
[4777] Fix | Delete
$this->hook_callback_to_sync_cron();
[4778] Fix | Delete
} else if ( $this->is_user_in_admin() ) {
[4779] Fix | Delete
/**
[4780] Fix | Delete
* Schedule daily data sync cron if:
[4781] Fix | Delete
*
[4782] Fix | Delete
* 1. User opted-in (for tracking).
[4783] Fix | Delete
* 2. If skipped, but later upgraded (opted-in via upgrade).
[4784] Fix | Delete
*
[4785] Fix | Delete
* @author Vova Feldman (@svovaf)
[4786] Fix | Delete
* @since 1.1.7.3
[4787] Fix | Delete
*
[4788] Fix | Delete
*/
[4789] Fix | Delete
if ( $this->is_registered() && $this->is_tracking_allowed() ) {
[4790] Fix | Delete
$this->maybe_schedule_sync_cron();
[4791] Fix | Delete
}
[4792] Fix | Delete
[4793] Fix | Delete
/**
[4794] Fix | Delete
* Check if requested for manual blocking background sync.
[4795] Fix | Delete
*/
[4796] Fix | Delete
if ( fs_request_has( 'background_sync' ) ) {
[4797] Fix | Delete
self::require_pluggable_essentials();
[4798] Fix | Delete
self::wp_cookie_constants();
[4799] Fix | Delete
[4800] Fix | Delete
$this->run_manual_sync();
[4801] Fix | Delete
}
[4802] Fix | Delete
}
[4803] Fix | Delete
}
[4804] Fix | Delete
[4805] Fix | Delete
if ( $this->is_registered() ) {
[4806] Fix | Delete
FS_Clone_Manager::instance()->maybe_resolve_new_subsite_install_automatically( $this );
[4807] Fix | Delete
[4808] Fix | Delete
$this->hook_callback_to_install_sync();
[4809] Fix | Delete
}
[4810] Fix | Delete
[4811] Fix | Delete
if ( $this->is_addon() ) {
[4812] Fix | Delete
if ( $this->is_parent_plugin_installed() ) {
[4813] Fix | Delete
// Link to parent FS.
[4814] Fix | Delete
$this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id );
[4815] Fix | Delete
[4816] Fix | Delete
// Get parent plugin reference.
[4817] Fix | Delete
$this->_parent_plugin = $this->_parent->get_plugin();
[4818] Fix | Delete
}
[4819] Fix | Delete
}
[4820] Fix | Delete
[4821] Fix | Delete
if ( $this->is_user_in_admin() ) {
[4822] Fix | Delete
if ( $this->is_registered() && fs_request_has( 'purchase_completed' ) ) {
[4823] Fix | Delete
$this->_admin_notices->add_sticky(
[4824] Fix | Delete
sprintf(
[4825] Fix | Delete
/* translators: %s: License type (e.g. you have a professional license) */
[4826] Fix | Delete
$this->get_text_inline( 'You have purchased a %s license.', 'you-have-x-license' ),
[4827] Fix | Delete
fs_request_get( 'purchased_plan' )
[4828] Fix | Delete
) .
[4829] Fix | Delete
sprintf(
[4830] Fix | Delete
$this->get_text_inline(" The %s's %sdownload link%s, license key, and installation instructions have been sent to %s. If you can't find the email after 5 min, please check your spam box.", 'post-purchase-email-sent-message' ),
[4831] Fix | Delete
$this->get_module_label( true ),
[4832] Fix | Delete
( FS_Plugin::is_valid_id( $this->get_bundle_id() ) ? "products' " : '' ),
[4833] Fix | Delete
( FS_Plugin::is_valid_id( $this->get_bundle_id() ) ? 's' : '' ),
[4834] Fix | Delete
sprintf(
[4835] Fix | Delete
'<strong>%s</strong>',
[4836] Fix | Delete
fs_request_get( 'purchase_email' )
[4837] Fix | Delete
)
[4838] Fix | Delete
),
[4839] Fix | Delete
'plan_purchased',
[4840] Fix | Delete
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
[4841] Fix | Delete
);
[4842] Fix | Delete
}
[4843] Fix | Delete
[4844] Fix | Delete
if ( $this->is_addon() ) {
[4845] Fix | Delete
if ( ! $this->is_parent_plugin_installed() ) {
[4846] Fix | Delete
$parent_name = $this->get_option( $plugin_info, 'parent_name', null );
[4847] Fix | Delete
[4848] Fix | Delete
if ( isset( $plugin_info['parent'] ) ) {
[4849] Fix | Delete
$parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
[4850] Fix | Delete
}
[4851] Fix | Delete
[4852] Fix | Delete
$this->_admin_notices->add(
[4853] Fix | Delete
( ! empty( $parent_name ) ?
[4854] Fix | Delete
sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) :
[4855] Fix | Delete
sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() )
[4856] Fix | Delete
),
[4857] Fix | Delete
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
[4858] Fix | Delete
'error'
[4859] Fix | Delete
);
[4860] Fix | Delete
[4861] Fix | Delete
return;
[4862] Fix | Delete
} else {
[4863] Fix | Delete
$is_network_admin = fs_is_network_admin();
[4864] Fix | Delete
[4865] Fix | Delete
if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
[4866] Fix | Delete
// If add-on activated and parent not, automatically install parent for the user.
[4867] Fix | Delete
$this->activate_parent_account( $this->_parent );
[4868] Fix | Delete
} else if (
[4869] Fix | Delete
$this->_parent->is_registered() &&
[4870] Fix | Delete
! $this->is_registered() &&
[4871] Fix | Delete
/**
[4872] Fix | Delete
* If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
[4873] Fix | Delete
* * Network active and in network admin - network activate add-on account.
[4874] Fix | Delete
* * Network active and not in network admin - activate add-on account for the current blog.
[4875] Fix | Delete
* * Not network active and not in network admin - activate add-on account for the current blog.
[4876] Fix | Delete
*
[4877] Fix | Delete
* If not registered for add-on, not network active, and in network admin, do not handle the add-on activation.
[4878] Fix | Delete
*
[4879] Fix | Delete
* @author Leo Fajardo (@leorw)
[4880] Fix | Delete
* @since 2.3.0
[4881] Fix | Delete
*/
[4882] Fix | Delete
( $this->is_network_active() || ! $is_network_admin )
[4883] Fix | Delete
) {
[4884] Fix | Delete
$premium_license = null;
[4885] Fix | Delete
[4886] Fix | Delete
if (
[4887] Fix | Delete
! $this->has_free_plan() &&
[4888] Fix | Delete
$this->is_bundle_license_auto_activation_enabled() &&
[4889] Fix | Delete
$this->_parent->is_activated_with_bundle_license()
[4890] Fix | Delete
) {
[4891] Fix | Delete
/**
[4892] Fix | Delete
* If the add-on has no free plan, try to activate the account only when there's a bundle license.
[4893] Fix | Delete
*
[4894] Fix | Delete
* @author Leo Fajardo (@leorw)
[4895] Fix | Delete
* @since 2.4.0
[4896] Fix | Delete
*/
[4897] Fix | Delete
$bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false );
[4898] Fix | Delete
[4899] Fix | Delete
if (
[4900] Fix | Delete
is_object( $bundle_license ) &&
[4901] Fix | Delete
! empty( $bundle_license->products ) &&
[4902] Fix | Delete
in_array( $this->get_id(), $bundle_license->products )
[4903] Fix | Delete
) {
[4904] Fix | Delete
$premium_license = $bundle_license;
[4905] Fix | Delete
}
[4906] Fix | Delete
}
[4907] Fix | Delete
[4908] Fix | Delete
if ( $this->has_free_plan() || is_object( $premium_license) ) {
[4909] Fix | Delete
// If parent plugin activated, automatically install add-on for the user.
[4910] Fix | Delete
$this->_activate_addon_account(
[4911] Fix | Delete
$this->_parent,
[4912] Fix | Delete
( $this->is_network_active() && $is_network_admin ) ?
[4913] Fix | Delete
true :
[4914] Fix | Delete
get_current_blog_id(),
[4915] Fix | Delete
$premium_license
[4916] Fix | Delete
);
[4917] Fix | Delete
}
[4918] Fix | Delete
}
[4919] Fix | Delete
[4920] Fix | Delete
// @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
[4921] Fix | Delete
if ( $this->is_premium() ) {
[4922] Fix | Delete
// Remove add-on download admin-notice.
[4923] Fix | Delete
$this->_parent->_admin_notices->remove_sticky( array(
[4924] Fix | Delete
'addon_plan_upgraded_' . $this->_slug,
[4925] Fix | Delete
'no_addon_license_' . $this->_slug,
[4926] Fix | Delete
) );
[4927] Fix | Delete
}
[4928] Fix | Delete
[4929] Fix | Delete
// $this->deactivate_premium_only_addon_without_license();
[4930] Fix | Delete
}
[4931] Fix | Delete
}
[4932] Fix | Delete
[4933] Fix | Delete
add_action( 'admin_init', array( &$this, '_admin_init_action' ) );
[4934] Fix | Delete
[4935] Fix | Delete
// if ( $this->is_registered() ||
[4936] Fix | Delete
// $this->is_anonymous() ||
[4937] Fix | Delete
// $this->is_pending_activation()
[4938] Fix | Delete
// ) {
[4939] Fix | Delete
// $this->_init_admin();
[4940] Fix | Delete
// }
[4941] Fix | Delete
}
[4942] Fix | Delete
[4943] Fix | Delete
/**
[4944] Fix | Delete
* Should be called outside `$this->is_user_in_admin()` scope
[4945] Fix | Delete
* because the updater has some logic that needs to be executed
[4946] Fix | Delete
* during AJAX calls.
[4947] Fix | Delete
*
[4948] Fix | Delete
* Currently, we need to hook to the `http_request_host_is_external` filter.
[4949] Fix | Delete
* In the future, there might be additional logic added.
[4950] Fix | Delete
*
[4951] Fix | Delete
* @author Vova Feldman
[4952] Fix | Delete
* @since 1.2.1.6
[4953] Fix | Delete
*/
[4954] Fix | Delete
if (
[4955] Fix | Delete
$this->should_use_freemius_updater_and_dialog() &&
[4956] Fix | Delete
(
[4957] Fix | Delete
$this->is_premium() ||
[4958] Fix | Delete
/**
[4959] Fix | Delete
* If not premium but the premium version is installed, also instantiate the updater so that the
[4960] Fix | Delete
* plugin information dialog of the premium version will have the information from the server.
[4961] Fix | Delete
*
[4962] Fix | Delete
* @author Leo Fajardo (@leorw)
[4963] Fix | Delete
* @since 2.2.3
[4964] Fix | Delete
*/
[4965] Fix | Delete
( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) )
[4966] Fix | Delete
) &&
[4967] Fix | Delete
$this->has_release_on_freemius() &&
[4968] Fix | Delete
( ! $this->is_unresolved_clone( true ) )
[4969] Fix | Delete
) {
[4970] Fix | Delete
FS_Plugin_Updater::instance( $this );
[4971] Fix | Delete
}
[4972] Fix | Delete
[4973] Fix | Delete
$this->do_action( 'initiated' );
[4974] Fix | Delete
[4975] Fix | Delete
if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) {
[4976] Fix | Delete
if ( isset( $this->_storage->prev_is_premium ) ) {
[4977] Fix | Delete
$this->apply_filters(
[4978] Fix | Delete
'after_code_type_change',
[4979] Fix | Delete
// New code type.
[4980] Fix | Delete
$this->_plugin->is_premium
[4981] Fix | Delete
);
[4982] Fix | Delete
} else {
[4983] Fix | Delete
// Set for code type for the first time.
[4984] Fix | Delete
$this->_storage->prev_is_premium = $this->_plugin->is_premium;
[4985] Fix | Delete
}
[4986] Fix | Delete
}
[4987] Fix | Delete
[4988] Fix | Delete
if ( ! $this->is_addon() ) {
[4989] Fix | Delete
if ( $this->is_registered() ) {
[4990] Fix | Delete
// Fix for upgrade from versions < 1.0.9.
[4991] Fix | Delete
if ( ! isset( $this->_storage->activation_timestamp ) ) {
[4992] Fix | Delete
$this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
[4993] Fix | Delete
}
[4994] Fix | Delete
[4995] Fix | Delete
$this->do_action( 'after_init_plugin_registered' );
[4996] Fix | Delete
} else if ( $this->is_anonymous() ) {
[4997] Fix | Delete
$this->do_action( 'after_init_plugin_anonymous' );
[4998] Fix | Delete
} else if ( $this->is_pending_activation() ) {
[4999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function