get_settings(); $width = \AjaxPress\Templates::get_instance()->is_ajax_request() ? '100%' : '0%'; // Calculate height based on thickness setting $thickness = $settings['progressbar_weight']; if ( 'thin' === $thickness ) { $height = '3px'; } elseif ( 'normal' === $thickness ) { $height = '7px'; } elseif ( 'large' === $thickness ) { $height = '12px'; } elseif ( 'custom' === $thickness ) { $custom_value = ! empty( $settings['progressbar_weight_custom'] ) ? $settings['progressbar_weight_custom'] : '7px'; // Validate custom value (allow px, rem, em, %, vh, vw, etc.) if ( preg_match( '/^-?\d+(\.\d+)?(px|rem|em|%|vh|vw|vmin|vmax|ch|ex)$/i', trim( $custom_value ) ) ) { $height = $custom_value; } else { $height = '7px'; // Fallback to default if invalid } } else { // Fallback for old numeric values $height = $thickness . 'px'; } ?>