84% better-images

Code Review | Better Images - Sharpen, compress, optimize and resize image after upload

WordPress plugin Better Images - Sharpen, compress, optimize and resize image after upload scored84%from 54 tests.

About plugin

  • Plugin page: better-images
  • Plugin version: 1.2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: May 28, 2020
  • Latest release: Apr 11, 2023
  • Number of updates: 21
  • Update frequency: every 49.9 days
  • Top authors: svunz (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /12,161 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.36ms] Passed 4 tests

An overview of server-side resources used by Better Images - Sharpen, compress, optimize and resize image after upload
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1244.22 ▲2.56
Dashboard /wp-admin3.42 ▲0.0846.23 ▼13.67
Posts /wp-admin/edit.php3.54 ▲0.1854.24 ▲7.39
Add New Post /wp-admin/post-new.php6.01 ▲0.1284.47 ▼11.21
Media Library /wp-admin/upload.php3.35 ▲0.1233.69 ▲0.89
Better Images /wp-admin/options-general.php?page=better-images3.3131.56

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 14 new options
New WordPress options
widget_recent-posts
widget_recent-comments
wnbi_better_images_version
can_compress_scripts
wnbi_better_images_quality
wnbi_better_images_resize_image
wnbi_better_images_sharpen_image
wnbi_better_images_convert_cmyk
db_upgraded
wnbi_better_images_convert_png
...

Browser metrics Passed 4 tests

Checking browser requirements for Better Images - Sharpen, compress, optimize and resize image after upload
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.36 ▼0.061.78 ▲0.2045.43 ▲3.08
Dashboard /wp-admin2,196 ▲165.61 ▲0.0188.03 ▲4.6745.71 ▲3.78
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0635.84 ▲0.6833.95 ▼1.05
Add New Post /wp-admin/post-new.php1,540 ▲1418.34 ▼5.16625.10 ▼51.7464.31 ▲11.03
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.0493.31 ▼14.3442.88 ▼3.73
Better Images /wp-admin/options-general.php?page=better-images1,5791.9922.9931.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/better-images/better-images.php

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 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

better-images/better-images.php 92% from 13 tests

The main PHP file in "Better Images - Sharpen, compress, optimize and resize image after upload" ver. 1.2.6 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 239 characters long)

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
Success! There were no dangerous files found in this plugin866 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4170206593
PO File14157180
CSS115071
Markdown110022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected