78% webp-wasm

Code Review | WebP WASM

WordPress plugin WebP WASM scored78%from 54 tests.

About plugin

  • Plugin page: webp-wasm
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 19, 2020
  • Latest release: Jun 19, 2020
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: gecko43 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /515 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.69ms] Passed 4 tests

A check of server-side resources used by WebP WASM
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6547.29 ▲5.33
Dashboard /wp-admin3.36 ▲0.0654.92 ▲1.71
Posts /wp-admin/edit.php3.41 ▲0.0549.12 ▼0.78
Add New Post /wp-admin/post-new.php5.96 ▲0.0786.04 ▼14.63
Media Library /wp-admin/upload.php3.28 ▲0.0535.51 ▼1.06
WebP WASM /wp-admin/tools.php?page=webpwasm-backoffice3.2632.64

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WebP WASM
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.40 ▼0.251.82 ▲0.2444.11 ▼0.07
Dashboard /wp-admin2,208 ▲345.64 ▲0.0790.20 ▼9.7243.69 ▲3.07
Posts /wp-admin/edit.php2,113 ▲132.01 ▲0.0036.44 ▼5.2236.43 ▼4.06
Add New Post /wp-admin/post-new.php1,538 ▲923.26 ▲0.16648.22 ▼30.9855.17 ▼12.61
Media Library /wp-admin/upload.php1,407 ▲44.27 ▲0.06100.33 ▲1.5243.04 ▲1.22
WebP WASM /wp-admin/tools.php?page=webpwasm-backoffice8541.9126.4428.80

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/webp-wasm/main.php
    • > /wp-content/plugins/webp-wasm/webp.wasm.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/webp-wasm/main.html.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: image, webp

webp-wasm/main.php 92% from 13 tests

The main PHP file in "WebP WASM" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("webp-wasm.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected3,621 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP44063652,035
JavaScript25674871,500
CSS114356
Markdown120030

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity193.50
▷ Minimum class complexity138.00
▷ Maximum class complexity249.00
Average method complexity5.28
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods90
▷ Static methods11.11%
▷ Public methods7583.33%
▷ Protected methods1516.67%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants25
▷ Global constants2288.00%
▷ Class constants312.00%
▷ Public constants3100.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
No PNG files were detected