74% webp-simple

Code Review | Simple WebP

WordPress plugin Simple WebP scored 74% from 54 tests.

About plugin

  • Plugin page: webp-simple
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.1-5.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2019
  • Latest release: Nov 27, 2019
  • Number of updates: 7
  • Update frequency: every 3.7 days
  • Top authors: jillro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,821 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.71ms] Passed 4 tests

An overview of server-side resources used by Simple WebP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.49 ▲1.0342.43 ▲3.02
Dashboard /wp-admin3.31 ▲0.0143.33 ▼7.55
Posts /wp-admin/edit.php3.36 ▲0.0147.26 ▲0.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.32 ▼6.50
Media Library /wp-admin/upload.php3.24 ▲0.0134.08 ▲3.84

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 145 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Simple WebP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲9313.71 ▼0.881.80 ▼0.0337.64 ▼11.91
Dashboard /wp-admin2,203 ▲185.83 ▼0.07105.45 ▲5.1837.32 ▼6.52
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.0839.04 ▼1.6536.00 ▼0.53
Add New Post /wp-admin/post-new.php1,542 ▲2123.08 ▼0.07608.10 ▼19.0660.38 ▲5.44
Media Library /wp-admin/upload.php1,391 ▲64.20 ▲0.0197.45 ▼6.5143.91 ▲0.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 51× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ImageMimeTypeGuesser\\Detectors\\AbstractDetector' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/image-mime-type-guesser/src/Detectors/Stack.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Options\\Option' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Options/GhostOption.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Converters\\AbstractConverter' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Convert/Converters/GraphicsMagick.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Exceptions\\ConversionFailed\\FileSystemProblemsException' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailed/FileSystemProblems/CreateDestinationFolderException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Loggers\\BaseLogger' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Loggers/EchoLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Options\\Option' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Options/BooleanOption.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Convert\\Exceptions\\ConversionFailedException' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Convert/Exceptions/ConversionFailed/ConversionSkippedException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\InvalidInputException' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Exceptions/InvalidInput/TargetNotFoundException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Options\\ArrayOption' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Options/SensitiveArrayOption.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebPConvert\\Exceptions\\WebPConvertException' not found in wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Options/Exceptions/InvalidOptionTypeException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: performance, webp

webp-simple/webp-simple.php Passed 13 tests

The principal PHP file in "Simple WebP" v. 1.0.0 is loaded by WordPress automatically on each request
69 characters long description:
Serve WebP images instead of jpeg/png to browsers that supports WebP.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/webp-simple/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-103-windows-x64.exe
9,740 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
PHP961,4883,6056,807
Markdown2182902,456
JSON500415
XML24161
JavaScript1041

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity8.61
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces24
Interfaces0
Traits9
Classes80
▷ Abstract classes33.75%
▷ Concrete classes7796.25%
▷ Final classes00.00%
Methods334
▷ Static methods8324.85%
▷ Public methods20862.28%
▷ Protected methods7422.16%
▷ Private methods5215.57%
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

It is recommended to compress PNG files in your plugin to 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%