83% yith-woocommerce-featured-video

Code Review | YITH WooCommerce Featured Video

WordPress plugin YITH WooCommerce Featured Video scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 1.31.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.2-6.4
  • WordPress version: 6.3.1
  • First release: Aug 2, 2013
  • Latest release: Dec 1, 2023
  • Number of updates: 131
  • Update frequency: every 28.8 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

5,000+ active /358,197 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 gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.64ms] Passed 4 tests

An overview of server-side resources used by YITH WooCommerce Featured Video
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.65 ▼2.67
Dashboard /wp-admin3.33 ▲0.0345.76 ▼7.03
Posts /wp-admin/edit.php3.38 ▲0.0344.00 ▼0.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.73 ▼12.49
Media Library /wp-admin/upload.php3.25 ▲0.0234.72 ▲0.99

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 339 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
yit_recently_activated

Browser metrics Passed 4 tests

YITH WooCommerce Featured Video: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.36 ▼0.361.81 ▲0.0642.34 ▼3.63
Dashboard /wp-admin2,204 ▲275.62 ▼0.0787.17 ▼9.0939.66 ▼4.05
Posts /wp-admin/edit.php2,107 ▲41.97 ▼0.0035.75 ▼3.3331.67 ▼5.48
Add New Post /wp-admin/post-new.php1,532 ▲623.33 ▲0.01653.91 ▼38.9550.29 ▲0.38
Media Library /wp-admin/upload.php1,406 ▲34.20 ▼0.02100.68 ▲4.9941.54 ▼1.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • yit_recently_activated
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/yith-woocommerce-featured-video/templates/admin/premium.php:153

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
Please take inspiration from this readme.txt

yith-woocommerce-featured-video/init.php 77% from 13 tests

This is the main PHP file of "YITH WooCommerce Featured Video" version 1.31.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 257 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("6.2" instead of "8.2")
  • Main file name: Name the main plugin file the same as the plugin slug ("yith-woocommerce-featured-video.php" instead of "init.php")

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
Success! There were no dangerous files found in this plugin41,406 lines of code in 262 files:
LanguageFilesBlank linesComment linesLines of code
PHP1732,7775,48115,348
JavaScript531,3508239,377
CSS191,6682439,211
PO File71,6972,2074,476
SVG9012,954
XML112940

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity39.71
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.98
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes13.23%
▷ Concrete classes3096.77%
▷ Final classes00.00%
Methods389
▷ Static methods5413.88%
▷ Public methods31781.49%
▷ Protected methods5213.37%
▷ Private methods205.14%
Functions150
▷ Named functions14294.67%
▷ Anonymous functions85.33%
Constants17
▷ Global constants1694.12%
▷ Class constants15.88%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
51 PNG files occupy 0.76MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/images/sidebar-right.png0.95KB0.11KB▼ 87.91%
plugin-fw/assets/images/colorbox/border1.png0.61KB0.82KB0.00%
plugin-fw/assets/css/jquery-ui/images/ui-icons_888888_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
assets/images/04-bg.png2.75KB1.22KB▼ 55.56%