????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
?????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
???????????????????????????????????????
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
PNG
\x49\x44\x41\x54?\x89\x50
\x4E\x47\x0D\x0A\x1A\x0A
JFIF ?? C
!"$"$?? C
?? p
" ??
?? ?
????
(% aA*?XYD?(J??E RE,P XYae?)(E 2 B R BQ X?)X ? @
adadasdasdasasdasdas
.....................................................................................................................................??????????????????????
??? ???????????????????????????????????????...............................
JFIF ?? C
!"$"$?? C
?? p
" ??
?? ?
????
(% aA*?XYD?(J??E RE,P XYae?)(E 2 B R BQ X?)X ? @
adadasdasdasasdasdas
..................................................................................................................................... ????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
?????????????????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
????????????????????????????????????????
???????????????????????????????????????
PNG
\x49\x44\x41\x54?\x89\x50
\x4E\x47\x0D\x0A\x1A\x0A
JFIF ?? C
!"$"$?? C
?? p
" ??
?? ?
????
(% aA*?XYD?(J??E RE,P XYae?)(E 2 B R BQ X?)X ? @
adadasdasdasasdasdas
.....................................................................................................................................??????????????????????
??? ???????????????????????????????????????...............................
JFIF ?? C
!"$"$?? C
?? p
" ??
?? ?
????
(% aA*?XYD?(J??E RE,P XYae?)(E 2 B R BQ X?)X ? @
adadasdasdasasdasdas
.....................................................................................................................................????????????????????????????????
???????????????????????????????
???????????????????????????????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
Warning: Undefined variable $auth in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 695
Warning: Trying to access array offset on value of type null in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 695
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 332
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 333
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 334
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 335
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 336
Warning: Cannot modify header information - headers already sent by (output started at /home/blacotuu/deliciouskenya.com/d94fc6/index.php:1) in /home/blacotuu/deliciouskenya.com/d94fc6/index.php on line 337
ai-functions.php 0000644 00000034264 15207577252 0007701 0 ustar 00 shortcodes[$pl_tag])){
// Create attribute Object
$innerHTML = pagelayer_isset($pagelayer->shortcodes[$pl_tag], 'innerHTML');
if(!empty($innerHTML) && isset($block['attrs'][$innerHTML])){
$block['innerHTML'] = $block['attrs'][$innerHTML];
$block['innerContent'] = array($block['attrs'][$innerHTML]);
}
}
}
// This have innerBlocks
if(!empty($block['innerBlocks']) && is_array($block['innerBlocks'])){
foreach($block['innerBlocks'] as $key => $inner_block){
$block['innerBlocks'][$key] = pagelayer_pro_add_atts_block($inner_block, $new_atts);
}
}
return $block;
}
// Add tmp attribute to block code
function pagelayer_pro_extract_editable_atts($content){
$blocks = parse_blocks( $content );
$el_atts = array();
foreach( $blocks as $block ){
$block_name = $block['blockName'];
// Is pagelayer block
if( is_string( $block_name ) && 0 === strpos( $block_name, 'pagelayer/' ) ){
pagelayer_pro_parse_ai_atts($block, $el_atts);
}
}
return array_filter($el_atts);
}
function pagelayer_pro_parse_ai_atts($block, &$el_atts){
global $pagelayer;
// Load shortcode
pagelayer_load_shortcodes();
// TODO: if empty then assign id and updated content
if(empty($block['attrs']['pagelayer-id'])){
return;
}
// If block saved by Pagelayer Editor
if(in_array( $block['blockName'], ['pagelayer/pl_inner_col', 'pagelayer/pl_inner_row'])){
$block['blockName'] = str_replace('inner_', '', $block['blockName']);
}
$tag = substr( $block['blockName'], 10 );
$pl_tag = str_replace('-', '_', $tag);
if(isset($pagelayer->shortcodes[$pl_tag])){
// Create attribute Object
$pl_props = $pagelayer->shortcodes[$pl_tag];
$pl_id = $block['attrs']['pagelayer-id'];
$el_atts[$pl_id] = array();
foreach($pagelayer->tabs as $tab){
if(empty($pl_props[$tab])){
continue;
}
foreach($pl_props[$tab] as $section => $_props){
$props = !empty($pl_props[$section]) ? $pl_props[$section] : $pagelayer->styles[$section];
if(empty($props)){
continue;
}
// Reset / Create the cache
foreach($props as $prop => $param){
// No value set
if(empty($block['attrs'][$prop]) || (isset($param['ai']) && $param['ai'] === false)){
continue;
}
$has_attrs = false;
// is editable?
if(!empty($param['edit'])){
$el_atts[$pl_id][$prop] = $block['attrs'][$prop];
$has_attrs = true;
}
// is editable?
if(!empty($param['type']) && $param['type'] == 'image'){
$el_atts[$pl_id]['img_urls'][] = $block['attrs'][$prop];
}
// is editable?
if(!empty($param['type']) && $param['type'] == 'multi_image'){
$el_atts[$pl_id]['img_urls'][] = $block['attrs'][$prop];
}
if($has_attrs){
$el_atts[$pl_id]['blockName'] = $pl_props['name'];
}
}
}
}
}
// This have innerBlocks
if(!empty($block['innerBlocks'])){
foreach($block['innerBlocks'] as $key => $inner_block){
pagelayer_pro_parse_ai_atts($inner_block, $el_atts);
}
}
}
// Call to AI server
function pagelayer_pro_ai_prompt_run($ai_data = array()){
global $pagelayer;
if(empty($pagelayer->license) || empty($pagelayer->license['license'])){
return null;
}
// Only SoftWP license works
$ai_data['license'] = $pagelayer->license['license'];
$ai_data['url'] = site_url();
$response = wp_remote_post(PAGELAYER_AI_API, [
'body' => $ai_data,
'timeout' => 600,
]);
$body = wp_remote_retrieve_body($response);
$result = json_decode($body, true);
// pagelayer_print($result);
if(isset($result['error'])){
// TODO: show this error error if possible
error_log('API Request Failed: ' . $result['error']);
return null;
}
if(isset($result['response'])){
$json_content = $result['response'];
// Remove markdown code fences if they exist
if(strpos($json_content, '```') !== false){
$json_content = preg_replace('/^```(?:json)?\s*/', '', trim($json_content));
$json_content = preg_replace('/\s*```$/', '', $json_content);
}
$generated = json_decode($json_content, true);
if (json_last_error() === JSON_ERROR_NONE) {
return $generated;
} else {
error_log("JSON decode error: " . json_last_error_msg());
return null;
}
}
return null;
}
// The actual function to import the theme
function pagelayer_pro_generate_ai_contents($content, $args = array()){
if(empty($args['description'])){
return $content;
}
if(defined('PAGELAYER_BLOCK_PREFIX') && PAGELAYER_BLOCK_PREFIX == 'wp'){
$content = str_replace('