74% amw-clear-upload-folder

Code Review | AMW Clear Upload Folder

WordPress plugin AMW Clear Upload Folder scored 74% from 54 tests.

About plugin

  • Plugin page: amw-clear-upload-...
  • Plugin version: 1.1.5
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-4.8.2
  • WordPress version: 6.3.1
  • First release: Sep 26, 2017
  • Latest release: Oct 25, 2017
  • Number of updates: 23
  • Update frequency: every 1.3 days
  • Top authors: alim511 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 1,163 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.09ms] Passed 4 tests

A check of server-side resources used by AMW Clear Upload Folder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.06 ▼3.67
Dashboard /wp-admin3.41 ▲0.1145.85 ▲2.54
Posts /wp-admin/edit.php3.53 ▲0.1749.39 ▲6.28
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.47 ▼5.78
Media Library /wp-admin/upload.php3.34 ▲0.1135.01 ▲2.54
AMW Clear Upload Folder /wp-admin/tools.php?page=amw-clear-upload-folder3.34104.79

Server storage [IO: ▲0.32MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: 4 new tables, 6 new options
New tables
wp_amv_data_table_result
wp_amv_deleted_files
wp_amv_ignored_folders
wp_amv_settings
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by AMW Clear Upload Folder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.19 ▼1.491.95 ▲0.1039.17 ▼12.53
Dashboard /wp-admin2,210 ▲196.01 ▲1.1295.37 ▼11.3538.10 ▼4.54
Posts /wp-admin/edit.php2,093 ▲41.97 ▼0.0238.54 ▲0.3236.45 ▲3.38
Add New Post /wp-admin/post-new.php1,536 ▼023.35 ▲0.15665.11 ▲6.6257.14 ▲2.76
Media Library /wp-admin/upload.php1,395 ▲164.26 ▲0.0198.44 ▼9.8643.10 ▼4.10
AMW Clear Upload Folder /wp-admin/tools.php?page=amw-clear-upload-folder9261.9832.7457.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 4 tables
    • wp_amv_settings
    • wp_amv_ignored_folders
    • wp_amv_deleted_files
    • wp_amv_data_table_result
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(AWM_CUF_DIR/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/amw-clear-upload-folder/loaderFunc.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/amw-clear-upload-folder/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'AMVCUFClass' not found in wp-content/plugins/amw-clear-upload-folder/views/folders-admin.php:3
    • > PHP Warning
      Use of undefined constant AWM_CUF_DIR - assumed 'AWM_CUF_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amw-clear-upload-folder/loaderFunc.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amw-clear-upload-folder/includes/functions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'AMVCUFSettingsClass' not found in wp-content/plugins/amw-clear-upload-folder/views/settings-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AMVCUFClass' not found in wp-content/plugins/amw-clear-upload-folder/views/files-admin.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'AWM_CUF_DIR/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/amw-clear-upload-folder/loaderFunc.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'AMVCUFClass' not found in wp-content/plugins/amw-clear-upload-folder/views/main-admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

amw-clear-upload-folder/amw-clear-upload-folder.php Passed 13 tests

The main file in "AMW Clear Upload Folder" v. 1.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
46 characters long description:
Removes unused files from the 'uploads' folder

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin8,687 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS3990316,340
JavaScript45443291,506
PHP13127122841

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity38.50
▷ Minimum class complexity18.00
▷ Maximum class complexity59.00
Average method complexity4.95
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin