PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.8.2
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.8.2
8.8.2 8.8.1 8.8.0 8.7.9 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 All 538 releases
← All changes | inc/qcld-floating-openai-style-filter.php +10 -3 8.7.2 → 8.8.2 View file →
@@ -1,7 +1,8 @@
1 1 <?php
2 2 defined('ABSPATH') or die("You can't access this file directly.");
3 3
4 +// phpcs:disable WordPress.WP.AlternativeFunctions.curl_curl_init, WordPress.WP.AlternativeFunctions.curl_curl_setopt, WordPress.WP.AlternativeFunctions.curl_curl_exec, WordPress.WP.AlternativeFunctions.curl_curl_errno, WordPress.WP.AlternativeFunctions.curl_curl_error, WordPress.WP.AlternativeFunctions.curl_curl_close -- Legacy OpenAI HTTP calls in this module.
4 5
5 6 add_filter('qc_wpbotpro_floating_openai_filter_for_style', 'qc_wpbotpro_floating_help_openai_filter_for_style', 10, 2);
6 7 if ( ! function_exists( 'qc_wpbotpro_floating_help_openai_filter_for_style' ) ) {
7 8 function qc_wpbotpro_floating_help_openai_filter_for_style($qcld_writing_style, $qcld_language){
@@ -5673,11 +5674,16 @@
5673 5674 $uploaddir = wp_upload_dir();
5674 5675 $target_file_name = $uploaddir['path'] . '/' . $filename;
5675 5676
5676 5677 $contents = file_get_contents( $imgresult );
5677 - $savefile = fopen($target_file_name, 'w');
5678 - fwrite($savefile, $contents);
5679 - fclose($savefile);
5678 + global $wp_filesystem;
5679 + if ( empty( $wp_filesystem ) ) {
5680 + require_once ABSPATH . 'wp-admin/includes/file.php';
5681 + WP_Filesystem();
5682 + }
5683 + if ( $wp_filesystem ) {
5684 + $wp_filesystem->put_contents( $target_file_name, $contents, FS_CHMOD_FILE );
5685 + }
5680 5686
5681 5687 /* add the image title */
5682 5688 $image_title = ucwords( $uniq_name );
5683 5689
@@ -5723,5 +5729,6 @@
5723 5729
5724 5730 return $imgresult;
5725 5731
5726 5732 }
5733 +// phpcs:enable WordPress.WP.AlternativeFunctions.curl_curl_init, WordPress.WP.AlternativeFunctions.curl_curl_setopt, WordPress.WP.AlternativeFunctions.curl_curl_exec, WordPress.WP.AlternativeFunctions.curl_curl_errno, WordPress.WP.AlternativeFunctions.curl_curl_error, WordPress.WP.AlternativeFunctions.curl_curl_close
5727 5734 }