$dir ) { $file = $dir . $class_file; if ( is_file( $file ) ) { require_once $file; break; } } } } spl_autoload_register( 'alg_wc_aps_autoloader' ); } // Constants if ( ! defined( 'ALG_WC_APS_DIR' ) ) { define( 'ALG_WC_APS_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR ); } if ( ! defined( 'ALG_WC_APS_URL' ) ) { define( 'ALG_WC_APS_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'ALG_WC_APS_BASENAME' ) ) { define( 'ALG_WC_APS_BASENAME', plugin_basename( __FILE__ ) ); } if ( ! defined( 'ALG_WC_APS_FOLDER_NAME' ) ) { define( 'ALG_WC_APS_FOLDER_NAME', untrailingslashit( plugin_dir_path( plugin_basename( __FILE__ ) ) ) ); } if ( ! function_exists( 'alg_ajax_product_search_for_wc' ) ) { /** * Returns the main instance of Alg_WC_APS_Core to prevent the need to use globals. * * @version 1.0.0 * @since 1.0.0 * @return Alg_WC_APS_Core */ function alg_ajax_product_search_for_wc() { return Alg_WC_APS_Core::instance(); } } // Start plugin add_action( 'plugins_loaded', 'alg_wc_aps_start_plugin' ); if ( ! function_exists( 'alg_wc_aps_start_plugin' ) ) { /** * Starts the plugin * * @version 1.0.1 * @since 1.0.1 */ function alg_wc_aps_start_plugin() { // Includes composer dependencies require __DIR__ . '/vendor/autoload.php'; alg_ajax_product_search_for_wc(); } }