getValue() == 1){ ACPT_Lite_DB::injectCache(cacheInstance()); } } catch (\Exception $exception){ // do nothing } class ACPT_Lite { /** * The code that runs during plugin activation. */ public function activate() { ACPT_Lite_Activator::activate(); } /** * The code that runs during plugin deactivation. */ public function deactivate() { ACPT_Lite_Deactivator::deactivate(); } /** * Check for plugin upgrades */ public static function checkForPluginUpgrades() { $old_version = get_option('acpt_lite_version', 0); $current_version = filemtime(__FILE__); if ($old_version != $current_version) { ACPT_Lite_DB::flushCache(); ACPT_Lite_DB::createSchema(ACPT_LITE_PLUGIN_VERSION, oldPluginVersion($old_version)); ACPT_Lite_DB::sync(); update_option('acpt_lite_version', $current_version, false); } } } register_activation_hook( __FILE__, [new ACPT_Lite(), 'activate'] ); register_deactivation_hook( __FILE__, [new ACPT_Lite(), 'deactivate'] ); ACPT_Lite::checkForPluginUpgrades(); /** * APPSERO * Initialize the plugin tracker * * @return void */ function appsero_init_tracker_acpt_lite() { if ( ! class_exists( 'Appsero\Client' ) ) { require_once __DIR__ . '/vendor/appsero/client/src/Client.php'; } $client = new Appsero\Client( '858a08d4-bccd-4710-a3bc-e768cfe80675', 'Advanced Custom Post Type Lite', __FILE__ ); // Active insights $client->insights()->init(); } appsero_init_tracker_acpt_lite(); try { /** * 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 */ $plugin = new ACPT_Lite_Plugin(new ACPT_Lite_Loader()); $plugin->run(); } catch (\Exception $exception){ function wpb_admin_notice_error() { echo '
Something went wrong.