72% easy-embed-for-youtube-wall

Code Review | YouTube Easy Embed (Wall/Rail)

WordPress plugin YouTube Easy Embed (Wall/Rail) scored72%from 54 tests.

About plugin

  • Plugin page: easy-embed-for-yo...
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 20, 2020
  • Latest release: Jul 16, 2023
  • Number of updates: 73
  • Update frequency: every 13.7 days
  • Top authors: vaibhavagar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,797 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.38MB] [CPU: ▲23.22ms] 50% from 4 tests

A check of server-side resources used by YouTube Easy Embed (Wall/Rail)
It is recommended to improve the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 2,105.01ms on /wp-admin/options-general.php?page=gwt-youtube-api)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.38MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.19 ▲5.7366.66 ▲22.02
Dashboard /wp-admin9.21 ▲5.8782.13 ▲17.88
Posts /wp-admin/edit.php9.22 ▲5.8674.47 ▲23.93
Add New Post /wp-admin/post-new.php9.96 ▲4.07130.20 ▲29.04
Media Library /wp-admin/upload.php9.22 ▲5.9977.69 ▲41.06
YouTube Easy Embed (Wall/Rail) /wp-admin/options-general.php?page=gwt-youtube-api9.222,105.01
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2261.91

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 225 new files
Database: no new tables, 9 new options
New WordPress options
fs_accounts
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
fs_active_plugins
db_upgraded
fs_debug_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for YouTube Easy Embed (Wall/Rail)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲18013.98 ▼0.429.60 ▲7.9728.58 ▼13.34
Dashboard /wp-admin2,237 ▲635.84 ▲0.2595.01 ▲1.0744.33 ▲0.04
Posts /wp-admin/edit.php2,124 ▲242.33 ▲0.3738.45 ▲3.6736.47 ▲1.47
Add New Post /wp-admin/post-new.php1,558 ▲3022.16 ▼0.89636.76 ▼42.2235.68 ▼17.97
Media Library /wp-admin/upload.php1,446 ▲494.37 ▲0.1893.47 ▼5.4044.49 ▼5.32
YouTube Easy Embed (Wall/Rail) /wp-admin/options-general.php?page=gwt-youtube-api1,0132.0927.7165.76
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0972.1028.9725.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/easy-embed-for-youtube-wall/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: channelLogo in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: tiletext in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: videoLikes in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: columnspacing in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: tilebordercolor in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: shortcodeID in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: videoTitle in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: shortcodeID in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: channelUsername in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18
    • > PHP Notice
      Undefined variable: hideContainer in wp-content/plugins/easy-embed-for-youtube-wall/public/partials/gwt-youtube-api-public-display.php on line 18

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Plugin Name: You should set the name of your plugin on the first line ( === easy-embed-for-youtube-wall === )
The official readme.txt is a good inspiration

easy-embed-for-youtube-wall/gwt-youtube-api.php 85% from 13 tests

The main file in "YouTube Easy Embed (Wall/Rail)" v. 1.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("easy-embed-for-youtube-wall.php" instead of "gwt-youtube-api.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected34,985 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP1288,23017,82533,891
JavaScript659126768
CSS153221292
SVG51034

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.18
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods1,288
▷ Static methods19915.45%
▷ Public methods89469.41%
▷ Protected methods171.32%
▷ Private methods37729.27%
Functions134
▷ Named functions134100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 0.84MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/img/cross.png2.67KB2.12KB▼ 20.80%
admin/img/slide1.png82.19KB33.91KB▼ 58.74%
admin/img/twitch-player.png6.97KB4.26KB▼ 38.90%
admin/img/twitch-wall.png7.49KB4.16KB▼ 44.49%