Plugin Directory

Changeset 3360532


Ignore:
Timestamp:
09/12/2025 12:45:23 PM (7 months ago)
Author:
ansera01
Message:

Prepare trunk for version 1.1.5

Location:
ansera-search/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ansera-search/trunk/ansera_search.php

    r3349746 r3360532  
    33 * Plugin Name: Ansera Search
    44 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content.
    5  * Version: 1.1.4
     5 * Version: 1.1.5
    66 * Author: Ansera.AI
    77 * Author URI:  https://www.ansera.ai/
     
    2626add_action('admin_enqueue_scripts', 'ansera_search_enqueue_admin_assets');
    2727register_activation_hook(__FILE__, "ansera_search_registration");
     28register_deactivation_hook(__FILE__, 'ansera_search_on_uninstall');
    2829add_filter('wp_nav_menu_items', 'ansera_search_add_to_menu', 10, 2);
    2930add_action('wp_ajax_ansera_search_likedislike_request', 'ansera_search_likedislike_request');
     
    9293}
    9394
    94 
    95 
     95function ansera_search_on_uninstall()
     96{
     97    ansera_search_send_status('uninstalled');
     98}
    9699
    97100const ANSERA_SEARCH_SYNC_COUNT = 'ansera_search_sync_count';
     
    18771880}
    18781881
     1882function ansera_search_send_status($status)
     1883{
     1884    try {
     1885        $option_name = "ansera_search_api_key";
     1886        $token = get_option($option_name);
     1887        if (!$token) {
     1888            throw new Exception("No Token Found!!!");
     1889        }
     1890        $headers = [
     1891            'Content-Type' => 'application/json',
     1892            'DOMAIN-TOKEN' => $token,
     1893        ];
     1894
     1895       
     1896        $url = esc_url(get_option("ansera_search_host_url") . "/api/domain-status");
     1897        $postParameter = ["status" => $status];
     1898   
     1899   
     1900        $response = wp_remote_post( $url, array(
     1901            'body' => wp_json_encode($postParameter),
     1902            'headers' => $headers,
     1903            'timeout' => 15,
     1904        ) );
     1905    }
     1906    catch(Exception $e)
     1907    {
     1908
     1909    }
     1910}
    18791911
    18801912function ansera_search_register_token()
     
    19111943            );
    19121944        }
     1945    }
     1946    else {
     1947        ansera_search_send_status('installed');
    19131948    }
    19141949}
     
    26272662        "page_id" => $post_id,
    26282663    ];
    2629     $json = json_encode($json_array);
     2664    $json = ($json_array);
    26302665   
    26312666    $response = ansera_search_send_synchronous_request(esc_url(get_option("ansera_search_host_url") . "/api/web-content"),$json,$url,$post_id);
  • ansera-search/trunk/readme.txt

    r3349746 r3360532  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.1.4
     7Stable tag: 1.1.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9393
    9494== Changelog ==
     95= 1.1.5 =
     96* Fixed DataSync issue bug
     97
    9598= 1.1.4 =
    9699* Added support for external documents syncing (Google Drive or Direct File URLs)
Note: See TracChangeset for help on using the changeset viewer.