84% ratio-thumbnails-size

Code Review | Ratio Thumbnails Size

WordPress plugin Ratio Thumbnails Size scored84%from 54 tests.

About plugin

  • Plugin page: ratio-thumbnails-...
  • Plugin version: 1.07
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 25, 2019
  • Latest release: Oct 31, 2023
  • Number of updates: 28
  • Update frequency: every 51.3 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,458 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.61ms] Passed 4 tests

This is a short check of server-side resources used by Ratio Thumbnails Size
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.24 ▼2.33
Dashboard /wp-admin3.36 ▲0.0543.87 ▼1.55
Posts /wp-admin/edit.php3.41 ▲0.0548.57 ▼4.90
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.56 ▼7.45
Media Library /wp-admin/upload.php3.28 ▲0.0532.98 ▼3.77
Ratio Thumbnails Size /wp-admin/options-general.php?page=ratiothumbnailssize3.2530.48

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Ratio Thumbnails Size
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.33 ▼0.281.75 ▲0.1943.99 ▲7.20
Dashboard /wp-admin2,202 ▲285.60 ▼0.0892.61 ▼1.7244.45 ▲3.46
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0039.41 ▼4.3035.45 ▼0.65
Add New Post /wp-admin/post-new.php1,529 ▼223.62 ▲0.57689.47 ▲20.7446.43 ▼12.25
Media Library /wp-admin/upload.php1,404 ▲74.19 ▲0.0197.15 ▼0.7240.63 ▼3.67
Ratio Thumbnails Size /wp-admin/options-general.php?page=ratiothumbnailssize9352.0123.3328.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ratio-thumbnails-size/lib/class-ratiothumbnailssizeadmin.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ratio-thumbnails-size/lib/class-ratiothumbnailssize.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ratio-thumbnails-size/lib/class-ratiothumbnailssize.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: thumbnails, media, ratio

ratio-thumbnails-size/ratiothumbnailssize.php 92% from 13 tests

"Ratio Thumbnails Size" version 1.07's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("ratio-thumbnails-size.php" instead of "ratiothumbnailssize.php")

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
Good job! No executable or dangerous file extensions detected309 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP459123309

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity21.00
▷ Minimum class complexity12.00
▷ Maximum class complexity30.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
There were not PNG files found in your plugin