78% ttv-easy-embed

Code Review | Twitch Rail

WordPress plugin Twitch Rail scored78%from 54 tests.

About plugin

  • Plugin page: ttv-easy-embed
  • Plugin version: 2.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 15, 2016
  • Latest release: Jun 14, 2023
  • Number of updates: 63
  • Update frequency: every 43.0 days
  • Top authors: j.burleigh1 (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

400+ active /30,159 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.50MB] [CPU: ▼0.57ms] Passed 4 tests

Analyzing server-side resources used by Twitch Rail
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5146.61 ▲9.09
Dashboard /wp-admin3.84 ▲0.5352.21 ▼4.04
Posts /wp-admin/edit.php3.89 ▲0.5350.62 ▲1.14
Add New Post /wp-admin/post-new.php6.37 ▲0.4986.48 ▼8.47
Media Library /wp-admin/upload.php3.70 ▲0.4745.72 ▲9.65
[StreamWeasels] Twitch Rail /wp-admin/options-general.php?page=twitch-tv-rail3.6741.77
[Add-On] Rail /wp-admin/admin.php?page=streamweasels-rail3.6463.88
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.8636.35

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Twitch Rail
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲21213.45 ▼1.318.87 ▲7.2742.01 ▼1.61
Dashboard /wp-admin2,266 ▲595.81 ▲0.72107.10 ▼9.7748.23 ▲3.44
Posts /wp-admin/edit.php2,157 ▲572.20 ▲0.1739.49 ▼1.0640.17 ▼1.80
Add New Post /wp-admin/post-new.php1,566 ▲2623.41 ▲0.36621.03 ▲17.0279.32 ▲8.68
Media Library /wp-admin/upload.php1,453 ▲534.29 ▲0.05113.73 ▲6.4952.54 ▲2.39
[StreamWeasels] Twitch Rail /wp-admin/options-general.php?page=twitch-tv-rail1,5649.29314.3596.60
[Add-On] Rail /wp-admin/admin.php?page=streamweasels-rail8262.2239.2841.52
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,0352.0928.8134.73

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=streamweasels-rail
    • > Warning in wp-content/plugins/ttv-easy-embed/admin/class-streamweasels-rail-pro-admin.php+154
    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-rail
    • > Warning in wp-content/plugins/ttv-easy-embed/admin/class-streamweasels-rail-pro-admin.php+154
    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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ttv-easy-embed/includes/class-streamweasels-tgmpa.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ttv-easy-embed/public/partials/streamweasels-rail-pro-public-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ttv-easy-embed/admin/partials/streamweasels-rail-pro-admin-display.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: twitch, twitch streams, twitch widget, twitchtv, twitch embed...

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

The entry point to "Twitch Rail" version 2.1.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ttv-easy-embed.php" instead of "twitch-tv-easy-embed.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected8,590 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JSON2005,117
PHP126412,1492,250
Sass456211,123
JavaScript614298
CSS4082

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity24.13
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods135
▷ Static methods75.19%
▷ Public methods10779.26%
▷ Protected methods2317.04%
▷ Private methods53.70%
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%