84% image-sizes-panel

Code Review | Image Sizes Panel

WordPress plugin Image Sizes Panel scored84%from 54 tests.

About plugin

  • Plugin page: image-sizes-panel
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.9
  • WordPress version: 6.3.1
  • First release: Sep 30, 2014
  • Latest release: Feb 22, 2022
  • Number of updates: 11
  • Update frequency: every 245.8 days
  • Top authors: husobj (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,183 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.02MB] [CPU: ▼4.20ms] Passed 4 tests

This is a short check of server-side resources used by Image Sizes Panel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.18 ▲4.66
Dashboard /wp-admin3.33 ▲0.0345.37 ▼0.27
Posts /wp-admin/edit.php3.38 ▲0.0243.98 ▼2.21
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.33 ▼12.07
Media Library /wp-admin/upload.php3.25 ▲0.0232.40 ▼2.25

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Image Sizes Panel
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▼0.111.79 ▼0.0843.61 ▼0.47
Dashboard /wp-admin2,206 ▲145.85 ▲0.9395.13 ▼9.6336.75 ▼3.58
Posts /wp-admin/edit.php2,089 ▲32.03 ▲0.0434.84 ▼4.2037.25 ▼0.79
Add New Post /wp-admin/post-new.php1,542 ▲818.32 ▼4.73632.31 ▼28.9647.52 ▼6.80
Media Library /wp-admin/upload.php1,385 ▼34.42 ▲0.1898.13 ▼5.1242.77 ▼3.48

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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)
Even though everything seems fine, this is not 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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/image-sizes-panel/image-sizes-panel.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-sizes-panel/admin/admin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: sizes, media, images, attachments

image-sizes-panel/image-sizes-panel.php Passed 13 tests

The main file in "Image Sizes Panel" v. 0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
98 characters long description:
Display a meta box when viewing a media item in the admin that display all generated images sizes.

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
No dangerous file extensions were detected170 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24433102
CSS114062
JavaScript1506

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods3100.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
No PNG images were found in this plugin