PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.6.8
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.6.8
3.8.0 3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 All 112 releases
← All changes | includes/Core/Importer/Runners/Finalizer.php +13 -16 3.7.3 → 3.6.8 View file →
@@ -4,10 +4,10 @@
4 4
5 5
6 6 use Exception;
7 7 use Templately\Core\Importer\Utils\AIContentHelper;
8 -use Templately\Core\Importer\Utils\AIContentResolver;
9 8 use Templately\Core\Importer\Utils\Utils;
9 +use Templately\Core\Importer\Utils\AIUtils;
10 10 use Templately\Utils\Helper;
11 11
12 12 class Finalizer extends BaseRunner {
13 13 use AIContentHelper;
@@ -273,25 +273,22 @@
273 273 $processed_pages = get_option("templately_ai_processed_pages", []);
274 274 $updated_ids = $processed_pages[$this->process_id] ?? [];
275 275 $ai_paths = $this->generateAiFilePaths($old_template_id);
276 276 if($this->is_ai_content($old_template_id) && !file_exists($ai_paths['ai_file_path'])){
277 - // Source-agnostic seam: whichever AI-content source owns this
278 - // process (classic per-page callback, chat-id pull, or a future
279 - // source) stages the .ai.json; otherwise the shared SSE-wait runs.
280 - AIContentResolver::ensure_page_ready([
281 - 'session_id' => $this->session_id,
282 - 'process_id' => $this->process_id,
283 - 'content_id' => $old_template_id,
284 - 'ai_page_ids' => $this->ai_page_ids,
285 - 'updated_ids' => $updated_ids,
286 - 'sse_callback' => [$this, 'sse_message'],
287 - 'progress_id' => 'ai_content_time',
288 - 'additional_sse_data' => [
289 - 'name' => method_exists($this, 'get_name') ? $this->get_name() : '',
277 + // Use the static timeout-aware wait handler from AIUtils
278 + AIUtils::handle_sse_wait_with_timeout(
279 + $this->session_id,
280 + 'ai_content_time',
281 + $updated_ids,
282 + $this->ai_page_ids,
283 + [$this, 'sse_message'],
284 + [
285 + 'name' => method_exists($this, 'get_name') ? $this->get_name() : '',
290 286 'post_type' => $post_type,
291 - 'id' => $old_template_id,
287 + 'id' => $old_template_id,
292 288 ],
293 - ]);
289 + $old_template_id // Pass template ID for local site polling
290 + );
294 291 }
295 292 // Check if this is AI content before processing
296 293 if ($this->isAiContent($old_template_id)) {
297 294 // Process AI content using AIContentHelper trait