HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprotonperinggit/wp-content/plugins/wp-cardealer/templates/misc/user-dashboard.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}


$query_vars = array(
	'post_type'     => 'listing',
	'post_status'   => 'publish',
	'author'        => $user_id,
	'fields'		=> 'ids',
	'posts_per_page' => -1
);
$listings = new WP_Query($query_vars);
$count_listings = $listings->post_count;

$favorite = WP_CarDealer_Favorite::get_listing_favorites();
$favorite = is_array($favorite) ? count($favorite) : 0;

?>

<div class="user-dashboard-wrapper">
	<h1 class="title"><?php esc_html_e('Dashboard', 'wp-cardealer'); ?></h1>
	<div class="statistics row">
		<div class="col-sm-6">
			<div class="posted-listings">
				<div class="listings-count"><?php echo WP_CarDealer_Mixes::format_number($count_listings); ?></div>
				<h4><?php esc_html_e('Posted Listings', 'wp-cardealer'); ?></h4>
			</div>
		</div>
		<div class="col-sm-6">
			<div class="favorite">
				<div class="listings-count"><?php echo WP_CarDealer_Mixes::format_number($favorite); ?></div>
				<h4><?php esc_html_e('Favorites', 'wp-cardealer'); ?></h4>
			</div>
		</div>
	</div>
	<div class="recent-wrapper row">
		<div class="col-sm-8">
			<!-- recent review -->
			<?php
			$post_ids = array();

			if ( !empty($listings->posts) ) {
				$post_ids = $listings->posts;
			}
			$number = apply_filters('wp-cardealer-dashboard-number-reviews', 3);
			$args = array(
				'post_type' => array('listing'),
				'status' => 'approve',
				'number'  => $number,
				'meta_query' => array(
			        array(
			           'key' => '_rating_avg',
			           'value' => 0,
			           'compare' => '>',
			        )
			    )
			);
			$comments = null;
			if ( !empty($post_ids) ) {
				$comments = WP_CarDealer_Review::get_comments( $args, $post_ids );
			}
			?>

			<div class="user-reviews">
				<?php
				if ( $comments ) {
					
					echo '<ul class="list-reviews">';
						wp_list_comments(array(
							'per_page' => $number,
							'page' => 1,
							'reverse_top_level' => false,
							'callback' => array('WP_CarDealer_Review', 'user_reviews')
						), $comments);
					echo '</ul>';
				} else { ?>
					<div class="not-found"><?php esc_html_e('No reviews found.', 'wp-cardealer'); ?></div>
				<?php } ?>

			</div>
		</div>
		<div class="col-sm-4">
			<!-- recent message -->
		</div>
	</div>
</div>