Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/seo-by-rank-math/includes/class-kb.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + /**
3 + * Knowledgebase links.
4 + *
5 + * This class defines all code necessary to run during the plugin's activation.
6 + *
7 + * @since 0.9.0
8 + * @package RankMath
9 + * @subpackage RankMath\Core
10 + * @author Rank Math <support@rankmath.com>
11 + */
12 +
13 + namespace RankMath;
14 +
15 + defined( 'ABSPATH' ) || exit;
16 +
17 + /**
18 + * KB class.
19 + */
20 + class KB {
21 +
22 + /**
23 + * Hold links.
24 + *
25 + * @var array
26 + */
27 + private static $links = [
28 + // General.
29 + 'seo-suite' => 'https://rankmath.com/',
30 + 'blog' => 'https://rankmath.com/blog/',
31 + 'free-account' => 'https://rankmath.com/my-account/',
32 + 'support' => 'https://rankmath.com/support/',
33 + 'pro' => 'https://rankmath.com/pricing/',
34 + 'site-checkout' => 'https://rankmath.com/site-checkout/',
35 + 'changelog' => 'https://rankmath.com/changelog/',
36 + 'changelog-free' => 'https://rankmath.com/changelog/free/',
37 + 'help-affiliate' => 'https://rankmath.com/affiliates/',
38 + 'content-ai' => 'https://rankmath.com/content-ai/',
39 + 'content-ai-pricing-tables' => 'https://rankmath.com/content-ai/?#pricing-tables',
40 + 'content-ai-restore-credits' => 'https://rankmath.com/kb/how-to-restore-missing-content-ai-credits/',
41 + 'free-vs-pro' => 'https://rankmath.com/free-vs-pro/',
42 + 'google-updates' => 'https://rankmath.com/google-updates/',
43 + 'usage-policy' => 'https://rankmath.com/usage-tracking/',
44 + 'logo' => 'https://rankmath.com/wordpress/plugin/seo-suite/',
45 + 'offer' => 'https://rankmath.com/offer/',
46 +
47 + // Knowledgebase.
48 + 'knowledgebase' => 'https://rankmath.com/kb/',
49 + 'how-to-setup' => 'https://rankmath.com/kb/how-to-setup/',
50 + 'how-to-setup-your-site' => 'https://rankmath.com/kb/how-to-setup/?#your-site',
51 + 'seo-import' => 'https://rankmath.com/kb/how-to-setup/?#import-data',
52 + 'seo-tweaks' => 'https://rankmath.com/kb/how-to-setup/?#optimization',
53 + 'local-seo' => 'https://rankmath.com/kb/how-to-setup/?#easy-and-advanced-mode',
54 + 'general-settings' => 'https://rankmath.com/kb/general-settings/',
55 + 'remove-category-base' => 'https://rankmath.com/kb/general-settings/?#strip-category-base',
56 + 'link-settings' => 'https://rankmath.com/kb/general-settings/?#links',
57 + 'image-settings' => 'https://rankmath.com/kb/general-settings/?#images',
58 + 'breadcrumbs' => 'https://rankmath.com/kb/general-settings/?#breadcrumbs',
59 + 'webmaster-tools' => 'https://rankmath.com/kb/general-settings/?#webmaster-tools',
60 + 'edit-robotstxt' => 'https://rankmath.com/kb/general-settings/?#edit-robotstxt',
61 + 'robotstxt-tool' => 'https://rankmath.com/tools/robots-txt/',
62 + 'edit-htaccess' => 'https://rankmath.com/kb/general-settings/?#edit-htaccess',
63 + 'woocommerce-settings' => 'https://rankmath.com/kb/general-settings/?#woo-commerce',
64 + '404-monitor-settings' => 'https://rankmath.com/kb/general-settings/?#404-monitor',
65 + 'redirections-settings' => 'https://rankmath.com/kb/general-settings/?#redirections',
66 + 'analytics-settings' => 'https://rankmath.com/kb/general-settings/?#search-console',
67 + 'other-settings' => 'https://rankmath.com/kb/general-settings/?#others',
68 + 'score-100' => 'https://rankmath.com/kb/score-100-in-tests/',
69 + 'content-length' => 'https://rankmath.com/kb/score-100-in-tests/?#content-length',
70 + 'toc' => 'https://rankmath.com/kb/score-100-in-tests/?#content-length',
71 + 'configure-sitemaps' => 'https://rankmath.com/kb/configure-sitemaps/',
72 + 'sitemap-general' => 'https://rankmath.com/kb/configure-sitemaps/?#general',
73 + 'sitemap-post' => 'https://rankmath.com/kb/configure-sitemaps/?#posts',
74 + 'sitemap-page' => 'https://rankmath.com/kb/configure-sitemaps/?#pages',
75 + 'sitemap-media' => 'https://rankmath.com/kb/configure-sitemaps/?#media',
76 + 'sitemap-product' => 'https://rankmath.com/kb/configure-sitemaps/?#products',
77 + 'social-meta-settings' => 'https://rankmath.com/kb/titles-and-meta/?#social-meta',
78 + 'homepage-settings' => 'https://rankmath.com/kb/titles-and-meta/?#homepage',
79 + 'author-settings' => 'https://rankmath.com/kb/titles-and-meta/?#authors',
80 + 'misc-settings' => 'https://rankmath.com/kb/titles-and-meta/?#misc-pages',
81 + 'post-settings' => 'https://rankmath.com/kb/titles-and-meta/?#Posts',
82 + 'page-settings' => 'https://rankmath.com/kb/titles-and-meta/?#pages',
83 + 'media-settings' => 'https://rankmath.com/kb/titles-and-meta/?#media',
84 + 'product-settings' => 'https://rankmath.com/kb/titles-and-meta/?#products',
85 + 'category-settings' => 'https://rankmath.com/kb/titles-and-meta/?#categories',
86 + 'tag-settings' => 'https://rankmath.com/kb/titles-and-meta/?#tags',
87 + 'product-categories-settings' => 'https://rankmath.com/kb/titles-and-meta/?#product-categories',
88 + 'product-tags-settings' => 'https://rankmath.com/kb/titles-and-meta/?#product-tags',
89 + 'seo-email-reporting' => 'https://rankmath.com/kb/seo-email-reporting/',
90 + 'email-reports-logo' => 'https://rankmath.com/kb/seo-email-reporting/#report-logo',
91 + 'kb-seo-suite' => 'https://rankmath.com/kb/wordpress/seo-suite/',
92 + 'kb-search' => 'https://rankmath.com/kb/wordpress/seo-suite/?ht-kb-search=1',
93 + 'help-analytics' => 'https://rankmath.com/kb/analytics/',
94 + 'monitor-seo-performance' => 'https://rankmath.com/kb/client-management/#num-3-1-monitor-seo-performance-business',
95 + 'top-5-winning-and-losing' => 'https://rankmath.com/kb/analytics/?#top-5-winning-and-losing-posts-pro',
96 + 'using-ga4' => 'https://rankmath.com/kb/using-ga4/',
97 + 'local-seo-settings' => 'https://rankmath.com/kb/local-seo/',
98 + 'kml-sitemap' => 'https://rankmath.com/kb/kml-sitemap/',
99 + 'news-sitemap' => 'https://rankmath.com/kb/news-sitemap/',
100 + 'role-manager' => 'https://rankmath.com/kb/role-manager/',
101 + 'seo-analysis' => 'https://rankmath.com/kb/seo-analysis/',
102 + 'competitor-analyzer' => 'https://rankmath.com/kb/analyzing-competitors-seo-strategy/',
103 + 'requirements' => 'https://rankmath.com/kb/requirements/',
104 + 'video-sitemap' => 'https://rankmath.com/kb/video-sitemap/',
105 + 'rich-snippets' => 'https://rankmath.com/kb/rich-snippets/',
106 + 'podcast-settings' => 'https://rankmath.com/kb/podcast-schema/',
107 + 'fix-404' => 'https://rankmath.com/kb/fix-404-errors/',
108 + 'titles-meta' => 'https://rankmath.com/kb/titles-and-meta/',
109 + 'version-control' => 'https://rankmath.com/kb/version-control/',
110 + 'tools' => 'https://rankmath.com/kb/rank-math-status-and-tools/#database-tools',
111 + 'status' => 'https://rankmath.com/kb/rank-math-status-and-tools/#system-status',
112 + 'headless-support' => 'https://rankmath.com/kb/headless-support/',
113 + 'faq-schema-block' => 'https://rankmath.com/kb/faq-schema-block/',
114 + '404-monitor' => 'https://rankmath.com/kb/monitor-404-errors/',
115 + 'meta-box-social-tab' => 'https://rankmath.com/kb/meta-box-social-tab/',
116 + 'instant-indexing' => 'https://rankmath.com/kb/how-to-use-indexnow/',
117 + 'analytics-stats-bar' => 'https://rankmath.com/kb/analytics-stats-bar/',
118 + 'content-ai-settings' => 'https://rankmath.com/kb/how-to-use-content-ai/',
119 + 'content-ai-links' => 'https://rankmath.com/kb/how-to-use-content-ai/?#links',
120 + 'content-ai-keywords' => 'https://rankmath.com/kb/how-to-use-content-ai/?#keywords',
121 + 'content-ai-credits-usage' => 'https://rankmath.com/kb/content-ai-plans-and-credits/',
122 + 'free-account-benefits' => 'https://rankmath.com/kb/free-account-benefits/',
123 + 'import-export-settings' => 'https://rankmath.com/kb/import-export-settings/',
124 + 'location-data-shortcode' => 'https://rankmath.com/kb/location-data-shortcode/',
125 + 'redirections' => 'https://rankmath.com/kb/setting-up-redirections/',
126 + 'about-and-mentions-schema' => 'https://rankmath.com/kb/about-and-mentions-schema/',
127 + 'url-inspection-api' => 'https://rankmath.com/kb/url-inspection-api-integration/',
128 + 'pillar-content-internal-linking' => 'https://rankmath.com/kb/pillar-content-internal-linking/',
129 + 'breadcrumbs-install' => 'https://rankmath.com/kb/breadcrumbs/?#add-breadcrumbs-theme',
130 + 'change-seo-score-backlink' => 'https://rankmath.com/kb/filters-hooks-api-developer/?#change-seo-score-backlink',
131 + 'unable-to-encrypt' => 'https://rankmath.com/kb/fix-automatic-update-unavailable-for-this-plugin/?#unable-to-encrypt',
132 + 'google-verification-kb' => 'https://rankmath.com/kb/google-site-verification/',
133 + 'bing-verification-kb' => 'https://rankmath.com/kb/verify-your-site-with-bing-webmaster-tools/',
134 + 'baidu-verification-kb' => 'https://rankmath.com/kb/baidu-webmaster-tools-verification/',
135 + 'yandex-verification-kb' => 'https://rankmath.com/kb/verifying-your-domain-with-yandex/',
136 + 'norton-verification-kb' => 'https://rankmath.com/kb/verify-site-with-norton-safe-web/',
137 + 'pinterest-verification-kb' => 'https://rankmath.com/kb/pinterest-site-verification/',
138 +
139 + // SEO Analysis.
140 + 'analysis-site-tagline' => 'https://rankmath.com/kb/seo-analysis/?#site-tagline-test',
141 + 'analysis-blog-public' => 'https://rankmath.com/kb/seo-analysis/?#blog-public-test',
142 + 'analysis-permalink-structure' => 'https://rankmath.com/kb/seo-analysis/?#permalink-structure-test',
143 + 'analysis-focus-keywords' => 'https://rankmath.com/kb/seo-analysis/?#focus-keywords-test',
144 + 'analysis-post-titles' => 'https://rankmath.com/kb/seo-analysis/?#post-titles-missing-focus-keywords-test',
145 + 'analysis-search-console' => 'https://rankmath.com/kb/seo-analysis/?#search-console-test',
146 + 'analysis-sitemaps' => 'https://rankmath.com/kb/seo-analysis/?#sitemaps-test',
147 + 'analysis-auto-update' => 'https://rankmath.com/kb/seo-analysis/?#priority',
148 +
149 + // Social Media.
150 + 'yt-link' => 'http://youtube.com/rankmath',
151 + 'fb-group' => 'https://www.facebook.com/groups/rankmathseopluginwordpress/',
152 +
153 + // Other.
154 + 'google-article-schema' => 'https://developers.google.com/search/docs/data-types/article/?utm_campaign=Rank+Math',
155 + 'create-facebook-app' => 'https://www.youtube.com/watch?utm_source=Plugin&utm_campaign=WP&v=-XME8Q25omQ&feature=youtu.be',
156 + ];
157 +
158 + /**
159 + * Echo the link.
160 + *
161 + * @param string $id Id of the link to get.
162 + * @param string $medium Medium of the link to get.
163 + */
164 + public static function the( $id, $medium = '' ) {
165 + echo self::get( $id, $medium ); // phpcs:ignore
166 + }
167 +
168 + /**
169 + * Return the link.
170 + *
171 + * @param string $id Id of the link to get.
172 + * @param string $medium Medium of the link to get.
173 + * @return string
174 + */
175 + public static function get( $id, $medium = '' ) {
176 + $links = self::get_links();
177 + $url = isset( $links[ $id ] ) ? $links[ $id ] : '#';
178 +
179 + if ( empty( $medium ) ) {
180 + return $url;
181 + }
182 +
183 + return add_query_arg(
184 + [
185 + 'utm_source' => 'Plugin',
186 + 'utm_medium' => rawurlencode( $medium ),
187 + 'utm_campaign' => 'WP',
188 + ],
189 + $url
190 + );
191 + }
192 +
193 + /**
194 + * Get links.
195 + *
196 + * @return array
197 + */
198 + public static function get_links() {
199 + $processed = [];
200 + foreach ( self::$links as $key => $base_url ) {
201 + // Allow third-parties to append query parameters based on the base URL.
202 + $params = (array) apply_filters( 'rank_math/link', [], $key, $base_url );
203 + $processed[ $key ] = ! empty( $params ) ? add_query_arg( $params, $base_url ) : $base_url;
204 + }
205 +
206 + return $processed;
207 + }
208 + }
209 +