77% video-for-woocommerce

Code Review | WooCommerce Video

WordPress plugin WooCommerce Video scored77%from 54 tests.

About plugin

  • Plugin page: video-for-woocomm...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 1, 2020
  • Latest release: Jan 2, 2020
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: Mcurly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /458 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by WooCommerce Video
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.93 ▼6.51
Dashboard /wp-admin3.32 ▼0.0252.74 ▼16.53
Posts /wp-admin/edit.php3.37 ▲0.0250.98 ▲1.87
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.74 ▼7.89
Media Library /wp-admin/upload.php3.25 ▲0.0233.88 ▲0.76
WooCommerce Video /wp-admin/options-general.php?page=woocommerce-video-settings3.2633.78

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Video
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.26 ▼0.101.70 ▼0.5241.16 ▼2.03
Dashboard /wp-admin2,196 ▲165.54 ▼0.1686.50 ▼10.6639.48 ▼8.01
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0335.78 ▼2.5135.52 ▼2.95
Add New Post /wp-admin/post-new.php1,548 ▲823.26 ▲5.22628.16 ▼13.7155.65 ▼7.66
Media Library /wp-admin/upload.php1,395 ▼24.15 ▼0.0998.76 ▼7.6843.96 ▼5.88
WooCommerce Video /wp-admin/options-general.php?page=woocommerce-video-settings8782.0624.3727.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=woocommerce-video-settings
    • > Notice in wp-content/plugins/video-for-woocommerce/admin/partials/woocommerce-video-admin-display.php+34
    Undefined variable: selected_position
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=woocommerce-video-settings
    • > Notice in wp-content/plugins/video-for-woocommerce/admin/partials/woocommerce-video-admin-display.php+63
    Undefined variable: selected_icon

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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/video-for-woocommerce/public/partials/woocommerce-video-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Display on the theme Twenty Twenty), #2 (Settings), #3 (WooCommerce Product with Youtube URL video field)
You can look at the official readme.txt

video-for-woocommerce/woocommerce-video.php 85% from 13 tests

"WooCommerce Video" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("video-for-woocommerce.php" instead of "woocommerce-video.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin393 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP15176577343
PO File1171750

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
10 PNG files occupy 0.87MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png126.35KB127.18KB0.00%
public/img/camera.png1.50KB1.43KB▼ 5.07%
screenshot-3.png18.92KB9.21KB▼ 51.35%
public/img/video-red-2.png113.44KB47.77KB▼ 57.89%
public/img/youtube-black.png3.18KB2.38KB▼ 25.19%