Plugin Directory

Changeset 3414135


Ignore:
Timestamp:
12/08/2025 10:47:28 AM (4 months ago)
Author:
enkic
Message:

v2.3.12

Location:
ai-builder
Files:
4 edited
48 copied

Legend:

Unmodified
Added
Removed
  • ai-builder/tags/2.3.12/aibui-builder.php

    r3414105 r3414135  
    44 * Plugin URI:        https://website-ai-builder.com/
    55 * Description: This plugin is used to build your website with AI.
    6  * Version: 2.3.11
     6 * Version: 2.3.12
    77 * Author: enkic
    88 * Author URI:        https://enkicorbin.fr/
     
    1818
    1919// Définir la version du plugin
    20 define('AIBUI_VERSION', '2.3.11');
     20define('AIBUI_VERSION', '2.3.12');
    2121
    2222// Simple CSS minifier (safe whitespace/comment removal)
     
    11221122
    11231123// -------------------------------
     1124// Increase timeouts for REST API requests (especially for slower servers)
     1125// -------------------------------
     1126/**
     1127 * Increase HTTP request timeout for WordPress REST API calls
     1128 * This helps prevent 500 errors on slower servers
     1129 */
     1130add_filter('http_request_timeout', function($timeout) {
     1131    // Increase timeout to 120 seconds (2 minutes) for REST API requests
     1132    // This is especially important for /wp/v2/settings and other REST endpoints
     1133    if (defined('REST_REQUEST') && REST_REQUEST) {
     1134        return 120;
     1135    }
     1136    return $timeout;
     1137}, 10, 1);
     1138
     1139/**
     1140 * Increase PHP execution time limit for REST API requests
     1141 * This prevents PHP timeout errors (500) on slower servers
     1142 */
     1143add_action('rest_api_init', function() {
     1144    // Increase PHP execution time limit to 120 seconds for REST API requests
     1145    @set_time_limit(120);
     1146}, 1);
     1147
     1148// -------------------------------
    11241149// Multi-Page Generator: Cleanup cron and migration
    11251150// -------------------------------
  • ai-builder/tags/2.3.12/assets/js/multi-page.js

    r3414077 r3414135  
    437437        // Get JWT token with timeout
    438438        const controller = new AbortController();
    439         timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
     439        timeoutId = setTimeout(() => controller.abort(), 20000); // 10 second timeout
    440440
    441441        const tokenResponse = await fetch(ajaxurl, {
  • ai-builder/tags/2.3.12/includes/class-ajax-handler.php

    r3414077 r3414135  
    101101        // Increase timeout for this request (in case DB is slow)
    102102        // Default is usually 30s, but some hosts have shorter limits
    103         @set_time_limit(60); // Allow up to 60 seconds
     103        @set_time_limit(120); // Allow up to 120 seconds (2 minutes) for slower servers
    104104       
    105105        // Vérifier que les données POST existent
     
    585585    public function get_generation()
    586586    {
     587        // Increase timeout for file operations on slower servers
     588        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     589       
    587590        if (!isset($_POST['nonce']) || !isset($_POST['id'])) {
    588591            wp_send_json_error('Missing required data');
     
    610613    public function mark_generation_applied()
    611614    {
     615        // Increase timeout for file operations on slower servers
     616        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     617       
    612618        if (!isset($_POST['nonce']) || !isset($_POST['id'])) {
    613619            wp_send_json_error('Missing required data');
     
    695701    public function mark_ai_created()
    696702    {
     703        // Increase timeout for database operations on slower servers
     704        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     705       
    697706        // Vérifier que les données POST existent
    698707        if (!isset($_POST['nonce']) || !isset($_POST['post_id'])) {
  • ai-builder/tags/2.3.12/readme.txt

    r3414105 r3414135  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.3.11
     7Stable tag: 2.3.12
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • ai-builder/trunk/aibui-builder.php

    r3414105 r3414135  
    44 * Plugin URI:        https://website-ai-builder.com/
    55 * Description: This plugin is used to build your website with AI.
    6  * Version: 2.3.11
     6 * Version: 2.3.12
    77 * Author: enkic
    88 * Author URI:        https://enkicorbin.fr/
     
    1818
    1919// Définir la version du plugin
    20 define('AIBUI_VERSION', '2.3.11');
     20define('AIBUI_VERSION', '2.3.12');
    2121
    2222// Simple CSS minifier (safe whitespace/comment removal)
     
    11221122
    11231123// -------------------------------
     1124// Increase timeouts for REST API requests (especially for slower servers)
     1125// -------------------------------
     1126/**
     1127 * Increase HTTP request timeout for WordPress REST API calls
     1128 * This helps prevent 500 errors on slower servers
     1129 */
     1130add_filter('http_request_timeout', function($timeout) {
     1131    // Increase timeout to 120 seconds (2 minutes) for REST API requests
     1132    // This is especially important for /wp/v2/settings and other REST endpoints
     1133    if (defined('REST_REQUEST') && REST_REQUEST) {
     1134        return 120;
     1135    }
     1136    return $timeout;
     1137}, 10, 1);
     1138
     1139/**
     1140 * Increase PHP execution time limit for REST API requests
     1141 * This prevents PHP timeout errors (500) on slower servers
     1142 */
     1143add_action('rest_api_init', function() {
     1144    // Increase PHP execution time limit to 120 seconds for REST API requests
     1145    @set_time_limit(120);
     1146}, 1);
     1147
     1148// -------------------------------
    11241149// Multi-Page Generator: Cleanup cron and migration
    11251150// -------------------------------
  • ai-builder/trunk/assets/js/multi-page.js

    r3414077 r3414135  
    437437        // Get JWT token with timeout
    438438        const controller = new AbortController();
    439         timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
     439        timeoutId = setTimeout(() => controller.abort(), 20000); // 10 second timeout
    440440
    441441        const tokenResponse = await fetch(ajaxurl, {
  • ai-builder/trunk/includes/class-ajax-handler.php

    r3414077 r3414135  
    101101        // Increase timeout for this request (in case DB is slow)
    102102        // Default is usually 30s, but some hosts have shorter limits
    103         @set_time_limit(60); // Allow up to 60 seconds
     103        @set_time_limit(120); // Allow up to 120 seconds (2 minutes) for slower servers
    104104       
    105105        // Vérifier que les données POST existent
     
    585585    public function get_generation()
    586586    {
     587        // Increase timeout for file operations on slower servers
     588        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     589       
    587590        if (!isset($_POST['nonce']) || !isset($_POST['id'])) {
    588591            wp_send_json_error('Missing required data');
     
    610613    public function mark_generation_applied()
    611614    {
     615        // Increase timeout for file operations on slower servers
     616        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     617       
    612618        if (!isset($_POST['nonce']) || !isset($_POST['id'])) {
    613619            wp_send_json_error('Missing required data');
     
    695701    public function mark_ai_created()
    696702    {
     703        // Increase timeout for database operations on slower servers
     704        @set_time_limit(120); // Allow up to 120 seconds (2 minutes)
     705       
    697706        // Vérifier que les données POST existent
    698707        if (!isset($_POST['nonce']) || !isset($_POST['post_id'])) {
  • ai-builder/trunk/readme.txt

    r3414105 r3414135  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 2.3.11
     7Stable tag: 2.3.12
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.