/**
  * An array representing items to be added to the At a Glance dashboard widget
  *
  * @return array
  */
 private function statistic_items()
 {
     if (false !== ($items = get_transient(self::CACHE_TRANSIENT_KEY))) {
         return $items;
     }
     $items = array(array('seo_rank' => 'good', 'title' => __('Posts with good SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-good', 'count' => $this->statistics->get_good_seo_post_count()), array('seo_rank' => 'ok', 'title' => __('Posts with OK SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-ok', 'count' => $this->statistics->get_ok_seo_post_count()), array('seo_rank' => 'poor', 'title' => __('Posts with poor SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-poor', 'count' => $this->statistics->get_poor_seo_post_count()), array('seo_rank' => 'bad', 'title' => __('Posts with bad SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-bad', 'count' => $this->statistics->get_bad_seo_post_count()), array('seo_rank' => 'na', 'title' => __('Posts without focus keyword', 'wordpress-seo'), 'class' => 'wpseo-glance-na', 'count' => $this->statistics->get_no_focus_post_count()), array('seo_rank' => 'noindex', 'title' => sprintf(__('Posts that are set to %s', 'wordpress-seo'), '<code>noindex</code>'), 'class' => 'wpseo-glance-noindex', 'count' => $this->statistics->get_no_index_post_count()));
     $items = array_filter($items, array($this, 'filter_items'));
     set_transient(self::CACHE_TRANSIENT_KEY, $items, DAY_IN_SECONDS);
     return $items;
 }
 /**
  * Converts a rank to data usable in the dashboard widget
  *
  * @param WPSEO_Rank $rank The rank to map.
  *
  * @return array
  */
 private function map_rank_to_widget(WPSEO_Rank $rank)
 {
     return array('seo_rank' => $rank->get_rank(), 'title' => $this->get_title_for_rank($rank), 'class' => 'wpseo-glance-' . $rank->get_css_class(), 'icon_class' => $rank->get_css_class(), 'count' => $this->statistics->get_post_count($rank));
 }
 /**
  * Set the SEO scores belonging to their SEO score result
  *
  * @return array
  */
 private function get_seo_scores_with_post_count()
 {
     return array(array('seo_rank' => 'good', 'title' => __('Posts with good SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-good', 'count' => $this->statistics->get_good_seo_post_count()), array('seo_rank' => 'ok', 'title' => __('Posts with OK SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-ok', 'count' => $this->statistics->get_ok_seo_post_count()), array('seo_rank' => 'poor', 'title' => __('Posts with poor SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-poor', 'count' => $this->statistics->get_poor_seo_post_count()), array('seo_rank' => 'bad', 'title' => __('Posts with bad SEO score', 'wordpress-seo'), 'class' => 'wpseo-glance-bad', 'count' => $this->statistics->get_bad_seo_post_count()), array('seo_rank' => 'na', 'title' => __('Posts without focus keyword', 'wordpress-seo'), 'class' => 'wpseo-glance-na', 'count' => $this->statistics->get_no_focus_post_count()), array('seo_rank' => 'noindex', 'title' => sprintf(__('Posts that are set to %s', 'wordpress-seo'), '<code>noindex</code>'), 'class' => 'wpseo-glance-noindex', 'count' => $this->statistics->get_no_index_post_count()));
 }