A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Cannot assign requested address

Filename: mysqli/mysqli_driver.php

Line Number: 201

Backtrace:

File: /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php
Line: 343
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/application/controllers/Api.php
Line: 12
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/index.php
Line: 316
Function: require_once

Database Error

数据库发生错误。

无法使用提供的设置连接到数据库服务器。

Filename: core/MY_Controller.php

Line Number: 343


Fatal error: Uncaught Error: Call to a member function close() on string in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php:349 Stack trace: #0 [internal function]: Index_Controller->__destruct() #1 {main} thrown in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php on line 349
HEX
HEX
Server: Apache/2
System: Linux ns1.websitegang.club 5.4.0-149-generic #166-Ubuntu SMP Tue Apr 18 16:51:45 UTC 2023 x86_64
User: kunchorn (1109)
PHP: 8.2.29
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/kunchorn/public_html/wp-content/plugins/testimonial-free/src/Admin/updates/update-2.2.5.php
<?php
/**
 * Update options for the version 2.2.5
 *
 * @link       https://shapedplugin.com
 *
 * @package    testimonial_free
 * @subpackage testimonial_free/Admin/updates
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

update_option( 'testimonial_version', '2.2.5' );
update_option( 'testimonial_db_version', '2.2.5' );

/**
 * Shortcode query for id.
 */
$args          = new WP_Query(
	array(
		'post_type'      => 'sp_tfree_shortcodes',
		'post_status'    => 'any',
		'posts_per_page' => '300',
	)
);
$shortcode_ids = wp_list_pluck( $args->posts, 'ID' );
if ( count( $shortcode_ids ) > 0 ) {
	foreach ( $shortcode_ids as $shortcode_key => $shortcode_id ) {
		$shortcode_data = get_post_meta( $shortcode_id, 'sp_tpro_shortcode_options', true );

		/**
		 * Responsive columns.
		 */
		$number_of_testimonials               = isset( $shortcode_data['number_of_testimonials'] ) ? $shortcode_data['number_of_testimonials'] : '';
		$number_of_testimonials_desktop       = isset( $shortcode_data['number_of_testimonials_desktop'] ) ? $shortcode_data['number_of_testimonials_desktop'] : '';
		$number_of_testimonials_small_desktop = isset( $shortcode_data['number_of_testimonials_small_desktop'] ) ? $shortcode_data['number_of_testimonials_small_desktop'] : '';
		$number_of_testimonials_tablet        = isset( $shortcode_data['number_of_testimonials_tablet'] ) ? $shortcode_data['number_of_testimonials_tablet'] : '';
		$number_of_testimonials_mobile        = isset( $shortcode_data['number_of_testimonials_mobile'] ) ? $shortcode_data['number_of_testimonials_mobile'] : '';
		$shortcode_data['columns']            = array(
			'large_desktop' => $number_of_testimonials,
			'desktop'       => $number_of_testimonials_desktop,
			'laptop'        => $number_of_testimonials_small_desktop,
			'tablet'        => $number_of_testimonials_tablet,
			'mobile'        => $number_of_testimonials_mobile,
		);
		if ( ! empty( $number_of_testimonials ) ) {
			unset( $shortcode_data['number_of_testimonials'] );
		}
		if ( ! empty( $number_of_testimonials_desktop ) ) {
			unset( $shortcode_data['number_of_testimonials_desktop'] );
		}
		if ( ! empty( $number_of_testimonials_small_desktop ) ) {
			unset( $shortcode_data['number_of_testimonials_small_desktop'] );
		}
		if ( ! empty( $number_of_testimonials_tablet ) ) {
			unset( $shortcode_data['number_of_testimonials_tablet'] );
		}
		if ( ! empty( $number_of_testimonials_mobile ) ) {
			unset( $shortcode_data['number_of_testimonials_mobile'] );
		}

		$navigation_arrow_color              = isset( $shortcode_data['navigation_arrow_color'] ) ? $shortcode_data['navigation_arrow_color'] : '';
		$navigation_hover_arrow_color        = isset( $shortcode_data['navigation_hover_arrow_color'] ) ? $shortcode_data['navigation_hover_arrow_color'] : '';
		$shortcode_data['navigation_color']  = array(
			'color'            => $navigation_arrow_color,
			'hover-color'      => $navigation_hover_arrow_color,
			'background'       => 'transparent',
			'hover-background' => 'transparent',
		);
		$shortcode_data['navigation_border'] = array(
			'all'         => '0',
			'style'       => 'solid',
			'color'       => '#777777',
			'hover-color' => '#1595ce',
		);
		if ( ! empty( $navigation_arrow_color ) ) {
			unset( $shortcode_data['navigation_arrow_color'] );
		}
		if ( ! empty( $navigation_hover_arrow_color ) ) {
			unset( $shortcode_data['navigation_hover_arrow_color'] );
		}

		$pagination_color                    = isset( $shortcode_data['pagination_color'] ) ? $shortcode_data['pagination_color'] : '';
		$pagination_active_color             = isset( $shortcode_data['pagination_active_color'] ) ? $shortcode_data['pagination_active_color'] : '';
		$shortcode_data['pagination_colors'] = array(
			'color'        => $pagination_color,
			'active-color' => $pagination_active_color,
		);
		if ( ! empty( $pagination_color ) ) {
			unset( $shortcode_data['pagination_color'] );
		}
		if ( ! empty( $pagination_active_color ) ) {
			unset( $shortcode_data['pagination_active_color'] );
		}

		$rtl_mode         = isset( $shortcode_data['rtl_mode'] ) ? $shortcode_data['rtl_mode'] : '';
		$slider_direction = 'ltr';
		if ( true == $rtl_mode ) {
			$slider_direction = 'rtl';
		}
		$shortcode_data['slider_direction'] = $slider_direction;
		if ( ! empty( $rtl_mode ) ) {
			unset( $shortcode_data['rtl_mode'] );
		}

		$shortcode_data['image_sizes'] = 'tf-client-image-size';

		update_post_meta( $shortcode_id, 'sp_tpro_shortcode_options', $shortcode_data );
	}
}