94% 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 scored 94% from 54 tests.

About plugin

  • Plugin page: better-images
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 5.8.1
  • First release: May 28, 2020
  • Latest release: Apr 22, 2021
  • Number of updates: 19
  • Update frequency: every 17.3 days
  • Top authors: svunz (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active / 6,235 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼170.73ms] 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 /2.85 ▲0.1333.93 ▲13.59
Dashboard /wp-admin3.08 ▲0.0242.99 ▲1.62
Posts /wp-admin/edit.php3.13 ▲0.0237.15 ▼3.16
Add New Post /wp-admin/post-new.php5.44 ▲0.0081.06 ▼679.00
Media Library /wp-admin/upload.php3.02 ▲0.0231.62 ▼2.38
Better Images /wp-admin/options-general.php?page=better-images2.9928.79

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, 8 new options
New WordPress options
wnbi_better_images_remove_exif
wnbi_better_images_version
wnbi_better_images_convert_cmyk
wnbi_better_images_resize_threshold
wnbi_better_images_quality
wnbi_better_images_resize_image
wnbi_better_images_sharpen_image
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 /3,684 ▲8815.85 ▲0.288.89 ▼1.3046.60 ▼1.31
Dashboard /wp-admin2,978 ▲475.90 ▼0.07135.83 ▼6.05124.19 ▲13.79
Posts /wp-admin/edit.php2,741 ▲22.71 ▼0.0263.31 ▼0.1689.27 ▼0.70
Add New Post /wp-admin/post-new.php1,679 ▲9818.79 ▲4.35363.44 ▼26.49106.95 ▲3.66
Media Library /wp-admin/upload.php1,812 ▲85.06 ▲0.04143.46 ▼3.47119.92 ▼0.50
Better Images /wp-admin/options-general.php?page=better-images1,9192.0957.8991.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

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.4 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 plugin868 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4171206595
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.35
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