JezK
Edit File: investigate_inodes.php
<?php require_once('wp-load.php'); $results = array( 'logs' => array(), 'cache' => array(), 'inactive_themes' => array(), 'inactive_plugins' => array() ); // 1. Check for log files in root and wp-content $logs_to_check = array( ABSPATH . 'error_log', ABSPATH . 'debug.log', WP_CONTENT_DIR . '/debug.log', WP_CONTENT_DIR . '/error_log' ); foreach ($logs_to_check as $log) { if (file_exists($log)) { $results['logs'][$log] = filesize($log); } } // Helper to count files function count_files_and_size($dir) { $count = 0; $size = 0; if (is_dir($dir)) { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS) ); foreach ($iterator as $file) { $count++; $size += $file->getSize(); } } return array('count' => $count, 'size' => $size); } // 2. Check Cache Directories $cache_dirs = array( WP_CONTENT_DIR . '/cache', WP_CONTENT_DIR . '/w3tc-config', WP_CONTENT_DIR . '/et-cache', // Divi WP_CONTENT_DIR . '/elementor/css' // Elementor ); foreach ($cache_dirs as $dir) { if (is_dir($dir)) { $results['cache'][$dir] = count_files_and_size($dir); } } // 3. Check Inactive Themes $themes = wp_get_themes(); $active_theme = wp_get_theme()->get_stylesheet(); foreach ($themes as $stylesheet => $theme) { if ($stylesheet !== $active_theme && $stylesheet !== 'twentytwentyfour' && $stylesheet !== 'twentytwentythree') { $theme_dir = $theme->get_stylesheet_directory(); $results['inactive_themes'][$stylesheet] = count_files_and_size($theme_dir); } } // 4. Check Inactive Plugins if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); $active_plugins = get_option('active_plugins'); foreach ($all_plugins as $plugin_file => $plugin_data) { if (!in_array($plugin_file, $active_plugins)) { $plugin_dir = WP_PLUGIN_DIR . '/' . dirname($plugin_file); if ($plugin_dir !== WP_PLUGIN_DIR . '/.') { // If it's a folder, not a single file $results['inactive_plugins'][$plugin_file] = count_files_and_size($plugin_dir); } } } echo json_encode($results, JSON_PRETTY_PRINT);