Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
}
[1500] Fix | Delete
[1501] Fix | Delete
if ( is_multisite() ) {
[1502] Fix | Delete
add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) );
[1503] Fix | Delete
add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) );
[1504] Fix | Delete
add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) );
[1505] Fix | Delete
[1506] Fix | Delete
if ( version_compare( $GLOBALS['wp_version'], '5.1', '<' ) ) {
[1507] Fix | Delete
add_action( 'deleted_blog', array( $this, '_after_site_deleted_callback' ), 10, 2 );
[1508] Fix | Delete
} else {
[1509] Fix | Delete
add_action( 'wp_delete_site', array( $this, '_after_wpsite_deleted_callback' ) );
[1510] Fix | Delete
}
[1511] Fix | Delete
[1512] Fix | Delete
add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) );
[1513] Fix | Delete
add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) );
[1514] Fix | Delete
add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
[1515] Fix | Delete
}
[1516] Fix | Delete
[1517] Fix | Delete
if ( $this->is_theme() &&
[1518] Fix | Delete
self::is_customizer() &&
[1519] Fix | Delete
$this->apply_filters( 'show_customizer_upsell', true )
[1520] Fix | Delete
) {
[1521] Fix | Delete
// Register customizer upsell.
[1522] Fix | Delete
add_action( 'customize_register', array( &$this, '_customizer_register' ) );
[1523] Fix | Delete
}
[1524] Fix | Delete
[1525] Fix | Delete
add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
[1526] Fix | Delete
[1527] Fix | Delete
if ( $this->is_theme() && ! $this->is_migration() ) {
[1528] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
[1529] Fix | Delete
}
[1530] Fix | Delete
[1531] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
[1532] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) );
[1533] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) );
[1534] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_user_change_option' ) );
[1535] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_email_address_update_option' ) );
[1536] Fix | Delete
[1537] Fix | Delete
$this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
[1538] Fix | Delete
$this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
[1539] Fix | Delete
$this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
[1540] Fix | Delete
$this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
[1541] Fix | Delete
[1542] Fix | Delete
if ( $this->_is_network_active && fs_is_network_admin() ) {
[1543] Fix | Delete
$this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
[1544] Fix | Delete
}
[1545] Fix | Delete
[1546] Fix | Delete
$this->add_ajax_action( 'install_premium_version', array(
[1547] Fix | Delete
&$this,
[1548] Fix | Delete
'_install_premium_version_ajax_action'
[1549] Fix | Delete
) );
[1550] Fix | Delete
[1551] Fix | Delete
$this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
[1552] Fix | Delete
[1553] Fix | Delete
$this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
[1554] Fix | Delete
[1555] Fix | Delete
$this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
[1556] Fix | Delete
[1557] Fix | Delete
$this->add_action(
[1558] Fix | Delete
'plugin_version_update',
[1559] Fix | Delete
array( &$this, '_after_version_update' ),
[1560] Fix | Delete
WP_FS__DEFAULT_PRIORITY,
[1561] Fix | Delete
2
[1562] Fix | Delete
);
[1563] Fix | Delete
$this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
[1564] Fix | Delete
[1565] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_trial_notice' ) ); // @phpstan-ignore-line
[1566] Fix | Delete
add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) ); // @phpstan-ignore-line
[1567] Fix | Delete
add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
[1568] Fix | Delete
[1569] Fix | Delete
/**
[1570] Fix | Delete
* Handle request to reset anonymous mode for `get_reconnect_url()` or reset the pending activation mode.
[1571] Fix | Delete
*
[1572] Fix | Delete
* @author Vova Feldman (@svovaf)
[1573] Fix | Delete
* @since 1.2.1.5
[1574] Fix | Delete
*/
[1575] Fix | Delete
if (
[1576] Fix | Delete
(
[1577] Fix | Delete
fs_request_is_action( 'reset_anonymous_mode' ) ||
[1578] Fix | Delete
fs_request_is_action( 'reset_pending_activation_mode' )
[1579] Fix | Delete
) &&
[1580] Fix | Delete
$this->get_unique_affix() === fs_request_get_raw( 'fs_unique_affix' )
[1581] Fix | Delete
) {
[1582] Fix | Delete
add_action( 'admin_init', array( &$this, 'connect_again' ) );
[1583] Fix | Delete
}
[1584] Fix | Delete
}
[1585] Fix | Delete
[1586] Fix | Delete
/**
[1587] Fix | Delete
* Register the required hooks right after the settings parse is completed.
[1588] Fix | Delete
*
[1589] Fix | Delete
* @author Vova Feldman (@svovaf)
[1590] Fix | Delete
* @since 2.3.1
[1591] Fix | Delete
*/
[1592] Fix | Delete
private function register_after_settings_parse_hooks() {
[1593] Fix | Delete
if ( is_admin() &&
[1594] Fix | Delete
$this->is_theme() &&
[1595] Fix | Delete
$this->is_premium() &&
[1596] Fix | Delete
! $this->has_active_valid_license()
[1597] Fix | Delete
) {
[1598] Fix | Delete
$this->add_ajax_action(
[1599] Fix | Delete
'delete_theme_update_data',
[1600] Fix | Delete
array( &$this, '_delete_theme_update_data_action' )
[1601] Fix | Delete
);
[1602] Fix | Delete
}
[1603] Fix | Delete
[1604] Fix | Delete
if ( $this->show_settings_with_tabs() ) {
[1605] Fix | Delete
/**
[1606] Fix | Delete
* Include the required hooks to capture the theme settings' page tabs
[1607] Fix | Delete
* and cache them.
[1608] Fix | Delete
*
[1609] Fix | Delete
* @author Vova Feldman (@svovaf)
[1610] Fix | Delete
* @since 1.2.2.7
[1611] Fix | Delete
*/
[1612] Fix | Delete
if ( ! $this->_cache->has_valid( 'tabs' ) ) {
[1613] Fix | Delete
add_action( 'admin_footer', array( &$this, '_tabs_capture' ) );
[1614] Fix | Delete
// Add license activation AJAX callback.
[1615] Fix | Delete
$this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) );
[1616] Fix | Delete
[1617] Fix | Delete
add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 );
[1618] Fix | Delete
}
[1619] Fix | Delete
[1620] Fix | Delete
add_action(
[1621] Fix | Delete
'admin_footer',
[1622] Fix | Delete
array( &$this, '_add_freemius_tabs' ),
[1623] Fix | Delete
/**
[1624] Fix | Delete
* The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
[1625] Fix | Delete
* That's why the priority is 11 while the tabs capture logic is added
[1626] Fix | Delete
* with priority 10.
[1627] Fix | Delete
*
[1628] Fix | Delete
* @author Vova Feldman (@svovaf)
[1629] Fix | Delete
*/
[1630] Fix | Delete
11
[1631] Fix | Delete
);
[1632] Fix | Delete
}
[1633] Fix | Delete
[1634] Fix | Delete
if ( ! self::is_ajax() ) {
[1635] Fix | Delete
if ( ! $this->is_addon() || $this->is_only_premium() ) {
[1636] Fix | Delete
add_action(
[1637] Fix | Delete
( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
[1638] Fix | Delete
array( &$this, '_prepare_admin_menu' ),
[1639] Fix | Delete
WP_FS__LOWEST_PRIORITY
[1640] Fix | Delete
);
[1641] Fix | Delete
}
[1642] Fix | Delete
}
[1643] Fix | Delete
}
[1644] Fix | Delete
[1645] Fix | Delete
/**
[1646] Fix | Delete
* Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that
[1647] Fix | Delete
* they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin).
[1648] Fix | Delete
*
[1649] Fix | Delete
* @author Leo Fajardo (@leorw)
[1650] Fix | Delete
* @since 2.2.3
[1651] Fix | Delete
*
[1652] Fix | Delete
* @param object $updates
[1653] Fix | Delete
* @param string|null $transient
[1654] Fix | Delete
*
[1655] Fix | Delete
* @return object
[1656] Fix | Delete
*/
[1657] Fix | Delete
static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) {
[1658] Fix | Delete
if ( is_object( $updates ) && isset( $updates->response ) ) {
[1659] Fix | Delete
foreach ( $updates->response as $file => $plugin ) {
[1660] Fix | Delete
if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) {
[1661] Fix | Delete
unset( $updates->response[ $file ] );
[1662] Fix | Delete
}
[1663] Fix | Delete
}
[1664] Fix | Delete
}
[1665] Fix | Delete
[1666] Fix | Delete
return $updates;
[1667] Fix | Delete
}
[1668] Fix | Delete
[1669] Fix | Delete
/**
[1670] Fix | Delete
* Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle
[1671] Fix | Delete
* the information that is shown on the plugin details dialog that is shown when the relevant link is clicked.
[1672] Fix | Delete
*
[1673] Fix | Delete
* @author Leo Fajardo (@leorw)
[1674] Fix | Delete
* @since 2.2.3
[1675] Fix | Delete
*
[1676] Fix | Delete
* @return void
[1677] Fix | Delete
*/
[1678] Fix | Delete
static function _prepend_fs_allow_updater_and_dialog_flag_url_param() {
[1679] Fix | Delete
$slug_basename_map = array();
[1680] Fix | Delete
foreach ( self::$_instances as $instance ) {
[1681] Fix | Delete
if ( ! $instance->is_plugin() ) {
[1682] Fix | Delete
continue;
[1683] Fix | Delete
}
[1684] Fix | Delete
[1685] Fix | Delete
$slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename();
[1686] Fix | Delete
}
[1687] Fix | Delete
?>
[1688] Fix | Delete
<script type="text/javascript">
[1689] Fix | Delete
(function( $ ) {
[1690] Fix | Delete
var slugBasenameMap = <?php echo json_encode( $slug_basename_map ) ?>;
[1691] Fix | Delete
for ( var slug in slugBasenameMap ) {
[1692] Fix | Delete
var basename = slugBasenameMap[ slug ];
[1693] Fix | Delete
[1694] Fix | Delete
// Try to get the plugin rows if on the "Plugins" page.
[1695] Fix | Delete
var $pluginRows = $( '.wp-list-table.plugins tr[data-plugin="' + basename + '"]');
[1696] Fix | Delete
[1697] Fix | Delete
if ( 0 === $pluginRows.length ) {
[1698] Fix | Delete
// Try to get the plugin rows if on the "Updates" page.
[1699] Fix | Delete
var $pluginCheckbox = $( '#update-plugins-table input[type="checkbox"][value="' + basename + '"]' );
[1700] Fix | Delete
if ( 0 !== $pluginCheckbox.length ) {
[1701] Fix | Delete
$pluginRows = $pluginCheckbox.parents( 'tr:first' );
[1702] Fix | Delete
}
[1703] Fix | Delete
}
[1704] Fix | Delete
[1705] Fix | Delete
if ( 0 === $pluginRows.length ) {
[1706] Fix | Delete
// No plugin rows found.
[1707] Fix | Delete
continue;
[1708] Fix | Delete
}
[1709] Fix | Delete
[1710] Fix | Delete
// Find the "View details" links and add the `fs_allow_updater_and_dialog` param to the URL.
[1711] Fix | Delete
$pluginRows.find( 'a[href*="plugin-install.php?tab=plugin-information"]' ).each(function() {
[1712] Fix | Delete
var $this = $( this ),
[1713] Fix | Delete
href = $this.attr( 'href' ).replace( '?tab=', '?fs_allow_updater_and_dialog=true&tab=');
[1714] Fix | Delete
[1715] Fix | Delete
$this.attr( 'href', href );
[1716] Fix | Delete
});
[1717] Fix | Delete
}
[1718] Fix | Delete
})( jQuery );
[1719] Fix | Delete
</script>
[1720] Fix | Delete
<?php
[1721] Fix | Delete
}
[1722] Fix | Delete
[1723] Fix | Delete
/**
[1724] Fix | Delete
* @author Leo Fajardo (@leorw)
[1725] Fix | Delete
* @since 2.3.0
[1726] Fix | Delete
*/
[1727] Fix | Delete
static function _maybe_add_beta_label_styles() {
[1728] Fix | Delete
$has_any_beta_version = false;
[1729] Fix | Delete
[1730] Fix | Delete
foreach ( self::$_instances as $instance ) {
[1731] Fix | Delete
if ( $instance->is_beta() ) {
[1732] Fix | Delete
$has_any_beta_version = true;
[1733] Fix | Delete
break;
[1734] Fix | Delete
}
[1735] Fix | Delete
}
[1736] Fix | Delete
[1737] Fix | Delete
if ( $has_any_beta_version ) {
[1738] Fix | Delete
fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' );
[1739] Fix | Delete
}
[1740] Fix | Delete
}
[1741] Fix | Delete
[1742] Fix | Delete
/**
[1743] Fix | Delete
* @author Leo Fajardo (@leorw)
[1744] Fix | Delete
* @since 2.3.0
[1745] Fix | Delete
*/
[1746] Fix | Delete
static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() {
[1747] Fix | Delete
$beta_data = array();
[1748] Fix | Delete
[1749] Fix | Delete
foreach ( self::$_instances as $instance ) {
[1750] Fix | Delete
if ( ! $instance->is_premium() ) {
[1751] Fix | Delete
continue;
[1752] Fix | Delete
}
[1753] Fix | Delete
[1754] Fix | Delete
/**
[1755] Fix | Delete
* If there's an available beta version update, a confirmation message will be shown when the
[1756] Fix | Delete
* "Update now" link on the "Plugins" or "Themes" page is clicked.
[1757] Fix | Delete
*/
[1758] Fix | Delete
$has_beta_update = $instance->has_beta_update();
[1759] Fix | Delete
[1760] Fix | Delete
$is_beta = (
[1761] Fix | Delete
// The "Beta" label is added separately for themes.
[1762] Fix | Delete
$instance->is_plugin() &&
[1763] Fix | Delete
$instance->is_beta()
[1764] Fix | Delete
);
[1765] Fix | Delete
[1766] Fix | Delete
if ( ! $is_beta && ! $has_beta_update ) {
[1767] Fix | Delete
continue;
[1768] Fix | Delete
}
[1769] Fix | Delete
[1770] Fix | Delete
$beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta );
[1771] Fix | Delete
[1772] Fix | Delete
if ( ! $has_beta_update ) {
[1773] Fix | Delete
continue;
[1774] Fix | Delete
}
[1775] Fix | Delete
[1776] Fix | Delete
$beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf(
[1777] Fix | Delete
'%s %s',
[1778] Fix | Delete
sprintf(
[1779] Fix | Delete
fs_esc_attr_inline(
[1780] Fix | Delete
'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.',
[1781] Fix | Delete
'beta-version-update-caution',
[1782] Fix | Delete
$instance->get_slug()
[1783] Fix | Delete
),
[1784] Fix | Delete
$instance->get_plugin_title()
[1785] Fix | Delete
),
[1786] Fix | Delete
fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() )
[1787] Fix | Delete
);
[1788] Fix | Delete
}
[1789] Fix | Delete
[1790] Fix | Delete
if ( empty( $beta_data ) ) {
[1791] Fix | Delete
return;
[1792] Fix | Delete
}
[1793] Fix | Delete
?>
[1794] Fix | Delete
<script type="text/javascript">
[1795] Fix | Delete
( function( $ ) {
[1796] Fix | Delete
var betaData = <?php echo json_encode( $beta_data ) ?>;
[1797] Fix | Delete
[1798] Fix | Delete
for ( var pluginBasename in betaData ) {
[1799] Fix | Delete
if ( ! betaData.hasOwnProperty( pluginBasename ) ) {
[1800] Fix | Delete
continue;
[1801] Fix | Delete
}
[1802] Fix | Delete
[1803] Fix | Delete
if ( ! betaData[ pluginBasename ].is_installed_version_beta ) {
[1804] Fix | Delete
continue;
[1805] Fix | Delete
}
[1806] Fix | Delete
[1807] Fix | Delete
var $parentContainer = $( '.wp-list-table.plugins tr[data-plugin="' + pluginBasename + '"]' );
[1808] Fix | Delete
if ( 0 === $parentContainer.length ) {
[1809] Fix | Delete
continue;
[1810] Fix | Delete
}
[1811] Fix | Delete
[1812] Fix | Delete
$parentContainer.find( '.plugin-title > strong:first-child').append(
[1813] Fix | Delete
'<span class="fs-tag fs-info"><?php fs_esc_js_echo_inline( 'Beta', 'beta' ) ?></span>'
[1814] Fix | Delete
);
[1815] Fix | Delete
}
[1816] Fix | Delete
[1817] Fix | Delete
setTimeout( function() {
[1818] Fix | Delete
// Wait a little bit before adding the event handler, otherwise, it will be overridden by the core WP logic.
[1819] Fix | Delete
$( '.plugins .update-message .update-link, .themes .theme .update-message' ).on( 'click', function() {
[1820] Fix | Delete
var $parentContainer = $( this ).parents( 'tr:first' );
[1821] Fix | Delete
pluginBasename = ( 0 !== $parentContainer.length ) ?
[1822] Fix | Delete
$parentContainer.data( 'plugin' ) :
[1823] Fix | Delete
$( this ).parents( '.theme:first' ).data( 'slug' );
[1824] Fix | Delete
[1825] Fix | Delete
if (
[1826] Fix | Delete
betaData[ pluginBasename ] &&
[1827] Fix | Delete
betaData[ pluginBasename ].beta_version_update_confirmation_message &&
[1828] Fix | Delete
! confirm( betaData[ pluginBasename ].beta_version_update_confirmation_message )
[1829] Fix | Delete
) {
[1830] Fix | Delete
return false;
[1831] Fix | Delete
}
[1832] Fix | Delete
} );
[1833] Fix | Delete
}, 20 );
[1834] Fix | Delete
} )( jQuery );
[1835] Fix | Delete
</script>
[1836] Fix | Delete
<?php
[1837] Fix | Delete
}
[1838] Fix | Delete
[1839] Fix | Delete
/**
[1840] Fix | Delete
* Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
[1841] Fix | Delete
* could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
[1842] Fix | Delete
* plugin will trigger inclusion of the free or premium version and if one of them is active during the
[1843] Fix | Delete
* uninstallation, a fatal error may occur in case the plugin's class or functions are already defined.
[1844] Fix | Delete
*
[1845] Fix | Delete
* @author Leo Fajardo (@leorw)
[1846] Fix | Delete
*
[1847] Fix | Delete
* @since 1.2.0
[1848] Fix | Delete
*/
[1849] Fix | Delete
private function unregister_uninstall_hook() {
[1850] Fix | Delete
$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
[1851] Fix | Delete
unset( $uninstallable_plugins[ $this->_free_plugin_basename ] );
[1852] Fix | Delete
unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] );
[1853] Fix | Delete
[1854] Fix | Delete
update_option( 'uninstall_plugins', $uninstallable_plugins );
[1855] Fix | Delete
}
[1856] Fix | Delete
[1857] Fix | Delete
/**
[1858] Fix | Delete
* @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
[1859] Fix | Delete
*
[1860] Fix | Delete
* @param bool $store_prev_path
[1861] Fix | Delete
*/
[1862] Fix | Delete
private function clear_module_main_file_cache( $store_prev_path = true ) {
[1863] Fix | Delete
if ( ! isset( $this->_storage->plugin_main_file ) ||
[1864] Fix | Delete
empty( $this->_storage->plugin_main_file->path )
[1865] Fix | Delete
) {
[1866] Fix | Delete
return;
[1867] Fix | Delete
}
[1868] Fix | Delete
[1869] Fix | Delete
if ( ! $store_prev_path ) {
[1870] Fix | Delete
/**
[1871] Fix | Delete
* Storing the previous path is not needed when clearing the cache after an SDK version update since
[1872] Fix | Delete
* the main purpose of the cache clearing in that event is to correct a wrong plugin main file path
[1873] Fix | Delete
* which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
[1874] Fix | Delete
*
[1875] Fix | Delete
* @author Leo Fajardo (@leorw)
[1876] Fix | Delete
* @since 2.2.1
[1877] Fix | Delete
*/
[1878] Fix | Delete
unset( $this->_storage->plugin_main_file->path );
[1879] Fix | Delete
} else {
[1880] Fix | Delete
$plugin_main_file = clone $this->_storage->plugin_main_file;
[1881] Fix | Delete
[1882] Fix | Delete
// Store cached path (2nd layer cache).
[1883] Fix | Delete
$plugin_main_file->prev_path = $plugin_main_file->path;
[1884] Fix | Delete
[1885] Fix | Delete
// Clear cached path.
[1886] Fix | Delete
unset( $plugin_main_file->path );
[1887] Fix | Delete
[1888] Fix | Delete
$this->_storage->plugin_main_file = $plugin_main_file;
[1889] Fix | Delete
}
[1890] Fix | Delete
[1891] Fix | Delete
/**
[1892] Fix | Delete
* Clear global cached path.
[1893] Fix | Delete
*
[1894] Fix | Delete
* @author Leo Fajardo (@leorw)
[1895] Fix | Delete
* @since 1.2.2
[1896] Fix | Delete
*/
[1897] Fix | Delete
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' );
[1898] Fix | Delete
unset( $id_slug_type_path_map[ $this->_module_id ]['path'] );
[1899] Fix | Delete
self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
[1900] Fix | Delete
}
[1901] Fix | Delete
[1902] Fix | Delete
/**
[1903] Fix | Delete
* @author Leo Fajardo (@leorw)
[1904] Fix | Delete
* @since 2.0.0
[1905] Fix | Delete
*/
[1906] Fix | Delete
function _hook_action_links_and_register_account_hooks() {
[1907] Fix | Delete
if ( $this->is_migration() ) {
[1908] Fix | Delete
return;
[1909] Fix | Delete
}
[1910] Fix | Delete
[1911] Fix | Delete
if (
[1912] Fix | Delete
( self::is_plugins_page() && $this->is_plugin() ) ||
[1913] Fix | Delete
( self::is_themes_page() && $this->is_theme() ) ||
[1914] Fix | Delete
fs_request_is_action_secure( $this->get_unique_affix() . '_reconnect' )
[1915] Fix | Delete
) {
[1916] Fix | Delete
$this->_add_tracking_links();
[1917] Fix | Delete
}
[1918] Fix | Delete
[1919] Fix | Delete
if ( self::is_plugins_page() && $this->is_plugin() ) {
[1920] Fix | Delete
$this->hook_plugin_action_links();
[1921] Fix | Delete
}
[1922] Fix | Delete
[1923] Fix | Delete
$this->_register_account_hooks();
[1924] Fix | Delete
}
[1925] Fix | Delete
[1926] Fix | Delete
/**
[1927] Fix | Delete
* @author Vova Feldman (@svovaf)
[1928] Fix | Delete
* @since 1.0.9
[1929] Fix | Delete
*/
[1930] Fix | Delete
private function _register_account_hooks() {
[1931] Fix | Delete
if ( ! is_admin() ) {
[1932] Fix | Delete
return;
[1933] Fix | Delete
}
[1934] Fix | Delete
[1935] Fix | Delete
/**
[1936] Fix | Delete
* Always show the deactivation feedback form since we added
[1937] Fix | Delete
* automatic free version deactivation upon premium code activation.
[1938] Fix | Delete
*
[1939] Fix | Delete
* @since 1.2.1.6
[1940] Fix | Delete
*/
[1941] Fix | Delete
$this->add_ajax_action(
[1942] Fix | Delete
'submit_uninstall_reason',
[1943] Fix | Delete
array( &$this, '_submit_uninstall_reason_action' )
[1944] Fix | Delete
);
[1945] Fix | Delete
[1946] Fix | Delete
$this->add_ajax_action(
[1947] Fix | Delete
'cancel_subscription_or_trial',
[1948] Fix | Delete
array( &$this, 'cancel_subscription_or_trial_ajax_action' )
[1949] Fix | Delete
);
[1950] Fix | Delete
[1951] Fix | Delete
if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
[1952] Fix | Delete
if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
[1953] Fix | Delete
( $this->is_theme() && self::is_themes_page() )
[1954] Fix | Delete
) {
[1955] Fix | Delete
add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) );
[1956] Fix | Delete
}
[1957] Fix | Delete
}
[1958] Fix | Delete
}
[1959] Fix | Delete
[1960] Fix | Delete
/**
[1961] Fix | Delete
* Leverage backtrace to find caller plugin file path.
[1962] Fix | Delete
*
[1963] Fix | Delete
* @param bool $is_init Is initiation sequence.
[1964] Fix | Delete
* @param string $main_file Since 2.5.0 expects the module's main file path to potentially purge the cached path.
[1965] Fix | Delete
*
[1966] Fix | Delete
* @return string
[1967] Fix | Delete
* @since 1.0.6
[1968] Fix | Delete
*
[1969] Fix | Delete
* @author Vova Feldman (@svovaf)
[1970] Fix | Delete
*/
[1971] Fix | Delete
private function _find_caller_plugin_file( $is_init = false, $main_file = '' ) {
[1972] Fix | Delete
// Try to load the cached value of the file path.
[1973] Fix | Delete
if ( isset( $this->_storage->plugin_main_file ) ) {
[1974] Fix | Delete
$plugin_main_file = $this->_storage->plugin_main_file;
[1975] Fix | Delete
if ( ! empty( $plugin_main_file->path ) ) {
[1976] Fix | Delete
$absolute_path = $this->get_absolute_path( $plugin_main_file->path );
[1977] Fix | Delete
if ( file_exists( $absolute_path ) ) {
[1978] Fix | Delete
if ( $is_init && $absolute_path !== $this->get_absolute_path( $main_file ) ) {
[1979] Fix | Delete
// Update cached path if not matching the actual path.
[1980] Fix | Delete
$plugin_main_file->path = $main_file;
[1981] Fix | Delete
$this->_storage->plugin_main_file = $plugin_main_file;
[1982] Fix | Delete
}
[1983] Fix | Delete
[1984] Fix | Delete
return $absolute_path;
[1985] Fix | Delete
}
[1986] Fix | Delete
}
[1987] Fix | Delete
}
[1988] Fix | Delete
[1989] Fix | Delete
/**
[1990] Fix | Delete
* @since 1.2.1
[1991] Fix | Delete
*
[1992] Fix | Delete
* `clear_module_main_file_cache()` is clearing the plugin's cached path on
[1993] Fix | Delete
* deactivation. Therefore, if any plugin/theme was initiating `Freemius`
[1994] Fix | Delete
* with that plugin's slug, it was overriding the empty plugin path with a wrong path.
[1995] Fix | Delete
*
[1996] Fix | Delete
* So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
[1997] Fix | Delete
* when the class instantiator isn't the module.
[1998] Fix | Delete
*/
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function