84% cut-down-uploads-size

Code Review | Cut down uploads size

WordPress plugin Cut down uploads size scored84%from 54 tests.

About plugin

  • Plugin page: cut-down-uploads-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 26, 2021
  • Latest release: Aug 26, 2023
  • Number of updates: 7
  • Update frequency: every 113.0 days
  • Top authors: markomaksym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /473 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▲3.33ms] Passed 4 tests

This is a short check of server-side resources used by Cut down uploads size
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2144.84 ▲3.66
Dashboard /wp-admin3.51 ▲0.2160.84 ▲14.36
Posts /wp-admin/edit.php3.56 ▲0.2149.58 ▲4.28
Add New Post /wp-admin/post-new.php6.05 ▲0.1685.47 ▲0.41
Media Library /wp-admin/upload.php3.37 ▲0.1537.28 ▲4.95
Cut down uploads size /wp-admin/options-general.php?page=settings_menu_item3.3431.30

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

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

Browser metrics Passed 4 tests

Cut down uploads size: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.72 ▼0.575.13 ▲3.3543.50 ▼4.44
Dashboard /wp-admin2,227 ▲395.02 ▲0.14120.28 ▲18.4138.45 ▲0.60
Posts /wp-admin/edit.php2,116 ▲272.34 ▲0.2941.82 ▲2.3335.97 ▲1.33
Add New Post /wp-admin/post-new.php1,530 ▼1223.54 ▲5.25670.85 ▲64.9260.28 ▲8.38
Media Library /wp-admin/upload.php1,415 ▲334.44 ▲0.2094.12 ▲1.9841.74 ▲1.77
Cut down uploads size /wp-admin/options-general.php?page=settings_menu_item8762.4537.9231.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cut-down-uploads-size/includes/admin/views/settings-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/cut-down-uploads-size/includes/admin/classes/php-image-resize/vendor/gumlet/php-image-resize/test/ImageResizeExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/cut-down-uploads-size/includes/admin/classes/php-image-resize/vendor/gumlet/php-image-resize/test/ImageResizeTest.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: compress images, reduce image size, image optimization, optimize images

cut-down-uploads-size/all-images-optimizer.php 92% from 13 tests

The principal PHP file in "Cut down uploads size" v. 1.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cut-down-uploads-size.php" instead of "all-images-optimizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected15,426 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,3691,5089,747
CSS42152,316
PHP369578672,200
SVG100685
Markdown21160286
JSON300118
PO File18833
YAML15027
XML10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.64
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes14.17%
Methods168
▷ Static methods3319.64%
▷ Public methods16296.43%
▷ Protected methods21.19%
▷ Private methods42.38%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants18
▷ Global constants844.44%
▷ Class constants1055.56%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected