83% custom-upload-folders-plus

Code Review | Custom Upload Folders Plus

WordPress plugin Custom Upload Folders Plus scored83%from 54 tests.

About plugin

  • Plugin page: custom-upload-fol...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2
  • WordPress version: 6.3.1
  • First release: Mar 8, 2015
  • Latest release: Jun 19, 2015
  • Number of updates: 44
  • Update frequency: every 2.3 days
  • Top authors: jwight1234 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /3,052 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
Installer ran successfully

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

An overview of server-side resources used by Custom Upload Folders Plus
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.14 ▼4.22
Dashboard /wp-admin3.40 ▲0.0553.42 ▼15.96
Posts /wp-admin/edit.php3.51 ▲0.1546.48 ▼6.61
Add New Post /wp-admin/post-new.php5.98 ▲0.0982.51 ▼8.87
Media Library /wp-admin/upload.php3.32 ▲0.0937.02 ▲3.39

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Custom Upload Folders Plus: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.461.65 ▼0.1641.97 ▼1.78
Dashboard /wp-admin2,203 ▲155.89 ▲1.03104.61 ▼12.4543.26 ▲0.11
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0236.03 ▼1.3334.22 ▲2.47
Add New Post /wp-admin/post-new.php1,514 ▼2317.63 ▼5.49635.27 ▲13.1359.77 ▲1.66
Media Library /wp-admin/upload.php1,391 ▲64.17 ▲0.0198.17 ▼4.1740.62 ▼4.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/custom-upload-folders-plus/custom-upload-folders-plus.php:59

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: media, upload, custom upload folders, folder

custom-upload-folders-plus/custom-upload-folders-plus.php 77% from 13 tests

This is the main PHP file of "Custom Upload Folders Plus" version 1.0.4, 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:
  • Domain Path: The domain path folder was not found ("/languages/")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Git Repository: Please remove the Git repository from this plugin

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
No dangerous file extensions were detected4,174 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript36303962,764
CSS4183153934
PHP2155139451
Markdown18025

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/select2x2.png0.83KB0.77KB▼ 6.15%
assets/screenshot-1.png37.19KB14.57KB▼ 60.81%
images/cancel-circle.png0.31KB0.19KB▼ 39.69%
assets/screenshot-2.png20.61KB10.55KB▼ 48.78%
images/select2.png0.60KB0.99KB0.00%