60, 'display' => __( 'Every Minute', 'affiliateboxes' ), ); } return $schedules; } ); // phpcs:enable WordPress.WP.CronInterval.CronSchedulesInterval // Load composer autoloader for Action Scheduler. if ( file_exists( AFFILIATEBOXES_PLUGIN_DIR . 'vendor/autoload.php' ) ) { require_once AFFILIATEBOXES_PLUGIN_DIR . 'vendor/autoload.php'; } // Initialize Action Scheduler. if ( file_exists( AFFILIATEBOXES_PLUGIN_DIR . 'vendor/woocommerce/action-scheduler/action-scheduler.php' ) ) { require_once AFFILIATEBOXES_PLUGIN_DIR . 'vendor/woocommerce/action-scheduler/action-scheduler.php'; } // Include required files. $affiliateboxes_includes = array( 'includes/class-affiliateboxes-logger.php', 'includes/class-affiliateboxes.php', 'includes/class-affiliateboxes-utils.php', 'includes/class-affiliateboxes-renderer.php', 'includes/class-affiliateboxes-action-scheduler.php', 'admin/class-affiliateboxes-admin.php', 'public/class-affiliateboxes-public.php', ); foreach ( $affiliateboxes_includes as $affiliateboxes_file ) { $affiliateboxes_filepath = AFFILIATEBOXES_PLUGIN_DIR . $affiliateboxes_file; if ( file_exists( $affiliateboxes_filepath ) ) { require_once $affiliateboxes_filepath; } elseif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { // Log error if file is missing - use error_log here since AffiliateBoxes_Logger may not be loaded yet. // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Debug logging only, logger not yet available. error_log( sprintf( 'AffiliateBoxes Error: Cannot find file at path %s', $affiliateboxes_filepath ) ); } } /** * Initialize the plugin. */ function affiliateboxes_run() { if ( class_exists( 'AffiliateBoxes' ) ) { $plugin = new AffiliateBoxes(); $plugin->run(); } else { add_action( 'admin_notices', function () { ?>