84% resmushit-image-optimizer

Code Review | reSmush.it : the only free Image Optimizer & compress plugin

WordPress plugin reSmush.it : the only free Image Optimizer & compress plugin scored84%from 54 tests.

About plugin

  • Plugin page: resmushit-image-o...
  • Plugin version: 0.4.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2016
  • Latest release: Oct 14, 2023
  • Number of updates: 134
  • Update frequency: every 20.1 days
  • Top authors: resmushit (73.13%)maecia (27.61%)

Code review

54 tests

User reviews

131 reviews

Install metrics

100,000+ active /2,589,799 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
Installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼2.33ms] Passed 4 tests

This is a short check of server-side resources used by reSmush.it : the only free Image Optimizer & compress plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3345.75 ▲0.71
Dashboard /wp-admin3.63 ▲0.3351.66 ▼5.32
Posts /wp-admin/edit.php3.75 ▲0.3952.58 ▲1.70
Add New Post /wp-admin/post-new.php6.23 ▲0.3496.60 ▼6.39
Media Library /wp-admin/upload.php3.56 ▲0.3241.30 ▲5.57
reSmush.it /wp-admin/upload.php?page=resmushit_options3.53299.12

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 18 new options
New WordPress options
resmushit_preserve_exif
resmushit_remove_unsmushed
db_upgraded
widget_recent-posts
resmushit_cron_firstactivation
resmushit_statistics
resmushit_notice_close_eoldec23
resmushit_has_no_backup_files
resmushit_on_upload
resmushit_cron_lastrun
...

Browser metrics Passed 4 tests

Checking browser requirements for reSmush.it : the only free Image Optimizer & compress plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.36 ▼0.241.70 ▼0.0829.29 ▼15.00
Dashboard /wp-admin2,237 ▲575.64 ▼0.0381.59 ▼19.2791.29 ▲47.43
Posts /wp-admin/edit.php2,164 ▲642.14 ▲0.1741.82 ▲6.4460.65 ▲23.76
Add New Post /wp-admin/post-new.php1,544 ▲1818.28 ▼5.25586.31 ▼79.8567.93 ▲13.05
Media Library /wp-admin/upload.php1,460 ▲574.24 ▲0.0596.83 ▲0.3687.89 ▲44.86
reSmush.it /wp-admin/upload.php?page=resmushit_options1,0162.0225.4140.80

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
  • This plugin does not fully uninstall, leaving 18 options in the database
    • db_upgraded
    • resmushit_notice_close_eoldec23
    • can_compress_scripts
    • resmushit_statistics
    • widget_recent-comments
    • resmushit_preserve_exif
    • resmushit_cron_lastrun
    • resmushit_total_optimized
    • resmushit_on_upload
    • resmushit_has_no_backup_files
    • ...

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/resmushit-image-optimizer/resmushit.settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/resmushit-image-optimizer/resmushit.settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/resmushit-image-optimizer/resmushit.admin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/resmushit-image-optimizer/resmushit.settings.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

resmushit-image-optimizer/resmushit.php 92% from 13 tests

This is the main PHP file of "reSmush.it : the only free Image Optimizer & compress plugin" version 0.4.13, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("resmushit-image-optimizer.php" instead of "resmushit.php")

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
Success! There were no dangerous files found in this plugin2,283 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP73175511,355
PO File3139155399
CSS1110303
JavaScript13732226

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity33.67
▷ Minimum class complexity16.00
▷ Maximum class complexity44.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods2987.88%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants1083.33%
▷ Class constants216.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/info.png1.63KB0.78KB▼ 52.48%
images/twitter.png0.36KB0.44KB0.00%
images/maecia.png1.86KB1.24KB▼ 33.73%
images/ok.png0.48KB0.72KB0.00%
images/toggle.png1.42KB0.53KB▼ 62.38%