84% youtube-widget-responsive

Code Review | Widget Responsive for Youtube

WordPress plugin Widget Responsive for Youtube scored84%from 54 tests.

About plugin

  • Plugin page: youtube-widget-re...
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 8, 2013
  • Latest release: Sep 19, 2023
  • Number of updates: 63
  • Update frequency: every 56.7 days
  • Top authors: stefanoai (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

10,000+ active /319,052 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼2.09ms] Passed 4 tests

This is a short check of server-side resources used by Widget Responsive for Youtube
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2243.03 ▼5.30
Dashboard /wp-admin46.81 ▲0.018,941,779.33 ▲8,438.99
Posts /wp-admin/edit.php3.69 ▲0.2953.42 ▲1.37
Add New Post /wp-admin/post-new.php6.16 ▲0.2289.29 ▼6.11
Media Library /wp-admin/upload.php3.50 ▲0.2239.01 ▲1.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_youtube_responsive
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Widget Responsive for Youtube: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲16013.46 ▼1.1510.22 ▲8.3342.80 ▲1.19
Dashboard /wp-admin2,195 ▲235.61 ▼0.0190.64 ▼12.3542.47 ▲2.33
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0139.35 ▼1.0136.09 ▼4.95
Add New Post /wp-admin/post-new.php1,526 ▼223.35 ▼0.10610.27 ▼73.2068.13 ▲14.81
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.09100.41 ▼19.6342.95 ▼5.09

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_youtube_responsive
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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 fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/youtube-widget-responsive/youtube-widget-responsive.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WPBakeryShortCode' not found in wp-content/plugins/youtube-widget-responsive/js_composer.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
You can take inspiration from this readme.txt

youtube-widget-responsive/youtube-widget-responsive.php Passed 13 tests

Analyzing the main PHP file in "Widget Responsive for Youtube" version 1.6.2
112 characters long description:
Widgets responsive and shorcode to embed youtube in your sidebar or in your content, with all available options.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,463 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP242411,299
PO File124094181,164

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity129.00
▷ Minimum class complexity2.00
▷ Maximum class complexity256.00
Average method complexity24.27
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods436.36%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
YouTube-icon.png21.62KB1.28KB▼ 94.07%