Example #1
0
 /**
  * Resets the site to the default WordPress SEO settings and runs a title test to check whether force rewrite needs to be on.
  */
 function reset_defaults()
 {
     foreach (get_wpseo_options_arr() as $opt) {
         delete_option($opt);
     }
     wpseo_defaults();
     wpseo_title_test();
 }
 /**
  * Resets the site to the default WordPress SEO settings and runs a title test to check whether force rewrite needs to be on.
  */
 function reset_defaults()
 {
     foreach (get_wpseo_options_arr() as $opt) {
         delete_option($opt);
     }
     wpseo_defaults();
     //wpseo_title_test(); // is already run in wpseo_defaults
     //wpseo_description_test(); // is already run in wpseo_defaults
 }
/**
 * Runs on activation of the plugin.
 */
function wpseo_activate()
{
    wpseo_defaults();
    wpseo_flush_rules();
    wpseo_title_test();
    // Clear cache so the changes are obvious.
    if (function_exists('w3tc_pgcache_flush')) {
        w3tc_pgcache_flush();
    } else {
        if (function_exists('wp_cache_clear_cache')) {
            wp_cache_clear_cache();
        }
    }
}
/**
 * Runs on activation of the plugin.
 */
function wpseo_activate()
{
    wpseo_defaults();
    wpseo_flush_rules();
    if (!function_exists('schedule_yoast_tracking')) {
        require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    }
    schedule_yoast_tracking(null, get_option('wpseo'));
    //	wpseo_title_test(); // is already run in wpseo_defaults
    //  wpseo_description_test(); // is already run in wpseo_defaults
    // Clear cache so the changes are obvious.
    if (function_exists('w3tc_pgcache_flush')) {
        w3tc_pgcache_flush();
    } else {
        if (function_exists('wp_cache_clear_cache')) {
            wp_cache_clear_cache();
        }
    }
}
Example #5
0
        if ($replace) {
            delete_post_meta($old->post_id, $old_metakey);
        }
    }
}
$msg = '';
if (isset($_POST['import'])) {
    check_admin_referer('wpseo-import');
    global $wpdb;
    $replace = false;
    $deletekw = false;
    if (isset($_POST['wpseo']['deleteolddata']) && $_POST['wpseo']['deleteolddata'] == 'on') {
        $replace = true;
    }
    if (isset($_POST['wpseo']['importwoo'])) {
        wpseo_defaults();
        $sep = get_option('seo_woo_seperator');
        $options = get_wpseo_options();
        switch (get_option('seo_woo_home_layout')) {
            case 'a':
                $options['title-home'] = '%%sitename%% ' . $sep . ' %%sitedesc%%';
                break;
            case 'b':
                $options['title-home'] = '%%sitename%% ' . get_option('seo_woo_paged_var') . ' %%pagenum%%';
                break;
            case 'c':
                $options['title-home'] = '%%sitedesc%%';
                break;
        }
        if ($replace) {
            delete_option('seo_woo_home_layout');