The File Scanning feature automatically extracts CSS classes from your theme files, CSS files, JavaScript files, and any other files containing class definitions. This powerful tool helps you discover and use all available classes in your WordPress installation.
🎯 Overview
File Scanning provides:
- Automatic Discovery: Find classes in CSS files
- Background Processing: Non-blocking scans that won’t slow down your site
- Automatic Triggers: Scan when specific post types are saved
- Flexible Selection: Choose specific files or entire directories
- Real-time Updates: New classes immediately available in autocomplete
🏗️ How File Scanning Works
Supported File Types
The scanner can extract classes from:
- CSS Files:
.css
– You can select each css file separatly - Folder: You can select folder and it will scan for all .css files inside that folder
Scanning Process
- File Selection: Choose files/folders to scan
- Background Processing: Scan runs asynchronously
- Class Extraction: Parse files for CSS class patterns
- Database Storage: Store found classes with “Scanned” type
- Autocomplete Update: Classes immediately available
🚀 Manual Scanning
Accessing File Scanner
Navigate to Tools → Plain Classes Gutenberg → Scan Classes

Interface Overview
File Tree Explorer:
- Browse your WordPress installation
- Select individual files or entire folders
- Visual icons distinguish files from folders
- Real-time path selection
Selected Paths Panel:
- View currently selected scan targets
- Remove individual paths
- Clear all selections
Scan Controls:
- “Scan Selected Files” button
- Progress indicator during scanning
- Results summary after completion
Selecting Files for Scanning
Method 1: Individual Files
- Navigate through file tree
- Click on specific files to select
- File appears in “Selected Paths” list
- Repeat for multiple files
Method 2: Entire Folders
- Click on folder names in tree view
- Entire folder and subfolders selected
- Efficient for theme/plugin directories
- Can combine with individual files
Running Manual Scans
Select Target Files/Folders
- Use file tree to choose scan targets
- Verify selections in “Selected Paths” panel
Start Scanning
- Click “Scan Selected Files” button
- Progress bar shows scanning status
- Process runs in background
Review Results
- Scan completion message appears
- Number of new classes found
- Classes immediately available in autocomplete
🔄 Automatic Scanning
Post-Save Triggers
The plugin can automatically scan files when certain post types are saved:
Supported Save Methods:
- ✅ WordPress “Update” button
- ✅ Keyboard shortcuts (Ctrl+S/Cmd+S via Scripts Organizer)
Default Trigger:
- Post Type:
scorg
(Scripts Organizer posts) - When: Every time post is saved
- What: Scans your selected files/folders
Intelligent Filtering
Valid Class Detection:
- Filters out CSS properties that aren’t classes
- Removes pseudo-selectors and media queries
- Excludes JavaScript variables that look like classes
- Validates class name format
Duplicate Prevention:
- Checks against existing classes before adding
- Merges results from multiple files
- Prevents redundant database entries
Integration Hooks
Before Scan:
add_action('pcguten_before_scan', function($file_paths) {
// Custom logic before scanning
});
After Scan:
add_action('pcguten_after_scan', function($found_classes, $file_paths) {
// Process results
});
Filter Classes:
add_filter('pcguten_scanned_classes', function($classes, $file_path) {
// Modify found classes before storage
return $classes;
}, 10, 2);