/** * @covers WPSEO_Rewrite::flush */ public function test_flush() { delete_option($this->flush_option_name); $this->assertFalse(self::$class_instance->flush()); self::$class_instance->schedule_flush(); $this->assertTrue(self::$class_instance->flush()); }
/** * Runs on activation of the plugin. */ function _wpseo_activate() { require_once WPSEO_PATH . 'inc/wpseo-functions.php'; wpseo_load_textdomain(); // Make sure we have our translations available for the defaults. WPSEO_Options::get_instance(); if (!is_multisite()) { WPSEO_Options::initialize(); } else { WPSEO_Options::maybe_set_multisite_defaults(true); } WPSEO_Options::ensure_options_exist(); if (is_multisite() && ms_is_switched()) { delete_option('rewrite_rules'); } else { $wpseo_rewrite = new WPSEO_Rewrite(); $wpseo_rewrite->schedule_flush(); } wpseo_add_capabilities(); // Clear cache so the changes are obvious. WPSEO_Utils::clear_cache(); do_action('wpseo_activate'); }