PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.14.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.14.0
2.14.2 2.14.1 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 All 57 releases
← All changes | includes/seo/email-report-sections/class-position-summary-section.php +15 -40 2.14.1 → 2.14.0 View file →
@@ -3,10 +3,9 @@
3 3 * Position Summary Section — "Where your keywords rank".
4 4 *
5 5 * Buckets the period's queries into Top 3 / 4–10 / 11–50 / 51–100 and draws
6 6 * them as bars. Source: GSC `position_distribution` already computed by
7 - * Analytics_Manager over the whole property (#913), with queries ranked
8 - * past 100 in `over_100`.
7 + * Analytics_Manager.
9 8 *
10 9 * @package ThinkRank
11 10 * @subpackage SEO\Email_Report_Sections
12 11 * @since 1.9.0
@@ -51,22 +50,17 @@
51 50 if (!is_array($dist) || empty($dist)) {
52 51 return [];
53 52 }
54 53 return [
55 - 'top_3' => (int) ($dist['top_3'] ?? 0),
56 - '4_10' => (int) ($dist['4_10'] ?? 0),
57 - '11_50' => (int) ($dist['10_50'] ?? 0), // GSC's `10_50` bucket starts at 11
58 - '51_100' => (int) ($dist['51_100'] ?? 0),
59 - // Counted over the whole property since #913. A payload cached
60 - // before then has neither key and reads as before.
61 - 'over_100' => (int) ($dist['over_100'] ?? 0),
62 - 'complete' => (bool) ($dist['complete'] ?? true),
54 + 'top_3' => (int) ($dist['top_3'] ?? 0),
55 + '4_10' => (int) ($dist['4_10'] ?? 0),
56 + '11_50' => (int) ($dist['10_50'] ?? 0), // GSC's `10_50` bucket starts at 11
57 + '51_100' => (int) ($dist['51_100'] ?? 0),
63 58 ];
64 59 }
65 60
66 61 public function has_data(array $payload): bool {
67 - $counts = array_intersect_key($payload, array_flip(['top_3', '4_10', '11_50', '51_100', 'over_100']));
68 - return array_sum(array_map('intval', $counts)) > 0;
62 + return array_sum(array_map('intval', $payload)) > 0;
69 63 }
70 64
71 65 public function render(array $payload): string {
72 66 $counts = [
@@ -74,47 +68,28 @@
74 68 '4_10' => (int) ($payload['4_10'] ?? 0),
75 69 '11_50' => (int) ($payload['11_50'] ?? 0),
76 70 '51_100' => (int) ($payload['51_100'] ?? 0),
77 71 ];
78 - // The bars share out the top 100; queries ranked past it still had
79 - // an impression, so they count toward the headline total (#913).
80 - $ranked = array_sum($counts);
81 - $over_100 = max(0, (int) ($payload['over_100'] ?? 0));
82 - $total = $ranked + $over_100;
72 + $total = array_sum($counts);
83 73 if ($total === 0) {
84 74 return '';
85 75 }
86 76 $page_one = $counts['top_3'] + $counts['4_10'];
87 77
88 - // Incomplete means Search Console could not be paged to the end, so
89 - // the count covers the top of the property by clicks, not all of it.
90 - $subtitle = (bool) ($payload['complete'] ?? true)
91 - ? sprintf(
78 + $html = Email_Report_Html::heading(
79 + $this->label(),
80 + sprintf(
92 81 /* translators: %s: number of queries. */
93 82 _n('%s query got at least one impression this period', '%s queries got at least one impression this period', $total, 'thinkrank'),
94 83 number_format_i18n($total)
95 84 )
96 - : sprintf(
97 - /* translators: %s: number of queries counted. */
98 - _n('Counted over your top %s query by clicks this period', 'Counted over your top %s queries by clicks this period', $total, 'thinkrank'),
99 - number_format_i18n($total)
100 - );
101 -
102 - $html = Email_Report_Html::heading($this->label(), $subtitle);
85 + );
103 86 $html .= '<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin-top:14px;">'
104 - . Email_Report_Html::bar_row(__('Top 3', 'thinkrank'), $counts['top_3'], $ranked, Email_Report_Html::PRIMARY)
105 - . Email_Report_Html::bar_row(__('Positions 4–10', 'thinkrank'), $counts['4_10'], $ranked, '#6e79ff')
106 - . Email_Report_Html::bar_row(__('Positions 11–50', 'thinkrank'), $counts['11_50'], $ranked, '#b3b9ff')
107 - . Email_Report_Html::bar_row(__('Positions 51–100', 'thinkrank'), $counts['51_100'], $ranked, '#dcdfff')
87 + . Email_Report_Html::bar_row(__('Top 3', 'thinkrank'), $counts['top_3'], $total, Email_Report_Html::PRIMARY)
88 + . Email_Report_Html::bar_row(__('Positions 4–10', 'thinkrank'), $counts['4_10'], $total, '#6e79ff')
89 + . Email_Report_Html::bar_row(__('Positions 11–50', 'thinkrank'), $counts['11_50'], $total, '#b3b9ff')
90 + . Email_Report_Html::bar_row(__('Positions 51–100', 'thinkrank'), $counts['51_100'], $total, '#dcdfff')
108 91 . '</table>';
109 - if ($over_100 > 0) {
110 - $html .= Email_Report_Html::note(sprintf(
111 - /* translators: 1: queries ranking in the top 100, 2: queries ranking beyond position 100. */
112 - _n('%1$s rank in the top 100 and %2$s ranks beyond position 100.', '%1$s rank in the top 100 and %2$s rank beyond position 100.', $over_100, 'thinkrank'),
113 - number_format_i18n($ranked),
114 - number_format_i18n($over_100)
115 - ));
116 - }
117 92 $html .= Email_Report_Html::note(sprintf(
118 93 /* translators: %s: number of queries ranking in positions 1–10. */
119 94 _n('%s query is on page one.', '%s queries are on page one.', $page_one, 'thinkrank'),
120 95 number_format_i18n($page_one)