<?php
/**
 * ReadJutsu — server-side render for the readjutsu/progress-bar block.
 */

defined( 'ABSPATH' ) or exit;

// Editor preview: render a visual placeholder only.
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
	return;
}

if ( ! get_option( 'readjutsu_activate' ) || ! get_option( 'readjutsu_progress_activate', true ) ) {
	return;
}

if ( ! class_exists( '\ReadJutsu\Frontend' ) ) {
	require_once READJUTSU_PLUGIN_PATH . 'includes/class-readjutsu-frontend.php';
}

( new \ReadJutsu\Frontend() )->trigger_progress_bar_once();
