File Change Finder
WordPress plugin to identify the file changes. This will help admin to see if any new files added or edited any files. This helps in preventing hacking attempts.
by Sanjay Shankar · github.com/sanjuacodez/aco-file-change-finder · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sanjuacodez/aco-file-change-finder/archive/refs/heads/main.zipFile Change Finder WordPress Plugin
Author: Sanjay Shankar
WordPress.org Profile: sanjuacodez
GitHub Repository: aco-file-change-finder
Buy Me a Coffee: https://buymeacoffee.com/sanjayshankar
A comprehensive WordPress plugin that monitors your website for file and database changes. It helps detect unauthorized modifications, malware infections, and other security issues by scanning your WordPress installation directory and monitoring key database tables.
Features
- Automatic File Scanning: Regularly scans your WordPress root directory for changes
- Database Monitoring: Tracks new/deleted users and new/modified posts with granular control
- Scan History: Keeps a detailed history of the last 10 scans with an accordion view
- Email Notifications: Sends detailed email alerts when changes are detected (with truncation for large reports)
- Configurable Settings: Customize scan frequency, exclusions, and notification preferences
- Manual Scanning: Trigger scans manually from the admin interface
- Recent Changes Display: View recent file changes directly in the WordPress admin
- Security Best Practices: Built with WordPress security standards in mind
- Performance Optimized: Configurable scan depth and file size limits
Installation
- Upload the
aco-file-change-finderfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Tools > File Change Finder to configure the plugin settings
Configuration
General Settings
- Email Recipients: Comma-separated email addresses for notifications
- Enable Email Notifications: Toggle email alerts on/off
- Scan Frequency: Choose between hourly, twice daily, or daily scans
Advanced Settings
- Exclude File Extensions: Skip specific file types (e.g., log, tmp, cache)
- Exclude Directories: Skip entire directories (e.g., cache folders)
- Maximum Scan Depth: Limit directory traversal depth (1-10)
- File Size Limit: Skip files larger than specified size (MB)
Usage
Automatic Monitoring
Once activated, the plugin will automatically:
- Create a baseline of your current files
- Run scheduled scans based on your frequency setting
- Send email notifications when changes are detected
- Cache recent changes for display in the admin interface
Manual Operations
- Run Manual Scan: Trigger an immediate scan from the admin interface
- Send Test Email: Verify your email notification settings
- View Recent Changes: See the latest detected changes in the admin panel
File Change Types
The plugin detects three types of changes:
- New Files: Files that have been added since the last scan
- Modified Files: Existing files that have been changed
- Deleted Files: Files that were present in the previous scan but are now missing
- Database Changes: New/Deleted Users and New/Modified Posts
Security Features
- Nonce Verification: All AJAX requests are protected with WordPress nonces
- Capability Checks: Only users with
manage_optionscapability can access settings - Data Sanitization: All user inputs are properly sanitized and validated
- Safe File Operations: Uses WordPress APIs and PHP safe functions
- Exclusion Defaults: Automatically excludes common cache and temporary files
Performance Considerations
Default Exclusions
The plugin automatically excludes:
- Cache directories (
wp-content/cache, etc.) - Temporary files (
.tmp,.log, etc.) - Version control directories (
.git,.svn) - Node modules and build artifacts
Optimization Settings
- File Size Limit: Default 10MB to prevent memory issues
- Scan Depth: Default 5 levels to balance thoroughness and performance
- Transient Caching: Uses WordPress transients to prevent concurrent scans
Extending the Plugin
The plugin is built with extensibility in mind:
Action Hooks
afcf_changes_detected: Fired when file changes are detected
Example Usage
// Add custom functionality when changes are detected
add_action('afcf_changes_detected', 'my_custom_change_handler');
function my_custom_change_handler($changes) {
// Your custom logic here
// $changes contains arrays of new_files, modified_files, deleted_files
}
Troubleshooting
Common Issues
- Scans Not Running: Check that WordPress cron is working properly
- High Memory Usage: Reduce file size limit or scan depth
- Email Not Sending: Verify WordPress mail configuration
- False Positives: Add problematic files/folders to exclusion lists
Debug Information
Check the following if you encounter issues:
- WordPress error logs
- PHP error logs
- Plugin's scan result messages
- Email test functionality
Technical Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Sufficient PHP memory for file scanning operations
- Working WordPress cron system
- Proper file system permissions
File Structure
aco-file-change-finder/
├── afcf.php (Main plugin file)
├── uninstall.php
├── admin/
│ ├── class-afcf-admin.php
│ └── partials/
│ └── afcf-admin-display.php
├── includes/
│ ├── class-afcf.php
│ ├── class-afcf-activator.php
│ ├── class-afcf-deactivator.php
│ ├── class-afcf-i18n.php
│ ├── class-afcf-loader.php
│ ├── class-afcf-scanner.php
│ └── class-afcf-notifier.php
├── assets/
│ ├── css/
│ │ └── afcf-admin.css
│ └── js/
│ └── afcf-admin.js
└── public/
└── class-afcf-public.php
License
This plugin is licensed under the GPL v2 or later.
Support
For support and feature requests, please:
- Visit the GitHub repository to report issues
- Check the WordPress.org profile for other plugins
- Contact the author at: me@sanjayshankar.me
Changelog
Version 1.2.0
- New: Granular Database Scanning settings (Users, Specific Post Types)
- Improved: Email notifications now include Database Changes
- Improved: Email reports are truncated if too long with a "View More" link
- Improved: DB Scanner respects selected post types
Version 1.1.0
- New: Database monitoring (Users and Posts)
- New: Scan History with accordion view
- New: Separate tables for New, Modified, and Deleted files
- New: Lines of Code (LOC) column in scan results
- Improved: Email notifications with detailed file info
- Improved: UI/UX with tabbed interface and better layout
Version 1.0.0
- Initial release
- File scanning and change detection
- Email notifications
- Admin interface with settings
- Configurable exclusions and scanning options
- Security best practices implementation