84% video-background

Code Review | Video Background

WordPress plugin Video Background scored84%from 54 tests.

About plugin

  • Plugin page: video-background
  • Plugin version: 2.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 10, 2015
  • Latest release: Mar 9, 2023
  • Number of updates: 81
  • Update frequency: every 33.8 days
  • Top authors: blakedotvegas (91.36%)pushlabs (9.88%)

Code review

54 tests

User reviews

61 reviews

Install metrics

10,000+ active /232,594 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.64MB] [CPU: ▲6.18ms] Passed 4 tests

Analyzing server-side resources used by Video Background
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3944.63 ▲4.79
Dashboard /wp-admin4.03 ▲0.7354.18 ▲9.57
Posts /wp-admin/edit.php4.07 ▲0.7148.19 ▲3.34
Add New Post /wp-admin/post-new.php7.03 ▲1.1494.61 ▲9.44
Media Library /wp-admin/upload.php3.96 ▲0.7339.13 ▲7.13
Video Background /wp-admin/options-general.php?page=pushlabs-vidbg3.9335.26

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 383 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Video Background
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲6713.38 ▼1.001.86 ▼0.0844.74 ▲2.94
Dashboard /wp-admin2,242 ▲545.03 ▲0.13118.20 ▲20.5242.21 ▼1.15
Posts /wp-admin/edit.php2,124 ▲352.16 ▲0.1737.44 ▲1.5834.93 ▲1.48
Add New Post /wp-admin/post-new.php6,551 ▲5,01426.26 ▲3.09939.46 ▲266.2044.36 ▼8.05
Media Library /wp-admin/upload.php1,418 ▲274.36 ▲0.1198.19 ▲0.2242.36 ▼0.95
Video Background /wp-admin/options-general.php?page=pushlabs-vidbg8602.3025.8027.71

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 41× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/video-background/inc/vendor/cmb2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/video-background/inc/classes/cmb2_field_slider.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/video-background/inc/vendor/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/video-background/inc/vendor/cmb2/includes/rest-api/CMB2_REST_Controller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === video-background === )
Please take inspiration from this readme.txt

video-background/candide-vidbg.php 92% from 13 tests

The principal PHP file in "Video Background" v. 2.7.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("video-background.php" instead of "candide-vidbg.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected55,640 lines of code in 232 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP622,3346,7248,044
JSON2006,602
CSS152681,2004,700
JavaScript114397041,722
Sass18312291,466
Markdown32490768
SVG10115

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.10
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes912.68%
▷ Concrete classes6287.32%
▷ Final classes00.00%
Methods553
▷ Static methods9116.46%
▷ Public methods46183.36%
▷ Protected methods8916.09%
▷ Private methods30.54%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants750.00%
▷ Class constants750.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/vendor/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
inc/vendor/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
inc/vendor/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
inc/vendor/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
inc/vendor/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%