Plugin Directory

Changeset 3463104


Ignore:
Timestamp:
02/17/2026 06:15:42 AM (6 weeks ago)
Author:
ansera01
Message:

Release version 1.1.23

Location:
ansera-search
Files:
2 deleted
2 edited
7 copied

Legend:

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

    r3435995 r3463104  
    33 * Plugin Name: Ansera Search
    44 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content.
    5  * Version: 1.1.22
     5 * Version: 1.1.23
    66 * Author: Ansera.AI
    77 * Author URI:  https://www.ansera.ai/
     
    996996                case 'appearance':
    997997               
    998                 $bgs = ['white', 'black'];
     998                $bgs = ['white', 'black', 'white'];
    999999                $selected = get_option('ansera-search-logo');
    10001000               
     
    22822282    if ( metadata_exists( 'post', $post_id, 'ct_builder_json' ) ) return 'oxygen';
    22832283    if ( metadata_exists( 'post', $post_id, '_fl_builder_data' ) ) return 'beaver';
     2284    if ( metadata_exists( 'post', $post_id, '_breakdance_data' ) ) return 'breakdance';
    22842285    $theme = wp_get_theme();
    22852286    if( ($theme->get( 'Name' ) === 'Divi' || $theme->get_template() === 'Divi') && function_exists('do_shortcode')) return 'divi';
    2286 
     2287// wp bakery, brizy, thrive,
     2288    // block based setups like Spectra/GenerateBlocks
    22872289    return 'classic';
    22882290}
     
    23592361            $web_data = do_shortcode( get_post_field( 'post_content', $post->ID ) );
    23602362            break;
     2363        case "breakdance":
     2364            $breakdance_data = get_post_meta($post->ID, '_breakdance_data', true);
     2365            $web_data = "\n\n<!-- Breakdance Content -->\n";
     2366            $web_data .= ansera_parse_breakdance_content($breakdance_data);
     2367            break;
    23612368    }
    23622369    return $web_data;
    23632370}
     2371
     2372function ansera_parse_breakdance_content($raw) {
     2373
     2374    if (!$raw) return '';
     2375
     2376    $level1 = json_decode($raw, true);
     2377    if (empty($level1['tree_json_string'])) return '';
     2378
     2379    $tree = json_decode($level1['tree_json_string'], true);
     2380    if (empty($tree['root'])) return '';
     2381
     2382    $texts = [];
     2383
     2384    ansera_extract_breakdance_text($tree['root'], $texts);
     2385
     2386    // Combine everything
     2387    $content = implode("\n", $texts);
     2388
     2389    // Remove dynamic shortcodes
     2390    $content = preg_replace('/\[breakdance_dynamic.*?\]/', '', $content);
     2391
     2392    // Strip HTML if present
     2393    $content = wp_strip_all_tags($content);
     2394
     2395    return trim($content);
     2396}
     2397
     2398
     2399/**
     2400 * Recursive tree parser
     2401 */
     2402function ansera_extract_breakdance_text($node, &$texts = []) {
     2403
     2404    if (!is_array($node)) {
     2405        return;
     2406    }
     2407
     2408    // 1. Extract normal text
     2409    if (!empty($node['data']['properties']['content']['content']['text'])) {
     2410        $texts[] = $node['data']['properties']['content']['content']['text'];
     2411    }
     2412
     2413    // 2. Extract IconList text
     2414    if (!empty($node['data']['properties']['content']['content']['list'])) {
     2415        foreach ($node['data']['properties']['content']['content']['list'] as $item) {
     2416            if (!empty($item['text'])) {
     2417                $texts[] = $item['text'];
     2418            }
     2419        }
     2420    }
     2421
     2422    // 3. Traverse children
     2423    if (!empty($node['children']) && is_array($node['children'])) {
     2424        foreach ($node['children'] as $child) {
     2425            ansera_extract_breakdance_text($child, $texts);
     2426        }
     2427    }
     2428}
     2429
     2430
    23642431
    23652432function ansera_search_send_post_to_rag($post)
     
    23852452    $url = get_permalink($post_id); // Get full URL
    23862453    $web_data = $post->web_data ?? ''; // Full post content
    2387 
    2388     // giving support to Bricks wordpress
     2454    if(strpos($web_data, "wp:breakdance") > 0 && strlen($web_data)<55)
     2455    {
     2456        $web_data = '';
     2457    }
     2458    // giving support to Bricks and breakdance wordpress
    23892459    if(empty($web_data))
    23902460    {
  • ansera-search/tags/1.1.23/readme.txt

    r3435995 r3463104  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.1.22
     7Stable tag: 1.1.23
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9898
    9999== Changelog ==
     100= 1.1.23 =
     101* Giving support to Breakdance website builder plugin.
     102
    100103= 1.1.22 =
    101104* Enhanced the data sync and also added inline edit feature for the external media to change the title and link.
  • ansera-search/trunk/ansera_search.php

    r3435995 r3463104  
    33 * Plugin Name: Ansera Search
    44 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content.
    5  * Version: 1.1.22
     5 * Version: 1.1.23
    66 * Author: Ansera.AI
    77 * Author URI:  https://www.ansera.ai/
     
    996996                case 'appearance':
    997997               
    998                 $bgs = ['white', 'black'];
     998                $bgs = ['white', 'black', 'white'];
    999999                $selected = get_option('ansera-search-logo');
    10001000               
     
    22822282    if ( metadata_exists( 'post', $post_id, 'ct_builder_json' ) ) return 'oxygen';
    22832283    if ( metadata_exists( 'post', $post_id, '_fl_builder_data' ) ) return 'beaver';
     2284    if ( metadata_exists( 'post', $post_id, '_breakdance_data' ) ) return 'breakdance';
    22842285    $theme = wp_get_theme();
    22852286    if( ($theme->get( 'Name' ) === 'Divi' || $theme->get_template() === 'Divi') && function_exists('do_shortcode')) return 'divi';
    2286 
     2287// wp bakery, brizy, thrive,
     2288    // block based setups like Spectra/GenerateBlocks
    22872289    return 'classic';
    22882290}
     
    23592361            $web_data = do_shortcode( get_post_field( 'post_content', $post->ID ) );
    23602362            break;
     2363        case "breakdance":
     2364            $breakdance_data = get_post_meta($post->ID, '_breakdance_data', true);
     2365            $web_data = "\n\n<!-- Breakdance Content -->\n";
     2366            $web_data .= ansera_parse_breakdance_content($breakdance_data);
     2367            break;
    23612368    }
    23622369    return $web_data;
    23632370}
     2371
     2372function ansera_parse_breakdance_content($raw) {
     2373
     2374    if (!$raw) return '';
     2375
     2376    $level1 = json_decode($raw, true);
     2377    if (empty($level1['tree_json_string'])) return '';
     2378
     2379    $tree = json_decode($level1['tree_json_string'], true);
     2380    if (empty($tree['root'])) return '';
     2381
     2382    $texts = [];
     2383
     2384    ansera_extract_breakdance_text($tree['root'], $texts);
     2385
     2386    // Combine everything
     2387    $content = implode("\n", $texts);
     2388
     2389    // Remove dynamic shortcodes
     2390    $content = preg_replace('/\[breakdance_dynamic.*?\]/', '', $content);
     2391
     2392    // Strip HTML if present
     2393    $content = wp_strip_all_tags($content);
     2394
     2395    return trim($content);
     2396}
     2397
     2398
     2399/**
     2400 * Recursive tree parser
     2401 */
     2402function ansera_extract_breakdance_text($node, &$texts = []) {
     2403
     2404    if (!is_array($node)) {
     2405        return;
     2406    }
     2407
     2408    // 1. Extract normal text
     2409    if (!empty($node['data']['properties']['content']['content']['text'])) {
     2410        $texts[] = $node['data']['properties']['content']['content']['text'];
     2411    }
     2412
     2413    // 2. Extract IconList text
     2414    if (!empty($node['data']['properties']['content']['content']['list'])) {
     2415        foreach ($node['data']['properties']['content']['content']['list'] as $item) {
     2416            if (!empty($item['text'])) {
     2417                $texts[] = $item['text'];
     2418            }
     2419        }
     2420    }
     2421
     2422    // 3. Traverse children
     2423    if (!empty($node['children']) && is_array($node['children'])) {
     2424        foreach ($node['children'] as $child) {
     2425            ansera_extract_breakdance_text($child, $texts);
     2426        }
     2427    }
     2428}
     2429
     2430
    23642431
    23652432function ansera_search_send_post_to_rag($post)
     
    23852452    $url = get_permalink($post_id); // Get full URL
    23862453    $web_data = $post->web_data ?? ''; // Full post content
    2387 
    2388     // giving support to Bricks wordpress
     2454    if(strpos($web_data, "wp:breakdance") > 0 && strlen($web_data)<55)
     2455    {
     2456        $web_data = '';
     2457    }
     2458    // giving support to Bricks and breakdance wordpress
    23892459    if(empty($web_data))
    23902460    {
  • ansera-search/trunk/readme.txt

    r3435995 r3463104  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.1.22
     7Stable tag: 1.1.23
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9898
    9999== Changelog ==
     100= 1.1.23 =
     101* Giving support to Breakdance website builder plugin.
     102
    100103= 1.1.22 =
    101104* Enhanced the data sync and also added inline edit feature for the external media to change the title and link.
Note: See TracChangeset for help on using the changeset viewer.