/** * Install plugin on plugin activation */ function cleverness_todo_activation() { global $wp_version; $exit_msg = __('To-Do List requires WordPress 3.8 or newer. <a href="http://codex.wordpress.org/Upgrading_WordPress">Please update.</a>', 'cleverness-to-do-list'); if (version_compare($wp_version, '3.8', '<')) { exit($exit_msg); } if (!defined('CTDL_DB_VERSION')) { define('CTDL_DB_VERSION', '3.4'); } if (!defined('CTDL_FILE')) { define('CTDL_FILE', __FILE__); } include_once 'includes/cleverness-to-do-list-library.class.php'; if (get_option('CTDL_db_version')) { $installed_ver = get_option('CTDL_db_version'); } else { $installed_ver = 0; } if (CTDL_DB_VERSION != $installed_ver) { CTDL_Lib::install_plugin(); } }