• Resolved gvanto

    (@gvanto)


    I have a save_post hook in which I need to get the linkdex score to (followed by translate) to see if SEO result is good (or not).

    The problem is, when I do a retrieval in my plugin like below, the postmeta value for the ‘linkdex’ value has not been updated in the DB yet by Yoast plugin (it does all calc’s using ajax now which is nice)

    if (($score = WPSEO_Metabox::get_value('linkdex', $post_id) ) != '') {

    This retrieves whichever value had been in there previously (not the newly-calculated value). I tried using save_post with priority=99 (to try and get mine to run after WP SEO’s) but this doesn’t work.

    Is there a way to force-calculate the linkdex score? (not using ajax)

    https://wordpress.org/plugins/wordpress-seo/

Viewing 1 replies (of 1 total)
  • Thread Starter gvanto

    (@gvanto)

    Btw in previous version of Yoast SEO I had the following working just fine:

    $ymb = new WPSEO_Metabox();
            $results = $ymb->calculate_results($this->post); // deprecated fxn
            $is_seo_good = true;
    
            if (!is_wp_error($results)) {
                $score_label = WPSEO_Utils::translate_score($results['total']);
                if ($score_label != 'good') {
                    $is_seo_good = false;
                }
            }
Viewing 1 replies (of 1 total)
  • The topic ‘How to calculate SEO scores from within my own plugin?’ is closed to new replies.