78% webp-attachments

Code Review | Webp Attachments

WordPress plugin Webp Attachments scored78%from 54 tests.

About plugin

  • Plugin page: webp-attachments
  • Plugin version: 1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Dec 10, 2020
  • Latest release: Dec 14, 2020
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: nicolasguitton (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.97ms] Passed 4 tests

This is a short check of server-side resources used by Webp Attachments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.47 ▼3.60
Dashboard /wp-admin3.36 ▲0.0651.91 ▲2.42
Posts /wp-admin/edit.php3.42 ▲0.0645.43 ▼7.92
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.17 ▼14.77
Media Library /wp-admin/upload.php3.29 ▲0.0635.68 ▲3.19
Webp Attachments /wp-admin/options-general.php?page=webp-config3.2532.11

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Webp Attachments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.44 ▲0.061.72 ▼0.5436.71 ▼10.63
Dashboard /wp-admin2,204 ▲135.79 ▲0.92115.25 ▲10.2742.92 ▼1.43
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0335.80 ▼5.4429.56 ▼6.94
Add New Post /wp-admin/post-new.php1,414 ▼10517.98 ▼5.16590.60 ▼73.9142.35 ▼4.54
Media Library /wp-admin/upload.php1,392 ▲74.18 ▼0.05101.09 ▼1.7740.64 ▼1.43
Webp Attachments /wp-admin/options-general.php?page=webp-config7712.0527.6726.34

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/webp-attachments/views/config-admin.tpl.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/webp-attachments/ngwebpattachments.php:21
    • > PHP Notice
      Trying to get property 'gdLoaded' of non-object in wp-content/plugins/webp-attachments/views/config-admin.tpl.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === webp-attachments === )
You can look at the official readme.txt

webp-attachments/ngwebpattachments.php 85% from 13 tests

The main PHP script in "Webp Attachments" version 1.4 is automatically included on every request by WordPress
The following require your attention:
  • Requires PHP: Required version must match the one declared in readme.txt ("7.0" instead of "5.6")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("webp-attachments.php" instead of "ngwebpattachments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected239 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23423239

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin