load(); } // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } define( 'KUDOS_VERSION', '2.3.3' ); define( 'KUDOS_PLUGIN_DIR', dirname( __FILE__ ) ); define( 'KUDOS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'KUDOS_STORAGE_DIR', wp_upload_dir()['basedir'] . '/kudos-donations/' ); define( 'KUDOS_STORAGE_URL', wp_upload_dir()['baseurl'] . '/kudos-donations/' ); define( 'KUDOS_DEBUG', get_option( '_kudos_debug_mode' ) ); /** * The code that runs during plugin activation. * This action is documented in app/Service/ActivatorService.php */ function activate_kudos() { require_once KUDOS_PLUGIN_DIR . '/app/Service/ActivatorService.php'; ActivatorService::activate(); } /** * The code that runs during plugin deactivation. * This action is documented in app/Service/DeactivatorService.php */ function deactivate_kudos() { require_once KUDOS_PLUGIN_DIR . '/app/Service/DeactivatorService.php'; DeactivatorService::deactivate(); } register_activation_hook( __FILE__, __NAMESPACE__ . '\activate_kudos' ); register_deactivation_hook( __FILE__, __NAMESPACE__ . '\deactivate_kudos' ); /** * The core plugin class that is used to define internationalization, * admin-specific hooks, and public-facing site hooks. */ require KUDOS_PLUGIN_DIR . '/app/KudosDonations.php'; /** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 1.0.0 */ function run_kudos() { // Check compatibility and run kudos if OK $compatibility = new CompatibilityService(); $continue = $compatibility->init(); if ( $continue ) { $plugin = new KudosDonations(); $plugin->run(); } } run_kudos();