| Server IP : 77.50.203.18 / Your IP : 192.168.0.10 Web Server : Apache/2.4.62 (CentOS Stream) OpenSSL/3.5.7 mpm-itk/2.4.7-04 PHP/8.4.23 System : Linux web2 5.14.0-722.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 6 09:07:51 UTC 2026 x86_64 User : warsnews.ru ( 1001) PHP Version : 8.4.23 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ifwar.ru/www/wp-content/plugins/clever-fox/inc/convo/default-pages/ |
Upload File : |
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$cleverfox_file = CLEVERFOX_PLUGIN_URL .'inc/convo/images/logo.png';
$cleverfox_ImagePath = CLEVERFOX_PLUGIN_URL .'inc/convo/images';
$cleverfox_images = array(
$cleverfox_ImagePath. '/logo.png',
);
$cleverfox_parent_post_id = null;
foreach($cleverfox_images as $cleverfox_name) {
$cleverfox_filename = basename($cleverfox_name);
$cleverfox_remote_content = wp_remote_get($cleverfox_name);
if (!is_wp_error($cleverfox_remote_content) && $cleverfox_remote_content['response']['code'] === 200) {
$cleverfox_upload_file = wp_upload_bits($cleverfox_filename, null, $cleverfox_remote_content['body']);
if (!$cleverfox_upload_file['error']) {
$cleverfox_wp_filetype = wp_check_filetype($cleverfox_filename, null );
$cleverfox_attachment = array(
'post_mime_type' => $cleverfox_wp_filetype['type'],
'post_parent' => $cleverfox_parent_post_id,
'post_title' => preg_replace('/\.[^.]+$/', '', $cleverfox_filename),
'post_excerpt' => 'convo caption',
'post_status' => 'inherit'
);
$cleverfox_ImageId[] = $cleverfox_attachment_id = wp_insert_attachment($cleverfox_attachment, $cleverfox_upload_file['file'], $cleverfox_parent_post_id );
if (!is_wp_error($cleverfox_attachment_id)) {
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
$cleverfox_attachment_data = wp_generate_attachment_metadata($cleverfox_attachment_id, $cleverfox_upload_file['file']);
wp_update_attachment_metadata($cleverfox_attachment_id, $cleverfox_attachment_data);
}
}
}
}
update_option( 'conceptly_media_id', $cleverfox_ImageId );
?>