コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 /**
  * 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()));
 }