73% display-image-dimensions-in-media-library

Code Review | Display Image Dimensions in Media Library

WordPress plugin Display Image Dimensions in Media Library scored73%from 54 tests.

About plugin

  • Plugin page: display-image-dim...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.1
  • WordPress version: 6.3.1
  • First release: Jan 29, 2019
  • Latest release: Jun 11, 2019
  • Number of updates: 8
  • Update frequency: every 17.2 days
  • Top authors: mikeill (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /2,386 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.58ms] Passed 4 tests

Server-side resources used by Display Image Dimensions in Media Library
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.22 ▼2.43
Dashboard /wp-admin3.31 ▲0.0053.08 ▼1.34
Posts /wp-admin/edit.php3.36 ▲0.0052.27 ▼2.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.37 ▼12.19
Media Library /wp-admin/upload.php3.23 ▲0.0040.78 ▲4.59

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Display Image Dimensions in Media Library
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.99 ▲0.1950.92 ▲5.04
Dashboard /wp-admin2,198 ▲205.62 ▼0.0986.86 ▼22.5440.65 ▼4.32
Posts /wp-admin/edit.php2,097 ▼62.04 ▲0.0736.09 ▼2.3337.26 ▲0.76
Add New Post /wp-admin/post-new.php1,526 ▼223.23 ▲0.14694.04 ▲8.8346.85 ▼2.62
Media Library /wp-admin/upload.php1,397 ▼04.19 ▼0.03101.31 ▲1.4646.51 ▼1.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 8 files (0.74MB) in the plugin directory
    • (new file) uninstall.php
    • (new file) display-image-dimensions.php
    • (new file) screenshot1.png
    • (new file) screenshot-1.png
    • (new file) readme.txt
    • (new file) screenshot2.png
    • (new file) upload.sh
    • (new file) screenshot-2.png
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-image-dimensions-in-media-library/display-image-dimensions.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/display-image-dimensions-in-media-library/uninstall.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Heading), #2 (Location)
Please take inspiration from this readme.txt

display-image-dimensions-in-media-library/display-image-dimensions.php 85% from 13 tests

The primary PHP file in "Display Image Dimensions in Media Library" version 1.0.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("display-image-dimensions-in-media-library.php" instead of "display-image-dimensions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin95 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2345193
Bourne Shell1202

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.73MB with 0.54MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot1.png33.60KB8.93KB▼ 73.42%
screenshot2.png342.03KB87.57KB▼ 74.40%
screenshot-1.png33.60KB8.93KB▼ 73.42%
screenshot-2.png342.03KB87.57KB▼ 74.40%