72% simple-webp-images

Code Review | Simple Webp Images

WordPress plugin Simple Webp Images scored72%from 54 tests.

About plugin

  • Plugin page: simple-webp-images
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 18, 2020
  • Latest release: Jul 25, 2021
  • Number of updates: 16
  • Update frequency: every 34.8 days
  • Top authors: mikebricknellbarlow (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /4,827 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼7.76ms] Passed 4 tests

Server-side resources used by Simple Webp Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1341.62 ▼7.83
Dashboard /wp-admin3.42 ▲0.1244.77 ▼3.35
Posts /wp-admin/edit.php3.54 ▲0.1847.02 ▼0.26
Add New Post /wp-admin/post-new.php6.02 ▲0.1482.17 ▼18.74
Media Library /wp-admin/upload.php3.35 ▲0.1234.73 ▼1.10
Simple Webp Images /wp-admin/options-general.php?page=simple-webp-images3.3432.03

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

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • The plugin illegally modified 1 file (0.45KB) outside of "wp-content/plugins/simple-webp-images/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/output_buffering.php
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Simple Webp Images: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5514.82 ▲0.421.63 ▼0.5744.76 ▼7.00
Dashboard /wp-admin2,218 ▲304.88 ▼1.02111.83 ▲8.7741.05 ▼3.33
Posts /wp-admin/edit.php2,101 ▲152.08 ▲0.0242.58 ▲6.8934.70 ▼1.73
Add New Post /wp-admin/post-new.php1,535 ▲1518.41 ▼4.78623.90 ▼62.4664.17 ▲6.71
Media Library /wp-admin/upload.php1,404 ▲134.49 ▲0.34100.75 ▼5.7442.77 ▲1.34
Simple Webp Images /wp-admin/options-general.php?page=simple-webp-images9522.0031.1936.10

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 does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • 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
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-webp-images
    • > Warning in wp-content/plugins/simple-webp-images/templates/template-admin-menu-page.php+52
    in_array() expects parameter 2 to be array, bool given

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-webp-images/templates/partial-single-convert-button.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/simple-webp-images/simple-webp-images.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/simple-webp-images/templates/template-admin-menu-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/simple-webp-images/mu-plugins/output_buffering.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: webp, pagespeed, images, conversion, speed

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

The main PHP script in "Simple Webp Images" version 1.2.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 202 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin1,817 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript7211218842
PHP717419685
Sass2340230
Markdown113044
JSON10014
CSS2022

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.32
Average class complexity25.00
▷ Minimum class complexity12.00
▷ Maximum class complexity50.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods2556.82%
▷ Protected methods00.00%
▷ Private methods1943.18%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants3
▷ Global constants3100.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 were not PNG files found in your plugin