84% allow-webp-image

Code Review | Allow Webp image

WordPress plugin Allow Webp imagescored84%from 54 tests.

About plugin

  • Plugin page: allow-webp-image
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.8+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Sep 5, 2020
  • Latest release: Jan 31, 2022
  • Number of updates: 5
  • Update frequency: every 102.8 days
  • Top authors: ravisinghit (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active /42,321 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.84ms] Passed 4 tests

Analyzing server-side resources used by Allow Webp image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0646.47 ▼0.84
Dashboard /wp-admin3.35 ▲0.0150.54 ▼16.46
Posts /wp-admin/edit.php3.47 ▲0.1152.46 ▲3.08
Add New Post /wp-admin/post-new.php5.95 ▲0.07100.36 ▲2.85
Media Library /wp-admin/upload.php3.28 ▲0.0544.29 ▲3.22

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Allow Webp image: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.43 ▼0.928.72 ▲6.4742.02 ▼1.38
Dashboard /wp-admin2,193 ▲135.49 ▼0.1887.72 ▼16.2838.25 ▼4.83
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0840.28 ▲0.7434.22 ▼2.55
Add New Post /wp-admin/post-new.php1,530 ▲423.04 ▼0.68623.43 ▼90.3058.67 ▲6.86
Media Library /wp-admin/upload.php1,398 ▼54.21 ▲0.10100.09 ▼6.9043.40 ▼1.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/allow-webp-image/public/partials/allow-webp-image-public-display.php
    • > /wp-content/plugins/allow-webp-image/admin/partials/allow-webp-image-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Allow Webp image=== )
You can take inspiration from this readme.txt

allow-webp-image/allow-webp-image.php Passed 13 tests

The principal PHP file in "Allow Webp image" v. 1.0.1 is loaded by WordPress automatically on each request
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected192 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12122531186
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin