68% webp-images

Code Review | WebP Images

WordPress plugin WebP Images scored68%from 54 tests.

About plugin

  • Plugin page: webp-images
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 13
  • Update frequency: every 89.8 days
  • Top authors: andreadegiovine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /5,636 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.69ms] Passed 4 tests

Server-side resources used by WebP Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2140.65 ▼0.66
Dashboard /wp-admin3.52 ▲0.2149.07 ▼0.60
Posts /wp-admin/edit.php3.63 ▲0.2752.75 ▲1.56
Add New Post /wp-admin/post-new.php6.12 ▲0.2388.62 ▼11.07
Media Library /wp-admin/upload.php3.44 ▲0.2137.50 ▲2.54
WebP settings /wp-admin/upload.php?page=webp-images-settings3.4238.92

Server storage [IO: ▲12.19MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification found: 1 file (1.21KB) outside of "wp-content/plugins/webp-images/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 131 new files
Database: no new tables, 8 new options
New WordPress options
webp_images_version
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
webp_images_installation_time
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WebP Images
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.72 ▼0.801.53 ▼0.7143.75 ▲0.84
Dashboard /wp-admin2,217 ▲295.82 ▲0.91106.44 ▼0.4940.34 ▼3.05
Posts /wp-admin/edit.php2,103 ▲142.04 ▲0.0437.26 ▲0.9333.53 ▼0.77
Add New Post /wp-admin/post-new.php1,524 ▼1823.07 ▲4.73678.85 ▲20.8956.77 ▲3.90
Media Library /wp-admin/upload.php1,396 ▲54.18 ▼0.0396.92 ▼1.8643.01 ▼1.06
WebP settings /wp-admin/upload.php?page=webp-images-settings9332.0723.4638.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • webp_images_version
    • widget_recent-comments
    • db_upgraded
    • webp_images_installation_time
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/webp-images/parts/options-page-status.php
    • > /wp-content/plugins/webp-images/parts/sidebar.php
    • > /wp-content/plugins/webp-images/parts/options-page-main.php
    • > /wp-content/plugins/webp-images/inc/functions.php
    • > /wp-content/plugins/webp-images/webp-images.php
  • 50× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Converters\\AbstractConverter' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Converters/GraphicsMagick.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ImageMimeTypeGuesser\\Detectors\\AbstractDetector' not found in wp-content/plugins/webp-images/vendor/rosell-dk/image-mime-type-guesser/src/Detectors/ExifImageType.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Serve/Exceptions/ServeFailedException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Exceptions\\ConversionFailed\\FileSystemProblemsException' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailed/FileSystemProblems/CreateDestinationFileException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Options/Exceptions/InvalidOptionValueException.php:7
    • > PHP Fatal error
      Trait 'WebPConvert\\Convert\\Converters\\BaseTraits\\AutoQualityTrait' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Converters/AbstractConverter.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Exceptions\\ConversionFailedException' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailed/InvalidInputException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Options\\Option' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Options/IntegerOption.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Converters\\AbstractConverter' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Converters/Wpc.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Options/Exceptions/OptionNotFoundException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: images compression, images optimize, images, webp converter, webp

webp-images/webp-images.php 92% from 13 tests

The main PHP file in "WebP Images" ver. 2.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/webp-images/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-103-windows-x64.exe
9,051 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PHP1001,6033,7037,831
JSON510512
Markdown51350366
CSS1412178
JavaScript1190103
XML24161

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity9.81
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces24
Interfaces0
Traits9
Classes81
▷ Abstract classes33.70%
▷ Concrete classes7896.30%
▷ Final classes00.00%
Methods371
▷ Static methods8823.72%
▷ Public methods24164.96%
▷ Protected methods7119.14%
▷ Private methods5915.90%
Functions11
▷ Named functions872.73%
▷ Anonymous functions327.27%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin