84% disable-webp-by-default

Code Review | Disable WebP By Default

WordPress plugin Disable WebP By Default scored84%from 54 tests.

About plugin

  • Plugin page: disable-webp-by-d...
  • Plugin version: 0.7.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 31, 2022
  • Latest release: Aug 3, 2023
  • Number of updates: 20
  • Update frequency: every 24.5 days
  • Top authors: davidbaumwald (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /1,958 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.07ms] Passed 4 tests

This is a short check of server-side resources used by Disable WebP By Default
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.33 ▼3.42
Dashboard /wp-admin3.33 ▲0.0349.97 ▲2.18
Posts /wp-admin/edit.php3.38 ▲0.0347.15 ▲0.66
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.61 ▼10.14
Media Library /wp-admin/upload.php3.26 ▲0.0336.94 ▲0.64

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
disable_webp_by_default_database_version
can_compress_scripts
disable_webp_transforms
disable_webp_by_default_plugin_version
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Disable WebP By Default
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▼0.021.96 ▲0.2242.73 ▼0.87
Dashboard /wp-admin2,198 ▲215.67 ▲0.0881.97 ▼12.1937.71 ▼2.46
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0233.87 ▼1.6033.36 ▼2.19
Add New Post /wp-admin/post-new.php1,526 ▼023.46 ▲5.70672.05 ▼18.8951.82 ▼2.60
Media Library /wp-admin/upload.php1,394 ▼94.20 ▼0.0499.98 ▼6.7644.10 ▲1.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/disable-webp-by-default/inc/activator.php
    • > /wp-content/plugins/disable-webp-by-default/inc/class-disable-webp-by-default.php
    • > /wp-content/plugins/disable-webp-by-default/disable-webp-by-default.php
    • > /wp-content/plugins/disable-webp-by-default/inc/deactivator.php

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 Passed 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
4 plugin tags: webp, media, image, jpeg

disable-webp-by-default/disable-webp-by-default.php Passed 13 tests

The main PHP script in "Disable WebP By Default" version 0.7.0 is automatically included on every request by WordPress
73 characters long description:
A small plugin to disable WebP image creation on image upload by default.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin246 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP449196140
XML16843
JSON10032
Markdown115031

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.33
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods10
▷ Static methods660.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
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
PNG images were not found in this plugin