93% wc-product-videos

Code Review | WC Product Videos

WordPress plugin WC Product Videos scored 93% from 54 tests.

About plugin

  • Plugin page: wc-product-videos
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-5.2.2
  • WordPress version: 5.8.1
  • First release: Jun 30, 2019
  • Latest release: Jun 30, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: glen_scott (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 339 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by WC Product Videos
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.0731.73 ▼1.16
Dashboard /wp-admin3.12 ▲0.0647.32 ▲0.58
Posts /wp-admin/edit.php3.23 ▲0.1241.86 ▼2.56
Add New Post /wp-admin/post-new.php5.48 ▲0.0488.11 ▼565.82
Media Library /wp-admin/upload.php3.06 ▲0.0635.06 ▲2.81

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WC Product Videos
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲22016.66 ▲1.1215.27 ▲4.8945.57 ▼0.31
Dashboard /wp-admin2,977 ▲436.13 ▲0.24166.23 ▲14.09111.40 ▲3.65
Posts /wp-admin/edit.php2,740 ▲12.72 ▼0.0068.97 ▲1.4684.61 ▼1.25
Add New Post /wp-admin/post-new.php1,619 ▼6421.34 ▲2.60285.97 ▼100.58105.44 ▼2.22
Media Library /wp-admin/upload.php1,811 ▲45.05 ▲0.05141.96 ▼16.75110.25 ▼11.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-product-videos/admin/partials/woocommerce-product-videos-admin-display.php
    • > /wp-content/plugins/wc-product-videos/public/partials/woocommerce-product-videos-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === wc-product-videos === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Product page showing the main product image replaced with an embedded YouTube video), #2 (Product video admin entry on the edit product page allowing selection of video and position)
You can look at the official readme.txt

wc-product-videos/wc-product-videos.php 85% from 13 tests

"WC Product Videos" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected237 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12130539231
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
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 Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.31MB with 0.21MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png182.51KB60.13KB▼ 67.06%
screenshot-2.png136.79KB45.77KB▼ 66.54%