83% youtube-background-slider

Code Review | YouTube Background Slider

WordPress plugin YouTube Background Slider scored83%from 54 tests.

About plugin

  • Plugin page: youtube-backgroun...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Mar 31, 2014
  • Latest release: May 1, 2014
  • Number of updates: 5
  • Update frequency: every 6.2 days
  • Top authors: wptreasure (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,146 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

This is a short check of server-side resources used by YouTube Background Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.06 ▼6.66
Dashboard /wp-admin3.36 ▲0.0646.27 ▼5.35
Posts /wp-admin/edit.php3.41 ▲0.0647.19 ▼3.84
Add New Post /wp-admin/post-new.php5.94 ▲0.0693.07 ▼8.32
Media Library /wp-admin/upload.php3.28 ▲0.0634.09 ▼4.05

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
yts_options

Browser metrics Passed 4 tests

Checking browser requirements for YouTube Background Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲20914.00 ▼0.5611.05 ▲8.9640.79 ▼5.64
Dashboard /wp-admin2,220 ▲325.86 ▲0.91103.10 ▼15.7283.11 ▲36.94
Posts /wp-admin/edit.php2,112 ▲231.99 ▼0.0542.78 ▲7.7834.25 ▲0.74
Add New Post /wp-admin/post-new.php1,529 ▼417.59 ▼5.26746.19 ▲86.9850.03 ▼5.94
Media Library /wp-admin/upload.php1,405 ▲174.10 ▼0.0895.65 ▼4.5879.44 ▲38.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • yts_options
    • widget_recent-posts
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-background-slider/yts-display.php:186
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-background-slider/yts-display.php:186

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #2 (Frontend display.) image missing
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

youtube-background-slider/ytslider.php 92% from 13 tests

"YouTube Background Slider" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("youtube-background-slider.php" instead of "ytslider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,237 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript236058721
PHP34749372
CSS254144

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.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/plus.png0.11KB0.11KB0.00%
images/youtube.png0.81KB0.84KB0.00%
images/minus.png0.10KB0.10KB0.00%