10% smart-youtube

Code Review | Smart YouTube PRO

WordPress plugin Smart YouTube PRO scored 10% from 54 tests.

About plugin

  • Plugin page: smart-youtube
  • Plugin version: 4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-4.1
  • WordPress version: 5.8.1
  • First release: Feb 12, 2008
  • Latest release: Dec 21, 2014
  • Number of updates: 138
  • Update frequency: every 18.6 days
  • Top authors: freediver (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

20,000+ active / 1,957,727 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/smart-youtube/smartyoutube.php+1418
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartYouTube_Widget has a deprecated constructor

Server metrics [RAM: ▼1.19MB] [CPU: ▼202.54ms] Passed 4 tests

Server-side resources used by Smart YouTube PRO
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.44 ▼0.406.73 ▼32.01
Dashboard /wp-admin2.45 ▼0.6011.07 ▼42.92
Posts /wp-admin/edit.php2.46 ▼0.658.68 ▼45.72
Add New Post /wp-admin/post-new.php2.45 ▼2.986.84 ▼688.96
Media Library /wp-admin/upload.php2.45 ▼0.556.35 ▼32.57
Settings /wp-admin/admin.php?page=syt_settings2.467.62
Colorbox Options /wp-admin/admin.php?page=syt_colorbox_options2.466.61
About /wp-admin/admin.php?page=syt_about2.467.03

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 162 new files
Database: no new tables, 2 new options
New WordPress options
smart_youtube_pro
widget_smart-youtube

Browser metrics Passed 4 tests

Smart YouTube PRO: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,722 ▲15015.84 ▲0.5714.45 ▲2.1550.27 ▼8.51
Dashboard /wp-admin3,004 ▲735.92 ▼0.01158.17 ▼13.05136.59 ▲23.86
Posts /wp-admin/edit.php2,798 ▲622.70 ▼0.0169.93 ▼9.7993.62 ▼10.05
Add New Post /wp-admin/post-new.php1,714 ▲13318.73 ▲1.08445.11 ▼27.59120.08 ▼21.40
Media Library /wp-admin/upload.php1,792 ▼155.01 ▼0.05154.35 ▼22.47140.60 ▲12.65
Settings /wp-admin/admin.php?page=syt_settings1,9572.3769.27116.20
Colorbox Options /wp-admin/admin.php?page=syt_colorbox_options1,2422.1061.4792.30
About /wp-admin/admin.php?page=syt_about1,1452.0968.6186.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/smart-youtube/smartyoutube.php+1418
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartYouTube_Widget has a deprecated constructor
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_smart-youtube
    • smart_youtube_pro

Smoke tests 25% 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)
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=syt_about
    • > Deprecated in wp-content/plugins/smart-youtube/smartyoutube.php+1418
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartYouTube_Widget has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=syt_about
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in SmartYouTube_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=syt_about
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=syt_about
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/smart-youtube/smartyoutube.php:33

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=syt_settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/smart-youtube//yt.js 91:36 Uncaught TypeError: Cannot read properties of null (reading 'checked')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Plugin Admin Panel), #2 (Plugin in action in your RSS feed)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

smart-youtube/smartyoutube.php 92% from 13 tests

The principal PHP file in "Smart YouTube PRO" v. 4.3 is loaded by WordPress automatically on each request
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 ("smart-youtube.php" instead of "smartyoutube.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,594 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP1174851,275
JavaScript318472849
CSS103498470

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity207.50
▷ Minimum class complexity1.00
▷ Maximum class complexity414.00
Average method complexity16.30
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods27100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
102 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/theme8/images/internet_explorer/borderTopCenter.png0.17KB0.15KB▼ 10.40%
themes/theme9/images/controls.png0.56KB0.57KB0.00%
themes/theme4/images/internet_explorer/borderMiddleLeft.png0.15KB0.16KB0.00%
themes/theme10/images/next.png1.47KB1.53KB0.00%
themes/theme1/images/internet_explorer/borderBottomCenter.png0.11KB0.10KB▼ 8.11%