includes/class-freemius.php
private static function _load_required_static() {
            if ( self::$_statics_loaded ) {
                return;
            }

            self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );

            self::$_static_logger->entrance();

            self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );

            if ( is_multisite() ) {
                $has_skipped_migration = (
                    // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
                    null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
                    // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
                    null !== self::$_accounts->get_option( 'file_slug_map', null, false )
                );

                /**
                 * If the file_slug_map exists on the site level but doesn't exist on the
                 * network level storage, it means that we need to process the storage with migration.
                 *
                 * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
                 *
                 * @author Vova Feldman (@svovaf)
                 * @since  2.0.0
                 */
                if (
                    ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
                    ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
                        null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
                ) {
                    self::migrate_options_to_network();
                }
            }

            self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );

            if ( ! WP_FS__DEMO_MODE ) {
                add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
                    'Freemius',
                    '_add_debug_section'
                ) );
            }

            add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );

            self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );

            self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );

            self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );

            if ( 0 == did_action( 'plugins_loaded' ) ) {
                add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
            }

            add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
            add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );


            self::$_statics_loaded = true;
        }
private static function _load_required_static() {
            if ( self::$_statics_loaded ) {
                return;
            }

            self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );

            self::$_static_logger->entrance();

            self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );

            if ( is_multisite() ) {
                $has_skipped_migration = (
                    // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
                    null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
                    // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
                    null !== self::$_accounts->get_option( 'file_slug_map', null, false )
                );

                /**
                 * If the file_slug_map exists on the site level but doesn't exist on the
                 * network level storage, it means that we need to process the storage with migration.
                 *
                 * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
                 *
                 * @author Vova Feldman (@svovaf)
                 * @since  2.0.0
                 */
                if (
                    ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
                    ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
                        null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
                ) {
                    self::migrate_options_to_network();
                }
            }

            self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );

            if ( ! WP_FS__DEMO_MODE ) {
                add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
                    'Freemius',
                    '_add_debug_section'
                ) );
            }

            add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );

            self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );

            self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );

            self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );

            if ( 0 == did_action( 'plugins_loaded' ) ) {
                add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
            }

            add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
            add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );


            self::$_statics_loaded = true;
        }
private static function _load_required_static ( ) { if ( self :: $ _statics_loaded ) { return ; } self :: $ _static_logger = FS_Logger :: get_logger ( WP_FS__SLUG , WP_FS__DEBUG_SDK , WP_FS__ECHO_DEBUG_SDK ) ; self :: $ _static_logger -> entrance ( ) ; self :: $ _accounts = FS_Options :: instance ( WP_FS__ACCOUNTS_OPTION_NAME , true ) ; if ( is_multisite ( ) ) { $ has_skipped_migration = ( // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
 null === self :: $ _accounts -> get_option ( 'id_slug_type_path_map' , null , false ) && // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
 null !== self :: $ _accounts -> get_option ( 'file_slug_map' , null , false ) ) ; /**
                 * If the file_slug_map exists on the site level but doesn't exist on the
                 * network level storage, it means that we need to process the storage with migration.
                 *
                 * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
                 *
                 * @author Vova Feldman (@svovaf)
                 * @since  2.0.0
                 */ if ( ( $ has_skipped_migration && true !== self :: $ _accounts -> get_option ( 'ms_migration_complete' , false , true ) ) || ( null === self :: $ _accounts -> get_option ( 'file_slug_map' , null , true ) && null !== self :: $ _accounts -> get_option ( 'file_slug_map' , null , false ) ) ) { self :: migrate_options_to_network ( ) ; } } self :: $ _global_admin_notices = FS_Admin_Notices :: instance ( 'global' ) ; if ( ! WP_FS__DEMO_MODE ) { add_action ( ( fs_is_network_admin ( ) ? 'network_' : '' ) . 'admin_menu' , array ( 'Freemius' , '_add_debug_section' ) ) ; } add_action ( "wp_ajax_fs_toggle_debug_mode" , array ( 'Freemius' , '_toggle_debug_mode' ) ) ; self :: add_ajax_action_static ( 'get_debug_log' , array ( 'Freemius' , '_get_debug_log' ) ) ; self :: add_ajax_action_static ( 'get_db_option' , array ( 'Freemius' , '_get_db_option' ) ) ; self :: add_ajax_action_static ( 'set_db_option' , array ( 'Freemius' , '_set_db_option' ) ) ; if ( 0 == did_action ( 'plugins_loaded' ) ) { add_action ( 'plugins_loaded' , array ( 'Freemius' , '_load_textdomain' ) , 1 ) ; } add_action ( 'admin_footer' , array ( 'Freemius' , '_enrich_ajax_url' ) ) ; add_action ( 'admin_footer' , array ( 'Freemius' , '_open_support_forum_in_new_page' ) ) ; self :: $ _statics_loaded = true ; }
Load static resources.

@author Vova Feldman (@svovaf)
@since  1.0.1
Load static resources .