run(); add_action('after_setup_theme', [$this, 'after_setup_theme']); add_action('plugins_loaded', [$this, 'plugins_loaded']); add_action('init', [$this, 'init']); } function run() { // } /** * Centralized security check for all tools in init(). * - Ensures only administrators can access. * - Verifies nonce on POST requests, but ONLY when an adminz_* GET param * is active — so regular WP POST requests (Media, AJAX...) are not affected. * * Each form in a tool must include: wp_nonce_field('adminz_tool') */ function check_security() { // 1. Role check if (!current_user_can('administrator')) { return false; } // 2. CSRF check: only when this is an adminz tool request $is_adminz_tool = !empty(array_filter( array_keys($_GET ?? []), fn($k) => str_starts_with($k, 'adminz_') )); if ($is_adminz_tool && $_SERVER['REQUEST_METHOD'] === 'POST') { $nonce = $_POST['_wpnonce'] ?? ''; if (!wp_verify_nonce($nonce, 'adminz_tool')) { wp_die('Security check failed. Invalid or expired nonce.', 403); } } return true; } function after_setup_theme() { // if (current_user_can('administrator')) { if (($_GET['adminz_test_hooks'] ?? '') == 'flatsome') { $hooks = require_once(ADMINZ_DIR . "includes/file/flatsome_hooks.php"); foreach ($hooks as $hook) { add_action($hook, function () use ($hook) { echo do_shortcode('[adminz_test content="' . $hook . '"]'); }); } } } } function plugins_loaded() { // if (current_user_can('administrator')) { if (($_GET['adminz_test_hooks'] ?? '') == 'woocommerce') { $hooks = require_once(ADMINZ_DIR . "includes/file/woocommerce_hooks.php"); foreach ($hooks as $hook) { add_action($hook, function () use ($hook) { echo do_shortcode('[adminz_test content="' . $hook . '"]'); }); } } } } function init() { if (!$this->check_security()) { return; } // ========================= SERVER TOOLS ========================= // if ($_GET['adminz_server_tool'] ?? '') { switch ($_GET['adminz_server_tool']) { case 'serverinfo': echo "
| Key | Value |
|---|---|
| PHP Version | " . phpversion() . " |
| Server Software | " . $_SERVER['SERVER_SOFTWARE'] . " |
| Operating System | " . php_uname() . " |
| Server IP | " . $_SERVER['SERVER_ADDR'] . " |
| Client IP | " . $_SERVER['REMOTE_ADDR'] . " |
| MySQL Version | " . mysqli_get_server_info($link) . " |
| MySQL Version | Unable to connect to MySQL |
| MySQL Version | MySQL constants not defined |
| PHP Memory Limit | " . ini_get('memory_limit') . " |
| PHP Max Execution Time | " . ini_get('max_execution_time') . " seconds |
| PHP Upload Max Filesize | " . ini_get('upload_max_filesize') . " |
| PHP Post Max Size | " . ini_get('post_max_size') . " |
| Server Uptime | {$uptime} |
| Server Uptime | Unable to retrieve uptime |
| Server Uptime | shell_exec not enabled |
| WordPress Root Directory | " . ABSPATH . " |
| WordPress Content Directory | " . WP_CONTENT_DIR . " |
| WordPress Version | " . get_bloginfo('version') . " |
| Thông số | Giá trị | Đánh giá (1-10) |
|---|---|---|
| PHP Execution Speed | {$execution_time} seconds | " . round($phpScore) . " |
| Disk I/O Speed | Write: {$write_time}s | Read: {$read_time}s | " . round($diskScore) . " |
| MySQL Query Speed | {$query_time} seconds | " . round($mysqlScore) . " |
| Network Latency | {$network_time} seconds | " . round($networkScore) . " |
| Extension |
|---|
| {$extension} |
| Key | Value |
|---|---|
| {$key} | " . print_r($value, true) . " |
| Key | Value |
|---|---|
| {$key} | " . print_r($value, true) . " |
| Key | Value |
|---|---|
| {$key} | " . print_r($value, true) . " |
| Key | Value |
|---|---|
| {$key} | " . print_r($value, true) . " |
| Key | Value |
|---|---|
| {$key} | " . print_r($value, true) . " |
| Key | Value |
|---|---|
| MySQL Version | " . mysqli_get_server_info($link) . " |
| Variable Name | Value |
|---|---|
| {$row['Variable_name']} | {$row['Value']} |
| Key | Value | Unit | Analysis |
|---|---|---|---|
| Memory Usage | {$memoryUsage} | bytes | "; echo "" . round($memoryUsage / 1024, 2) . " KB / " . round($memoryUsage / (1024 * 1024), 2) . " MB |
| Peak Memory Usage | {$peakMemoryUsage} | bytes | "; echo "" . round($peakMemoryUsage / 1024, 2) . " KB / " . round($peakMemoryUsage / (1024 * 1024), 2) . " MB |
| Execution Time | {$executionTime} | seconds | "; echo "" . round($executionTime * 1000, 2) . " milliseconds |
| Key | Value |
|---|---|
| Connection to WordPress API | " . ($response !== false ? 'Success' : 'Failed') . " |
https://www.thegioididong.com/game-app/huong-dan-tao-bot-telegram-don-gian-ai-cung-co-the-thuc-hien-1395501
------------------------------
Create new bot with @botfather
Testadminzbot
1801547325:GAEDhT5bFLfCjKec8istwkKaOa4Pl7R0ZQE
------------------------------
Get your chat ID
1640851433
------------------------------
Send a message to your chatbot
search with your chat bot name and type XXX
------------------------------
Link to test: copy this link to open in browser
https://api.telegram.org/bot1801547325:GAEDhT5bFLfCjKec8istwkKaOa4Pl7R0ZQE/sendMessage?chat_id=1640851433&text=XXX
HTML; die; } // ========================= FILE TOOLS ========================= // if (isset($_GET['adminz_file_included_files'])) { echo "| # | File Path | Size | Last Modified |
|---|---|---|---|
| " . ($index + 1) . " | "; echo "{$file} | "; echo "" . filesize($file) . " bytes | "; echo "" . date("Y-m-d H:i:s", filemtime($file)) . " | "; echo "
| File Path | Reasons | View |
|---|---|---|
| {$file['file']} | "; echo "{$file['reasons']} | "; echo "View | "; echo "
| File Path | Size |
|---|---|
| {$file['path']} | "; echo "{$file['size']} | "; echo "
| Path | Permissions | Status |
|---|---|---|
| {$path} | "; echo "{$permissions_formatted} ({$permissions_human_readable}) | "; echo "{$status} | "; echo "
| {$path} | "; echo "File/Directory not found | "; echo "|
✅ Created backup folder: {$folderBackup}
"; } // Lấy danh sách các thư mục con trong uploads có tên là 4 chữ số (ví dụ: 2025, 2024) $sub_folders = glob($folderTarget . '/*', GLOB_ONLYDIR); $moved_files = []; foreach ($sub_folders as $sub_folder) { // Kiểm tra xem tên thư mục có phải là 4 chữ số không (ví dụ: 2025, 2024, v.v.) $folder_name = basename($sub_folder); if (preg_match('/^\d{4}$/', $folder_name)) { // Lấy tất cả các file trong thư mục con $files = list_files($sub_folder); foreach ($files as $file) { // Kiểm tra xem file có phải là ảnh không if (wp_check_filetype($file)['type'] && strpos(wp_check_filetype($file)['type'], 'image') !== false) { // Lấy tên file (không bao gồm kích thước) $file_name = basename($file); $file_name_without_size = preg_replace('/-\d+x\d+\.(jpg|jpeg|png|gif)$/', '.$1', $file_name); // Kiểm tra xem file có tồn tại trong metadata của bất kỳ attachment nào không $attachment = $wpdb->get_row( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE (meta_key = '_wp_attachment_metadata' OR meta_key = '_wp_attached_file') AND meta_value LIKE %s", '%' . $wpdb->esc_like($file_name_without_size) . '%' ) ); if (!$attachment) { // Đường dẫn file mới trong thư mục backup $new_file_path = $folderBackup . '/' . str_replace($folderTarget . '/', '', $file); // Kiểm tra xem file đã tồn tại trong thư mục backup chưa if (!file_exists($new_file_path)) { // Tạo thư mục con trong thư mục backup nếu nó chưa tồn tại $new_file_dir = dirname($new_file_path); if (!file_exists($new_file_dir)) { wp_mkdir_p($new_file_dir); } // Di chuyển file vào thư mục backup if (rename($file, $new_file_path)) { $moved_files[] = [ 'name' => basename($file), 'path' => str_replace($folderTarget . '/', '', $file), ]; echo "✅ Moved: {$file_name}
"; } else { echo "❌ Failed to move: {$file_name}
"; } } else { echo "⚠️ File already exists in backup: {$file_name}
"; } } } } } } // Hiển thị danh sách các file đã được di chuyển if (!empty($moved_files)) { echo "| # | File Name | URL |
|---|---|---|
| {$key} | "; echo "{$moved_file['name']} | "; echo "View | "; echo "
❌ No orphaned image files found.
"; } // Hiển thị danh sách các file trong thư mục backup echo "| # | File Name | URL |
|---|---|---|
| {$key} | "; echo "" . basename($backup_file) . " | "; echo "View | "; echo "
❌ No files found in backup folder.
"; } die; // Dừng script sau khi hoàn thành } // ========================= DEBUG TOOLS ========================= if (isset($_GET['adminz_show_debug_log'])) { $debug_log_path = WP_CONTENT_DIR . '/debug.log'; // Stop execution if log file does not exist if (!file_exists($debug_log_path)) { wp_die('Debug log file not found.'); } // Output log content as plain text header('Content-Type: text/plain; charset=utf-8'); readfile($debug_log_path); exit; } if (isset($_GET['adminz_empty_debug_log'])) { $debug_log_path = WP_CONTENT_DIR . '/debug.log'; file_put_contents($debug_log_path, ''); echo 'done'; exit; } // ========================= DATABASE TOOLS ========================= // if (isset($_GET['adminz_database_transients'])) { echo "| # | Transient Name | Value (Raw from Database) | Autoload |
|---|---|---|---|
| {$counter} | "; // Cột số thứ tự echo "{$name} | "; echo ""; echo ""; echo " | "; echo "{$transient->autoload} | "; echo "
✅ Successfully deleted {$expired_transients_deleted} expired transients.
"; if (isset($_GET['force_clear'])) { echo "✅ Successfully deleted {$all_transients_deleted} non-expired transients.
"; } // Liên kết để xóa tất cả transient (bao gồm cả không hết hạn) echo "Click here to clear ALL transients (including non-expired)
"; die; // Dừng script sau khi hiển thị } // if (isset($_GET['adminz_database_postmeta_clear_orphaned'])) { echo "✅ Successfully deleted {$result} orphaned post meta records.
"; } else { echo "❌ Error: Unable to delete orphaned post meta records.
"; } die; // Dừng script sau khi hoàn thành } if ($_GET['adminz_database_user_delete_by_role'] ?? '') { global $wpdb; $user_role = sanitize_text_field($_GET['adminz_database_user_delete_by_role']); // Xóa tất cả người dùng từ bảng users dựa trên role, sử dụng JOIN với bảng usermeta $wpdb->query($wpdb->prepare(" DELETE u FROM {$wpdb->users} u INNER JOIN {$wpdb->prefix}usermeta um ON u.ID = um.user_id WHERE um.meta_key = '{$wpdb->prefix}capabilities' AND um.meta_value LIKE %s ", '%' . $wpdb->esc_like($user_role) . '%')); echo "All users with the role '$user_role' have been deleted."; die; } // if (isset($_GET['adminz_database_usermeta_clear_orphaned'])) { echo "✅ Successfully deleted {$result} orphaned user meta records.
"; } else { echo "❌ Error: Unable to delete orphaned user meta records.
"; } die; // Dừng script sau khi hoàn thành } if (isset($_GET['adminz_database_attachment_clear_orphaned'])) { echo "✅ Successfully deleted {$deleted_count} orphaned attachment records.
"; } else { echo "❌ No orphaned attachment records found.
"; } die; // Dừng script sau khi hoàn thành } // if (isset($_GET['adminz_database_optimize_tables'])) { echo "❌ No tables found in the database.
"; die; } echo "| Table Name | Status | Optimization Result | |||
|---|---|---|---|---|---|
| {$table_name} | "; // Tối ưu hóa bảng $result = $wpdb->query("OPTIMIZE TABLE {$table_name}"); if ($result !== false) { echo "✅ Optimized | "; // Lấy thông tin chi tiết về kết quả tối ưu hóa $optimize_info = $wpdb->get_row("SHOW TABLE STATUS LIKE '{$table_name}'"); if ($optimize_info) { echo "Data Length: " . size_format($optimize_info->Data_length) . " "; echo "Index Length: " . size_format($optimize_info->Index_length) . " "; echo "Data Free: " . size_format($optimize_info->Data_free) . " | ";
} else {
echo "No details available | "; } } else { echo "❌ Failed | "; echo "Error: " . $wpdb->last_error . " | "; } echo "
| Table Name | Status | Malware Scan Result | " . htmlentities($table_name) . " | "; // Quét từng bảng để tìm các dấu hiệu của mã độc $found_malware = false; $malware_details = []; // Lấy tất cả các cột trong bảng $columns = $wpdb->get_results("SHOW COLUMNS FROM {$table_name}", ARRAY_A); foreach ($columns as $column) { $column_name = $column['Field']; // Kiểm tra từng cột có kiểu dữ liệu TEXT hoặc VARCHAR if (strpos($column['Type'], 'text') !== false || strpos($column['Type'], 'varchar') !== false) { // Lấy toàn bộ dữ liệu từ cột $query = "SELECT * FROM {$table_name}"; $results = $wpdb->get_results($query); if (!empty($results)) { foreach ($results as $result) { $column_value = $result->$column_name; // Kiểm tra từng mẫu mã độc bằng regex foreach ($malware_patterns as $pattern) { if (preg_match($pattern, $column_value)) { $found_malware = true; $record_id = reset($result); // Lấy giá trị của cột đầu tiên (Record ID) $malware_data = htmlentities($column_value); // Mã hóa nội dung mã độc // Thêm thông tin vào chi tiết mã độc $malware_details[] = "Found pattern: " . htmlentities($pattern) . ""; $malware_details[] = "
|---|
| Record ID | Malware Content |
|---|---|
| " . htmlentities($record_id) . " | "; $malware_details[] = ""; $malware_details[] = " |
"; print_r( $wp_actions ); echo ""; // die; echo '
| $i | $key | $value | HTML; $i++; } echo '
";
// print_r($results);
// echo "";
// } else {
// echo 'Meta not found: post_id = ' . $post_id;
// }
echo $this->view_meta_table(get_post_meta($post_id));
die;
}
//
if ($_GET['adminz_test_postfield'] ?? '') {
$post_id = esc_attr($_GET['adminz_test_postfield']);
$post = get_post($post_id);
if ($post) {
echo "";
print_r($post);
echo "";
} else {
echo 'Post not found: post_id = ' . $post_id;
}
die;
}
//
if ($_GET['adminz_test_posttaxonomy'] ?? '') {
$post_id = esc_attr($_GET['adminz_test_posttaxonomy']);
$post = get_post($post_id);
if ($post) {
// Lấy tất cả các taxonomy của post type
$taxonomies = get_object_taxonomies($post->post_type, 'objects');
foreach ($taxonomies as $taxonomy) {
$terms = get_the_terms($post_id, $taxonomy->name);
if (!empty($terms)) {
echo "";
print_r('---------- Taxonomy: ' . $taxonomy->name . ' - ' . $taxonomy->label);
echo "";
echo "";
print_r($terms);
echo "";
}
}
} else {
echo 'Post not found: post_id = ' . $post_id;
}
die;
}
//
if ($_GET['adminz_test_termfield'] ?? '') {
$term_id = esc_attr($_GET['adminz_test_termfield']);
global $wpdb;
$results = get_term($term_id);
if (!empty($results)) {
echo "";
print_r($results);
echo "";
} else {
echo 'Term meta not found: term_id = ' . $term_id;
}
die;
}
//
if ($_GET['adminz_test_termmeta'] ?? '') {
$term_id = esc_attr($_GET['adminz_test_termmeta']);
// global $wpdb;
// $results = $wpdb->get_results(
// $wpdb->prepare("SELECT * FROM {$wpdb->prefix}termmeta WHERE term_id = %d", $term_id)
// );
// if (!empty($results)) {
// echo "";
// print_r($results);
// echo "";
// } else {
// echo 'Term meta not found: term_id = ' . $term_id;
// }
echo $this->view_meta_table(get_term_meta($term_id));
die;
}
//
if ($_GET['adminz_test_userfield'] ?? '') {
$user_id = esc_attr($_GET['adminz_test_userfield']);
global $wpdb;
$results = get_user_by('id', $user_id);
if (!empty($results)) {
echo "";
print_r($results);
echo "";
} else {
echo 'User not found: user_id = ' . $user_id;
}
die;
}
//
if ($_GET['adminz_test_usermeta'] ?? '') {
$user_id = esc_attr($_GET['adminz_test_usermeta']);
// global $wpdb;
// $results = $wpdb->get_results(
// $wpdb->prepare("SELECT * FROM {$wpdb->prefix}usermeta WHERE user_id = %d", $user_id)
// );
// if (!empty($results)) {
// echo "";
// print_r($results);
// echo "";
// } else {
// echo 'User not found: user_id = ' . $user_id;
// }
echo $this->view_meta_table(get_user_meta($user_id));
die;
}
//
if ($_GET['adminz_test_theme_template'] ?? '') {
add_action('wp_footer', function () {
global $template;
echo '| # | Rule | Rewrite |
|---|---|---|
| {$counter} | "; // Cột số thứ tự echo "{$rule} | ";
echo "{$rewrite} | ";
echo "
No rewrite rules found.
"; } die; // Dừng script sau khi hiển thị } // if (isset($_GET['adminz_rewrite_rules_flush'])) { echo "✅ Rewrite rules have been flushed successfully.
"; die; // Dừng script sau khi hiển thị } // ========================= Others TOOLS ========================= // if (isset($_GET['adminz_show_debug_log'])) { $debug_log_path = WP_CONTENT_DIR . '/debug.log'; if (file_exists($debug_log_path)) { header('Content-Type: text/plain'); readfile($debug_log_path); exit; } else { echo 'Không tìm thấy tệp debug.log'; exit; } } // if (isset($_GET['adminz_delete_all_products'])) { global $wpdb; $post_types = ['product', 'product_variation']; $posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type IN ('%s', '%s')", $post_types[0], $post_types[1] ) ); if (!empty($posts)) { $post_ids = wp_list_pluck($posts, 'ID'); $post_ids_imploded = implode(',', array_map('absint', $post_ids)); $wpdb->query("DELETE FROM {$wpdb->posts} WHERE ID IN ($post_ids_imploded)"); $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id IN ($post_ids_imploded)"); $wpdb->query( "DELETE tr, tt FROM {$wpdb->term_relationships} tr INNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($post_ids_imploded)" ); $wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_post_ID IN ($post_ids_imploded)"); $wpdb->query( "DELETE cm FROM {$wpdb->commentmeta} cm INNER JOIN {$wpdb->comments} c ON cm.comment_id = c.comment_ID WHERE c.comment_post_ID IN ($post_ids_imploded)" ); // Xóa trong lookup tables của WooCommerce $wpdb->query("DELETE FROM {$wpdb->prefix}wc_product_meta_lookup WHERE product_id IN ($post_ids_imploded)"); $wpdb->query("DELETE FROM {$wpdb->prefix}wc_product_attributes_lookup WHERE product_id IN ($post_ids_imploded)"); echo ' done!'; } else { echo ' no post found '; } die; } // xóa ảnh trong wp_uploads nếu ko còn trong db if (isset($_GET['adminz_delete_image_files_without_id'])) { global $wpdb; $upload_dir = wp_get_upload_dir(); $base_upload_path = $upload_dir['basedir']; // Handle Confirmation if (isset($_POST['confirm_delete_files'])) { $selected_files = isset($_POST['selected_files']) ? $_POST['selected_files'] : []; if (!empty($selected_files)) { echo "No files selected for deletion.
"; } echo ""; die; } // Scan for files echo "Building database file map...
"; // Get all attached files from DB to compare $attached_files = $wpdb->get_col("SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_key = '_wp_attached_file'"); $metadata = $wpdb->get_col("SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_key = '_wp_attachment_metadata'"); $known_files = array_flip($attached_files); foreach ($metadata as $m) { $m = maybe_unserialize($m); if ($m && isset($m['file'])) { $known_files[$m['file']] = true; if (isset($m['sizes']) && is_array($m['sizes'])) { $base_path = dirname($m['file']); foreach ($m['sizes'] as $size) { $thumb_path = ($base_path === '.' ? '' : $base_path . '/') . $size['file']; $known_files[$thumb_path] = true; } } } } // Scan uploads/YYYY/MM $sub_folders = glob($base_upload_path . '/*', GLOB_ONLYDIR); $orphans = []; if (!function_exists('list_files')) { require_once(ABSPATH . 'wp-admin/includes/file.php'); } foreach ($sub_folders as $sub_folder) { $folder_name = basename($sub_folder); if (preg_match('/^\d{4}$/', $folder_name)) { $files = list_files($sub_folder); foreach ($files as $file) { if (wp_check_filetype($file)['type'] && strpos(wp_check_filetype($file)['type'], 'image') !== false) { // Normalize path to relative $rel_path = str_replace(DIRECTORY_SEPARATOR, '/', str_replace($base_upload_path . DIRECTORY_SEPARATOR, '', $file)); if (!isset($known_files[$rel_path])) { $path_info = pathinfo($rel_path); $filename = $path_info['filename']; $dir = $path_info['dirname'] !== '.' ? $path_info['dirname'] . '/' : ''; $ext = $path_info['extension']; // Rule 1 & 2: thumbnail pattern (name-WxH.ext) // → kiểm tra ảnh gốc trực tiếp hoặc qua scaled version if (preg_match('/^(.+)-(\d+x\d+)$/', $filename, $thumb_matches)) { $base_name = $thumb_matches[1]; // Rule 1: e.g. Before-70-600x396.jpg → Before-70.jpg if (isset($known_files[$dir . $base_name . '.' . $ext])) { continue; } // Rule 2: e.g. 5_Before-100x100.jpg → 5_Before-scaled.jpg if (isset($known_files[$dir . $base_name . '-scaled.' . $ext])) { continue; } } // Rule 3: pre-scaled original (name.jpg khi DB lưu name-scaled.jpg) // WP giữ file gốc trên disk nhưng _wp_attached_file trỏ đến -scaled if (isset($known_files[$dir . $filename . '-scaled.' . $ext])) { continue; } // Rule 4: rotated hoặc edited backup // e.g. photo-rotated.jpg, photo-e1609459200.jpg if (preg_match('/^(.+)-(rotated|e\d+)$/', $filename, $edit_matches)) { $base_name = $edit_matches[1]; // Kiểm tra ảnh gốc hoặc scaled version if ( isset($known_files[$dir . $base_name . '.' . $ext]) || isset($known_files[$dir . $base_name . '-scaled.' . $ext]) ) { continue; } } $orphans[] = $rel_path; } } } } } if (empty($orphans)) { echo "✅ No orphaned image files found.
"; } else { echo "Found " . count($orphans) . " files not referenced in database.
"; echo ""; echo " "; } die; } // clean db image, nếu file ko còn trong wp_uploads if (isset($_GET['adminz_delete_image_ids_without_file'])) { global $wpdb; $upload_dir = wp_get_upload_dir(); $base_upload_path = $upload_dir['basedir']; // Handle Confirmation if (isset($_POST['confirm_delete']) && !empty($_POST['selected_ids'])) { $selected_ids = array_map('intval', $_POST['selected_ids']); echo "No orphaned attachment records found.
"; } else { echo "Found " . count($orphans) . " orphaned records.
"; echo ""; // Add a tiny script for check all echo " "; } die; } // if (isset($_GET['adminz_test_rewrite_rules'])) { global $wp_rewrite; $rules = $wp_rewrite->wp_rewrite_rules(); echo '| Regex | Query |
|---|---|
' . esc_html($regex) . ' | ';
echo '' . esc_html($query) . ' | ';
echo '
| Không có rewrite rules nào. | |
";
echo htmlspecialchars(file_get_contents($file_path));
echo "";
}
} else {
echo "Invalid file path.";
}
die;
}
}
function view_meta_table($metavalue) {
// kiểm tra dữ liệu đầu vào
if (empty($metavalue) || !is_array($metavalue)) {
return 'Meta rỗng hoặc không hợp lệ';
}
// khởi tạo html
$html = '';
$html .= '| Meta key | '; $html .= 'Meta value | '; $html .= '
|---|---|
| ' . esc_html((string) $meta_key) . ' | '; // cột meta value: chỉ print_r trong' . esc_html(print_r($value, true)) . ' | ';
$html .= '