PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.9.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.9.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 1.0.1 1.0.2 All 50 releases
← All changes | includes/class-autoloader.php +30 -28 1.0.12.9.0 View file →
@@ -118,13 +118,17 @@
118 118 // Convert to lowercase and add class- prefix for WordPress convention
119 119 $parts = explode(DIRECTORY_SEPARATOR, $file_path);
120 120 $class_name = array_pop($parts);
121 121
122 - // Handle special cases for known acronyms/brands
122 + // Handle special cases where the generic CamelCase→kebab conversion
123 + // splits a brand/compound word (e.g. PageSpeed → page-speed) or an
124 + // acronym differently than the actual file name on disk.
123 125 $special_cases = [
124 126 'OpenAI_Client' => 'openai-client',
125 127 'Claude_Client' => 'claude-client',
126 128 'Gemini_Client' => 'gemini-client',
129 + 'OpenRouter_Client' => 'openrouter-client',
130 + 'Google_PageSpeed_Client' => 'google-pagespeed-client',
127 131 'Analytics_Endpoint' => 'analytics-endpoint',
128 132 'SEO_Manager' => 'seo-manager',
129 133 'SEO_Plugin_Detector' => 'seo-plugin-detector',
130 134 'SEO_Notice' => 'seo-notice',
@@ -130,13 +134,18 @@
130 134 'SEO_Notice' => 'seo-notice',
131 135 'LLMs_Txt_Endpoint' => 'llms-txt-endpoint',
132 136 'LLMs_Txt_Manager' => 'llms-txt-manager',
133 137 'Prompt_Builder' => 'prompt-builder',
134 - 'SEO_Prompts' => 'prompts/seo-prompts',
135 - 'Site_Identity_Prompts' => 'prompts/site-identity-prompts',
136 - 'Homepage_Prompts' => 'prompts/homepage-prompts',
137 - 'LLMs_Txt_Prompts' => 'prompts/llms-txt-prompts',
138 - 'Content_Brief_Prompts' => 'prompts/content-brief-prompts',
138 + 'SEO_Prompts' => 'seo-prompts',
139 + 'Site_Identity_Prompts' => 'site-identity-prompts',
140 + 'Homepage_Prompts' => 'homepage-prompts',
141 + 'LLMs_Txt_Prompts' => 'llms-txt-prompts',
142 + 'Content_Brief_Prompts' => 'content-brief-prompts',
143 + 'SEOPress_Exporter' => 'seopress-exporter',
144 + 'AIOSEO_Exporter' => 'aioseo-exporter',
145 + 'Squirrly_Exporter' => 'squirrly-exporter',
146 + 'Mcp_OAuth' => 'mcp-oauth',
147 + 'Google_OAuth_Proxy' => 'google-oauth-proxy',
139 148 ];
140 149
141 150 if (isset($special_cases[$class_name])) {
142 151 $class_file = 'class-' . $special_cases[$class_name] . '.php';
@@ -147,12 +156,24 @@
147 156 $class_name = preg_replace('/([a-z])([A-Z])/', '$1-$2', $class_name);
148 157 $class_file = 'class-' . strtolower(str_replace('_', '-', $class_name)) . '.php';
149 158 }
150 159
151 - // Build full path
152 - $directory = !empty($parts) ? strtolower(implode(DIRECTORY_SEPARATOR, $parts)) . DIRECTORY_SEPARATOR : '';
160 + // Build full path. Namespace segments with underscores map to
161 + // hyphenated directories (Email_Report_Sections → email-report-sections).
162 + $directory = !empty($parts) ? strtolower(str_replace('_', '-', implode(DIRECTORY_SEPARATOR, $parts))) . DIRECTORY_SEPARATOR : '';
153 163
154 - return $this->base_dir . $directory . $class_file;
164 + $file = $this->base_dir . $directory . $class_file;
165 +
166 + // Interfaces may use the WordPress interface- file prefix instead of class-
167 + // (e.g. Email_Report_Section_Interface → interface-email-report-section.php).
168 + if (!file_exists($file) && str_ends_with($class_file, '-interface.php')) {
169 + $interface_file = $this->base_dir . $directory . 'interface-' . substr($class_file, strlen('class-'), -strlen('-interface.php')) . '.php';
170 + if (file_exists($interface_file)) {
171 + return $interface_file;
172 + }
173 + }
174 +
175 + return $file;
155 176 }
156 177
157 178 /**
158 179 * Preload critical classes for performance
@@ -162,9 +183,8 @@
162 183 public static function preload_critical_classes(): void {
163 184 $critical_classes = [
164 185 'ThinkRank\\Core\\Database',
165 186 'ThinkRank\\Core\\Settings',
166 - 'ThinkRank\\Core\\Cache',
167 187 'ThinkRank\\API\\Manager',
168 188 'ThinkRank\\Admin\\Manager',
169 189 ];
170 190
@@ -173,24 +193,6 @@
173 193 $autoloader = new self();
174 194 $autoloader->load_class($class);
175 195 }
176 196 }
177 - }
178 -
179 - /**
180 - * Get loaded classes count for debugging
181 - *
182 - * @return int
183 - */
184 - public static function get_loaded_classes_count(): int {
185 - return count(self::$class_map);
186 - }
187 -
188 - /**
189 - * Get class map for debugging
190 - *
191 - * @return array
192 - */
193 - public static function get_class_map(): array {
194 - return self::$class_map;
195 197 }
196 198 }