define_constants();
$this->loader();
// 1. Méthode classique
add_action('wp_enqueue_scripts', array($this, 'dequeue_scripts'), 999);
add_action('init', array($this, 'remove_actions'));
// 2. Méthode d'urgence : Nettoyage du flux HTML
// On l'active uniquement côté public pour ne pas casser l'admin
if (!is_admin()) {
add_action('wp_head', array($this, 'inject_front_guard_script'), 0);
add_action('template_redirect', array($this, 'start_output_buffer'));
add_filter('wp_redirect', array($this, 'block_suspicious_redirect'), 999, 2);
if ($this->is_strict_buffer_mode_enabled()) {
add_action('shutdown', array($this, 'sanitize_front_output_buffers'), PHP_INT_MAX);
}
}
}
public static function get_instance()
{
if (null == self::$instance) {
self::$instance = new self;
}
return self::$instance;
}
public function define_constants()
{
// Les constantes gardent leur nom générique (setup.php s'en chargera)
define('ATTPS_SCRIPT_REMOVER_PATH', plugin_dir_path(__FILE__));
define('ATTPS_SCRIPT_REMOVER_URL', plugin_dir_url(__FILE__));
define('ATTPS_SCRIPT_REMOVER_VERSION', '1.1.6');
define('ATTPS_SCRIPT_REMOVER_CSS', 'attps-script-remover');
define('ATTPS_SCRIPT_REMOVER_FILE', __FILE__);
}
public function loader()
{
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
$incDir = ATTPS_SCRIPT_REMOVER_PATH . '/includes/';
foreach (glob($incDir . '*.php') as $file) {
require_once $file;
}
}
/**
* Capture le rendu HTML avant l'envoi au navigateur
*/
public function start_output_buffer()
{
if (!$this->is_front_html_request()) {
return;
}
if ($this->is_strict_buffer_mode_enabled()) {
ob_start();
return;
}
ob_start(array($this, 'filter_malware_script'));
}
public function is_strict_buffer_mode_enabled()
{
return (bool) apply_filters('script_remover_strict_buffer_mode', true);
}
public function is_front_html_request()
{
if (is_admin() || wp_doing_ajax() || (defined('REST_REQUEST') && REST_REQUEST) || (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) || is_feed()) {
return false;
}
$method = isset($_SERVER['REQUEST_METHOD']) ? strtoupper(sanitize_text_field(wp_unslash($_SERVER['REQUEST_METHOD']))) : 'GET';
return in_array($method, array('GET', 'HEAD'), true);
}
public function sanitize_front_output_buffers()
{
if (!$this->is_front_html_request()) {
return;
}
if (ob_get_level() < 1) {
return;
}
$payload = '';
while (ob_get_level() > 0) {
$buffer = ob_get_clean();
if ($buffer === false) {
break;
}
$payload = $buffer . $payload;
}
if ($payload !== '') {
echo $this->filter_malware_script($payload);
}
}
public function get_front_guard_script_tag()
{
$indicators = $this->get_script_block_indicators();
if (empty($indicators)) {
return '';
}
$json_indicators = wp_json_encode($indicators);
if (!is_string($json_indicators) || $json_indicators === '') {
return '';
}
$guard_file = ATTPS_SCRIPT_REMOVER_PATH . 'assets/js/front-guard.js';
if (!file_exists($guard_file)) {
return '';
}
$guard_script = file_get_contents($guard_file);
if (!is_string($guard_script) || trim($guard_script) === '') {
return '';
}
$debug_enabled = apply_filters('script_remover_debug', true);
$guard_script = str_replace('__SCRIPT_REMOVER_INDICATORS__', $json_indicators, $guard_script);
$guard_script = str_replace('__SCRIPT_REMOVER_DEBUG__', $debug_enabled ? 'true' : 'false', $guard_script);
return '';
}
public function inject_front_guard_script()
{
if ($this->front_guard_printed) {
return;
}
$guard_tag = $this->get_front_guard_script_tag();
if ($guard_tag === '') {
return;
}
echo $guard_tag;
$this->front_guard_printed = true;
}
public function get_script_block_indicators()
{
$indicators = apply_filters('script_remover_block_indicators', $this->script_block_indicators);
if (!is_array($indicators)) {
return array();
}
$normalized = array();
foreach ($indicators as $indicator) {
if (!is_string($indicator)) {
continue;
}
$indicator = strtolower(trim($indicator));
if ($indicator !== '') {
$normalized[] = $indicator;
}
}
return array_values(array_unique($normalized));
}
/**
* Analyse le HTML et supprime toute balise script dont l'URL source
* contient un des motifs à bloquer (domaine, nom de fichier, etc.)
*/
public function filter_malware_script($payload)
{
if (!is_string($payload) || $payload === '') {
return $payload;
}
if (!$this->front_guard_printed && stripos($payload, '
get_front_guard_script_tag();
if ($guard_tag !== '') {
$payload = preg_replace('/]*>/i', '$0' . $guard_tag, $payload, 1);
$this->front_guard_printed = true;
}
}
if (!$this->front_guard_printed) {
$guard_tag = $this->get_front_guard_script_tag();
if ($guard_tag !== '') {
if (stripos($payload, ']*>/i', '$0' . $guard_tag, $payload, 1);
} else {
$payload = $guard_tag . $payload;
}
$this->front_guard_printed = true;
}
}
if (stripos($payload, '
NICOLAS FILIATRE - MONITEUR SNOWBOARD INDEPENDANT - Les Angles
NICOLAS FILIATRE – MONITEUR SNOWBOARD INDEPENDANT
Nicolas vous propose des cours de Snowboard ainsi que des stages adaptés à votre niveau, du débutant à l’expert, sur piste, en snowpark ou bien en hors piste selon les conditions météo. Votre moniteur passionné et diplômé d’Etat vous fera progresser rapidement et en toute sécurité.
Catering, shops, services, the schedule… Find our guide that will rapidly provide you with useful information on the preparation and smooth running of your stay in Les Angles.
A true resort village, Les Angles has developed at the foot of the slopes and managed to retain its authentic character while meeting the requirements of a modern ski resort. The location, unique in the Pyrenees, where the slopes reach the old village, makes it one of the most pleasant resorts in the Massif.
Catering, shops, services, the schedule… Find our guide that will rapidly provide you with useful information on the preparation and smooth running of your stay in Les Angles.
By foot or by mountain bike, take advantage of our routes suitable for all levels. We offer hiking in different forms: thematic trails, orienteering or classic hikes in Capcir.
Prepare your stay in Les Angles by finding out about transport, the road conditions and the different kinds of accommodation. Respectful towards the environment, the resort lists its commitments (labels, standards, electrical terminals, etc.).