PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 6.3.6
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v6.3.6
8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 8.5.6 8.5.5 8.5.4 8.5.3 All 534 releases
← All changes | includes/openai/admin/data_post_converter.php +106 -107 8.7.46.3.6 View file →
@@ -1,107 +1,106 @@
1 -<?php
2 -if (!defined('ABSPATH')) exit; // Exit if accessed directly
3 -global $wpchatbot_pro_professional_init,$wpchatbot_pro_master_init;
4 -if((isset($wpchatbot_pro_master_init) && $wpchatbot_pro_master_init->is_valid()) || (isset($wpchatbot_pro_professional_init) && $wpchatbot_pro_professional_init->is_valid()) || (function_exists('get_openaiaddon_valid_license') && get_openaiaddon_valid_license())){
5 -?>
6 - <div class="row">
7 - <div class="col-md-12">
8 - <div class="alert alert-danger my-4">
9 - <?php esc_html_e('This feature is still experimental and development is ongoing because of the difficulties in cleaning up the multitudes of tags added by page builders','chatbot'); ?>
10 - </div>
11 - <form class="file_form my-4">
12 - <div id="wp-chatbot-post-converter">
13 - <ul class="checkbox-list">
14 - <?php
15 - $get_cpt_args = array(
16 - 'public' => true,
17 - );
18 - $post_types = get_post_types( $get_cpt_args, 'object' );
19 - foreach ($post_types as $post_type) {
20 - if($post_type->name != "attachment"){
21 - ?>
22 - <div class="form-check form-check-inline">
23 - <input
24 - id="wp_chatbot_data_converter_<?php echo esc_attr( $post_type->name ); ?>"
25 - type="checkbox"
26 - name="wp_chatbot_data_converter_list[]"
27 - value="<?php echo esc_attr( $post_type->name ); ?>" >
28 - <label class="form-check-label" for="wp_chatbot_data_converter_<?php echo esc_attr( $post_type->name ); ?>"> <?php echo esc_attr( $post_type->name ); ?></label>
29 - </div>
30 - <?php
31 - }
32 - }
33 - ?>
34 - </ul>
35 - </div>
36 - <a class="btn btn-default qcld_convert_data"><?php esc_html_e('Convert Data','chatbot'); ?></a>
37 - </form>
38 - <h3><?php esc_html_e('Conversions Files','chatbot'); ?></h3>
39 -
40 - <?php
41 -
42 - global $wpdb;
43 -
44 - $qcld_openai_files_page = isset($_GET['wpage']) && !empty($_GET['wpage']) ? sanitize_text_field(wp_unslash($_GET['wpage'])) : 1;
45 -
46 - $qcld_openai_files_per_page = 20;
47 -
48 - $qcld_openai_files_offset = ( $qcld_openai_files_page * $qcld_openai_files_per_page ) - $qcld_openai_files_per_page;
49 -
50 - $qcld_openai_files_count_sql = $wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb->posts." f WHERE f.post_type='qcldopenai_convert' AND f.post_status='publish'"); //DB: Nothing to pass as PREPARED STATEMENTS ARGUMENT
51 -
52 - $qcld_openai_files_sql = $wpdb->prepare("SELECT f.* FROM ".$wpdb->posts." f WHERE f.post_type='qcldopenai_convert' AND f.post_status='publish' ORDER BY f.post_date DESC LIMIT %d, %d", $qcld_openai_files_offset, $qcld_openai_files_per_page);
53 -
54 - $qcld_openai_files = $wpdb->get_results( $qcld_openai_files_sql ); //DB Call OK, No Caching OK
55 -
56 - $qcld_openai_files_total = $wpdb->get_var( $qcld_openai_files_count_sql ); //DB Call OK, No Caching OK
57 -
58 - ?>
59 -
60 - <div class="table-responsive">
61 - <table class="table table-striped table-bordered qcld_convert_datatable">
62 - <thead><tr><td><?php esc_html_e( 'Filename','chatbot');?></td><td><?php esc_html_e( 'Fine tune with','chatbot');?></td><td><?php esc_html_e( 'Date of creation','chatbot');?></td><td><?php esc_html_e( 'Size','chatbot');?></td><td> <?php esc_html_e( 'Action','chatbot');?></td></tr></thead>
63 - <tbody id="post_conversion_files">
64 - <?php
65 - if($qcld_openai_files && is_array($qcld_openai_files) && count($qcld_openai_files)):
66 - foreach($qcld_openai_files as $qcld_openai_file):
67 - $file = wp_upload_dir()['basedir'].'/qcldopenai_site_training/'.$qcld_openai_file->post_title;
68 - if(file_exists($file)):
69 - $type = explode('_',$qcld_openai_file->post_title);
70 - $type = (sizeof($type) == 2) ? 'GPT3.5' : 'Davinci, ADA etc.';
71 - ?>
72 - <tr>
73 - <td><?php echo esc_html($qcld_openai_file->post_title);?></td>
74 - <td><?php echo esc_html($type);?></td>
75 - <td><?php echo esc_html( date('d.m.Y H:i',strtotime($qcld_openai_file->post_date)) );?></td>
76 - <td><?php echo esc_html( date('d.m.Y H:i',strtotime($qcld_openai_file->post_modified)) );?></td>
77 - <td><?php echo esc_html( size_format(filesize($file)) );?></td>
78 - <td>
79 - <a class="button button-small" href="<?php echo esc_url( wp_upload_dir()['baseurl'].'/qcldopenai_site_training/'.esc_html($qcld_openai_file->post_title) )?>" download><?php esc_html_e('Download','chatbot'); ?></a>
80 - <a class="button button-small qcld_delete_training_file" data-file="<?php echo esc_url( wp_upload_dir()['basedir'].'/qcldopenai_site_training/'.esc_html($qcld_openai_file->post_title) )?>" ><?php esc_html_e('Delete','chatbot'); ?></a>
81 - <button class="button button-small qcld_convert_upload" data-lines="<?php echo count(file($file))?>" data-file="<?php echo esc_html($qcld_openai_file->post_title)?>"><?php esc_html_e('Upload As FT Model','chatbot'); ?></button>
82 - </td>
83 - </tr>
84 - <?php
85 - endif;
86 - endforeach;
87 - endif;
88 - ?>
89 - </tbody>
90 - </table>
91 - </div>
92 - </div>
93 - </div>
94 -<?php
95 - } else { ?>
96 -<div class="row my-4">
97 - <div class="col-md-12">
98 - <?php esc_html_e('Fine tuning and training is available with the ','chatbot');?>
99 - <a href="https://www.wpbot.pro/pricing/"><?php esc_html_e('WPBot Pro Professional','chatbot'); ?></a>
100 - <?php esc_html_e(' and ','chatbot'); ?>
101 - <a href="https://www.wpbot.pro/pricing/"><?php esc_html_e('Master','chatbot'); ?></a>
102 - <?php esc_html_e(' Licenses','chatbot'); ?>
103 -
104 - </div>
105 -</div>
106 -<?php } ?>
107 -
1 +<?php
2 +global $wpchatbot_pro_professional_init,$wpchatbot_pro_master_init;
3 +if((isset($wpchatbot_pro_master_init) && $wpchatbot_pro_master_init->is_valid()) || (isset($wpchatbot_pro_professional_init) && $wpchatbot_pro_professional_init->is_valid()) || (function_exists('get_openaiaddon_valid_license') && get_openaiaddon_valid_license())){
4 +?>
5 + <div class="row">
6 + <div class="col-md-12">
7 + <div class="alert alert-danger my-4">
8 + <?php esc_html_e('This feature is still experimental and development is ongoing because of the difficulties in cleaning up the multitudes of tags added by page builders'); ?>
9 + </div>
10 + <form class="file_form my-4">
11 + <div id="wp-chatbot-post-converter">
12 + <ul class="checkbox-list">
13 + <?php
14 + $get_cpt_args = array(
15 + 'public' => true,
16 + );
17 + $post_types = get_post_types( $get_cpt_args, 'object' );
18 + foreach ($post_types as $post_type) {
19 + if($post_type->name != "attachment"){
20 + ?>
21 + <div class="form-check form-check-inline">
22 + <input
23 + id="wp_chatbot_data_converter_<?php echo esc_attr( $post_type->name ); ?>"
24 + type="checkbox"
25 + name="wp_chatbot_data_converter_list[]"
26 + value="<?php echo esc_attr( $post_type->name ); ?>" >
27 + <label class="form-check-label" for="wp_chatbot_data_converter_<?php echo esc_attr( $post_type->name ); ?>"> <?php echo esc_attr( $post_type->name ); ?></label>
28 + </div>
29 + <?php
30 + }
31 + }
32 + ?>
33 + </ul>
34 + </div>
35 + <a class="btn btn-default qcld_convert_data"><?php esc_html_e('Convert Data'); ?></a>
36 + </form>
37 + <h3><?php esc_html_e('Conversions Files'); ?></h3>
38 +
39 + <?php
40 +
41 + global $wpdb;
42 +
43 + $qcld_openai_files_page = isset($_GET['wpage']) && !empty($_GET['wpage']) ? sanitize_text_field($_GET['wpage']) : 1;
44 +
45 + $qcld_openai_files_per_page = 20;
46 +
47 + $qcld_openai_files_offset = ( $qcld_openai_files_page * $qcld_openai_files_per_page ) - $qcld_openai_files_per_page;
48 +
49 + $qcld_openai_files_count_sql = $wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb->posts." f WHERE f.post_type='qcldopenai_convert' AND f.post_status='publish'"); //DB: Nothing to pass as PREPARED STATEMENTS ARGUMENT
50 +
51 + $qcld_openai_files_sql = $wpdb->prepare("SELECT f.* FROM ".$wpdb->posts." f WHERE f.post_type='qcldopenai_convert' AND f.post_status='publish' ORDER BY f.post_date DESC LIMIT %d, %d", $qcld_openai_files_offset, $qcld_openai_files_per_page);
52 +
53 + $qcld_openai_files = $wpdb->get_results( $qcld_openai_files_sql ); //DB Call OK, No Caching OK
54 +
55 + $qcld_openai_files_total = $wpdb->get_var( $qcld_openai_files_count_sql ); //DB Call OK, No Caching OK
56 +
57 + ?>
58 +
59 + <div class="table-responsive">
60 + <table class="table table-striped table-bordered qcld_convert_datatable">
61 + <thead><tr><td><?php esc_html_e( 'Filename','openai_addon');?></td><td><?php esc_html_e( 'Fine tune with','openai_addon');?></td><td><?php esc_html_e( 'Date of creation','openai_addon');?></td><td><?php esc_html_e( 'Size','openai_addon');?></td><td> <?php esc_html_e( 'Action','openai_addon');?></td></tr></thead>
62 + <tbody id="post_conversion_files">
63 + <?php
64 + if($qcld_openai_files && is_array($qcld_openai_files) && count($qcld_openai_files)):
65 + foreach($qcld_openai_files as $qcld_openai_file):
66 + $file = wp_upload_dir()['basedir'].'/qcldopenai_site_training/'.$qcld_openai_file->post_title;
67 + if(file_exists($file)):
68 + $type = explode('_',$qcld_openai_file->post_title);
69 + $type = (sizeof($type) == 2) ? 'GPT3.5' : 'Davinci, ADA etc.';
70 + ?>
71 + <tr>
72 + <td><?php echo esc_html($qcld_openai_file->post_title);?></td>
73 + <td><?php echo esc_html($type);?></td>
74 + <td><?php echo esc_html( date('d.m.Y H:i',strtotime($qcld_openai_file->post_date)) );?></td>
75 + <td><?php echo esc_html( date('d.m.Y H:i',strtotime($qcld_openai_file->post_modified)) );?></td>
76 + <td><?php echo esc_html( size_format(filesize($file)) );?></td>
77 + <td>
78 + <a class="button button-small" href="<?php echo esc_url( wp_upload_dir()['baseurl'].'/qcldopenai_site_training/'.esc_html($qcld_openai_file->post_title) )?>" download><?php esc_html_e('Download'); ?></a>
79 + <a class="button button-small qcld_delete_training_file" data-file="<?php echo esc_url( wp_upload_dir()['basedir'].'/qcldopenai_site_training/'.esc_html($qcld_openai_file->post_title) )?>" ><?php esc_html_e('Delete'); ?></a>
80 + <button class="button button-small qcld_convert_upload" data-lines="<?php echo count(file($file))?>" data-file="<?php echo esc_html($qcld_openai_file->post_title)?>"><?php esc_html_e('Upload As FT Model'); ?></button>
81 + </td>
82 + </tr>
83 + <?php
84 + endif;
85 + endforeach;
86 + endif;
87 + ?>
88 + </tbody>
89 + </table>
90 + </div>
91 + </div>
92 + </div>
93 +<?php
94 + } else { ?>
95 +<div class="row my-4">
96 + <div class="col-md-12">
97 + <?php esc_html_e('Fine tuning and training is available with the ');?>
98 + <a href="https://www.wpbot.pro/pricing/"><?php esc_html_e('WPBot Pro Professional'); ?></a>
99 + <?php esc_html_e(' and '); ?>
100 + <a href="https://www.wpbot.pro/pricing/"><?php esc_html_e('Master'); ?></a>
101 + <?php esc_html_e(' Licenses'); ?>
102 +
103 + </div>
104 +</div>
105 +<?php } ?>
106 +