62% webp-express

Code Review | WebP Express

WordPress plugin WebP Express scored62%from 54 tests.

About plugin

  • Plugin page: webp-express
  • Plugin version: 0.25.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 1, 2018
  • Latest release: Oct 20, 2023
  • Number of updates: 266
  • Update frequency: every 7.2 days
  • Top authors: rosell.dk (100%)

Code review

54 tests

User reviews

148 reviews

Install metrics

300,000+ active /2,693,835 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.65ms] Passed 4 tests

This is a short check of server-side resources used by WebP Express
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.67 ▲1.66
Dashboard /wp-admin3.41 ▲0.0648.21 ▼11.54
Posts /wp-admin/edit.php3.53 ▲0.1745.39 ▼1.51
Add New Post /wp-admin/post-new.php6.00 ▲0.1081.85 ▼13.50
Media Library /wp-admin/upload.php3.34 ▲0.1035.10 ▼0.06
WebP Express /wp-admin/options-general.php?page=webp_express_settings_page3.5529.23
WebP Express /wp-admin/upload.php?page=webp_express_conversion_page3.3131.04

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

Filesystem and database footprint
Just a few items left to fix
  • The plugin illegally modified 6 files (1.38KB) outside of "wp-content/plugins/webp-express/" and "wp-content/uploads/"
    • (new file) wp-content/webp-express/htaccess-capability-tests/header-set/.htaccess
    • (new file) wp-content/webp-express/htaccess-capability-tests/header-set/request-me.txt
    • (new file) wp-content/webp-express/config/.htaccess
    • (new file) wp-content/webp-express/htaccess-capability-tests/pass-info-from-rewrite-to-script-through-env/test.php
    • (new file) wp-content/webp-express/htaccess-capability-tests/pass-info-from-rewrite-to-script-through-env/.htaccess
    • (new file) wp-content/webp-express/webp-images/.empty
Filesystem: 550 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
db_upgraded
webp-express-messages-pending
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
webp-express-migration-version
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WebP Express
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6714.72 ▲0.371.94 ▲0.2844.65 ▲3.29
Dashboard /wp-admin2,200 ▲235.59 ▲0.0282.56 ▼5.3838.46 ▼3.23
Posts /wp-admin/edit.php2,108 ▲81.97 ▲0.0236.04 ▼5.6932.33 ▼4.61
Add New Post /wp-admin/post-new.php1,535 ▲923.56 ▲0.09602.46 ▼70.6052.24 ▼3.15
Media Library /wp-admin/upload.php1,405 ▲114.19 ▲0.0896.01 ▼5.0140.66 ▼1.44
WebP Express /wp-admin/options-general.php?page=webp_express_settings_page3,2531.7934.19404.60
WebP Express /wp-admin/upload.php?page=webp_express_conversion_page2,9096.6878.1253.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=webp_express_conversion_page
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/webp-express/lib/classes/FileHelper.php+226
    fopen(wp-content/webp-express/config/config.json): failed to open stream: No such file or directory

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
Please fix the following
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/webp-express/wod2/webp-on-demand.php
    • > /wp-content/plugins/webp-express/wod2/ping.php
    • > /wp-content/plugins/webp-express/wod/ping.php
    • > /wp-content/plugins/webp-express/wod/webp-realizer.php
    • > /wp-content/plugins/webp-express/wod2/webp-realizer.php
    • > /wp-content/plugins/webp-express/wod/webp-on-demand.php
    • > /wp-content/plugins/webp-express/lib/options/options/conversion-options/converter-options/imagick.php
  • 240× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'HtaccessCapabilityTester\\Tests\\Testers\\BasisTestCase' not found in wp-content/plugins/webp-express/vendor/rosell-dk/htaccess-capability-tester/tests/Testers/DirectoryIndexTesterTest.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'WebPExpress\\PathHelper' not found in wp-content/plugins/webp-express/lib/migrate/migrate3.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'HtaccessCapabilityTester\\Testers\\CustomTester' not found in wp-content/plugins/webp-express/vendor/rosell-dk/htaccess-capability-tester/src/Testers/ServerSignatureTester.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'HtaccessCapabilityTester\\Tests\\Testers\\BasisTestCase' not found in wp-content/plugins/webp-express/vendor/rosell-dk/htaccess-capability-tester/tests/Testers/HeaderSetTesterTest.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/webp-express/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: webp, performance, images

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

This is the main PHP file of "WebP Express" version 0.25.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files 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/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-110-windows-x64.exe
      • wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-120-windows-x64.exe
33,012 lines of code in 485 files:
LanguageFilesBlank linesComment linesLines of code
PHP4045,57210,19226,030
Markdown2580702,412
JSON15101,848
JavaScript183754121,581
CSS47574630
XML10141231
YAML64412231
SVG31249

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.08
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces38
Interfaces2
Traits9
Classes307
▷ Abstract classes61.95%
▷ Concrete classes30198.05%
▷ Final classes00.00%
Methods1,274
▷ Static methods58746.08%
▷ Public methods97976.84%
▷ Protected methods14511.38%
▷ Private methods15011.77%
Functions63
▷ Named functions5079.37%
▷ Anonymous functions1320.63%
Constants34
▷ Global constants2779.41%
▷ Class constants720.59%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.36MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/options/css/images/checker.png0.18KB0.15KB▼ 19.05%
assets/icon-256x256.png6.86KB4.01KB▼ 41.51%
test/test.png3.04KB1.63KB▼ 46.57%
test/dice.png231.30KB58.53KB▼ 74.69%
assets/screenshot-1.png77.40KB31.19KB▼ 59.70%