73% wp-media-optimizer-webp

Code Review | WP Media Optimizer (.webp)

WordPress plugin WP Media Optimizer (.webp) scored73%from 54 tests.

About plugin

  • Plugin page: wp-media-optimize...
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2019
  • Latest release: Sep 21, 2023
  • Number of updates: 64
  • Update frequency: every 22.6 days
  • Top authors: francescosganga (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

300+ active /9,172 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼3.97ms] Passed 4 tests

An overview of server-side resources used by WP Media Optimizer (.webp)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1641.88 ▲1.81
Dashboard /wp-admin3.49 ▲0.1947.83 ▲4.25
Posts /wp-admin/edit.php3.59 ▲0.2350.35 ▲4.71
Add New Post /wp-admin/post-new.php6.18 ▲0.2980.04 ▼25.98
Media Library /wp-admin/upload.php3.43 ▲0.2037.03 ▲4.06
About /wp-admin/admin.php?page=wpmowebp-option-about3.36292.49
Above the Fold /wp-admin/admin.php?page=wpmowebp-option-abovethefold3.3235.51
WP Media Optimizer /wp-admin/admin.php?page=wpmowebp-options3.3435.29

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
can_compress_scripts
wpmowebp-css
theysaidso_admin_options
widget_theysaidso_widget
wpmowebp-js
wpmowebp-images-dir
widget_recent-posts
wpmowebp-atf
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Media Optimizer (.webp)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲14613.21 ▼1.371.88 ▲0.1344.03 ▲0.94
Dashboard /wp-admin2,247 ▲595.87 ▲1.0198.55 ▼4.3540.95 ▼5.76
Posts /wp-admin/edit.php2,142 ▲532.00 ▲0.0039.57 ▲1.9937.58 ▲1.68
Add New Post /wp-admin/post-new.php1,577 ▲5721.12 ▼2.30674.69 ▲77.5058.62 ▲5.81
Media Library /wp-admin/upload.php1,441 ▲504.26 ▲0.0595.51 ▼4.0544.39 ▼1.09
About /wp-admin/admin.php?page=wpmowebp-option-about8142.1724.5326.05
Above the Fold /wp-admin/admin.php?page=wpmowebp-option-abovethefold1,1212.0121.8330.44
WP Media Optimizer /wp-admin/admin.php?page=wpmowebp-options1,0312.0728.5030.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • wpmowebp-images-dir
    • wpmowebp-css
    • widget_theysaidso_widget
    • wpmowebp-atf
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • wpmowebp-js
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpmowebp-option-abovethefold
    • > Notice in wp-content/plugins/wp-media-optimizer-webp/wp-media-optimizer-webp.php+304
    Undefined index: blacklisted
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpmowebp-option-abovethefold
    • > Warning in wp-content/plugins/wp-media-optimizer-webp/wp-media-optimizer-webp.php+304
    Invalid argument supplied for foreach()

SRP 50% 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-media-optimizer-webp/wp-media-optimizer-webp.php:34

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wpmowebp-option-about
    • > Network (severe)
    site/templates/styles/main.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wpmowebp-options
    • > Network (severe)
    wp-content/plugins/wp-media-optimizer-webp/assets/admin-main.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: image, load, lazy, media, webp...

wp-media-optimizer-webp/wp-media-optimizer-webp.php Passed 13 tests

The main PHP script in "WP Media Optimizer (.webp)" version 1.4.0 is automatically included on every request by WordPress
88 characters long description:
Convert your media images to .webp for increase performances, now with lazy load feature

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin544 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14515525
JavaScript11012
CSS1107

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
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%
Functions19
▷ Named functions1789.47%
▷ Anonymous functions210.53%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin