Changeset 3463104
- Timestamp:
- 02/17/2026 06:15:42 AM (6 weeks ago)
- Location:
- ansera-search
- Files:
-
- 2 deleted
- 2 edited
- 7 copied
-
tags/1.1.23 (copied) (copied from ansera-search/trunk)
-
tags/1.1.23/ansera_search.php (copied) (copied from ansera-search/trunk/ansera_search.php) (5 diffs)
-
tags/1.1.23/css/ansera_search_admin_settings.css (copied) (copied from ansera-search/trunk/css/ansera_search_admin_settings.css)
-
tags/1.1.23/embed.js (deleted)
-
tags/1.1.23/includes/action-scheduler (deleted)
-
tags/1.1.23/includes/ansera_search_utils.php (copied) (copied from ansera-search/trunk/includes/ansera_search_utils.php)
-
tags/1.1.23/js/ansera_search_admin.js (copied) (copied from ansera-search/trunk/js/ansera_search_admin.js)
-
tags/1.1.23/js/ansera_search_admin_settings.js (copied) (copied from ansera-search/trunk/js/ansera_search_admin_settings.js)
-
tags/1.1.23/readme.txt (copied) (copied from ansera-search/trunk/readme.txt) (2 diffs)
-
trunk/ansera_search.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ansera-search/tags/1.1.23/ansera_search.php
r3435995 r3463104 3 3 * Plugin Name: Ansera Search 4 4 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content. 5 * Version: 1.1.2 25 * Version: 1.1.23 6 6 * Author: Ansera.AI 7 7 * Author URI: https://www.ansera.ai/ … … 996 996 case 'appearance': 997 997 998 $bgs = ['white', 'black' ];998 $bgs = ['white', 'black', 'white']; 999 999 $selected = get_option('ansera-search-logo'); 1000 1000 … … 2282 2282 if ( metadata_exists( 'post', $post_id, 'ct_builder_json' ) ) return 'oxygen'; 2283 2283 if ( metadata_exists( 'post', $post_id, '_fl_builder_data' ) ) return 'beaver'; 2284 if ( metadata_exists( 'post', $post_id, '_breakdance_data' ) ) return 'breakdance'; 2284 2285 $theme = wp_get_theme(); 2285 2286 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 2287 2289 return 'classic'; 2288 2290 } … … 2359 2361 $web_data = do_shortcode( get_post_field( 'post_content', $post->ID ) ); 2360 2362 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; 2361 2368 } 2362 2369 return $web_data; 2363 2370 } 2371 2372 function 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 */ 2402 function 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 2364 2431 2365 2432 function ansera_search_send_post_to_rag($post) … … 2385 2452 $url = get_permalink($post_id); // Get full URL 2386 2453 $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 2389 2459 if(empty($web_data)) 2390 2460 { -
ansera-search/tags/1.1.23/readme.txt
r3435995 r3463104 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.2 7 Stable tag: 1.1.2 27 Stable tag: 1.1.23 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 98 98 99 99 == Changelog == 100 = 1.1.23 = 101 * Giving support to Breakdance website builder plugin. 102 100 103 = 1.1.22 = 101 104 * 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 3 3 * Plugin Name: Ansera Search 4 4 * Description: Ansera AI-powered search plugin provides answers based on your existing Wordpress content. 5 * Version: 1.1.2 25 * Version: 1.1.23 6 6 * Author: Ansera.AI 7 7 * Author URI: https://www.ansera.ai/ … … 996 996 case 'appearance': 997 997 998 $bgs = ['white', 'black' ];998 $bgs = ['white', 'black', 'white']; 999 999 $selected = get_option('ansera-search-logo'); 1000 1000 … … 2282 2282 if ( metadata_exists( 'post', $post_id, 'ct_builder_json' ) ) return 'oxygen'; 2283 2283 if ( metadata_exists( 'post', $post_id, '_fl_builder_data' ) ) return 'beaver'; 2284 if ( metadata_exists( 'post', $post_id, '_breakdance_data' ) ) return 'breakdance'; 2284 2285 $theme = wp_get_theme(); 2285 2286 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 2287 2289 return 'classic'; 2288 2290 } … … 2359 2361 $web_data = do_shortcode( get_post_field( 'post_content', $post->ID ) ); 2360 2362 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; 2361 2368 } 2362 2369 return $web_data; 2363 2370 } 2371 2372 function 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 */ 2402 function 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 2364 2431 2365 2432 function ansera_search_send_post_to_rag($post) … … 2385 2452 $url = get_permalink($post_id); // Get full URL 2386 2453 $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 2389 2459 if(empty($web_data)) 2390 2460 { -
ansera-search/trunk/readme.txt
r3435995 r3463104 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.2 7 Stable tag: 1.1.2 27 Stable tag: 1.1.23 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 98 98 99 99 == Changelog == 100 = 1.1.23 = 101 * Giving support to Breakdance website builder plugin. 102 100 103 = 1.1.22 = 101 104 * 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.