94% webp-image-block

Code Review | Webp Image Block

WordPress plugin Webp Image Block scored 94% from 54 tests.

About plugin

  • Plugin page: webp-image-block
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.4.2
  • WordPress version: 5.8.1
  • First release: Jul 9, 2020
  • Latest release: Jul 21, 2020
  • Number of updates: 10
  • Update frequency: every 1.3 days
  • Top authors: kodeknight (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 290 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼148.48ms] Passed 4 tests

An overview of server-side resources used by Webp Image Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1637.19 ▲15.05
Dashboard /wp-admin3.10 ▲0.0550.29 ▲3.67
Posts /wp-admin/edit.php3.15 ▲0.0437.52 ▼32.60
Add New Post /wp-admin/post-new.php5.46 ▲0.0397.22 ▼564.99
Media Library /wp-admin/upload.php3.04 ▲0.0436.42 ▼0.01

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Webp Image Block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,709 ▲11316.18 ▲0.669.28 ▼0.0151.01 ▲1.04
Dashboard /wp-admin2,980 ▲435.92 ▼0.08139.84 ▼28.63120.85 ▼4.75
Posts /wp-admin/edit.php2,746 ▲72.68 ▼0.0172.96 ▼16.1090.75 ▼8.43
Add New Post /wp-admin/post-new.php1,877 ▲37719.12 ▲0.58381.96 ▼18.29112.69 ▼0.86
Media Library /wp-admin/upload.php1,814 ▲75.05 ▲0.06161.73 ▲8.70122.20 ▲3.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function KK_EL_WIDGETS\\add_action() in wp-content/plugins/webp-image-block/includes/blocks/elementor/custom-el-widgets.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: performance, elementor widget, image conversion, image compression, webp

webp-image-block/webp-image-block.php 85% from 13 tests

"Webp Image Block" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Description: The description should be shorter than 140 characters (currently 161 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
Good job! No executable or dangerous file extensions detected378 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP811690378

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.67
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods21
▷ Static methods314.29%
▷ Public methods1257.14%
▷ Protected methods419.05%
▷ Private methods523.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin