84% custom-upload-folder

Code Review | Custom Upload Folder

WordPress plugin Custom Upload Folder scored84%from 54 tests.

About plugin

  • Plugin page: custom-upload-folder
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2018
  • Latest release: Sep 17, 2022
  • Number of updates: 10
  • Update frequency: every 144.3 days
  • Top authors: motekar (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /3,186 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.46ms] Passed 4 tests

This is a short check of server-side resources used by Custom Upload Folder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0340.65 ▼2.68
Dashboard /wp-admin3.37 ▲0.0348.40 ▼5.45
Posts /wp-admin/edit.php3.49 ▲0.0951.68 ▼0.93
Add New Post /wp-admin/post-new.php5.96 ▲0.0395.34 ▼12.14
Media Library /wp-admin/upload.php3.30 ▲0.0335.50 ▼1.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Custom Upload Folder
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4314.24 ▼0.392.15 ▲0.3943.87 ▲2.16
Dashboard /wp-admin2,195 ▲215.61 ▼0.0695.34 ▲4.2241.45 ▼0.03
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0240.02 ▲4.9835.16 ▼0.97
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.03612.21 ▼79.3960.16 ▲6.68
Media Library /wp-admin/upload.php1,434 ▲344.22 ▲0.01102.99 ▼7.8845.12 ▼2.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-upload-folder/custom-upload-folder.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: The official readme.txt is a good inspiration

custom-upload-folder/custom-upload-folder.php Passed 13 tests

The primary PHP file in "Custom Upload Folder" version 1.1.2 is used by WordPress to initiate all plugin functionality
53 characters long description:
Upload files to custom directory in WP Media Library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin87 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1201287

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin