68% ht-fast-web

Code Review | HT Fast webp

WordPress plugin HT Fast webp scored68%from 54 tests.

About plugin

  • Plugin page: ht-fast-web
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 6, 2021
  • Latest release: Apr 10, 2021
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: htorresv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /436 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼8.61ms] Passed 4 tests

An overview of server-side resources used by HT Fast webp
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0425.44 ▼28.98
Dashboard /wp-admin3.33 ▲0.0348.86 ▼2.38
Posts /wp-admin/edit.php3.38 ▲0.0349.64 ▼3.18
Add New Post /wp-admin/post-new.php5.91 ▲0.0391.08 ▲0.76
Media Library /wp-admin/upload.php3.26 ▲0.0336.73 ▲0.10
Principal /wp-admin/admin.php?page=HT-fast-webp3.2234.44
Cookie policy /wp-admin/admin.php?page=HT-fast-webp-cookie-policy3.2334.54

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 149 new files
Database: no new tables, 15 new options
New WordPress options
widget_recent-comments
db_upgraded
HTFastWebp_cookie_policy_url
HTFastWebp_lazy_load_active
HTFastWebp_cookie_policy_text_url
can_compress_scripts
HTFastWebp_cookie_policy_btn
theysaidso_admin_options
HTFastWebp_cookie_policy_active
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for HT Fast webp
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.27 ▼1.112.15 ▼0.5743.56 ▼11.15
Dashboard /wp-admin2,235 ▲475.86 ▲0.77103.44 ▲0.0839.29 ▼7.27
Posts /wp-admin/edit.php2,121 ▲292.04 ▲0.0034.55 ▼7.6632.02 ▼6.68
Add New Post /wp-admin/post-new.php1,552 ▲3123.52 ▲0.43678.64 ▼1.8454.02 ▲1.42
Media Library /wp-admin/upload.php1,417 ▲294.19 ▲0.0496.80 ▼16.3044.82 ▼1.49
Principal /wp-admin/admin.php?page=HT-fast-webp8952.0223.1531.87
Cookie policy /wp-admin/admin.php?page=HT-fast-webp-cookie-policy9372.0322.7027.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 15 options
    • widget_theysaidso_widget
    • HTFastWebp_script_attribute_defer
    • HTFastWebp_cookie_policy_btn
    • widget_recent-posts
    • HTFastWebp_cookie_policy_title
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • HTFastWebp_cookie_policy_buttonAcceptTechnical
    • HTFastWebp_cookie_policy_text_url
    • ...

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ht-fast-web/actions/webp-on-demand.php
  • 56× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/ht-fast-web/settings/myOptions.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/webp-convert/src/Options/Exceptions/InvalidOptionValueException.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ht-fast-web/views/principal.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Converters\\AbstractConverter' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/webp-convert/src/Convert/Converters/GmagickBinary.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ht-fast-web/settings/run.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ImageMimeTypeGuesser\\Detectors\\AbstractDetector' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/image-mime-type-guesser/src/Detectors/MimeContentType.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ImageMimeTypeGuesser\\Detectors\\AbstractDetector' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/image-mime-type-guesser/src/Detectors/GetImageSize.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailedException.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Exceptions\\ConversionFailed\\InvalidInputException' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailed/InvalidInput/TargetNotFoundException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ImageMimeTypeGuesser\\Detectors\\AbstractDetector' not found in wp-content/plugins/ht-fast-web/vendor/rosell-dk/image-mime-type-guesser/src/Detectors/SniffFirstFourBytes.php:7

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: fast web, fast, pagespeed, web

ht-fast-web/init.php 85% from 13 tests

This is the main PHP file of "HT Fast webp" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ht-fast-web.php" instead of "init.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/ht-fast-web/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-110-windows-x64.exe
8,060 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1011,2862,6625,327
Markdown2179602,370
JSON300290
XML10028
CSS22026
JavaScript32017
YAML1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity8.22
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces23
Interfaces0
Traits9
Classes77
▷ Abstract classes33.90%
▷ Concrete classes7496.10%
▷ Final classes00.00%
Methods327
▷ Static methods8525.99%
▷ Public methods20462.39%
▷ Protected methods7322.32%
▷ Private methods5015.29%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.23MB with 0.17MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/rosell-dk/webp-convert/docs/v2.0/converting/dice.png231.30KB58.53KB▼ 74.69%