10% kraken-image-optimizer

Code Review | Kraken.io Image Optimizer

WordPress plugin Kraken.io Image Optimizer scored10%from 54 tests.

About plugin

  • Plugin page: kraken-image-opti...
  • Plugin version: 2.6.8
  • PHP compatiblity: 5.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.3
  • WordPress version: 6.3.1
  • First release: Feb 24, 2014
  • Latest release: Jan 13, 2023
  • Number of updates: 107
  • Update frequency: every 30.3 days
  • Top authors: karim79 (100%)

Code review

54 tests

User reviews

119 reviews

Install metrics

20,000+ active /366,821 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/kraken-image-optimizer/kraken.php+53
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.52MB] [CPU: ▼51.68ms] Passed 4 tests

Analyzing server-side resources used by Kraken.io Image Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.47 ▼1.007.02 ▼32.01
Dashboard /wp-admin2.49 ▼0.829.53 ▼35.20
Posts /wp-admin/edit.php2.49 ▼0.878.56 ▼42.59
Add New Post /wp-admin/post-new.php2.49 ▼3.407.12 ▼96.92
Media Library /wp-admin/upload.php2.49 ▼0.747.01 ▼31.62
Kraken.io /wp-admin/options-general.php?page=wp-krakenio2.497.16

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Kraken.io Image Optimizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.261.68 ▼0.0636.52 ▼7.98
Dashboard /wp-admin2,202 ▲225.66 ▼0.0580.84 ▼5.9139.61 ▼3.44
Posts /wp-admin/edit.php2,101 ▼21.95 ▼0.0939.92 ▼2.1237.17 ▲0.54
Add New Post /wp-admin/post-new.php1,531 ▲322.67 ▼0.36645.06 ▲17.7154.21 ▼7.36
Media Library /wp-admin/upload.php1,405 ▲54.21 ▼0.0296.54 ▼0.5841.40 ▼1.68
Kraken.io /wp-admin/options-general.php?page=wp-krakenio1,6631.7226.6536.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/kraken-image-optimizer/kraken.php+53
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wp-krakenio
    • > Notice in wp-content/plugins/kraken-image-optimizer/kraken.php+53
    Trying to access array offset on value of type bool

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
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 get_option() in wp-content/plugins/kraken-image-optimizer/kraken.php:52

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

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 25 tag instead of maximum 10
You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "Kraken.io Image Optimizer" version 2.6.8
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("kraken-image-optimizer.php" instead of "kraken.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin3,205 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5213601,644
PHP2212591,161
CSS4304400

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity111.00
▷ Minimum class complexity6.00
▷ Maximum class complexity216.00
Average method complexity6.37
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods41
▷ Static methods37.32%
▷ Public methods4097.56%
▷ Protected methods00.00%
▷ Private methods12.44%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected