10% th23-upload

Code Review | th23 Upload

WordPress plugin th23 Upload scored10%from 54 tests.

About plugin

  • Plugin page: th23-upload
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.6.32+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.4
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: May 15, 2020
  • Number of updates: 11
  • Update frequency: every 1.6 days
  • Top authors: th23 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /513 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/th23-upload/th23-upload-admin.php+1303
    Undefined index: max_width

Server metrics [RAM: ▲0.20MB] [CPU: ▲0.81ms] Passed 4 tests

A check of server-side resources used by th23 Upload
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.04 ▲3.04
Dashboard /wp-admin3.57 ▲0.2748.24 ▼2.71
Posts /wp-admin/edit.php3.68 ▲0.3347.27 ▲0.66
Add New Post /wp-admin/post-new.php6.15 ▲0.2694.56 ▲2.23
Media Library /wp-admin/upload.php3.49 ▲0.2637.27 ▲3.23
th23 Upload /wp-admin/options-general.php?page=th23-upload3.4733.10

Server storage [IO: ▲0.11MB] [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: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
th23_upload_options

Browser metrics Passed 4 tests

A check of browser resources used by th23 Upload
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.22 ▼1.461.80 ▲0.2643.86 ▲2.36
Dashboard /wp-admin2,213 ▲225.83 ▲0.9795.12 ▼11.7938.85 ▼5.93
Posts /wp-admin/edit.php2,093 ▲72.01 ▼0.0136.27 ▼0.6033.46 ▲3.09
Add New Post /wp-admin/post-new.php1,550 ▲3123.16 ▲0.04647.93 ▼18.7151.77 ▼1.61
Media Library /wp-admin/upload.php1,392 ▲74.25 ▲0.02101.01 ▲5.9643.73 ▲2.05
th23 Upload /wp-admin/options-general.php?page=th23-upload1,1662.1128.0651.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • th23_upload_options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/th23-upload/th23-upload.php:153
    • > PHP Fatal error
      Uncaught Error: Class 'th23_upload_pro' not found in wp-content/plugins/th23-upload/th23-upload-admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: mark, stamp, image, copyright, dimensions...

th23-upload/th23-upload.php Passed 13 tests

The primary PHP file in "th23 Upload" version 1.6.0 is used by WordPress to initiate all plugin functionality
71 characters long description:
Resize images on upload to maximum allowed dimensions and add watermark

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 plugin1,674 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP31702581,203
CSS1617244
JavaScript12244227

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity86.33
▷ Minimum class complexity1.00
▷ Maximum class complexity239.00
Average method complexity7.24
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods41100.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

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-square.png5.38KB3.10KB▼ 42.43%
img/icon-horizontal.png5.93KB1.52KB▼ 74.41%