=") && version_compare($php_version, '5.3.0', ">=") ); return $result; } //use Tenweb_Manager\Manager; if(tenweb_check_plugin_requirements()) { include_once 'config.php'; include_once TENWEB_INCLUDES_DIR . '/class-helper.php'; include_once 'manager.php'; add_action('plugins_loaded', array('Tenweb_Manager\Manager', 'get_instance'), 1); } register_activation_hook(__FILE__, 'tenweb_activate'); register_deactivation_hook(__FILE__, 'tenweb_deactivate'); function tenweb_activate($to_die = "1"){ //when tenweb_check_plugin_requirements() return false include_once 'config.php'; $error_msg = array(); if(tenweb_check_plugin_requirements() == false) { array_push($error_msg, "PHP or Wordpress version not compatible with plugin."); } if(plugin_basename(__FILE__) !== TENWEB_SLUG) { array_push($error_msg, "Plugin foldername/filename.php must be " . TENWEB_SLUG); } //send new state delete_site_transient(TENWEB_PREFIX . '_send_states_transient'); update_option(TENWEB_PREFIX . '_version', TENWEB_VERSION); update_option(TENWEB_PREFIX . '_activated', '1'); if(!empty($error_msg) && ($to_die == "1" || $to_die == "")) { $error_msg = implode("
", $error_msg); die($error_msg); } else { return $error_msg; } } function tenweb_deactivate(){ if(tenweb_check_plugin_requirements() == false) { return; } call_user_func(array('\Tenweb_Manager\Helper' , 'send_state_before_deactivation')); }