78% in-browser-image-compression

Code Review | In Browser Image Compression

WordPress plugin In Browser Image Compression scored78%from 54 tests.

About plugin

  • Plugin page: in-browser-image-...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 18, 2022
  • Latest release: Feb 27, 2023
  • Number of updates: 7
  • Update frequency: every 83.0 days
  • Top authors: staurand (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,047 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.77ms] Passed 4 tests

Analyzing server-side resources used by In Browser Image Compression
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.49 ▼5.60
Dashboard /wp-admin3.39 ▲0.0853.42 ▲4.23
Posts /wp-admin/edit.php3.50 ▲0.1450.71 ▼1.45
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.07 ▼11.06
Media Library /wp-admin/upload.php3.31 ▲0.0837.95 ▲3.03
Image compression /wp-admin/upload.php?page=ibic-image-compression3.2833.66

Server storage [IO: ▲1.11MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • You have illegally modified 1 file (1.35KB) outside of "wp-content/plugins/in-browser-image-compression/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for In Browser Image Compression
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8114.36 ▼0.042.23 ▲0.4944.02 ▲1.53
Dashboard /wp-admin2,209 ▲295.66 ▲0.1297.02 ▲0.9441.47 ▲0.16
Posts /wp-admin/edit.php2,118 ▲212.06 ▲0.0337.16 ▲0.6341.54 ▲4.56
Add New Post /wp-admin/post-new.php1,534 ▲823.56 ▲0.02677.72 ▲50.2054.32 ▼0.67
Media Library /wp-admin/upload.php1,422 ▲254.27 ▲0.07100.35 ▼9.7544.73 ▼13.22
Image compression /wp-admin/upload.php?page=ibic-image-compression8212.0626.8025.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/in-browser-image-compression/ibic.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/upload.php?page=ibic-image-compression
    • > Console-api (severe) in wp-content/plugins/in-browser-image-compression/assets/dist/ibic-admin.js?ver=1.1.1~54+0:2373
    Service worker unsupported

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: webp, image optimization

in-browser-image-compression/ibic.php 85% from 13 tests

"In Browser Image Compression" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("in-browser-image-compression.php" instead of "ibic.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin624 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP1078204405
Markdown2410120
JavaScript5131898
CSS1011

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
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%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin