plugin_name = WPAJXL_PLUGIN_IDENTIFIER; $this->version = WPAJXL_PLUGIN_VERSION; } /** * Registers every hook of the plugin (once per request). * * @return void */ public function run() { if ( self::$running ) { return; } self::$running = true; $settings = WPAJXL_Settings::instance(); $settings->register_hooks(); if ( did_action( 'plugins_loaded' ) ) { $settings->maybe_upgrade(); } else { add_action( 'plugins_loaded', array( $settings, 'maybe_upgrade' ), 5 ); } ( new WPAJXL_Frontend( $settings ) )->register(); ( new WPAJXL_REST( $settings ) )->register(); if ( is_admin() && class_exists( 'WPAJXL_Admin', false ) ) { ( new WPAJXL_Admin( $this->plugin_name, $this->version ) )->register(); } } /** * Activation hook: migrates 1.x data, creates defaults when no settings * exist and records the version. * * Network activation prepares the current site; every other site is * prepared by maybe_upgrade() on its first request. * * @param bool $network_wide Whether the plugin is network activated. * @return void */ public static function activate( $network_wide = false ) { unset( $network_wide ); WPAJXL_Settings::instance()->activate(); } /** * Returns the plugin identifier. * * @return string */ public function get_plugin_name() { return $this->plugin_name; } /** * Returns the plugin version. * * @return string */ public function get_version() { return $this->version; } } if ( ! class_exists( 'WP_Ajax_loading_Core', false ) ) { class_alias( 'WPAJXL_Core', 'WP_Ajax_loading_Core' ); }