68% gowebp

Code Review | Go WebP

WordPress plugin Go WebP scored 68% from 54 tests.

About plugin

  • Plugin page: gowebp
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 2, 2022
  • Latest release: Jun 15, 2022
  • Number of updates: 17
  • Update frequency: every 4.5 days
  • Top authors: increaserev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 497 total downloads

Benchmarks

Plugin footprint 65% 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.67MB] [CPU: ▼2.11ms] Passed 4 tests

This is a short check of server-side resources used by Go WebP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.17 ▲0.7139.31 ▼1.22
Dashboard /wp-admin4.00 ▲0.7051.31 ▼0.09
Posts /wp-admin/edit.php4.05 ▲0.7050.49 ▲0.61
Add New Post /wp-admin/post-new.php6.52 ▲0.6386.75 ▼7.72
Media Library /wp-admin/upload.php3.86 ▲0.6338.97 ▲5.37
Settings /wp-admin/admin.php?page=gowebp/gowebp_option2.php4.0837.80

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 222 new files
Database: 1 new table, 6 new options
New tables
wp_gowebp
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Go WebP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.28 ▼1.011.64 ▼0.5738.35 ▼12.85
Dashboard /wp-admin2,238 ▲535.00 ▼0.90106.39 ▲4.2576.61 ▲32.98
Posts /wp-admin/edit.php2,121 ▲322.08 ▲0.0735.83 ▼6.4734.12 ▼0.89
Add New Post /wp-admin/post-new.php1,694 ▲15222.57 ▲4.24751.00 ▲122.2249.39 ▼0.05
Media Library /wp-admin/upload.php1,414 ▲264.30 ▲0.0599.83 ▲3.4375.01 ▲33.70
Settings /wp-admin/admin.php?page=gowebp/gowebp_option2.php1,8042.5057.06125.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/gowebp/uninstall.php+6
    The use statement with non-compound name 'DirectoryIterator' has no effect
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gowebp/ir_footer.php
    • > /wp-content/plugins/gowebp/vendor/lsolesen/pel/examples/dirsort.php
    • > /wp-content/plugins/gowebp/vendor/lsolesen/pel/examples/edit-description.php
    • > /wp-content/plugins/gowebp/vendor/lsolesen/pel/make-image-test.php
    • > /wp-content/plugins/gowebp/vendor/lsolesen/pel/examples/dump-image.php
  • 88× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/test/imagetests/CanonPowershotS60Test.php:30
    • > PHP Warning
      array_shift() expects parameter 1 to be array, null given in wp-content/plugins/gowebp/vendor/lsolesen/pel/examples/dump-image.php on line 36
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryException' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/src/PelWrongComponentCountException.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryNumber' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/src/PelEntrySShort.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/test/BrokenImagesTest.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryNumber' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/src/PelEntrySLong.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'Pel\\Test\umberTestCase' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/test/NumberRationalTest.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/test/ConvertTest.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/test/GH16Test.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntry' not found in wp-content/plugins/gowebp/vendor/lsolesen/pel/src/PelEntryAscii.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
Please take inspiration from this readme.txt

gowebp/gowebp.php 92% from 13 tests

The main PHP file in "Go WebP" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 176 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin32,854 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1143,8409,95918,544
CSS9932438,940
PO File72,6615,0934,433
Markdown52880590
Bourne Shell463116150
JSON200112
XML34340
YAML25031
JavaScript41611
INI1003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity16.75
▷ Minimum class complexity1.00
▷ Maximum class complexity353.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces7
Interfaces0
Traits3
Classes98
▷ Abstract classes44.08%
▷ Concrete classes9495.92%
▷ Final classes00.00%
Methods547
▷ Static methods7313.35%
▷ Public methods52996.71%
▷ Protected methods50.91%
▷ Private methods132.38%
Functions18
▷ Named functions1583.33%
▷ Anonymous functions316.67%
Constants375
▷ Global constants00.00%
▷ Class constants375100.00%
▷ Public constants37098.67%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
18 PNG files occupy 0.50MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/img/web-desk-char.png38.72KB15.75KB▼ 59.33%
lib/img/mobile_preview.png29.78KB10.55KB▼ 64.58%
lib/img/oldpreview.png24.92KB10.20KB▼ 59.05%
lib/img/previewOLD.png24.92KB10.20KB▼ 59.05%
lib/img/preview.png29.84KB10.61KB▼ 64.43%