/** * Runs the needed cleanup after an update, setting the DB version to latest version, flushing caches etc. */ private function finish_up() { $this->options = get_option('wpseo'); // Re-get to make sure we have the latest version. update_option('wpseo', $this->options); // This also ensures the DB version is equal to YMBESEO_VERSION. add_action('shutdown', 'flush_rewrite_rules'); // Just flush rewrites, always, to at least make them work after an upgrade. YMBESEO_Utils::clear_sitemap_cache(); // Flush the sitemap cache. YMBESEO_Options::ensure_options_exist(); // Make sure all our options always exist - issue #1245. }
/** * Runs on activation of the plugin. */ function _YMBESEO_activate() { require_once YMBESEO_PATH . 'inc/ymbeseo-functions.php'; YMBESEO_load_textdomain(); // Make sure we have our translations available for the defaults. YMBESEO_Options::get_instance(); if (!is_multisite()) { YMBESEO_Options::initialize(); } else { YMBESEO_Options::maybe_set_multisite_defaults(true); } YMBESEO_Options::ensure_options_exist(); add_action('shutdown', 'flush_rewrite_rules'); YMBESEO_add_capabilities(); // Clear cache so the changes are obvious. YMBESEO_Utils::clear_cache(); do_action('YMBESEO_activate'); }