3rdparty
1 year ago
admin
1 year ago
cli
5 years ago
frontend
1 year ago
helpers
1 year ago
metaboxes
2 years ago
module
1 year ago
modules
1 year ago
opengraph
1 year ago
replace-variables
1 year ago
rest
1 year ago
settings
1 year ago
traits
1 year ago
updates
1 year ago
class-auto-updater.php
5 years ago
class-cmb2.php
2 years ago
class-common.php
1 year ago
class-compatibility.php
1 year ago
class-data-encryption.php
1 year ago
class-defaults.php
6 years ago
class-frontend-seo-score.php
1 year ago
class-helper.php
1 year ago
class-installer.php
1 year ago
class-json-manager.php
1 year ago
class-kb.php
1 year ago
class-metadata.php
1 year ago
class-post.php
1 year ago
class-rewrite.php
2 years ago
class-settings.php
1 year ago
class-term.php
1 year ago
class-thumbnail-overlay.php
1 year ago
class-update-email.php
3 years ago
class-updates.php
1 year ago
class-user.php
1 year ago
index.php
7 years ago
interface-runner.php
7 years ago
template-tags.php
1 year ago
class-kb.php
198 lines
| 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 | 'changelog' => 'https://rankmath.com/changelog/', |
| 35 | 'changelog-free' => 'https://rankmath.com/changelog/free/', |
| 36 | 'help-affiliate' => 'https://rankmath.com/affiliates/', |
| 37 | 'content-ai' => 'https://rankmath.com/content-ai/', |
| 38 | 'content-ai-pricing-tables' => 'https://rankmath.com/content-ai/?#pricing-tables', |
| 39 | 'content-ai-restore-credits' => 'https://rankmath.com/kb/how-to-restore-missing-content-ai-credits/', |
| 40 | 'free-vs-pro' => 'https://rankmath.com/free-vs-pro/', |
| 41 | 'google-updates' => 'https://rankmath.com/google-updates/', |
| 42 | 'usage-policy' => 'https://rankmath.com/usage-tracking/', |
| 43 | 'logo' => 'https://rankmath.com/wordpress/plugin/seo-suite/', |
| 44 | 'offer' => 'https://rankmath.com/offer/', |
| 45 | |
| 46 | // Knowledgebase. |
| 47 | 'knowledgebase' => 'https://rankmath.com/kb/', |
| 48 | 'how-to-setup' => 'https://rankmath.com/kb/how-to-setup/', |
| 49 | 'how-to-setup-your-site' => 'https://rankmath.com/kb/how-to-setup/?#your-site', |
| 50 | 'seo-import' => 'https://rankmath.com/kb/how-to-setup/?#import-data', |
| 51 | 'seo-tweaks' => 'https://rankmath.com/kb/how-to-setup/?#optimization', |
| 52 | 'local-seo' => 'https://rankmath.com/kb/how-to-setup/?#easy-and-advanced-mode', |
| 53 | 'general-settings' => 'https://rankmath.com/kb/general-settings/', |
| 54 | 'remove-category-base' => 'https://rankmath.com/kb/general-settings/?#strip-category-base', |
| 55 | 'link-settings' => 'https://rankmath.com/kb/general-settings/?#links', |
| 56 | 'image-settings' => 'https://rankmath.com/kb/general-settings/?#images', |
| 57 | 'breadcrumbs' => 'https://rankmath.com/kb/general-settings/?#breadcrumbs', |
| 58 | 'webmaster-tools' => 'https://rankmath.com/kb/general-settings/?#webmaster-tools', |
| 59 | 'edit-robotstxt' => 'https://rankmath.com/kb/general-settings/?#edit-robotstxt', |
| 60 | 'robotstxt-tool' => 'https://rankmath.com/tools/robots-txt/', |
| 61 | 'edit-htaccess' => 'https://rankmath.com/kb/general-settings/?#edit-htaccess', |
| 62 | 'woocommerce-settings' => 'https://rankmath.com/kb/general-settings/?#woo-commerce', |
| 63 | '404-monitor-settings' => 'https://rankmath.com/kb/general-settings/?#404-monitor', |
| 64 | 'redirections-settings' => 'https://rankmath.com/kb/general-settings/?#redirections', |
| 65 | 'analytics-settings' => 'https://rankmath.com/kb/general-settings/?#search-console', |
| 66 | 'other-settings' => 'https://rankmath.com/kb/general-settings/?#others', |
| 67 | 'score-100' => 'https://rankmath.com/kb/score-100-in-tests/', |
| 68 | 'content-length' => 'https://rankmath.com/kb/score-100-in-tests/?#content-length', |
| 69 | 'toc' => 'https://rankmath.com/kb/score-100-in-tests/?#content-length', |
| 70 | 'configure-sitemaps' => 'https://rankmath.com/kb/configure-sitemaps/', |
| 71 | 'sitemap-general' => 'https://rankmath.com/kb/configure-sitemaps/?#general', |
| 72 | 'sitemap-post' => 'https://rankmath.com/kb/configure-sitemaps/?#posts', |
| 73 | 'sitemap-page' => 'https://rankmath.com/kb/configure-sitemaps/?#pages', |
| 74 | 'sitemap-media' => 'https://rankmath.com/kb/configure-sitemaps/?#media', |
| 75 | 'sitemap-product' => 'https://rankmath.com/kb/configure-sitemaps/?#products', |
| 76 | 'social-meta-settings' => 'https://rankmath.com/kb/titles-and-meta/?#social-meta', |
| 77 | 'homepage-settings' => 'https://rankmath.com/kb/titles-and-meta/?#homepage', |
| 78 | 'author-settings' => 'https://rankmath.com/kb/titles-and-meta/?#authors', |
| 79 | 'misc-settings' => 'https://rankmath.com/kb/titles-and-meta/?#misc-pages', |
| 80 | 'post-settings' => 'https://rankmath.com/kb/titles-and-meta/?#Posts', |
| 81 | 'page-settings' => 'https://rankmath.com/kb/titles-and-meta/?#pages', |
| 82 | 'media-settings' => 'https://rankmath.com/kb/titles-and-meta/?#media', |
| 83 | 'product-settings' => 'https://rankmath.com/kb/titles-and-meta/?#products', |
| 84 | 'category-settings' => 'https://rankmath.com/kb/titles-and-meta/?#categories', |
| 85 | 'tag-settings' => 'https://rankmath.com/kb/titles-and-meta/?#tags', |
| 86 | 'product-categories-settings' => 'https://rankmath.com/kb/titles-and-meta/?#product-categories', |
| 87 | 'product-tags-settings' => 'https://rankmath.com/kb/titles-and-meta/?#product-tags', |
| 88 | 'seo-email-reporting' => 'https://rankmath.com/kb/seo-email-reporting/', |
| 89 | 'email-reports-logo' => 'https://rankmath.com/kb/seo-email-reporting/#report-logo', |
| 90 | 'kb-seo-suite' => 'https://rankmath.com/kb/wordpress/seo-suite/', |
| 91 | 'kb-search' => 'https://rankmath.com/kb/wordpress/seo-suite/?ht-kb-search=1', |
| 92 | 'help-analytics' => 'https://rankmath.com/kb/analytics/', |
| 93 | 'monitor-seo-performance' => 'https://rankmath.com/kb/client-management/#num-3-1-monitor-seo-performance-business', |
| 94 | 'top-5-winning-and-losing' => 'https://rankmath.com/kb/analytics/?#top-5-winning-and-losing-posts-pro', |
| 95 | 'using-ga4' => 'https://rankmath.com/kb/using-ga4/', |
| 96 | 'local-seo-settings' => 'https://rankmath.com/kb/local-seo/', |
| 97 | 'kml-sitemap' => 'https://rankmath.com/kb/kml-sitemap/', |
| 98 | 'news-sitemap' => 'https://rankmath.com/kb/news-sitemap/', |
| 99 | 'role-manager' => 'https://rankmath.com/kb/role-manager/', |
| 100 | 'seo-analysis' => 'https://rankmath.com/kb/seo-analysis/', |
| 101 | 'requirements' => 'https://rankmath.com/kb/requirements/', |
| 102 | 'video-sitemap' => 'https://rankmath.com/kb/video-sitemap/', |
| 103 | 'rich-snippets' => 'https://rankmath.com/kb/rich-snippets/', |
| 104 | 'podcast-settings' => 'https://rankmath.com/kb/podcast-schema/', |
| 105 | 'fix-404' => 'https://rankmath.com/kb/fix-404-errors/', |
| 106 | 'titles-meta' => 'https://rankmath.com/kb/titles-and-meta/', |
| 107 | 'version-control' => 'https://rankmath.com/kb/version-control/', |
| 108 | 'headless-support' => 'https://rankmath.com/kb/headless-support/', |
| 109 | 'faq-schema-block' => 'https://rankmath.com/kb/faq-schema-block/', |
| 110 | '404-monitor' => 'https://rankmath.com/kb/monitor-404-errors/', |
| 111 | 'meta-box-social-tab' => 'https://rankmath.com/kb/meta-box-social-tab/', |
| 112 | 'instant-indexing' => 'https://rankmath.com/kb/how-to-use-indexnow/', |
| 113 | 'analytics-stats-bar' => 'https://rankmath.com/kb/analytics-stats-bar/', |
| 114 | 'content-ai-settings' => 'https://rankmath.com/kb/how-to-use-content-ai/', |
| 115 | 'content-ai-links' => 'https://rankmath.com/kb/how-to-use-content-ai/?#links', |
| 116 | 'content-ai-keywords' => 'https://rankmath.com/kb/how-to-use-content-ai/?#keywords', |
| 117 | 'content-ai-credits-usage' => 'https://rankmath.com/kb/content-ai-plans-and-credits/', |
| 118 | 'free-account-benefits' => 'https://rankmath.com/kb/free-account-benefits/', |
| 119 | 'import-export-settings' => 'https://rankmath.com/kb/import-export-settings/', |
| 120 | 'location-data-shortcode' => 'https://rankmath.com/kb/location-data-shortcode/', |
| 121 | 'redirections' => 'https://rankmath.com/kb/setting-up-redirections/', |
| 122 | 'about-and-mentions-schema' => 'https://rankmath.com/kb/about-and-mentions-schema/', |
| 123 | 'url-inspection-api' => 'https://rankmath.com/kb/url-inspection-api-integration/', |
| 124 | 'pillar-content-internal-linking' => 'https://rankmath.com/kb/pillar-content-internal-linking/', |
| 125 | 'breadcrumbs-install' => 'https://rankmath.com/kb/breadcrumbs/?#add-breadcrumbs-theme', |
| 126 | 'change-seo-score-backlink' => 'https://rankmath.com/kb/filters-hooks-api-developer/?#change-seo-score-backlink', |
| 127 | 'unable-to-encrypt' => 'https://rankmath.com/kb/fix-automatic-update-unavailable-for-this-plugin/?#unable-to-encrypt', |
| 128 | 'google-verification-kb' => 'https://rankmath.com/kb/google-site-verification/', |
| 129 | 'bing-verification-kb' => 'https://rankmath.com/kb/verify-your-site-with-bing-webmaster-tools/', |
| 130 | 'baidu-verification-kb' => 'https://rankmath.com/kb/baidu-webmaster-tools-verification/', |
| 131 | 'yandex-verification-kb' => 'https://rankmath.com/kb/verifying-your-domain-with-yandex/', |
| 132 | 'norton-verification-kb' => 'https://rankmath.com/kb/verify-site-with-norton-safe-web/', |
| 133 | 'pinterest-verification-kb' => 'https://rankmath.com/kb/pinterest-site-verification/', |
| 134 | |
| 135 | // SEO Analysis. |
| 136 | 'analysis-site-tagline' => 'https://rankmath.com/kb/seo-analysis/?#site-tagline-test', |
| 137 | 'analysis-blog-public' => 'https://rankmath.com/kb/seo-analysis/?#blog-public-test', |
| 138 | 'analysis-permalink-structure' => 'https://rankmath.com/kb/seo-analysis/?#permalink-structure-test', |
| 139 | 'analysis-focus-keywords' => 'https://rankmath.com/kb/seo-analysis/?#focus-keywords-test', |
| 140 | 'analysis-post-titles' => 'https://rankmath.com/kb/seo-analysis/?#post-titles-missing-focus-keywords-test', |
| 141 | 'analysis-search-console' => 'https://rankmath.com/kb/seo-analysis/?#search-console-test', |
| 142 | 'analysis-sitemaps' => 'https://rankmath.com/kb/seo-analysis/?#sitemaps-test', |
| 143 | 'analysis-auto-update' => 'https://rankmath.com/kb/seo-analysis/?#priority', |
| 144 | |
| 145 | // Social Media. |
| 146 | 'yt-link' => 'http://youtube.com/rankmath', |
| 147 | 'fb-group' => 'https://www.facebook.com/groups/rankmathseopluginwordpress/', |
| 148 | |
| 149 | // Other. |
| 150 | 'google-article-schema' => 'https://developers.google.com/search/docs/data-types/article/?utm_campaign=Rank+Math', |
| 151 | 'create-facebook-app' => 'https://www.youtube.com/watch?utm_source=Plugin&utm_campaign=WP&v=-XME8Q25omQ&feature=youtu.be', |
| 152 | ]; |
| 153 | |
| 154 | /** |
| 155 | * Echo the link. |
| 156 | * |
| 157 | * @param string $id Id of the link to get. |
| 158 | * @param string $medium Medium of the link to get. |
| 159 | */ |
| 160 | public static function the( $id, $medium = '' ) { |
| 161 | echo self::get( $id, $medium ); // phpcs:ignore |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Return the link. |
| 166 | * |
| 167 | * @param string $id Id of the link to get. |
| 168 | * @param string $medium Medium of the link to get. |
| 169 | * @return string |
| 170 | */ |
| 171 | public static function get( $id, $medium = '' ) { |
| 172 | $links = self::get_links(); |
| 173 | $url = isset( $links[ $id ] ) ? $links[ $id ] : '#'; |
| 174 | |
| 175 | if ( empty( $medium ) ) { |
| 176 | return $url; |
| 177 | } |
| 178 | |
| 179 | return add_query_arg( |
| 180 | [ |
| 181 | 'utm_source' => 'Plugin', |
| 182 | 'utm_medium' => rawurlencode( $medium ), |
| 183 | 'utm_campaign' => 'WP', |
| 184 | ], |
| 185 | $url |
| 186 | ); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * Get links. |
| 191 | * |
| 192 | * @return array |
| 193 | */ |
| 194 | public static function get_links() { |
| 195 | return self::$links; |
| 196 | } |
| 197 | } |
| 198 |