84% webp-converter-for-media

Code Review | Converter for Media - Optimize images | Convert WebP & AVIF

WordPress plugin Converter for Media - Optimize images | Convert WebP & AVIF scored84%from 54 tests.

About plugin

  • Plugin page: webp-converter-fo...
  • Plugin version: 5.11.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Jun 16, 2019
  • Latest release: Nov 13, 2023
  • Number of updates: 684
  • Update frequency: every 2.4 days
  • Top authors: mateuszgbiorczyk (100%)

Code review

54 tests

User reviews

853 reviews

Install metrics

400,000+ active /8,197,846 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.43MB] [CPU: ▲1.38ms] Passed 4 tests

A check of server-side resources used by Converter for Media - Optimize images | Convert WebP & AVIF
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4239.67 ▲0.36
Dashboard /wp-admin3.74 ▲0.4447.84 ▼3.77
Posts /wp-admin/edit.php3.79 ▲0.4452.63 ▲5.89
Add New Post /wp-admin/post-new.php6.36 ▲0.4791.93 ▲3.05
Media Library /wp-admin/upload.php3.66 ▲0.4443.04 ▲13.29
Converter for Media /wp-admin/options-general.php?page=webpc_admin_page3.7454.73
Converter for Media /wp-admin/upload.php?page=webpc_optimization_page3.6546.29

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

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Illegal file modification detected: 6 files (14.92KB) outside of "wp-content/plugins/webp-converter-for-media/" and "wp-content/uploads/"
    • (new file) wp-content/.htaccess
    • (new file) wp-content/uploads-webpc/.htaccess
    • (new file) wp-content/uploads-webpc/uploads/webp-converter-for-media-test.png.webp
    • (new file) wp-content/uploads-webpc/uploads/webp-converter-for-media-test.png2.webp
    • (new file) wp-content/uploads-webpc/uploads/webp-converter-for-media-test.png.avif
    • (new file) wp-content/uploads-webpc/plugins/webp-converter-for-media/assets/img/icon-test.png.webp
Filesystem: 251 new files
Database: no new tables, 18 new options
New WordPress options
webpc_is_new_installation
webpc_stats_webp_unconverted
webpc_stats_installation_date
db_upgraded
widget_theysaidso_widget
webpc_token_data
webpc_notice_thanks
webpc_stats_webp_all
webpc_notice_upgrade
webpc_stats_first_version
...

Browser metrics Passed 4 tests

A check of browser resources used by Converter for Media - Optimize images | Convert WebP & AVIF
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲9114.43 ▲0.091.61 ▼0.0540.72 ▼3.15
Dashboard /wp-admin2,255 ▲815.79 ▲0.1698.64 ▼4.9361.55 ▲18.30
Posts /wp-admin/edit.php2,158 ▲582.22 ▲0.1840.48 ▲3.0836.24 ▲1.41
Add New Post /wp-admin/post-new.php1,723 ▲19722.41 ▼1.32637.37 ▼17.8358.70 ▲1.04
Media Library /wp-admin/upload.php1,516 ▲1164.32 ▲0.11100.20 ▼4.0078.34 ▲35.88
Converter for Media /wp-admin/options-general.php?page=webpc_admin_page1,5531.8234.3855.60
Converter for Media /wp-admin/upload.php?page=webpc_optimization_page1,2371.8029.7042.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 127× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WebpConverter\\Loader\\LoaderAbstract' not found in wp-content/plugins/webp-converter-for-media/src/Loader/HtaccessLoader.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WebpConverter\\Settings\\Option\\OptionAbstract' not found in wp-content/plugins/webp-converter-for-media/src/Settings/Option/AccessTokenOption.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WebpConverter\\Conversion\\Endpoint\\EndpointAbstract' not found in wp-content/plugins/webp-converter-for-media/src/Conversion/Endpoint/FilesStatsEndpoint.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebpConverter\\Conversion\\Directory\\DirectoryAbstract' not found in wp-content/plugins/webp-converter-for-media/src/Conversion/Directory/UploadsWebpcDirectory.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WebpConverter\\Conversion\\Format\\FormatAbstract' not found in wp-content/plugins/webp-converter-for-media/src/Conversion/Format/WebpFormat.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WebpConverter\\Exception\\ExceptionInterface' not found in wp-content/plugins/webp-converter-for-media/src/Exception/ExceptionAbstract.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WebpConverter\\Error\otice\oticeInterface' not found in wp-content/plugins/webp-converter-for-media/src/Error/Notice/ApiLimitExceededNotice.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WebpConverter\\Settings\\Option\\OptionInterface' not found in wp-content/plugins/webp-converter-for-media/src/Settings/Option/OptionAbstract.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WebpConverter\\Error\otice\oticeInterface' not found in wp-content/plugins/webp-converter-for-media/src/Error/Notice/PathUploadsUnavailableNotice.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WebpConverter\\Error\\Detector\\DetectorInterface' not found in wp-content/plugins/webp-converter-for-media/src/Error/Detector/TokenStatusDetector.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: convert webp, optimize images, compress images, image optimization, webp

webp-converter-for-media/webp-converter-for-media.php 92% from 13 tests

The main file in "Converter for Media - Optimize images | Convert WebP & AVIF" v. 5.11.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 171 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected11,233 lines of code in 237 files:
LanguageFilesBlank linesComment linesLines of code
PHP2312,3105,43211,135
JSON10076
SVG10018
CSS2002
JavaScript2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces31
Interfaces14
Traits0
Classes178
▷ Abstract classes105.62%
▷ Concrete classes16894.38%
▷ Final classes00.00%
Methods940
▷ Static methods656.91%
▷ Public methods84690.00%
▷ Protected methods80.85%
▷ Private methods869.15%
Functions21
▷ Named functions00.00%
▷ Anonymous functions21100.00%
Constants191
▷ Global constants00.00%
▷ Class constants191100.00%
▷ Public constants191100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo-headline.png10.20KB5.60KB▼ 45.06%
assets/img/icon-test.png21.08KB9.86KB▼ 53.24%
assets/img/author.png15.52KB15.82KB0.00%
assets/img/logo-bg.png0.92KB1.30KB0.00%