84% youtube-random-videos

Code Review | Youtube Random Videos

WordPress plugin Youtube Random Videos scored 84% from 54 tests.

About plugin

  • Plugin page: youtube-random-vi...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Apr 28, 2014
  • Latest release: Apr 28, 2014
  • Number of updates: 10
  • Update frequency: every 0.4 days
  • Top authors: fabwebstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,432 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.05MB] [CPU: ▼7.27ms] Passed 4 tests

A check of server-side resources used by Youtube Random Videos
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0431.97 ▼15.47
Dashboard /wp-admin3.38 ▲0.0845.07 ▼4.23
Posts /wp-admin/edit.php3.43 ▲0.0849.55 ▲2.96
Add New Post /wp-admin/post-new.php5.52 ▼0.3779.40 ▼9.35
Media Library /wp-admin/upload.php3.31 ▲0.0835.91 ▼0.01
Youtube Settings /wp-admin/options-general.php?page=override_settings3.2529.61

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

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

Browser metrics Passed 4 tests

Youtube Random Videos: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.23 ▼1.131.59 ▼0.5841.35 ▼4.51
Dashboard /wp-admin2,212 ▲214.84 ▼1.07109.53 ▼11.0037.81 ▼7.35
Posts /wp-admin/edit.php2,098 ▲122.05 ▼0.0140.23 ▲6.1136.14 ▲2.33
Add New Post /wp-admin/post-new.php6,513 ▲4,99920.22 ▲2.61887.51 ▲201.8555.03 ▼0.35
Media Library /wp-admin/upload.php1,391 ▲34.23 ▼0.0193.88 ▼18.0942.51 ▼3.56
Youtube Settings /wp-admin/options-general.php?page=override_settings8682.0723.2927.35

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+161
    Undefined property: wpYoutubeKeyword::$tname
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+179
    Undefined variable: yt_override_settings
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+188
    Undefined variable: yt_override_keyword
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+194
    Undefined variable: yt_override_n_keyword
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+200
    Undefined variable: yt_override_random_placement
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+215
    Undefined variable: yt_override_size
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+229
    Undefined variable: yt_override_location
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=override_settings
    • > Notice in wp-content/plugins/youtube-random-videos/youtube-random-videos.php+243
    Undefined variable: yt_override_align

SRP Passed 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
The SRP test was a success

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

youtube-random-videos/youtube-random-videos.php Passed 13 tests

The main PHP script in "Youtube Random Videos" version 1.1 is automatically included on every request by WordPress
62 characters long description:
Automatically Embed Videos Into Your Website Based on Keyword.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected410 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP18653376
CSS13034

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity33.50
▷ Minimum class complexity30.00
▷ Maximum class complexity37.00
Average method complexity6.42
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
No PNG images were found in this plugin