84% sharpen-resized-images

Code Review | Sharpen Resized Images

WordPress plugin Sharpen Resized Images scored84%from 54 tests.

About plugin

  • Plugin page: sharpen-resized-i...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 5, 2011
  • Latest release: Aug 6, 2022
  • Number of updates: 21
  • Update frequency: every 185.6 days
  • Top authors: unsalkorkmaz (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /25,151 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.06ms] Passed 4 tests

This is a short check of server-side resources used by Sharpen Resized Images
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.90 ▼2.42
Dashboard /wp-admin3.32 ▲0.0145.00 ▼1.40
Posts /wp-admin/edit.php3.37 ▲0.0145.37 ▼6.35
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.81 ▼6.07
Media Library /wp-admin/upload.php3.24 ▲0.0135.41 ▲0.25

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Sharpen Resized Images: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.011.61 ▼0.2240.97 ▼4.75
Dashboard /wp-admin2,195 ▲185.51 ▼0.0582.03 ▼2.6038.38 ▼2.64
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0432.97 ▼1.3634.59 ▲0.62
Add New Post /wp-admin/post-new.php1,525 ▼123.70 ▲0.04661.03 ▲22.7052.08 ▼6.81
Media Library /wp-admin/upload.php1,403 ▲64.28 ▲0.07101.07 ▼0.5344.84 ▲2.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sharpen-resized-images/ajx-sharpen-resized-images.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Difference) image required
You can take inspiration from this readme.txt

sharpen-resized-images/ajx-sharpen-resized-images.php 92% from 13 tests

The main PHP script in "Sharpen Resized Images" version 2.1.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sharpen-resized-images.php" instead of "ajx-sharpen-resized-images.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
No dangerous file extensions were detected44 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1253444

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.33MB with 0.24MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png338.84KB96.05KB▼ 71.65%