PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.12.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.12.0
2.14.3 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 All 58 releases
← All changes | includes/admin/importers/class-abstract-plugin-exporter.php +42 -11 1.29.0 → 2.12.0 View file →
@@ -152,8 +152,26 @@
152 152 return [];
153 153 }
154 154
155 155 /**
156 + * Records for a data type outside the fixed set above.
157 + *
158 + * Nothing to hand over by default. It exists so an exporter can gain a type
159 + * (ThinkRank's own export lets Pro register its tables this way) without
160 + * every subclass having to reimplement export_chunk()'s chunk writing and
161 + * manifest bookkeeping.
162 + *
163 + * @since 2.2.0
164 + *
165 + * @param string $type Data type
166 + * @param int $page Page number (1-indexed)
167 + * @return array Records
168 + */
169 + protected function export_custom_type_page(string $type, int $page): array {
170 + return [];
171 + }
172 +
173 + /**
156 174 * Capture the source plugin's Role Manager assignments: role slug => the
157 175 * capabilities that role holds whose name starts with $prefix.
158 176 *
159 177 * Shared by every exporter because role capabilities live on the roles
@@ -209,9 +227,9 @@
209 227 * @param mixed $value Value potentially containing template variables
210 228 * @param int|null $post_id Post ID for context-specific variables
211 229 * @return string Converted string
212 230 */
213 - abstract protected function convert_template_variables(mixed $value, ?int $post_id = null): string;
231 + abstract protected function convert_template_variables($value, ?int $post_id = null): string;
214 232
215 233 /**
216 234 * Coerce a foreign settings/meta value into a template string.
217 235 *
@@ -223,9 +241,9 @@
223 241 *
224 242 * @param mixed $value Raw value from the source plugin's storage.
225 243 * @return string Usable template string, possibly ''.
226 244 */
227 - final protected function stringify_template_value(mixed $value): string {
245 + final protected function stringify_template_value($value): string {
228 246 if (is_string($value)) {
229 247 return $value;
230 248 }
231 249
@@ -251,17 +269,30 @@
251 269 // Reset before the page method runs; it (or its id helper) records the
252 270 // raw fetched-row count here.
253 271 $this->last_page_row_count = null;
254 272
255 - $records = match ($type) {
256 - 'postmeta' => $this->export_postmeta_page($page),
257 - 'termmeta' => $this->export_termmeta_page($page),
258 - 'usermeta' => $this->export_usermeta_page($page),
259 - 'settings' => $this->export_settings(),
260 - 'redirections' => $this->export_redirections_page($page),
261 - '404_logs' => $this->export_404_logs_page($page),
262 - default => [],
263 - };
273 + switch ($type) {
274 + case 'postmeta':
275 + $records = $this->export_postmeta_page($page);
276 + break;
277 + case 'termmeta':
278 + $records = $this->export_termmeta_page($page);
279 + break;
280 + case 'usermeta':
281 + $records = $this->export_usermeta_page($page);
282 + break;
283 + case 'settings':
284 + $records = $this->export_settings();
285 + break;
286 + case 'redirections':
287 + $records = $this->export_redirections_page($page);
288 + break;
289 + case '404_logs':
290 + $records = $this->export_404_logs_page($page);
291 + break;
292 + default:
293 + $records = $this->export_custom_type_page($type, $page);
294 + }
264 295
265 296 $exported_count = count($records);
266 297
267 298 // Write chunk to snapshot store