PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.11.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.11.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 1.27.0 1.26.0 1.25.0 trunk 1.0.0 All 52 releases
← All changes | includes/seo/email-report-sections/class-top-winning-posts-section.php +21 -6 2.5.0 → 2.11.0 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * Top Winning Posts Section
3 + * Top Winning Posts Section — "Top growing pages".
4 4 *
5 5 * Pages with the largest click gain vs the previous period, computed from
6 6 * the shared current-vs-previous comparison the Data Provider builds from
7 7 * Search Console (page dimension).
@@ -27,9 +27,9 @@
27 27 return 'top_winning_posts';
28 28 }
29 29
30 30 public function label(): string {
31 - return __('Top Winning Posts', 'thinkrank');
31 + return __('Top growing pages', 'thinkrank');
32 32 }
33 33
34 34 public function default_enabled(): bool {
35 35 return true;
@@ -38,8 +38,12 @@
38 38 public function requires_capability(): ?string {
39 39 return null;
40 40 }
41 41
42 + public function renders_own_heading(): bool {
43 + return true;
44 + }
45 +
42 46 public function collect(array $context): array {
43 47 $shared = $context['shared'] ?? [];
44 48 $comparison = $shared['comparison'] ?? [];
45 49 if (empty($comparison['available']) || empty($comparison['pages'])) {
@@ -66,14 +70,25 @@
66 70 'rows' => array_slice($rows, 0, self::MAX_ROWS),
67 71 ];
68 72 }
69 73
74 + public function has_data(array $payload): bool {
75 + return !empty($payload['rows']);
76 + }
77 +
70 78 public function render(array $payload): string {
71 - return Top_Posts_Renderer::render($payload['rows'] ?? [], 'gain');
79 + $rows = Top_Posts_Renderer::page_rows($payload['rows'] ?? []);
80 + if ($rows === []) {
81 + return '';
82 + }
83 + return Email_Report_Html::heading(
84 + $this->label(),
85 + __('Pages that gained the most clicks vs the previous period', 'thinkrank')
86 + )
87 + . Email_Report_Html::list_rows($rows, 'up')
88 + . Email_Report_Html::link(__('See all pages', 'thinkrank'), Email_Report_Html::admin_link('analytics', 'dashboard'));
72 89 }
73 90
74 91 public function fallback_html(): string {
75 - return '<p style="color:#6b7280;font-style:italic;">'
76 - . esc_html__('Search Console data unavailable. Connect Search Console to see your winning posts.', 'thinkrank')
77 - . '</p>';
92 + return '';
78 93 }
79 94 }