HEX
Server: LiteSpeed
System: Linux server.zepintelhosting.com 4.18.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: enamadmin (1026)
PHP: 8.2.30
Disabled: exec,system,passthru,shell_exec,proc_open,popen,apache_child_terminate
Upload Files
File: /home/enamadmin/public_html/wp-content/plugins/learnpress-course-review/templates/rating-stars.php
<?php
/**
 * Template for displaying rating stars.
 *
 * This template can be overridden by copying it to yourtheme/learnpress/addons/course-review/rating-stars.php.
 *
 * @author  ThimPress
 * @package LearnPress/Course-Review/Templates
 * version  3.0.8
 */

// Prevent loading this file directly
defined( 'ABSPATH' ) || exit;

if ( ! isset( $rated ) ) {
	return;
}

$percent = min( 100, $rated * 20 );
$title   = sprintf( __( '%s out of 5 stars', 'learnpress-course-review' ), $rated );
LP_Addon_Course_Review_Preload::$addon->check_load_file_style();
?>
<div class="review-stars-rated" title="<?php echo esc_attr( $title ); ?>">
	<?php
	for ( $i = 1; $i <= 5; $i ++ ) {
		$p = ( $i * 20 );
		$r = max( $p <= $percent ? 100 : ( $percent - ( $i - 1 ) * 20 ) * 5, 0 );
		?>
		<div class="review-star">
			<em class="far lp-review-svg-star">
				<?php echo LP_Addon_Course_Review::get_svg_star() ?>
			</em>
			<em class="fas lp-review-svg-star" style="width:<?php echo $r; ?>%;">
				<?php echo LP_Addon_Course_Review::get_svg_star() ?>
			</em>
		</div>
	<?php } ?>
</div>