Plugin Directory

Changeset 3433173


Ignore:
Timestamp:
01/06/2026 02:43:13 AM (7 weeks ago)
Author:
homio13
Message:

Update to version 3.0.17

Location:
calliope/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • calliope/trunk/calliope.php

    r3432031 r3433173  
    44Plugin URI: https://wordpress.org/plugins/calliope/
    55Description: WordPress AI Contents Generator - Automatically generate high-quality content using AI technology
    6 Version: 3.0.16
     6Version: 3.0.17
    77Author: homio13
    88Author URI: https://profiles.wordpress.org/homio13/
  • calliope/trunk/readme-es.txt

    r3432031 r3433173  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 3.0.16
     7Stable tag: 3.0.17
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    128128== Changelog ==
    129129
     130= 3.0.17 =
     131* 🔧 **Corrección de Errores**: Mejorado el programador para usar nombres de hooks únicos por feed para prevenir conflictos de eventos cron al procesar múltiples feeds simultáneamente
     132
    130133= 3.0.16 =
    131134* 🔧 **Corrección de Errores**: Solucionado el problema donde los artículos no se generaban correctamente al ejecutar el programador de generación automática con múltiples feeds
  • calliope/trunk/readme-ja.txt

    r3432031 r3433173  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 3.0.16
     7Stable tag: 3.0.17
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    128128== Changelog ==
    129129
     130= 3.0.17 =
     131* 🔧 **バグ修正**: 複数フィードの同時処理時のcronイベント競合を防ぐため、フィードごとにユニークなフック名を使用するようスケジューラを改善
     132
    130133= 3.0.16 =
    131134* 🔧 **バグ修正**: 複数のフィードで自動生成スケジューラを実行した際に記事が正しく生成されない問題を修正
  • calliope/trunk/readme.txt

    r3432031 r3433173  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 3.0.16
     7Stable tag: 3.0.17
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    128128== Changelog ==
    129129
     130= 3.0.17 =
     131* 🔧 **Bug Fix**: Improved scheduler to use unique hook names per feed to prevent cron event conflicts when processing multiple feeds simultaneously
     132
    130133= 3.0.16 =
    131134* 🔧 **Bug Fix**: Fixed issue where articles were not generated correctly when running automatic generation scheduler with multiple feeds
  • calliope/trunk/src/Scheduler/Scheduler.php

    r3432031 r3433173  
    2727    function __construct($_is_test_exec = false)
    2828    {
    29         $this->add_single_action('cron_generate_related_keyword');
    30         $this->add_single_action('cron_generate_article');
    31         $this->add_single_action('cron_generate_post');
     29        // スケジュール済みのcronイベントに対応する動的アクションを登録
     30        $this->register_dynamic_actions();
     31
    3232        $this->is_test_exec = $_is_test_exec;
    3333    }
     
    358358    function add_single_event($action_name, $time, $args)
    359359    {
    360         $args = json_encode($args);
    361         // 引数のハッシュ値を使って微小な時間差を作る(複数フィードが同時処理される際の重複を回避)
    362         $unique_offset = abs(crc32($args)) % 60;
    363         $schedule_time = time() + $time + $unique_offset;
    364 
    365         wp_schedule_single_event($schedule_time, $this->get_cron_slug($action_name), [$args]);
     360        $uid = $args['uid'];
     361        $args_json = json_encode($args);
     362        $schedule_time = time() + $time;
     363
     364        // フック名にuidを付与してユニークにする(複数フィードの同時処理での競合を回避)
     365        $unique_hook = $this->get_cron_slug($action_name) . '_' . $uid;
     366
     367        // 現在のリクエストでイベントが実行される場合に備えて、アクションを登録
     368        add_action($unique_hook, [$this, $action_name]);
     369
     370        wp_schedule_single_event($schedule_time, $unique_hook, [$args_json]);
    366371    }
    367372
     
    403408    }
    404409
    405     ///// actionを登録する
    406     function add_single_action($action_name)
    407     {
    408         add_action($this->get_cron_slug($action_name), [$this, $action_name]);
     410    ///// スケジュール済みのcronイベントに対応するアクションを動的に登録する
     411    function register_dynamic_actions()
     412    {
     413        $crons = _get_cron_array();
     414        if (empty($crons)) {
     415            return;
     416        }
     417
     418        // 対象となるベースアクション名
     419        $base_actions = [
     420            'cron_generate_related_keyword',
     421            'cron_generate_article',
     422            'cron_generate_post'
     423        ];
     424
     425        foreach ($crons as $timestamp => $hooks) {
     426            foreach ($hooks as $hook => $events) {
     427                // calliope_cron_scheduler_XXX_YYY 形式のフックを探す
     428                foreach ($base_actions as $base_action) {
     429                    $base_hook = $this->get_cron_slug($base_action);
     430                    // フック名がベースフック名で始まり、かつベースフック名より長い場合(uid付き)
     431                    if (strpos($hook, $base_hook . '_') === 0) {
     432                        add_action($hook, [$this, $base_action]);
     433                    }
     434                }
     435            }
     436        }
    409437    }
    410438}
Note: See TracChangeset for help on using the changeset viewer.