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
}
[17500] Fix | Delete
[17501] Fix | Delete
// Pending activation, add message.
[17502] Fix | Delete
return $this->set_pending_confirmation(
[17503] Fix | Delete
( isset( $decoded->email ) ?
[17504] Fix | Delete
$decoded->email :
[17505] Fix | Delete
true ),
[17506] Fix | Delete
false,
[17507] Fix | Delete
$filtered_license_key,
[17508] Fix | Delete
! empty( $params['trial_plan_id'] ),
[17509] Fix | Delete
isset( $decoded->is_suspicious_email ) && $decoded->is_suspicious_email
[17510] Fix | Delete
);
[17511] Fix | Delete
} else if ( isset( $decoded->install_secret_key ) ) {
[17512] Fix | Delete
return $this->install_with_new_user(
[17513] Fix | Delete
$decoded->user_id,
[17514] Fix | Delete
$decoded->user_public_key,
[17515] Fix | Delete
$decoded->user_secret_key,
[17516] Fix | Delete
( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ?
[17517] Fix | Delete
$decoded->is_marketing_allowed :
[17518] Fix | Delete
null ),
[17519] Fix | Delete
( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ?
[17520] Fix | Delete
$decoded->is_extensions_tracking_allowed :
[17521] Fix | Delete
null ),
[17522] Fix | Delete
( isset( $decoded->is_diagnostic_tracking_allowed ) && ! is_null( $decoded->is_diagnostic_tracking_allowed ) ?
[17523] Fix | Delete
$decoded->is_diagnostic_tracking_allowed :
[17524] Fix | Delete
null ),
[17525] Fix | Delete
$decoded->install_id,
[17526] Fix | Delete
$decoded->install_public_key,
[17527] Fix | Delete
$decoded->install_secret_key,
[17528] Fix | Delete
false
[17529] Fix | Delete
);
[17530] Fix | Delete
} else if ( is_array( $decoded->installs ) ) {
[17531] Fix | Delete
return $this->install_many_with_new_user(
[17532] Fix | Delete
$decoded->user_id,
[17533] Fix | Delete
$decoded->user_public_key,
[17534] Fix | Delete
$decoded->user_secret_key,
[17535] Fix | Delete
( isset( $decoded->is_marketing_allowed ) && ! is_null( $decoded->is_marketing_allowed ) ?
[17536] Fix | Delete
$decoded->is_marketing_allowed :
[17537] Fix | Delete
null ),
[17538] Fix | Delete
( isset( $decoded->is_extensions_tracking_allowed ) && ! is_null( $decoded->is_extensions_tracking_allowed ) ?
[17539] Fix | Delete
$decoded->is_extensions_tracking_allowed :
[17540] Fix | Delete
null ),
[17541] Fix | Delete
( isset( $decoded->is_diagnostic_tracking_allowed ) && ! is_null( $decoded->is_diagnostic_tracking_allowed ) ?
[17542] Fix | Delete
$decoded->is_diagnostic_tracking_allowed :
[17543] Fix | Delete
null ),
[17544] Fix | Delete
$decoded->installs,
[17545] Fix | Delete
false
[17546] Fix | Delete
);
[17547] Fix | Delete
}
[17548] Fix | Delete
[17549] Fix | Delete
return $decoded;
[17550] Fix | Delete
}
[17551] Fix | Delete
[17552] Fix | Delete
/**
[17553] Fix | Delete
* Set user and site identities.
[17554] Fix | Delete
*
[17555] Fix | Delete
* @author Vova Feldman (@svovaf)
[17556] Fix | Delete
* @since 1.0.9
[17557] Fix | Delete
*
[17558] Fix | Delete
* @param FS_User $user
[17559] Fix | Delete
* @param FS_Site $site
[17560] Fix | Delete
* @param bool $redirect
[17561] Fix | Delete
* @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will
[17562] Fix | Delete
* redirect (or return a URL) to the account page with a special parameter to
[17563] Fix | Delete
* trigger the auto installation processes.
[17564] Fix | Delete
*
[17565] Fix | Delete
* @return string If redirect is `false`, returns the next page the user should be redirected to.
[17566] Fix | Delete
*/
[17567] Fix | Delete
function setup_account(
[17568] Fix | Delete
FS_User $user,
[17569] Fix | Delete
FS_Site $site,
[17570] Fix | Delete
$redirect = true,
[17571] Fix | Delete
$auto_install = false
[17572] Fix | Delete
) {
[17573] Fix | Delete
return $this->setup_network_account(
[17574] Fix | Delete
$user,
[17575] Fix | Delete
array( $site ),
[17576] Fix | Delete
$redirect,
[17577] Fix | Delete
$auto_install,
[17578] Fix | Delete
false
[17579] Fix | Delete
);
[17580] Fix | Delete
}
[17581] Fix | Delete
[17582] Fix | Delete
/**
[17583] Fix | Delete
* Set user and site identities.
[17584] Fix | Delete
*
[17585] Fix | Delete
* @author Vova Feldman (@svovaf)
[17586] Fix | Delete
* @since 2.0.0
[17587] Fix | Delete
*
[17588] Fix | Delete
* @param FS_User $user
[17589] Fix | Delete
* @param FS_Site[] $installs
[17590] Fix | Delete
* @param bool $redirect
[17591] Fix | Delete
* @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes.
[17592] Fix | Delete
* @param bool $is_network_level_opt_in
[17593] Fix | Delete
*
[17594] Fix | Delete
* @return string If redirect is `false`, returns the next page the user should be redirected to.
[17595] Fix | Delete
*/
[17596] Fix | Delete
function setup_network_account(
[17597] Fix | Delete
FS_User $user,
[17598] Fix | Delete
array $installs,
[17599] Fix | Delete
$redirect = true,
[17600] Fix | Delete
$auto_install = false,
[17601] Fix | Delete
$is_network_level_opt_in = true
[17602] Fix | Delete
) {
[17603] Fix | Delete
$first_install = $installs[0];
[17604] Fix | Delete
[17605] Fix | Delete
$this->_user = $user;
[17606] Fix | Delete
$this->_site = $first_install;
[17607] Fix | Delete
[17608] Fix | Delete
$this->_sync_plans();
[17609] Fix | Delete
[17610] Fix | Delete
if ( $this->_storage->handle_gdpr_admin_notice &&
[17611] Fix | Delete
$this->should_handle_gdpr_admin_notice() &&
[17612] Fix | Delete
FS_GDPR_Manager::instance()->should_show_opt_in_notice()
[17613] Fix | Delete
) {
[17614] Fix | Delete
/**
[17615] Fix | Delete
* Clear user lock after an opt-in.
[17616] Fix | Delete
*/
[17617] Fix | Delete
require_once WP_FS__DIR_INCLUDES . '/class-fs-user-lock.php';
[17618] Fix | Delete
FS_User_Lock::instance()->unlock();
[17619] Fix | Delete
}
[17620] Fix | Delete
[17621] Fix | Delete
if ( 1 < count( $installs ) ) {
[17622] Fix | Delete
// Only network level opt-in can have more than one install.
[17623] Fix | Delete
$is_network_level_opt_in = true;
[17624] Fix | Delete
}
[17625] Fix | Delete
[17626] Fix | Delete
$this->update_connectivity_info( true );
[17627] Fix | Delete
[17628] Fix | Delete
// $is_network_level_opt_in = self::is_ajax_action_static( 'network_activate', $this->_module_id );
[17629] Fix | Delete
// If Freemius was OFF before, turn it on.
[17630] Fix | Delete
$this->turn_on();
[17631] Fix | Delete
[17632] Fix | Delete
$this->handle_account_connection(
[17633] Fix | Delete
$installs,
[17634] Fix | Delete
( ! $this->_is_network_active || ! $is_network_level_opt_in )
[17635] Fix | Delete
);
[17636] Fix | Delete
[17637] Fix | Delete
if ( is_numeric( $first_install->license_id ) ) {
[17638] Fix | Delete
$this->set_license( $this->_get_license_by_id( $first_install->license_id ) );
[17639] Fix | Delete
}
[17640] Fix | Delete
[17641] Fix | Delete
$this->_admin_notices->remove_sticky( 'connect_account' );
[17642] Fix | Delete
[17643] Fix | Delete
if ( $this->is_pending_activation() || ! $this->has_settings_menu() ) {
[17644] Fix | Delete
$this->clear_pending_activation_mode();
[17645] Fix | Delete
[17646] Fix | Delete
if ( ! $this->is_paying_or_trial() ) {
[17647] Fix | Delete
$this->_admin_notices->add_sticky(
[17648] Fix | Delete
sprintf( $this->get_text_inline( '%s opt-in was successfully completed.', 'plugin-x-activation-message' ), '<b>' . $this->get_plugin_name() . '</b>' ),
[17649] Fix | Delete
'activation_complete'
[17650] Fix | Delete
);
[17651] Fix | Delete
}
[17652] Fix | Delete
}
[17653] Fix | Delete
[17654] Fix | Delete
if ( $this->is_paying_or_trial() ) {
[17655] Fix | Delete
if ( ! $this->is_premium() ||
[17656] Fix | Delete
! $this->has_premium_version() ||
[17657] Fix | Delete
! $this->has_settings_menu()
[17658] Fix | Delete
) {
[17659] Fix | Delete
if ( $this->is_paying() ) {
[17660] Fix | Delete
$this->add_complete_upgrade_instructions_notice(
[17661] Fix | Delete
sprintf(
[17662] Fix | Delete
$this->get_text_inline( 'Your account was successfully activated with the %s plan.', 'activation-with-plan-x-message' ),
[17663] Fix | Delete
$this->get_plan_title()
[17664] Fix | Delete
),
[17665] Fix | Delete
'plan_upgraded'
[17666] Fix | Delete
);
[17667] Fix | Delete
} else {
[17668] Fix | Delete
$trial_plan = $this->get_trial_plan();
[17669] Fix | Delete
[17670] Fix | Delete
$this->add_complete_upgrade_instructions_notice(
[17671] Fix | Delete
sprintf(
[17672] Fix | Delete
$this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ),
[17673] Fix | Delete
'<i>' . $this->get_plugin_name() . '</i>'
[17674] Fix | Delete
),
[17675] Fix | Delete
'trial_started',
[17676] Fix | Delete
$trial_plan->title
[17677] Fix | Delete
);
[17678] Fix | Delete
}
[17679] Fix | Delete
}
[17680] Fix | Delete
[17681] Fix | Delete
$this->_admin_notices->remove_sticky( array(
[17682] Fix | Delete
'trial_promotion',
[17683] Fix | Delete
) );
[17684] Fix | Delete
}
[17685] Fix | Delete
[17686] Fix | Delete
$plugin_id = fs_request_get( 'plugin_id', false );
[17687] Fix | Delete
[17688] Fix | Delete
// Store activation time ONLY for plugins & themes (not add-ons).
[17689] Fix | Delete
if ( ! is_numeric( $plugin_id ) || ( $plugin_id == $this->_plugin->id ) ) {
[17690] Fix | Delete
if ( empty( $this->_storage->activation_timestamp ) ) {
[17691] Fix | Delete
$this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
[17692] Fix | Delete
}
[17693] Fix | Delete
}
[17694] Fix | Delete
[17695] Fix | Delete
$next_page = '';
[17696] Fix | Delete
[17697] Fix | Delete
$extra = array();
[17698] Fix | Delete
if ( $auto_install ) {
[17699] Fix | Delete
$extra['auto_install'] = 'true';
[17700] Fix | Delete
}
[17701] Fix | Delete
[17702] Fix | Delete
if ( is_numeric( $plugin_id ) ) {
[17703] Fix | Delete
/**
[17704] Fix | Delete
* @author Leo Fajardo (@leorw)
[17705] Fix | Delete
* @since 1.2.1.6
[17706] Fix | Delete
*
[17707] Fix | Delete
* Also sync the license after an anonymous user subscribes.
[17708] Fix | Delete
*/
[17709] Fix | Delete
if ( $this->is_anonymous() || $plugin_id != $this->_plugin->id ) {
[17710] Fix | Delete
// Add-on was installed - sync license right after install.
[17711] Fix | Delete
$next_page = $this->_get_sync_license_url( $plugin_id, true, $extra );
[17712] Fix | Delete
}
[17713] Fix | Delete
} else {
[17714] Fix | Delete
/**
[17715] Fix | Delete
* @author Vova Feldman (@svovaf)
[17716] Fix | Delete
* @since 1.1.9 If site installed with a valid license, sync license.
[17717] Fix | Delete
*/
[17718] Fix | Delete
if ( $this->is_paying() ) {
[17719] Fix | Delete
$this->_sync_plugin_license(
[17720] Fix | Delete
true,
[17721] Fix | Delete
// Installs data is already synced in the beginning of this method directly or via _set_account().
[17722] Fix | Delete
false
[17723] Fix | Delete
);
[17724] Fix | Delete
}
[17725] Fix | Delete
[17726] Fix | Delete
// Reload the page with the keys.
[17727] Fix | Delete
$next_page = $this->is_anonymous() ?
[17728] Fix | Delete
// If user previously skipped, redirect to account page.
[17729] Fix | Delete
$this->get_account_url( false, $extra ) :
[17730] Fix | Delete
$this->get_after_activation_url( 'after_connect_url', array(), $is_network_level_opt_in );
[17731] Fix | Delete
}
[17732] Fix | Delete
[17733] Fix | Delete
if ( ! empty( $next_page ) && $redirect ) {
[17734] Fix | Delete
fs_redirect( $next_page );
[17735] Fix | Delete
}
[17736] Fix | Delete
[17737] Fix | Delete
return $next_page;
[17738] Fix | Delete
}
[17739] Fix | Delete
[17740] Fix | Delete
/**
[17741] Fix | Delete
* Install plugin with new user information after approval.
[17742] Fix | Delete
*
[17743] Fix | Delete
* @author Vova Feldman (@svovaf)
[17744] Fix | Delete
* @since 1.0.7
[17745] Fix | Delete
*/
[17746] Fix | Delete
function _install_with_new_user() {
[17747] Fix | Delete
$this->_logger->entrance();
[17748] Fix | Delete
[17749] Fix | Delete
if ( $this->is_registered() ) {
[17750] Fix | Delete
return;
[17751] Fix | Delete
}
[17752] Fix | Delete
[17753] Fix | Delete
$has_pending_activation_confirmation_param = fs_request_has( 'pending_activation' );
[17754] Fix | Delete
[17755] Fix | Delete
$this->update_license_required_permissions_if_anonymous();
[17756] Fix | Delete
[17757] Fix | Delete
if ( ( $this->is_plugin() && fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) ||
[17758] Fix | Delete
// @todo This logic should be improved because it's executed on every load of a theme.
[17759] Fix | Delete
$this->is_theme()
[17760] Fix | Delete
) {
[17761] Fix | Delete
// check_admin_referer( $this->_slug . '_activate_new' );
[17762] Fix | Delete
[17763] Fix | Delete
if ( fs_request_has( 'user_secret_key' ) ) {
[17764] Fix | Delete
if ( fs_is_network_admin() && isset( $this->_storage->pending_sites_info ) ) {
[17765] Fix | Delete
$pending_sites_info = $this->_storage->pending_sites_info;
[17766] Fix | Delete
[17767] Fix | Delete
$this->install_many_pending_with_user(
[17768] Fix | Delete
fs_request_get( 'user_id' ),
[17769] Fix | Delete
fs_request_get_raw( 'user_public_key' ),
[17770] Fix | Delete
fs_request_get_raw( 'user_secret_key' ),
[17771] Fix | Delete
fs_request_get_bool( 'is_marketing_allowed', null ),
[17772] Fix | Delete
fs_request_get_bool( 'is_extensions_tracking_allowed', null ),
[17773] Fix | Delete
fs_request_get_bool( 'is_diagnostic_tracking_allowed', null ),
[17774] Fix | Delete
$pending_sites_info['blog_ids'],
[17775] Fix | Delete
$pending_sites_info['license_key'],
[17776] Fix | Delete
$pending_sites_info['trial_plan_id']
[17777] Fix | Delete
);
[17778] Fix | Delete
} else {
[17779] Fix | Delete
$this->install_with_new_user(
[17780] Fix | Delete
fs_request_get( 'user_id' ),
[17781] Fix | Delete
fs_request_get_raw( 'user_public_key' ),
[17782] Fix | Delete
fs_request_get_raw( 'user_secret_key' ),
[17783] Fix | Delete
fs_request_get_bool( 'is_marketing_allowed', null ),
[17784] Fix | Delete
fs_request_get_bool( 'is_extensions_tracking_allowed', null ),
[17785] Fix | Delete
fs_request_get_bool( 'is_diagnostic_tracking_allowed', null ),
[17786] Fix | Delete
fs_request_get( 'install_id' ),
[17787] Fix | Delete
fs_request_get_raw( 'install_public_key' ),
[17788] Fix | Delete
fs_request_get_raw( 'install_secret_key' ),
[17789] Fix | Delete
true,
[17790] Fix | Delete
fs_request_get_bool( 'auto_install' )
[17791] Fix | Delete
);
[17792] Fix | Delete
}
[17793] Fix | Delete
} else if ( $has_pending_activation_confirmation_param ) {
[17794] Fix | Delete
$this->set_pending_confirmation(
[17795] Fix | Delete
fs_request_get( 'user_email' ),
[17796] Fix | Delete
true,
[17797] Fix | Delete
false,
[17798] Fix | Delete
false,
[17799] Fix | Delete
fs_request_get_bool( 'is_suspicious_email' ),
[17800] Fix | Delete
fs_request_get_bool( 'has_upgrade_context' ),
[17801] Fix | Delete
fs_request_get( 'support_email_address' )
[17802] Fix | Delete
);
[17803] Fix | Delete
}
[17804] Fix | Delete
}
[17805] Fix | Delete
}
[17806] Fix | Delete
[17807] Fix | Delete
/**
[17808] Fix | Delete
* @author Vova Feldman (@svovaf)
[17809] Fix | Delete
* @since 2.0.0
[17810] Fix | Delete
*
[17811] Fix | Delete
* @param number $id
[17812] Fix | Delete
* @param string $public_key
[17813] Fix | Delete
* @param string $secret_key
[17814] Fix | Delete
*
[17815] Fix | Delete
* @return \FS_User
[17816] Fix | Delete
*/
[17817] Fix | Delete
private function setup_user( $id, $public_key, $secret_key ) {
[17818] Fix | Delete
$user = self::_get_user_by_id( $id );
[17819] Fix | Delete
[17820] Fix | Delete
if ( is_object( $user ) ) {
[17821] Fix | Delete
$this->_user = $user;
[17822] Fix | Delete
} else {
[17823] Fix | Delete
$user = new FS_User();
[17824] Fix | Delete
$user->id = $id;
[17825] Fix | Delete
$user->public_key = $public_key;
[17826] Fix | Delete
$user->secret_key = $secret_key;
[17827] Fix | Delete
[17828] Fix | Delete
$this->_user = $user;
[17829] Fix | Delete
$user_result = $this->get_api_user_scope()->get();
[17830] Fix | Delete
$user = new FS_User( $user_result );
[17831] Fix | Delete
[17832] Fix | Delete
$this->_user = $user;
[17833] Fix | Delete
$this->_store_user();
[17834] Fix | Delete
}
[17835] Fix | Delete
[17836] Fix | Delete
return $user;
[17837] Fix | Delete
}
[17838] Fix | Delete
[17839] Fix | Delete
/**
[17840] Fix | Delete
* Install plugin with new user.
[17841] Fix | Delete
*
[17842] Fix | Delete
* @author Vova Feldman (@svovaf)
[17843] Fix | Delete
* @since 1.1.7.4
[17844] Fix | Delete
*
[17845] Fix | Delete
* @param number $user_id
[17846] Fix | Delete
* @param string $user_public_key
[17847] Fix | Delete
* @param string $user_secret_key
[17848] Fix | Delete
* @param bool|null $is_marketing_allowed
[17849] Fix | Delete
* @param bool|null $is_extensions_tracking_allowed Since 2.3.2
[17850] Fix | Delete
* @param bool|null $is_diagnostic_tracking_allowed Since 2.5.0.2
[17851] Fix | Delete
* @param number $install_id
[17852] Fix | Delete
* @param string $install_public_key
[17853] Fix | Delete
* @param string $install_secret_key
[17854] Fix | Delete
* @param bool $redirect
[17855] Fix | Delete
* @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes.
[17856] Fix | Delete
*
[17857] Fix | Delete
* @return string If redirect is `false`, returns the next page the user should be redirected to.
[17858] Fix | Delete
*/
[17859] Fix | Delete
private function install_with_new_user(
[17860] Fix | Delete
$user_id,
[17861] Fix | Delete
$user_public_key,
[17862] Fix | Delete
$user_secret_key,
[17863] Fix | Delete
$is_marketing_allowed,
[17864] Fix | Delete
$is_extensions_tracking_allowed,
[17865] Fix | Delete
$is_diagnostic_tracking_allowed,
[17866] Fix | Delete
$install_id,
[17867] Fix | Delete
$install_public_key,
[17868] Fix | Delete
$install_secret_key,
[17869] Fix | Delete
$redirect = true,
[17870] Fix | Delete
$auto_install = false
[17871] Fix | Delete
) {
[17872] Fix | Delete
/**
[17873] Fix | Delete
* This method is also executed after opting in with a license key since the
[17874] Fix | Delete
* license can be potentially associated with a different owner.
[17875] Fix | Delete
*
[17876] Fix | Delete
* @since 2.0.0
[17877] Fix | Delete
*/
[17878] Fix | Delete
$user = self::_get_user_by_id( $user_id );
[17879] Fix | Delete
[17880] Fix | Delete
if ( ! is_object( $user ) ) {
[17881] Fix | Delete
$user = new FS_User();
[17882] Fix | Delete
$user->id = $user_id;
[17883] Fix | Delete
$user->public_key = $user_public_key;
[17884] Fix | Delete
$user->secret_key = $user_secret_key;
[17885] Fix | Delete
[17886] Fix | Delete
$this->_user = $user;
[17887] Fix | Delete
$user_result = $this->get_api_user_scope()->get();
[17888] Fix | Delete
$user = new FS_User( $user_result );
[17889] Fix | Delete
}
[17890] Fix | Delete
[17891] Fix | Delete
$this->_user = $user;
[17892] Fix | Delete
[17893] Fix | Delete
$site = new FS_Site();
[17894] Fix | Delete
$site->id = $install_id;
[17895] Fix | Delete
$site->public_key = $install_public_key;
[17896] Fix | Delete
$site->secret_key = $install_secret_key;
[17897] Fix | Delete
[17898] Fix | Delete
$this->_site = $site;
[17899] Fix | Delete
$site_result = $this->get_api_site_scope( true )->get();
[17900] Fix | Delete
$site = new FS_Site( $site_result );
[17901] Fix | Delete
$this->_site = $site;
[17902] Fix | Delete
[17903] Fix | Delete
if ( ! is_null( $is_marketing_allowed ) ) {
[17904] Fix | Delete
$this->disable_opt_in_notice_and_lock_user();
[17905] Fix | Delete
}
[17906] Fix | Delete
[17907] Fix | Delete
FS_Permission_Manager::instance( $this )->update_permissions_tracking_flag( array(
[17908] Fix | Delete
FS_Permission_Manager::PERMISSION_DIAGNOSTIC => $is_diagnostic_tracking_allowed,
[17909] Fix | Delete
FS_Permission_Manager::PERMISSION_EXTENSIONS => $is_extensions_tracking_allowed,
[17910] Fix | Delete
) );
[17911] Fix | Delete
[17912] Fix | Delete
return $this->setup_account(
[17913] Fix | Delete
$this->_user,
[17914] Fix | Delete
$this->_site,
[17915] Fix | Delete
$redirect,
[17916] Fix | Delete
$auto_install
[17917] Fix | Delete
);
[17918] Fix | Delete
}
[17919] Fix | Delete
[17920] Fix | Delete
/**
[17921] Fix | Delete
* Install plugin with user.
[17922] Fix | Delete
*
[17923] Fix | Delete
* @author Leo Fajardo (@leorw)
[17924] Fix | Delete
* @since 2.0.0
[17925] Fix | Delete
*
[17926] Fix | Delete
* @param number $user_id
[17927] Fix | Delete
* @param string $user_public_key
[17928] Fix | Delete
* @param string $user_secret_key
[17929] Fix | Delete
* @param bool|null $is_marketing_allowed
[17930] Fix | Delete
* @param bool|null $is_extensions_tracking_allowed Since 2.3.2
[17931] Fix | Delete
* @param bool|null $is_diagnostic_tracking_allowed Since 2.5.0.2
[17932] Fix | Delete
* @param array $site_ids
[17933] Fix | Delete
* @param bool $license_key
[17934] Fix | Delete
* @param bool $trial_plan_id
[17935] Fix | Delete
* @param bool $redirect
[17936] Fix | Delete
*
[17937] Fix | Delete
* @return void
[17938] Fix | Delete
*/
[17939] Fix | Delete
private function install_many_pending_with_user(
[17940] Fix | Delete
$user_id,
[17941] Fix | Delete
$user_public_key,
[17942] Fix | Delete
$user_secret_key,
[17943] Fix | Delete
$is_marketing_allowed,
[17944] Fix | Delete
$is_extensions_tracking_allowed,
[17945] Fix | Delete
$is_diagnostic_tracking_allowed,
[17946] Fix | Delete
$site_ids,
[17947] Fix | Delete
$license_key = false,
[17948] Fix | Delete
$trial_plan_id = false,
[17949] Fix | Delete
$redirect = true
[17950] Fix | Delete
) {
[17951] Fix | Delete
$user = $this->setup_user( $user_id, $user_public_key, $user_secret_key );
[17952] Fix | Delete
[17953] Fix | Delete
if ( ! is_null( $is_marketing_allowed ) ) {
[17954] Fix | Delete
$this->disable_opt_in_notice_and_lock_user();
[17955] Fix | Delete
}
[17956] Fix | Delete
[17957] Fix | Delete
FS_Permission_Manager::instance( $this )->update_permissions_tracking_flag( array(
[17958] Fix | Delete
FS_Permission_Manager::PERMISSION_DIAGNOSTIC => $is_diagnostic_tracking_allowed,
[17959] Fix | Delete
FS_Permission_Manager::PERMISSION_EXTENSIONS => $is_extensions_tracking_allowed,
[17960] Fix | Delete
) );
[17961] Fix | Delete
[17962] Fix | Delete
$sites = array();
[17963] Fix | Delete
foreach ( $site_ids as $site_id ) {
[17964] Fix | Delete
$sites[] = $this->get_site_info( array( 'blog_id' => $site_id ) );
[17965] Fix | Delete
}
[17966] Fix | Delete
[17967] Fix | Delete
$this->install_with_user( $user, $license_key, $trial_plan_id, $redirect, true, $sites );
[17968] Fix | Delete
}
[17969] Fix | Delete
[17970] Fix | Delete
/**
[17971] Fix | Delete
* Multi-site install with a new user.
[17972] Fix | Delete
*
[17973] Fix | Delete
* @author Vova Feldman (@svovaf)
[17974] Fix | Delete
* @since 2.0.0
[17975] Fix | Delete
*
[17976] Fix | Delete
* @param number $user_id
[17977] Fix | Delete
* @param string $user_public_key
[17978] Fix | Delete
* @param string $user_secret_key
[17979] Fix | Delete
* @param bool|null $is_marketing_allowed
[17980] Fix | Delete
* @param bool|null $is_extensions_tracking_allowed Since 2.3.2
[17981] Fix | Delete
* @param bool|null $is_diagnostic_tracking_allowed Since 2.5.0.2
[17982] Fix | Delete
* @param object[] $installs
[17983] Fix | Delete
* @param bool $redirect
[17984] Fix | Delete
* @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will redirect (or return a URL) to the account page with a special parameter to trigger the auto installation processes.
[17985] Fix | Delete
*
[17986] Fix | Delete
* @return string If redirect is `false`, returns the next page the user should be redirected to.
[17987] Fix | Delete
*/
[17988] Fix | Delete
private function install_many_with_new_user(
[17989] Fix | Delete
$user_id,
[17990] Fix | Delete
$user_public_key,
[17991] Fix | Delete
$user_secret_key,
[17992] Fix | Delete
$is_marketing_allowed,
[17993] Fix | Delete
$is_extensions_tracking_allowed,
[17994] Fix | Delete
$is_diagnostic_tracking_allowed,
[17995] Fix | Delete
array $installs,
[17996] Fix | Delete
$redirect = true,
[17997] Fix | Delete
$auto_install = false
[17998] Fix | Delete
) {
[17999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function