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
if ( ! $is_init ) {
[2000] Fix | Delete
// Fetch prev path cache.
[2001] Fix | Delete
if ( isset( $this->_storage->plugin_main_file ) &&
[2002] Fix | Delete
! empty( $this->_storage->plugin_main_file->prev_path )
[2003] Fix | Delete
) {
[2004] Fix | Delete
$absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path );
[2005] Fix | Delete
if ( file_exists( $absolute_path ) ) {
[2006] Fix | Delete
return $absolute_path;
[2007] Fix | Delete
}
[2008] Fix | Delete
}
[2009] Fix | Delete
[2010] Fix | Delete
wp_die(
[2011] Fix | Delete
$this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) .
[2012] Fix | Delete
" Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
[2013] Fix | Delete
$this->get_text_inline( 'Error', 'error' ),
[2014] Fix | Delete
array( 'back_link' => true )
[2015] Fix | Delete
);
[2016] Fix | Delete
}
[2017] Fix | Delete
[2018] Fix | Delete
/**
[2019] Fix | Delete
* @since 1.2.1
[2020] Fix | Delete
*
[2021] Fix | Delete
* Only the original instantiator that calls dynamic_init can modify the module's path.
[2022] Fix | Delete
*/
[2023] Fix | Delete
// Find caller module.
[2024] Fix | Delete
$this->_storage->plugin_main_file = (object) array(
[2025] Fix | Delete
'path' => $main_file,
[2026] Fix | Delete
);
[2027] Fix | Delete
[2028] Fix | Delete
return $this->get_absolute_path( $main_file );
[2029] Fix | Delete
}
[2030] Fix | Delete
[2031] Fix | Delete
/**
[2032] Fix | Delete
* @author Leo Fajardo (@leorw)
[2033] Fix | Delete
* @since 1.2.3
[2034] Fix | Delete
*
[2035] Fix | Delete
* @param string $path
[2036] Fix | Delete
*
[2037] Fix | Delete
* @return string
[2038] Fix | Delete
*/
[2039] Fix | Delete
private function get_relative_path( $path ) {
[2040] Fix | Delete
$module_root_dir = $this->get_module_root_dir_path();
[2041] Fix | Delete
if ( 0 === strpos( $path, $module_root_dir ) ) {
[2042] Fix | Delete
$path = substr( $path, strlen( $module_root_dir ) );
[2043] Fix | Delete
}
[2044] Fix | Delete
[2045] Fix | Delete
return $path;
[2046] Fix | Delete
}
[2047] Fix | Delete
[2048] Fix | Delete
/**
[2049] Fix | Delete
* @author Leo Fajardo (@leorw)
[2050] Fix | Delete
* @since 1.2.3
[2051] Fix | Delete
*
[2052] Fix | Delete
* @param string $path
[2053] Fix | Delete
* @param string|bool $module_type
[2054] Fix | Delete
*
[2055] Fix | Delete
* @return string
[2056] Fix | Delete
*/
[2057] Fix | Delete
private function get_absolute_path( $path, $module_type = false ) {
[2058] Fix | Delete
$module_root_dir = $this->get_module_root_dir_path( $module_type );
[2059] Fix | Delete
if ( 0 !== strpos( $path, $module_root_dir ) ) {
[2060] Fix | Delete
$path = fs_normalize_path( $module_root_dir . $path );
[2061] Fix | Delete
}
[2062] Fix | Delete
[2063] Fix | Delete
return $path;
[2064] Fix | Delete
}
[2065] Fix | Delete
[2066] Fix | Delete
/**
[2067] Fix | Delete
* @author Leo Fajardo (@leorw)
[2068] Fix | Delete
* @since 1.2.3
[2069] Fix | Delete
*
[2070] Fix | Delete
* @param string|bool $module_type
[2071] Fix | Delete
*
[2072] Fix | Delete
* @return string
[2073] Fix | Delete
*/
[2074] Fix | Delete
private function get_module_root_dir_path( $module_type = false ) {
[2075] Fix | Delete
$is_plugin = empty( $module_type ) ?
[2076] Fix | Delete
$this->is_plugin() :
[2077] Fix | Delete
( WP_FS__MODULE_TYPE_PLUGIN === $module_type );
[2078] Fix | Delete
[2079] Fix | Delete
return fs_normalize_path( trailingslashit( $is_plugin ?
[2080] Fix | Delete
WP_PLUGIN_DIR :
[2081] Fix | Delete
get_theme_root( get_stylesheet() ) ) );
[2082] Fix | Delete
}
[2083] Fix | Delete
[2084] Fix | Delete
/**
[2085] Fix | Delete
* @author Leo Fajardo (@leorw)
[2086] Fix | Delete
*
[2087] Fix | Delete
* @param number $module_id
[2088] Fix | Delete
* @param string $slug
[2089] Fix | Delete
*
[2090] Fix | Delete
* @return string Since 2.5.0 return the module's main file path.
[2091] Fix | Delete
*
[2092] Fix | Delete
* @since 1.2.2
[2093] Fix | Delete
*/
[2094] Fix | Delete
private function store_id_slug_type_path_map( $module_id, $slug ) {
[2095] Fix | Delete
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
[2096] Fix | Delete
[2097] Fix | Delete
$store_option = false;
[2098] Fix | Delete
[2099] Fix | Delete
if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) {
[2100] Fix | Delete
$id_slug_type_path_map[ $module_id ] = array(
[2101] Fix | Delete
'slug' => $slug
[2102] Fix | Delete
);
[2103] Fix | Delete
[2104] Fix | Delete
$store_option = true;
[2105] Fix | Delete
} else if (
[2106] Fix | Delete
isset( $id_slug_type_path_map[ $module_id ]['slug'] ) &&
[2107] Fix | Delete
$slug !== $id_slug_type_path_map[ $module_id ]['slug']
[2108] Fix | Delete
) {
[2109] Fix | Delete
$id_slug_type_path_map[ $module_id ]['slug'] = $slug;
[2110] Fix | Delete
$store_option = true;
[2111] Fix | Delete
}
[2112] Fix | Delete
[2113] Fix | Delete
$find_caller = empty( $id_slug_type_path_map[ $module_id ]['path'] );
[2114] Fix | Delete
[2115] Fix | Delete
if ( ! $find_caller ) {
[2116] Fix | Delete
/**
[2117] Fix | Delete
* This verification is for cases when suddenly the same module
[2118] Fix | Delete
* is installed but with a different folder name.
[2119] Fix | Delete
*
[2120] Fix | Delete
* @author Vova Feldman (@svovaf)
[2121] Fix | Delete
* @since 1.2.3
[2122] Fix | Delete
*/
[2123] Fix | Delete
$find_caller = ! file_exists( $this->get_absolute_path(
[2124] Fix | Delete
$id_slug_type_path_map[ $module_id ]['path'],
[2125] Fix | Delete
$id_slug_type_path_map[ $module_id ]['type']
[2126] Fix | Delete
) );
[2127] Fix | Delete
}
[2128] Fix | Delete
[2129] Fix | Delete
foreach ( $id_slug_type_path_map as $id => $data ) {
[2130] Fix | Delete
if ( empty( $id ) ) {
[2131] Fix | Delete
// Remove maps with empty module ID.
[2132] Fix | Delete
unset( $id_slug_type_path_map[ $id ] );
[2133] Fix | Delete
$store_option = true;
[2134] Fix | Delete
continue;
[2135] Fix | Delete
}
[2136] Fix | Delete
[2137] Fix | Delete
/**
[2138] Fix | Delete
* If the module's main file path is identical to the main file path of another module then it means that the cached path of the current module or the other one with the same path is wrong, and therefore, we need to recalculate those paths.
[2139] Fix | Delete
*
[2140] Fix | Delete
* @author Vova Feldman (@svovaf)
[2141] Fix | Delete
* @since 2.5.0
[2142] Fix | Delete
*/
[2143] Fix | Delete
if ( ! $find_caller ) {
[2144] Fix | Delete
if ( $id == $module_id ) {
[2145] Fix | Delete
continue;
[2146] Fix | Delete
}
[2147] Fix | Delete
[2148] Fix | Delete
if (
[2149] Fix | Delete
isset( $data['path'] ) &&
[2150] Fix | Delete
$data['path'] === $id_slug_type_path_map[ $module_id ]['path']
[2151] Fix | Delete
) {
[2152] Fix | Delete
$find_caller = true;
[2153] Fix | Delete
}
[2154] Fix | Delete
}
[2155] Fix | Delete
}
[2156] Fix | Delete
[2157] Fix | Delete
if ( $find_caller ) {
[2158] Fix | Delete
$caller_main_file_and_type = $this->get_caller_main_file_and_type( $module_id );
[2159] Fix | Delete
[2160] Fix | Delete
$id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
[2161] Fix | Delete
$id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path;
[2162] Fix | Delete
[2163] Fix | Delete
$store_option = true;
[2164] Fix | Delete
}
[2165] Fix | Delete
[2166] Fix | Delete
if ( $store_option ) {
[2167] Fix | Delete
self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
[2168] Fix | Delete
}
[2169] Fix | Delete
[2170] Fix | Delete
return $id_slug_type_path_map[ $module_id ]['path'];
[2171] Fix | Delete
}
[2172] Fix | Delete
[2173] Fix | Delete
/**
[2174] Fix | Delete
* Identifies the caller type: plugin or theme.
[2175] Fix | Delete
*
[2176] Fix | Delete
* @author Leo Fajardo (@leorw)
[2177] Fix | Delete
* @since 1.2.2
[2178] Fix | Delete
*
[2179] Fix | Delete
* @author Vova Feldman (@svovaf)
[2180] Fix | Delete
* @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when
[2181] Fix | Delete
* add-ons are relying on loading the SDK from the parent module, and also allows themes including the
[2182] Fix | Delete
* SDK an internal file instead of directly from functions.php.
[2183] Fix | Delete
* @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic.
[2184] Fix | Delete
*
[2185] Fix | Delete
* @param number $module_id @since 2.5.0
[2186] Fix | Delete
*/
[2187] Fix | Delete
private function get_caller_main_file_and_type( $module_id ) {
[2188] Fix | Delete
self::require_plugin_essentials();
[2189] Fix | Delete
[2190] Fix | Delete
$all_plugins = fs_get_plugins( true );
[2191] Fix | Delete
$all_plugins_paths = array();
[2192] Fix | Delete
[2193] Fix | Delete
// Get active plugin's main files real full names (might be symlinks).
[2194] Fix | Delete
foreach ( $all_plugins as $relative_path => $data ) {
[2195] Fix | Delete
if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
[2196] Fix | Delete
/**
[2197] Fix | Delete
* Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
[2198] Fix | Delete
* can't really include the SDK.
[2199] Fix | Delete
*
[2200] Fix | Delete
* @author Vova Feldman
[2201] Fix | Delete
* @since 1.2.1.7
[2202] Fix | Delete
*/
[2203] Fix | Delete
continue;
[2204] Fix | Delete
}
[2205] Fix | Delete
[2206] Fix | Delete
$all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
[2207] Fix | Delete
}
[2208] Fix | Delete
[2209] Fix | Delete
$caller_file_candidate = false;
[2210] Fix | Delete
$caller_map = array();
[2211] Fix | Delete
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
[2212] Fix | Delete
$themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) );
[2213] Fix | Delete
$plugin_dir_to_skip = false;
[2214] Fix | Delete
[2215] Fix | Delete
for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
[2216] Fix | Delete
if ( empty( $bt[ $i ]['file'] ) ) {
[2217] Fix | Delete
continue;
[2218] Fix | Delete
}
[2219] Fix | Delete
[2220] Fix | Delete
if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) {
[2221] Fix | Delete
// If file same as the prev file in the stack, skip it.
[2222] Fix | Delete
continue;
[2223] Fix | Delete
}
[2224] Fix | Delete
[2225] Fix | Delete
if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array(
[2226] Fix | Delete
'do_action',
[2227] Fix | Delete
'apply_filter',
[2228] Fix | Delete
// The string split is stupid, but otherwise, theme check
[2229] Fix | Delete
// throws info notices.
[2230] Fix | Delete
'requir' . 'e_once',
[2231] Fix | Delete
'requir' . 'e',
[2232] Fix | Delete
'includ' . 'e_once',
[2233] Fix | Delete
'includ' . 'e',
[2234] Fix | Delete
'install_and_activate_plugin',
[2235] Fix | Delete
'try_activate_plugin',
[2236] Fix | Delete
'activate_plugin'
[2237] Fix | Delete
) )
[2238] Fix | Delete
) {
[2239] Fix | Delete
if ( 'activate_plugin' === $bt[ $i ]['function'] ) {
[2240] Fix | Delete
/**
[2241] Fix | Delete
* Store the directory of the activator plugin so that any other file that starts with it
[2242] Fix | Delete
* cannot be mistakenly chosen as a candidate caller file.
[2243] Fix | Delete
*
[2244] Fix | Delete
* @author Leo Fajardo
[2245] Fix | Delete
*
[2246] Fix | Delete
* @since 2.3.0
[2247] Fix | Delete
*/
[2248] Fix | Delete
$caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
[2249] Fix | Delete
[2250] Fix | Delete
foreach ( $all_plugins_paths as $plugin_path ) {
[2251] Fix | Delete
$plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' );
[2252] Fix | Delete
if ( false !== strpos( $caller_file_path, $plugin_dir ) ) {
[2253] Fix | Delete
$plugin_dir_to_skip = $plugin_dir;
[2254] Fix | Delete
[2255] Fix | Delete
break;
[2256] Fix | Delete
}
[2257] Fix | Delete
}
[2258] Fix | Delete
}
[2259] Fix | Delete
[2260] Fix | Delete
// Ignore call stack hooks and files inclusion.
[2261] Fix | Delete
continue;
[2262] Fix | Delete
}
[2263] Fix | Delete
[2264] Fix | Delete
$caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
[2265] Fix | Delete
[2266] Fix | Delete
if ( ! empty( $plugin_dir_to_skip ) ) {
[2267] Fix | Delete
/**
[2268] Fix | Delete
* Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file.
[2269] Fix | Delete
*
[2270] Fix | Delete
* @author Leo Fajardo
[2271] Fix | Delete
*
[2272] Fix | Delete
* @since 2.3.0
[2273] Fix | Delete
*/
[2274] Fix | Delete
if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) {
[2275] Fix | Delete
continue;
[2276] Fix | Delete
}
[2277] Fix | Delete
}
[2278] Fix | Delete
[2279] Fix | Delete
if ( 'functions.php' === basename( $caller_file_path ) ) {
[2280] Fix | Delete
/**
[2281] Fix | Delete
* 1. Assumes that theme's starting execution file is functions.php.
[2282] Fix | Delete
* 2. This complex logic fixes symlink issues (e.g. with Vargant).
[2283] Fix | Delete
*
[2284] Fix | Delete
* @author Vova Feldman (@svovaf)
[2285] Fix | Delete
* @since 1.2.2.5
[2286] Fix | Delete
*/
[2287] Fix | Delete
[2288] Fix | Delete
if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
[2289] Fix | Delete
$module_type = WP_FS__MODULE_TYPE_THEME;
[2290] Fix | Delete
[2291] Fix | Delete
/**
[2292] Fix | Delete
* Relative path of the theme, e.g.:
[2293] Fix | Delete
* `my-theme/functions.php`
[2294] Fix | Delete
*
[2295] Fix | Delete
* @author Leo Fajardo (@leorw)
[2296] Fix | Delete
*/
[2297] Fix | Delete
$caller_file_candidate = basename( dirname( $caller_file_path ) ) .
[2298] Fix | Delete
'/' .
[2299] Fix | Delete
basename( $caller_file_path );
[2300] Fix | Delete
[2301] Fix | Delete
continue;
[2302] Fix | Delete
}
[2303] Fix | Delete
}
[2304] Fix | Delete
[2305] Fix | Delete
$caller_file_hash = md5( $caller_file_path );
[2306] Fix | Delete
[2307] Fix | Delete
if ( ! isset( $caller_map[ $caller_file_hash ] ) ) {
[2308] Fix | Delete
foreach ( $all_plugins_paths as $plugin_path ) {
[2309] Fix | Delete
if ( empty( $plugin_path ) ) {
[2310] Fix | Delete
continue;
[2311] Fix | Delete
}
[2312] Fix | Delete
[2313] Fix | Delete
if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) {
[2314] Fix | Delete
$caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path );
[2315] Fix | Delete
break;
[2316] Fix | Delete
}
[2317] Fix | Delete
}
[2318] Fix | Delete
}
[2319] Fix | Delete
[2320] Fix | Delete
if ( isset( $caller_map[ $caller_file_hash ] ) ) {
[2321] Fix | Delete
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
[2322] Fix | Delete
$caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] );
[2323] Fix | Delete
}
[2324] Fix | Delete
}
[2325] Fix | Delete
[2326] Fix | Delete
$caller_main_file_and_type = (object) array(
[2327] Fix | Delete
'module_type' => $module_type,
[2328] Fix | Delete
'path' => $caller_file_candidate
[2329] Fix | Delete
);
[2330] Fix | Delete
[2331] Fix | Delete
return apply_filters( "fs_{$module_id}_caller_main_file_and_type", $caller_main_file_and_type );
[2332] Fix | Delete
}
[2333] Fix | Delete
[2334] Fix | Delete
#----------------------------------------------------------------------------------
[2335] Fix | Delete
#region Deactivation Feedback Form
[2336] Fix | Delete
#----------------------------------------------------------------------------------
[2337] Fix | Delete
[2338] Fix | Delete
/**
[2339] Fix | Delete
* Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
[2340] Fix | Delete
* page.
[2341] Fix | Delete
*
[2342] Fix | Delete
* @author Vova Feldman (@svovaf)
[2343] Fix | Delete
* @author Leo Fajardo (@leorw)
[2344] Fix | Delete
*
[2345] Fix | Delete
* @since 1.1.2
[2346] Fix | Delete
*/
[2347] Fix | Delete
function _add_deactivation_feedback_dialog_box() {
[2348] Fix | Delete
if (
[2349] Fix | Delete
$this->is_clone() ||
[2350] Fix | Delete
( is_object( $this->_site ) && ! $this->is_registered() )
[2351] Fix | Delete
) {
[2352] Fix | Delete
return;
[2353] Fix | Delete
}
[2354] Fix | Delete
[2355] Fix | Delete
$subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ?
[2356] Fix | Delete
$this->_get_subscription_cancellation_dialog_box_template_params() :
[2357] Fix | Delete
array();
[2358] Fix | Delete
[2359] Fix | Delete
/**
[2360] Fix | Delete
* @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter.
[2361] Fix | Delete
*/
[2362] Fix | Delete
$show_deactivation_feedback_form = ! self::is_deactivation_snoozed();
[2363] Fix | Delete
if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) {
[2364] Fix | Delete
$show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true );
[2365] Fix | Delete
} else if ( $this->is_addon() ) {
[2366] Fix | Delete
/**
[2367] Fix | Delete
* If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent.
[2368] Fix | Delete
*/
[2369] Fix | Delete
$show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true );
[2370] Fix | Delete
}
[2371] Fix | Delete
[2372] Fix | Delete
$uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' );
[2373] Fix | Delete
[2374] Fix | Delete
if (
[2375] Fix | Delete
empty( $subscription_cancellation_dialog_box_template_params ) &&
[2376] Fix | Delete
! $show_deactivation_feedback_form &&
[2377] Fix | Delete
empty( $uninstall_confirmation_message )
[2378] Fix | Delete
) {
[2379] Fix | Delete
return;
[2380] Fix | Delete
}
[2381] Fix | Delete
[2382] Fix | Delete
$vars = array( 'id' => $this->_module_id );
[2383] Fix | Delete
[2384] Fix | Delete
if ( $show_deactivation_feedback_form ) {
[2385] Fix | Delete
/* Check the type of user:
[2386] Fix | Delete
* 1. Long-term (long-term)
[2387] Fix | Delete
* 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
[2388] Fix | Delete
* 3. Short-term (short-term)
[2389] Fix | Delete
*/
[2390] Fix | Delete
$is_long_term_user = true;
[2391] Fix | Delete
[2392] Fix | Delete
// Check if the site is at least 2 days old.
[2393] Fix | Delete
$time_installed = $this->_storage->install_timestamp;
[2394] Fix | Delete
[2395] Fix | Delete
// Difference in seconds.
[2396] Fix | Delete
$date_diff = time() - $time_installed;
[2397] Fix | Delete
[2398] Fix | Delete
// Convert seconds to days.
[2399] Fix | Delete
$date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );
[2400] Fix | Delete
[2401] Fix | Delete
if ( $date_diff_days < 2 ) {
[2402] Fix | Delete
$is_long_term_user = false;
[2403] Fix | Delete
}
[2404] Fix | Delete
[2405] Fix | Delete
$is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );
[2406] Fix | Delete
[2407] Fix | Delete
if ( $is_long_term_user ) {
[2408] Fix | Delete
$user_type = 'long-term';
[2409] Fix | Delete
} else {
[2410] Fix | Delete
if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
[2411] Fix | Delete
$user_type = 'non-registered-and-non-anonymous-short-term';
[2412] Fix | Delete
} else {
[2413] Fix | Delete
$user_type = 'short-term';
[2414] Fix | Delete
}
[2415] Fix | Delete
}
[2416] Fix | Delete
[2417] Fix | Delete
$uninstall_reasons = $this->_get_uninstall_reasons( $user_type );
[2418] Fix | Delete
[2419] Fix | Delete
$vars['reasons'] = $uninstall_reasons;
[2420] Fix | Delete
}
[2421] Fix | Delete
[2422] Fix | Delete
$vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params;
[2423] Fix | Delete
$vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form;
[2424] Fix | Delete
$vars['uninstall_confirmation_message'] = $uninstall_confirmation_message;
[2425] Fix | Delete
[2426] Fix | Delete
/**
[2427] Fix | Delete
* Load the HTML template for the deactivation feedback dialog box.
[2428] Fix | Delete
*
[2429] Fix | Delete
* @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
[2430] Fix | Delete
*/
[2431] Fix | Delete
fs_require_template( 'forms/deactivation/form.php', $vars );
[2432] Fix | Delete
}
[2433] Fix | Delete
[2434] Fix | Delete
/**
[2435] Fix | Delete
* @author Leo Fajardo (@leorw)
[2436] Fix | Delete
* @since 1.1.2
[2437] Fix | Delete
*
[2438] Fix | Delete
* @param string $user_type
[2439] Fix | Delete
*
[2440] Fix | Delete
* @return array The uninstall reasons for the specified user type.
[2441] Fix | Delete
*/
[2442] Fix | Delete
function _get_uninstall_reasons( $user_type = 'long-term' ) {
[2443] Fix | Delete
$module_type = $this->_module_type;
[2444] Fix | Delete
[2445] Fix | Delete
$internal_message_template_var = array(
[2446] Fix | Delete
'id' => $this->_module_id
[2447] Fix | Delete
);
[2448] Fix | Delete
[2449] Fix | Delete
$plan = $this->get_plan();
[2450] Fix | Delete
[2451] Fix | Delete
if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) {
[2452] Fix | Delete
$contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var );
[2453] Fix | Delete
} else {
[2454] Fix | Delete
$contact_support_template = '';
[2455] Fix | Delete
}
[2456] Fix | Delete
[2457] Fix | Delete
$reason_found_better_plugin = array(
[2458] Fix | Delete
'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
[2459] Fix | Delete
'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ),
[2460] Fix | Delete
'input_type' => 'textfield',
[2461] Fix | Delete
'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ),
[2462] Fix | Delete
);
[2463] Fix | Delete
[2464] Fix | Delete
$reason_temporary_deactivation = array(
[2465] Fix | Delete
'id' => self::REASON_TEMPORARY_DEACTIVATION,
[2466] Fix | Delete
'text' => sprintf(
[2467] Fix | Delete
$this->get_text_inline( "It's a temporary %s - I'm troubleshooting an issue", 'reason-temporary-x' ),
[2468] Fix | Delete
strtolower( $this->is_plugin() ?
[2469] Fix | Delete
$this->get_text_inline( 'Deactivation', 'deactivation' ) :
[2470] Fix | Delete
$this->get_text_inline( 'Theme Switch', 'theme-switch' )
[2471] Fix | Delete
)
[2472] Fix | Delete
),
[2473] Fix | Delete
'input_type' => '',
[2474] Fix | Delete
'input_placeholder' => ''
[2475] Fix | Delete
);
[2476] Fix | Delete
[2477] Fix | Delete
$reason_other = array(
[2478] Fix | Delete
'id' => self::REASON_OTHER,
[2479] Fix | Delete
'text' => $this->get_text_inline( 'Other', 'reason-other' ),
[2480] Fix | Delete
'input_type' => 'textfield',
[2481] Fix | Delete
'input_placeholder' => ''
[2482] Fix | Delete
);
[2483] Fix | Delete
[2484] Fix | Delete
$long_term_user_reasons = array(
[2485] Fix | Delete
array(
[2486] Fix | Delete
'id' => self::REASON_NO_LONGER_NEEDED,
[2487] Fix | Delete
'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ),
[2488] Fix | Delete
'input_type' => '',
[2489] Fix | Delete
'input_placeholder' => ''
[2490] Fix | Delete
),
[2491] Fix | Delete
$reason_found_better_plugin,
[2492] Fix | Delete
array(
[2493] Fix | Delete
'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
[2494] Fix | Delete
'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ),
[2495] Fix | Delete
'input_type' => '',
[2496] Fix | Delete
'input_placeholder' => ''
[2497] Fix | Delete
),
[2498] Fix | Delete
array(
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function