72% wpstream

Code Review | WpStream - Live Streaming, Video on Demand, Pay Per View

WordPress plugin WpStream - Live Streaming, Video on Demand, Pay Per View scored72%from 54 tests.

About plugin

  • Plugin page: wpstream
  • Plugin version: 4.5.11.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 18, 2017
  • Latest release: Nov 16, 2023
  • Number of updates: 139
  • Update frequency: every 15.6 days
  • Top authors: wpstream (100%)

Code review

54 tests

User reviews

68 reviews

Install metrics

5,000+ active /217,002 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▲3.24ms] 75% from 4 tests

Server-side resources used by WpStream - Live Streaming, Video on Demand, Pay Per View
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,414.47ms on /wp-admin/admin.php?page=wpstream_recordings)
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3445.52 ▲5.23
Dashboard /wp-admin3.64 ▲0.2953.15 ▼2.36
Posts /wp-admin/edit.php3.70 ▲0.3456.01 ▲7.43
Add New Post /wp-admin/post-new.php6.32 ▲0.4392.73 ▲2.67
Media Library /wp-admin/upload.php3.56 ▲0.3340.41 ▲7.58
Movie Ratings /wp-admin/edit-tags.php?taxonomy=wpstream_movie_rating&post_type=wpstream_product3.5336.15
Settings /wp-admin/admin.php?page=wpstream_settings3.5141.31
All Free-To-View Live Channels /wp-admin/edit.php?post_type=wpstream_product3.6342.99
Credentials /wp-admin/admin.php?page=wpstream_credentials3.50475.32
All Free-To-View VODs /wp-admin/edit.php?post_type=wpstream_product_vod3.6342.97
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=wpstream_product_vod3.5638.97
Add New /wp-admin/post-new.php?post_type=wpstream_product_vod3.74491.23
Recordings /wp-admin/admin.php?page=wpstream_recordings3.491,414.47
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=wpstream_product3.5337.22
Actors /wp-admin/edit-tags.php?taxonomy=wpstream_actors&post_type=wpstream_product3.5333.39

Server storage [IO: ▲5.28MB] [DB: ▲0.08MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 104 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
category_children
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WpStream - Live Streaming, Video on Demand, Pay Per View
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,193 ▲44617.62 ▲3.27130.36 ▲128.6745.99 ▲1.12
Dashboard /wp-admin2,369 ▲1984.95 ▼0.6495.74 ▲5.0489.06 ▲51.93
Posts /wp-admin/edit.php2,279 ▲1762.53 ▲0.5638.22 ▲1.0142.58 ▲7.18
Add New Post /wp-admin/post-new.php1,831 ▲30522.63 ▼0.52825.44 ▲95.4247.35 ▼12.85
Media Library /wp-admin/upload.php1,574 ▲1744.56 ▲0.51100.04 ▲2.3594.47 ▲53.54
Movie Ratings /wp-admin/edit-tags.php?taxonomy=wpstream_movie_rating&post_type=wpstream_product1,4942.3036.3840.93
Settings /wp-admin/admin.php?page=wpstream_settings1,0592.1331.8654.94
All Free-To-View Live Channels /wp-admin/edit.php?post_type=wpstream_product1,3562.6038.2644.08
Credentials /wp-admin/admin.php?page=wpstream_credentials9932.1333.0243.11
All Free-To-View VODs /wp-admin/edit.php?post_type=wpstream_product_vod1,3322.4835.6541.58
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=wpstream_product_vod1,5012.3032.0441.81
Add New /wp-admin/post-new.php?post_type=wpstream_product_vod3,1518.37182.60146.61
Recordings /wp-admin/admin.php?page=wpstream_recordings9712.1432.4942.66
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=wpstream_product1,6722.2933.6446.42
Actors /wp-admin/edit-tags.php?taxonomy=wpstream_actors&post_type=wpstream_product1,4882.2832.1340.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • category_children

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=wpstream_actors&post_type=wpstream_product
    • > Notice in wp-content/plugins/wpstream/includes/class-wpstream_product.php+499
    Trying to get property 'taxonomy' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpstream_recordings
    • > Notice in wp-content/plugins/wpstream/admin/class-wpstream-admin.php+1834
    Undefined index: items

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wpstream/includes/templates/wpstream_chat_template.php
    • > /wp-content/plugins/wpstream/admin/partials/wpstream-admin-display.php
    • > /wp-content/plugins/wpstream/public/partials/wpstream-public-display.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wpstream/woocommerce/myaccount/video_list.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpstream/integrations/buddyboss/buddyboss.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ElementorWpStream\\add_action() in wp-content/plugins/wpstream/wpstream-elementor-base.php:116
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wpstream/woocommerce/myaccount/event_list.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Product' not found in wp-content/plugins/wpstream/includes/class-wc_product_video_on_demand.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Product' not found in wp-content/plugins/wpstream/includes/class-wc_product_live_stream.php:2

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 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (16 tag instead of maximum 10)
You can look at the official readme.txt

wpstream/wpstream.php 92% from 13 tests

The main PHP file in "WpStream - Live Streaming, Video on Demand, Pay Per View" ver. 4.5.11.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 261 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected17,454 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP313,0992,3336,770
CSS13828785,019
JavaScript181,1627954,790
SVG900784
Markdown155091

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity36.45
▷ Minimum class complexity1.00
▷ Maximum class complexity200.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods274
▷ Static methods31.09%
▷ Public methods24589.42%
▷ Protected methods186.57%
▷ Private methods114.01%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ 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
11 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/default_150.png1.25KB1.30KB0.00%
img/plugin-logo.png0.43KB0.44KB0.00%
img/default_300.png3.57KB3.78KB0.00%
admin/css/home-decor-lines3.png14.25KB15.40KB0.00%
public/js/list_media.png1.08KB0.14KB▼ 86.57%