10% random-online-twitch-stream-from-selection

Code Review | Random Online Twitch Stream from selection

WordPress plugin Random Online Twitch Stream from selection scored10%from 54 tests.

About plugin

  • Plugin page: random-online-twi...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2021
  • Latest release: Nov 14, 2021
  • Number of updates: 7
  • Update frequency: every 0.7 days
  • Top authors: sspooky13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /338 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/random-online-twitch-stream-from-selection/services/TwitchStreamFormDataNormalizer.php+14
    Uncaught TypeError: Argument 1 passed to TwitchStreamFormDataNormalizer::__construct() must be of the type array, bool given, called in wp-content/plugins/random-online-twitch-stream-from-selection/admin/TwitchStreamAdministrationPage.php on line 23 and defined in wp-content/plugins/random-online-twitch-stream-from-selection/services/TwitchStreamFormDataNormalizer.php:14
    Stack trace:
    #0 wp-content/plugins/random-online-twitch-stream-from-selection/admin/TwitchStreamAdministrationPage.php(23): TwitchStreamFormDataNormalizer->__construct()
    #1 wp-content/plugins/random-online-twitch-stream-from-selection/services/TwitchStreamKernel.php(22): TwitchStreamAdministrationPage->__construct()
    #2 wp-content/plugins/random-online-twitch-stream-from-selection/twitch-stream.php(37): TwitchStreamKernel::run()
    #3 wp-content/plugins/random-online-twitch-stream-from-selection/twitch-stream.php(40): runTwitchSteam()

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.70ms] Passed 4 tests

This is a short check of server-side resources used by Random Online Twitch Stream from selection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.58 ▲0.50
Dashboard /wp-admin3.31 ▲0.0045.49 ▼5.55
Posts /wp-admin/edit.php3.36 ▲0.0050.21 ▲3.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.41 ▼18.79
Media Library /wp-admin/upload.php3.23 ▲0.0034.15 ▲1.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random Online Twitch Stream from selection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.18 ▼1.202.04 ▼0.4237.87 ▼7.04
Dashboard /wp-admin2,200 ▲95.95 ▲1.04100.22 ▼17.6640.82 ▼4.19
Posts /wp-admin/edit.php2,092 ▲32.06 ▲0.0638.88 ▼1.3936.43 ▲1.33
Add New Post /wp-admin/post-new.php1,534 ▲623.15 ▲4.86640.97 ▲10.7259.38 ▼1.40
Media Library /wp-admin/upload.php1,382 ▼04.24 ▲0.0195.77 ▼5.2641.81 ▼0.17

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random-online-twitch-stream-from-selection/services/TwitchStreamKernel.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random-online-twitch-stream-from-selection/admin/TwitchStreamAdministrationPage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random-online-twitch-stream-from-selection/admin/partials/fields-output.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random-online-twitch-stream-from-selection/public/TwitchStreamPublicPage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random-online-twitch-stream-from-selection/public/partials/output.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/random-online-twitch-stream-from-selection/templates/twitch-stream-app.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

random-online-twitch-stream-from-selection/twitch-stream.php 85% from 13 tests

The principal PHP file in "Random Online Twitch Stream from selection" v. 1.1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • 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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("random-online-twitch-stream-from-selection.php" instead of "twitch-stream.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
Good job! No executable or dangerous file extensions detected797 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP159063409
CSS2621339
JavaScript18049

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.33
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.46
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods26
▷ Static methods311.54%
▷ Public methods2596.15%
▷ Protected methods00.00%
▷ Private methods13.85%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants133.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/twitch-rail.png7.07KB4.04KB▼ 42.93%
admin/img/new.png6.50KB6.48KB0.23%
admin/img/twitch-player.png6.97KB4.26KB▼ 38.90%
admin/img/twitch-wall.png7.49KB4.16KB▼ 44.49%