/** * Get SEO score for post from WordPress SEO Plugin * * @param int $post_id * * @return string */ protected function get_wp_seo_score($post_id) { // Get seo score from WordPress SEO $score = WPSEO_Metabox::get_value('linkdex', $post_id); if ($score !== '') { $nr = $this->wpseo_calc($score, '/', 10, true); $score_label = $this->wpseo_translate_score($nr); unset($nr); } else { $score_label = 'na'; } return $score_label; }