78% ttv-easy-embed-player

Code Review | Twitch Player

WordPress plugin Twitch Player scored 78% from 54 tests.

About plugin

  • Plugin page: ttv-easy-embed-pl...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 9, 2018
  • Latest release: Jun 14, 2023
  • Number of updates: 28
  • Update frequency: every 63.2 days
  • Top authors: j.burleigh1 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active / 21,404 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.51MB] [CPU: ▼1.94ms] Passed 4 tests

This is a short check of server-side resources used by Twitch Player
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5241.07 ▼7.95
Dashboard /wp-admin3.85 ▲0.5550.20 ▲1.60
Posts /wp-admin/edit.php3.90 ▲0.5451.70 ▲4.21
Add New Post /wp-admin/post-new.php6.39 ▲0.5097.50 ▼5.63
Media Library /wp-admin/upload.php3.71 ▲0.4844.69 ▲12.82
[StreamWeasels] Twitch Player /wp-admin/options-general.php?page=twitch-tv-player3.6935.58
[Add-On] Player /wp-admin/admin.php?page=streamweasels-player3.6549.98
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.7834.59

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Twitch Player
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲18313.72 ▼0.704.65 ▲2.9040.03 ▼3.57
Dashboard /wp-admin2,252 ▲645.87 ▲0.9795.94 ▼16.7241.17 ▲0.76
Posts /wp-admin/edit.php2,143 ▲542.07 ▲0.0542.27 ▲7.4541.51 ▲10.12
Add New Post /wp-admin/post-new.php1,564 ▲3618.39 ▲0.37590.51 ▼0.4846.04 ▼7.73
Media Library /wp-admin/upload.php1,445 ▲544.27 ▲0.1094.99 ▼4.7348.10 ▲3.07
[StreamWeasels] Twitch Player /wp-admin/options-general.php?page=twitch-tv-player1,5469.11283.1481.28
[Add-On] Player /wp-admin/admin.php?page=streamweasels-player7942.0627.3029.82
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,0232.1022.6331.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% 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
    • > GET request to /wp-admin/admin.php?page=streamweasels-player
    • > Warning in wp-content/plugins/ttv-easy-embed-player/admin/class-streamweasels-player-pro-admin.php+165
    include(wp-content/plugins/admin/partials/streamweasels-admin-display.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=streamweasels-player
    • > Warning in wp-content/plugins/ttv-easy-embed-player/admin/class-streamweasels-player-pro-admin.php+165
    include(): Failed opening 'wp-content/plugins/admin/partials/streamweasels-admin-display.php' for inclusion (include_path='.:/usr/share/php')

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
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ttv-easy-embed-player/admin/partials/streamweasels-player-pro-admin-display.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ttv-easy-embed-player/public/partials/streamweasels-player-pro-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ttv-easy-embed-player/includes/class-streamweasels-tgmpa.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: twitch player, twitch api, twitch, twitch widget, twitchtv...

ttv-easy-embed-player/twitch-player.php 85% from 13 tests

The main PHP file in "Twitch Player" ver. 2.1.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ttv-easy-embed-player.php" instead of "twitch-player.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin8,179 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JSON2005,117
PHP126662,1482,324
Sass2225654
JavaScript5193482
CSS4082

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity24.33
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods139
▷ Static methods75.04%
▷ Public methods11179.86%
▷ Protected methods2316.55%
▷ Private methods53.60%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/sw-full-logo.png62.43KB26.24KB▼ 57.97%