10% media-webp

Code Review | Media Webp

WordPress plugin Media Webp scored 10% from 54 tests.

About plugin

  • Plugin page: media-webp
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9
  • WordPress version: 6.3.1
  • First release: Oct 25, 2018
  • Latest release: Oct 30, 2018
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: steveturner2018 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active / 4,039 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/media-webp/classes/class-plugin.php+342
    Non-static method WPST\Media_Webp\Plugin::update_options() should not be called statically

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.49ms] Passed 4 tests

A check of server-side resources used by Media Webp
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.06 ▼3.97
Dashboard /wp-admin3.34 ▲0.0447.78 ▼0.54
Posts /wp-admin/edit.php3.46 ▲0.1045.08 ▼1.16
Add New Post /wp-admin/post-new.php5.95 ▲0.06120.15 ▲27.68
Media Library /wp-admin/upload.php3.27 ▲0.0439.31 ▲3.72
Media Webp /wp-admin/tools.php?page=media-webp_tools3.2629.45
Media Webp /wp-admin/options-general.php?page=media-webp_settings3.3730.94

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
media_webp_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Media Webp
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.22 ▼1.461.74 ▼0.0341.74 ▼8.55
Dashboard /wp-admin2,211 ▲235.77 ▲0.88102.64 ▼3.8738.18 ▼2.35
Posts /wp-admin/edit.php2,097 ▲52.05 ▲0.0740.10 ▲4.2835.36 ▲3.02
Add New Post /wp-admin/post-new.php1,538 ▲2418.42 ▲0.73615.16 ▼81.7248.09 ▼2.17
Media Library /wp-admin/upload.php1,402 ▲174.29 ▲0.0799.98 ▼0.5841.89 ▼0.66
Media Webp /wp-admin/tools.php?page=media-webp_tools9702.0823.8738.37
Media Webp /wp-admin/options-general.php?page=media-webp_settings1,1642.1325.0827.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • media_webp_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/tools.php?page=media-webp_tools
    • > Deprecated in wp-content/plugins/media-webp/classes/class-forms.php+64
    Non-static method WPST\Media_Webp\Plugin::networkactive() should not be called statically
    • > GET request to /wp-admin/tools.php?page=media-webp_tools
    • > Notice in wp-content/plugins/media-webp/classes/class-tool.php+49
    Undefined index: message

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-pluginTest.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-adminTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-settingTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/stubs.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-linkTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-noticeTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Tools\\TestCase' not found in wp-content/plugins/media-webp/tests/classes/class-toolTest.php:17
    • > PHP Warning
      Use of undefined constant MEDIA_WEBP_DIR - assumed 'MEDIA_WEBP_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-webp/autoload.php on line 215
    • > PHP Warning
      Use of undefined constant MEDIA_WEBP_DIR - assumed 'MEDIA_WEBP_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-webp/autoload.php on line 208
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock' not found in wp-content/plugins/media-webp/tests/bootstrap.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
7 plugin tags: latest, optimization, optimise, media, seo...

media-webp/mediawebp.php 85% from 13 tests

"Media Webp" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 235 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("media-webp.php" instead of "mediawebp.php")

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
No dangerous file extensions were detected5,926 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP245221,3103,261
PO File56058152,211
JavaScript4100279
CSS260132
XML10030
JSON10013

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity7.23
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods161
▷ Static methods74.35%
▷ Public methods15395.03%
▷ Protected methods53.11%
▷ Private methods31.86%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
tests/tmp/test.png0.12KB0.11KB▼ 6.72%