Plugin Directory

Changeset 3331685


Ignore:
Timestamp:
07/21/2025 07:00:31 PM (8 months ago)
Author:
ansera01
Message:

Release version 1.1.2

Location:
ansera-search
Files:
2 edited
10 copied

Legend:

Unmodified
Added
Removed
  • ansera-search/tags/1.1.2/ansera_search.php

    r3331599 r3331685  
    33 * Plugin Name: Ansera Search
    44 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content.
    5  * Version: 1.1.1
     5 * Version: 1.1.2
    66 * Author: Ansera.AI
    77 * Author URI:  https://www.ansera.ai/
     
    6464add_action('ansera_search_sync_single_video_parallel', 'ansera_search_sync_single_video_parallel');
    6565add_action('ansera_search_check_sync_completion', 'ansera_search_check_sync_completion');
     66
     67define('ANSERA_SEARCH_PLUGIN_DB_VERSION','1.1');
     68
     69add_action('plugins_loaded', 'ansera_search_update_db_check');
     70
     71function ansera_search_update_db_check() {
     72    $installed_version = get_option('ansera_search_plugin_db_version');
     73    if (!$installed_version) {
     74        $installed_version = '0.0';
     75    }
     76
     77    if ($installed_version != ANSERA_SEARCH_PLUGIN_DB_VERSION) {
     78        ansera_search_run_db_updates($installed_version);
     79        update_option('ansera_search_plugin_db_version', ANSERA_SEARCH_PLUGIN_DB_VERSION);
     80    }
     81}
     82
     83function ansera_search_run_db_updates($installed_version) {
     84    if (version_compare($installed_version, '1.1', '<')) {
     85        ansera_search_create_video_links_table();
     86    }
     87}
     88
     89
     90
    6691
    6792const ANSERA_SEARCH_SYNC_COUNT = 'ansera_search_sync_count';
     
    18601885    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    18611886    dbDelta($sql);
     1887
     1888
     1889    $post_sync_table = $wpdb->prefix . 'ansera_search_post_sync_status';
     1890    $column_type = $wpdb->get_var($wpdb->prepare( "SHOW COLUMNS FROM $post_sync_table LIKE %s", 'synced_status' ), 1);
     1891
     1892    // Check if 'pending' is NOT in the ENUM definition
     1893    if ( strpos( $column_type, "'pending'" ) === false ) {
     1894        // Modify the ENUM to include 'pending'
     1895        $update_sql = "
     1896            ALTER TABLE $post_sync_table
     1897            MODIFY synced_status ENUM('synced', 'modified', 'new', 'error', 'unsynced', 'unsyncpending', 'pending')
     1898            DEFAULT 'new'
     1899        ";
     1900        $wpdb->query( $update_sql );
     1901    }
    18621902   
    18631903}
  • ansera-search/tags/1.1.2/readme.txt

    r3331599 r3331685  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • ansera-search/trunk/ansera_search.php

    r3331599 r3331685  
    33 * Plugin Name: Ansera Search
    44 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content.
    5  * Version: 1.1.1
     5 * Version: 1.1.2
    66 * Author: Ansera.AI
    77 * Author URI:  https://www.ansera.ai/
     
    6464add_action('ansera_search_sync_single_video_parallel', 'ansera_search_sync_single_video_parallel');
    6565add_action('ansera_search_check_sync_completion', 'ansera_search_check_sync_completion');
     66
     67define('ANSERA_SEARCH_PLUGIN_DB_VERSION','1.1');
     68
     69add_action('plugins_loaded', 'ansera_search_update_db_check');
     70
     71function ansera_search_update_db_check() {
     72    $installed_version = get_option('ansera_search_plugin_db_version');
     73    if (!$installed_version) {
     74        $installed_version = '0.0';
     75    }
     76
     77    if ($installed_version != ANSERA_SEARCH_PLUGIN_DB_VERSION) {
     78        ansera_search_run_db_updates($installed_version);
     79        update_option('ansera_search_plugin_db_version', ANSERA_SEARCH_PLUGIN_DB_VERSION);
     80    }
     81}
     82
     83function ansera_search_run_db_updates($installed_version) {
     84    if (version_compare($installed_version, '1.1', '<')) {
     85        ansera_search_create_video_links_table();
     86    }
     87}
     88
     89
     90
    6691
    6792const ANSERA_SEARCH_SYNC_COUNT = 'ansera_search_sync_count';
     
    18601885    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    18611886    dbDelta($sql);
     1887
     1888
     1889    $post_sync_table = $wpdb->prefix . 'ansera_search_post_sync_status';
     1890    $column_type = $wpdb->get_var($wpdb->prepare( "SHOW COLUMNS FROM $post_sync_table LIKE %s", 'synced_status' ), 1);
     1891
     1892    // Check if 'pending' is NOT in the ENUM definition
     1893    if ( strpos( $column_type, "'pending'" ) === false ) {
     1894        // Modify the ENUM to include 'pending'
     1895        $update_sql = "
     1896            ALTER TABLE $post_sync_table
     1897            MODIFY synced_status ENUM('synced', 'modified', 'new', 'error', 'unsynced', 'unsyncpending', 'pending')
     1898            DEFAULT 'new'
     1899        ";
     1900        $wpdb->query( $update_sql );
     1901    }
    18621902   
    18631903}
  • ansera-search/trunk/readme.txt

    r3331599 r3331685  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    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.