67% streamweasels-twitch-integration

Code Review | StreamWeasels Twitch Integration

WordPress plugin StreamWeasels Twitch Integration scored67%from 54 tests.

About plugin

  • Plugin page: streamweasels-twi...
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 16, 2021
  • Latest release: Nov 11, 2023
  • Number of updates: 39
  • Update frequency: every 19.4 days
  • Top authors: streamweasels (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /24,105 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.73MB] [CPU: ▲3.95ms] Passed 4 tests

This is a short check of server-side resources used by StreamWeasels Twitch Integration
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6655.65 ▲12.98
Dashboard /wp-admin4.10 ▲0.7661.60 ▼1.81
Posts /wp-admin/edit.php4.15 ▲0.8062.43 ▲14.44
Add New Post /wp-admin/post-new.php6.63 ▲0.7490.98 ▼8.18
Media Library /wp-admin/upload.php4.00 ▲0.7749.17 ▲12.79
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.2147.93

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 271 new files
Database: no new tables, 10 new options
New WordPress options
fs_debug_mode
db_upgraded
widget_recent-posts
theysaidso_admin_options
swti_debug_log
widget_theysaidso_widget
fs_accounts
widget_recent-comments
fs_active_plugins
can_compress_scripts

Browser metrics Passed 4 tests

StreamWeasels Twitch Integration: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,149 ▲36215.38 ▲1.037.01 ▲4.9828.12 ▼16.28
Dashboard /wp-admin2,413 ▲2366.48 ▲0.82123.39 ▲25.1385.77 ▲41.16
Posts /wp-admin/edit.php2,357 ▲2543.77 ▲1.7759.27 ▲21.9670.03 ▲34.72
Add New Post /wp-admin/post-new.php6,448 ▲4,92228.16 ▲4.881,017.87 ▲304.6942.28 ▼15.93
Media Library /wp-admin/upload.php1,490 ▲934.44 ▲0.1087.78 ▼36.0294.07 ▲43.63
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,3093.3748.6729.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/streamweasels-twitch-integration/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-posts
    • widget_recent-comments
    • fs_accounts
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_theysaidso_widget
    • db_upgraded
    • fs_active_plugins
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-public-display.php
    • > /wp-content/plugins/streamweasels-twitch-integration/admin/partials/streamweasels-admin-sidebar.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-player-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function swti_twitch_get_layout_options() in wp-content/plugins/streamweasels-twitch-integration/admin/partials/streamweasels-admin-sidebar.php:90
    • > PHP Warning
      Use of undefined constant SWTI_PLUGIN_DIR - assumed 'SWTI_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/streamweasels-twitch-integration/admin/partials/streamweasels-admin-sidebar.php on line 74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-vods-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/streamweasels-twitch-integration/admin/class-streamweasels-admin.php:2246
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/streamweasels-twitch-integration/admin/partials/streamweasels-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-rail-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-status-public-display.php:18
    • > PHP Warning
      Use of undefined constant SWTI_PLUGIN_DIR - assumed 'SWTI_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/streamweasels-twitch-integration/admin/partials/streamweasels-admin-sidebar.php on line 57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/streamweasels-twitch-integration/public/partials/streamweasels-wall-public-display.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: block, gutenberg, twitch widget, twitch streams, twitch api...

streamweasels-twitch-integration/streamweasels.php 77% from 13 tests

The entry point to "StreamWeasels Twitch Integration" version 1.7.3 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("streamweasels-twitch-integration.php" instead of "streamweasels.php")
  • Plugin Name: Please shorten the plugin name (currently 74 characters long instead of max. 70)
  • 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 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin45,000 lines of code in 202 files:
LanguageFilesBlank linesComment linesLines of code
PHP1438,80918,19937,684
Sass141211084,473
JavaScript181862292,611
JSON400210
CSS231222

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity76.58
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes64
▷ Abstract classes23.12%
▷ Concrete classes6296.88%
▷ Final classes00.00%
Methods1,440
▷ Static methods20113.96%
▷ Public methods1,03371.74%
▷ Protected methods171.18%
▷ Private methods39027.08%
Functions113
▷ Named functions11198.23%
▷ Anonymous functions21.77%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.38MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/img/twitch-rail.png7.07KB4.04KB▼ 42.93%
admin/img/kick-logo.png2.23KB0.53KB▼ 76.23%
admin/img/swti-logo-vertical.png82.61KB38.44KB▼ 53.47%
admin/img/twitch-feature.png12.89KB6.05KB▼ 53.01%