67% wp-file-manager

Code Review | File Manager

WordPress plugin File Manager scored67%from 54 tests.

About plugin

  • Plugin page: wp-file-manager
  • Plugin version: 7.2.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 9, 2016
  • Latest release: Oct 27, 2023
  • Number of updates: 176
  • Update frequency: every 15.0 days
  • Top authors: mndpsingh287 (99.43%)Otto42 (1.14%)

Code review

54 tests

User reviews

1284 reviews

Install metrics

1,000,000+ active /18,415,582 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼5.87ms] Passed 4 tests

A check of server-side resources used by File Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3544.38 ▲4.29
Dashboard /wp-admin3.67 ▲0.3644.13 ▼8.28
Posts /wp-admin/edit.php3.78 ▲0.4245.98 ▼3.15
Add New Post /wp-admin/post-new.php6.25 ▲0.3784.41 ▼12.92
Media Library /wp-admin/upload.php3.59 ▲0.3633.40 ▲0.89
Backup/Restore /wp-admin/admin.php?page=wpfm-backup3.6235.40
Logs /wp-admin/admin.php?page=wpfm-logs3.5532.50
System Properties /wp-admin/admin.php?page=wp_file_manager_sys_properties3.5630.49
Settings /wp-admin/admin.php?page=wp_file_manager_settings3.5630.98
Shortcode - PRO /wp-admin/admin.php?page=wp_file_manager_shortcode_doc3.6032.53
Preferences /wp-admin/admin.php?page=wp_file_manager_preferences3.6032.16
WP File Manager /wp-admin/admin.php?page=wp_file_manager3.6836.79

Server storage [IO: ▲16.41MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • Illegal file modification found: 2 files (0.00KB) outside of "wp-content/plugins/wp-file-manager/" and "wp-content/uploads/"
    • (new file) .quarantine/.empty
    • (new file) .tmb/.empty
Filesystem: 906 new files
Database: 1 new table, 7 new options
New tables
wp_wpfm_backup
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
fm_key
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for File Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲9814.28 ▲0.121.73 ▲0.0838.91 ▼3.82
Dashboard /wp-admin2,268 ▲915.50 ▼0.1582.14 ▼5.3370.35 ▲28.75
Posts /wp-admin/edit.php2,170 ▲701.96 ▼0.0735.62 ▼2.1235.66 ▼0.73
Add New Post /wp-admin/post-new.php1,592 ▲6423.18 ▲0.02742.66 ▲120.7152.72 ▲6.07
Media Library /wp-admin/upload.php1,473 ▲734.06 ▼0.1391.86 ▼1.1978.00 ▲30.90
Backup/Restore /wp-admin/admin.php?page=wpfm-backup1,1992.0727.4367.60
Logs /wp-admin/admin.php?page=wpfm-logs8712.0422.0026.90
System Properties /wp-admin/admin.php?page=wp_file_manager_sys_properties9142.0021.0025.69
Settings /wp-admin/admin.php?page=wp_file_manager_settings8972.1323.2227.61
Shortcode - PRO /wp-admin/admin.php?page=wp_file_manager_shortcode_doc1,3172.1222.5940.39
Preferences /wp-admin/admin.php?page=wp_file_manager_preferences9481.9923.7729.38
WP File Manager /wp-admin/admin.php?page=wp_file_manager4,7125.89299.18118.36

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_wpfm_backup
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • fm_key
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-file-manager/lib/wpfilemanager.php
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderVolumeLocalFileSystem' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderVolumeTrash.class.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'elFinderSessionInterface' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderSession.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderVolumeDriver' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderVolumeDropbox2.class.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderVolumeDriver' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderVolumeLocalFileSystem.class.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderVolumeDriver' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderVolumeBox.class.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-file-manager/file_folder_manager.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wp-file-manager/classes/db-restore.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderEditor' not found in wp-content/plugins/wp-file-manager/lib/php/editors/ZohoOffice/editor.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'elFinder' not found in wp-content/plugins/wp-file-manager/lib/php/elFinderVolumeDropbox.class.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'elFinderPlugin' not found in wp-content/plugins/wp-file-manager/lib/php/plugins/AutoResize/plugin.php:62

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

wp-file-manager/file_folder_manager.php 92% from 13 tests

This is the main PHP file of "File Manager" version 7.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-file-manager.php" instead of "file_folder_manager.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin194,697 lines of code in 628 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript28910,49113,834113,497
PO File5215,95525,70826,618
PHP433,3649,63021,193
CSS512,2521,11116,282
HTML1282,509813,351
SVG6291433,710
Markdown311046

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,408)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 150)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity142.95
▷ Minimum class complexity1.00
▷ Maximum class complexity1,408.00
Average method complexity7.29
▷ Minimum method complexity1.00
▷ Maximum method complexity150.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes37
▷ Abstract classes12.70%
▷ Concrete classes3697.30%
▷ Final classes00.00%
Methods891
▷ Static methods505.61%
▷ Public methods28431.87%
▷ Protected methods58565.66%
▷ Private methods222.47%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants107
▷ Global constants3028.04%
▷ Class constants7771.96%
▷ Public constants77100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
162 compressed PNG files occupy 0.40MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/img/quicklook-bg.png0.07KB0.09KB0.00%
lib/themes/windows - 10/images/16px/redo.png0.66KB0.51KB▼ 21.73%
lib/themes/light/images/16px/deselect_all.png0.40KB0.42KB0.00%
lib/themes/windows - 10/images/16px/upload.png0.44KB0.50KB0.00%
lib/themes/light/images/48px/directory.png1.00KB1.61KB0.00%