78% webp-converter

Code Review | Webp Converter

WordPress plugin Webp Converter scored78%from 54 tests.

About plugin

  • Plugin page: webp-converter
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.9.3
  • WordPress version: 6.3.1
  • First release: Sep 3, 2021
  • Latest release: May 14, 2022
  • Number of updates: 6
  • Update frequency: every 42.2 days
  • Top authors: avi.megladon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,644 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
Installer ran successfully

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

This is a short check of server-side resources used by Webp Converter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.52 ▼0.37
Dashboard /wp-admin3.33 ▲0.0345.15 ▼3.79
Posts /wp-admin/edit.php3.38 ▲0.0347.58 ▲6.30
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.35 ▼2.58
Media Library /wp-admin/upload.php3.26 ▲0.0334.24 ▼1.20
WEBP Converter /wp-admin/admin.php?page=apwebp_converter_setup_data3.2732.78
Settings /wp-admin/admin.php?page=apwebp_converter_settings3.2931.36

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
apwebp_image_quality
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Webp Converter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲11013.36 ▼1.281.89 ▲0.2740.48 ▲1.58
Dashboard /wp-admin2,254 ▲685.05 ▲0.10120.38 ▲14.1339.43 ▼3.99
Posts /wp-admin/edit.php2,140 ▲512.25 ▲0.1945.84 ▲11.8836.46 ▲3.75
Add New Post /wp-admin/post-new.php1,552 ▲1823.50 ▲0.27653.34 ▲1.5736.58 ▼14.23
Media Library /wp-admin/upload.php1,433 ▲454.32 ▲0.15102.21 ▼8.5643.72 ▼5.60
WEBP Converter /wp-admin/admin.php?page=apwebp_converter_setup_data9281.9033.5128.03
Settings /wp-admin/admin.php?page=apwebp_converter_settings1,0281.9937.6630.42

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • apwebp_image_quality
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/webp-converter/view/admin/pro-add.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/webp-converter/view/admin/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/webp-converter/view/admin/help.php:3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/webp-converter/webp-converter.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webp-converter/view/admin/image-sub-item.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/webp-converter/webp-converter.php on line 45
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/webp-converter/webp-converter.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webp-converter/view/admin/image-item.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WEBP\\Init\\is_plugin_active() in wp-content/plugins/webp-converter/webp-converter.php:46
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/webp-converter/view/admin/converter-data.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt might help

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

The entry point to "Webp Converter" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,172 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS239561,276
PHP1412223755
JavaScript371141

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.20
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/rss.png0.60KB0.50KB▼ 16.18%
images/error.png0.44KB0.44KB0.00%
images/wait.png0.68KB0.75KB0.00%
images/done.png0.37KB0.39KB0.00%