84% related-youtube-videos

Code Review | Related YouTube Videos

WordPress plugin Related YouTube Videos scored 84% from 53 tests.

About plugin

  • Plugin page: related-youtube-v...
  • Plugin version: 1.9.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.0.0
  • WordPress version: 5.8.1
  • First release: Feb 23, 2013
  • Latest release: May 25, 2019
  • Number of updates: 121
  • Update frequency: every 18.9 days
  • Top authors: Zenation (100%)

Code review

53 tests

User reviews

13 reviews

Install metrics

1,000+ active / 41,794 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼266.49ms] Passed 4 tests

An overview of server-side resources used by Related YouTube Videos
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.3433.64 ▲13.08
Dashboard /wp-admin3.29 ▲0.2448.88 ▲5.38
Posts /wp-admin/edit.php3.40 ▲0.2942.92 ▼4.06
Add New Post /wp-admin/post-new.php5.65 ▲0.2294.56 ▼1,064.32
Media Library /wp-admin/upload.php3.23 ▲0.2235.21 ▼2.96
Settings /wp-admin/admin.php?page=relatedyoutubevideos_settings3.2432.45
Related YouTube Videos /wp-admin/admin.php?page=relatedyoutubevideos_index3.2330.29
Clear Cache Manually /wp-admin/admin.php?page=relatedyoutubevideos_clearcache3.2127.86

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 153 new files
Database: no new tables, 1 new option
New WordPress options
widget_relatedyoutubevideos

Browser metrics Passed 4 tests

An overview of browser requirements for Related YouTube Videos
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,709 ▲12716.06 ▲0.389.18 ▲1.6148.77 ▼0.14
Dashboard /wp-admin2,967 ▲1145.94 ▲0.08136.84 ▲5.99105.95 ▲3.21
Posts /wp-admin/edit.php2,740 ▲342.69 ▼0.0168.40 ▲3.5185.32 ▼13.37
Add New Post /wp-admin/post-new.php2,060 ▲39319.23 ▲0.39363.47 ▼20.08103.77 ▼4.45
Media Library /wp-admin/upload.php1,809 ▲375.03 ▲0.04145.21 ▼14.14122.73 ▲9.39
Settings /wp-admin/admin.php?page=relatedyoutubevideos_settings1,1862.0855.8383.59
Related YouTube Videos /wp-admin/admin.php?page=relatedyoutubevideos_index2,2152.0958.00134.31
Clear Cache Manually /wp-admin/admin.php?page=relatedyoutubevideos_clearcache1,0042.0652.4640.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_relatedyoutubevideos

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 87× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Calendar.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/TagManager.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Cloudlatencytest.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Books.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Tasks.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/PlusDomains.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Prediction.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Deploymentmanager.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/MapsEngine.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/related-youtube-videos/lib/Google/Service/Logging.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (The widget backend for customizing the video request.)
Please take inspiration from this readme.txt

related-youtube-videos/index.php 92% from 13 tests

Analyzing the main PHP file in "Related YouTube Videos" version 1.9.9
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("related-youtube-videos.php" instead of "index.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
There were no executable files found in this plugin170,857 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP13612,03632,611170,038
HTML2340421
PO File38082212
CSS31219186

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity1.28
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity1.04
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes3,083
▷ Abstract classes60.19%
▷ Concrete classes3,07799.81%
▷ Final classes00.00%
Methods24,088
▷ Static methods130.05%
▷ Public methods24,01999.71%
▷ Protected methods320.13%
▷ Private methods370.15%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants249
▷ Global constants31.20%
▷ Class constants24698.80%
▷ Public constants246100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png21.89KB13.86KB▼ 36.66%
images/checkmark.png0.67KB0.60KB▼ 9.66%
images/xmark.png0.58KB0.44KB▼ 24.54%