67% wp-live-tv

Code Review | Live TV Player - Worldwide Live TV Channels Player for WordPress

WordPress plugin Live TV Player - Worldwide Live TV Channels Player for WordPress scored 67% from 54 tests.

About plugin

  • Plugin page: wp-live-tv
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.9.2
  • First release: Aug 19, 2020
  • Latest release: Jul 10, 2021
  • Number of updates: 13
  • Update frequency: every 25.1 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 7,176 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.63MB] [CPU: ▼270.97ms] Passed 4 tests

Analyzing server-side resources used by Live TV Player - Worldwide Live TV Channels Player for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.48 ▲4.9678.78 ▲23.52
Dashboard /wp-admin8.50 ▲5.0964.92 ▲31.17
Posts /wp-admin/edit.php8.50 ▲4.8564.13 ▲27.56
Add New Post /wp-admin/post-new.php10.57 ▲3.60115.98 ▼1,158.28
Media Library /wp-admin/upload.php8.50 ▲5.2046.68 ▲23.31
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.5050.17

Server storage [IO: ▲7.44MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 571 new files
Database: no new tables, 11 new options
New WordPress options
wptv_general_settings
wptv_display_settings
fs_accounts
fs_gdpr
fs_debug_mode
wptv_color_settings
fs_active_plugins
wptv_install_time
wptv_player_settings
wptv_version
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Live TV Player - Worldwide Live TV Channels Player for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,264 ▲51019.44 ▲3.7221.00 ▲14.102.34 ▼0.47
Dashboard /wp-admin3,185 ▲3277.82 ▲1.58146.54 ▲13.37172.97 ▲3.78
Posts /wp-admin/edit.php3,010 ▲3195.43 ▲2.2087.80 ▲23.04158.83 ▲12.50
Add New Post /wp-admin/post-new.php1,757 ▲9621.69 ▼0.10431.06 ▼19.52165.52 ▲4.97
Media Library /wp-admin/upload.php1,800 ▲1056.29 ▲0.82113.94 ▼45.68205.52 ▲8.69
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,7485.2182.99118.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-live-tv/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 11 options in the database
    • fs_active_plugins
    • fs_gdpr
    • wptv_general_settings
    • fs_debug_mode
    • wptv_color_settings
    • wptv_player_settings
    • wptv_do_activation_redirect
    • wptv_display_settings
    • wptv_install_time
    • fs_accounts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-live-tv/includes/admin/views/get-started/index.php
    • > /wp-content/plugins/wp-live-tv/includes/admin/views/get-started/widget.php
    • > /wp-content/plugins/wp-live-tv/includes/admin/views/get-started/gutenberg.php
    • > /wp-content/plugins/wp-live-tv/includes/admin/views/get-started/elementor.php
    • > /wp-content/plugins/wp-live-tv/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/wp-live-tv/includes/admin/views/get-started/new.php
  • 55× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wptv() in wp-content/plugins/wp-live-tv/templates/shortcode/player.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Csv\\Exception' not found in wp-content/plugins/wp-live-tv/vendor/league/csv/src/UnavailableStream.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Csv\\ByteSequence' not found in wp-content/plugins/wp-live-tv/vendor/league/csv/src/AbstractCsv.php:34
    • > PHP Warning
      include_once(WPTV_INCLUDES/admin/views/get-started/elementor.php): failed to open stream: No such file or directory in wp-content/plugins/wp-live-tv/includes/admin/views/get-started/index.php on line 57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-live-tv/includes/base.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Csv\\Exception' not found in wp-content/plugins/wp-live-tv/vendor/league/csv/src/CannotInsertRecord.php:19
    • > PHP Warning
      include_once(WPTV_INCLUDES/admin/views/get-started/import.php): failed to open stream: No such file or directory in wp-content/plugins/wp-live-tv/includes/admin/views/get-started/index.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-live-tv/includes/admin/views/get-started/import.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-live-tv/freemius/templates/account/partials/addon.php:9
    • > PHP Warning
      Use of undefined constant WPTV_INCLUDES - assumed 'WPTV_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-live-tv/includes/admin/views/get-started/index.php on line 53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

wp-live-tv/plugin.php 85% from 13 tests

The entry point to "Live TV Player - Worldwide Live TV Channels Player for WordPress" version 1.0.5 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-live-tv.php" instead of "plugin.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 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
No dangerous file extensions were detected71,574 lines of code in 504 files:
LanguageFilesBlank linesComment linesLines of code
PHP1878,77018,79336,441
SVG2600117,676
JSON40013,792
JavaScript224632201,895
Sass1641221,752
CSS150018

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity52.39
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes84
▷ Abstract classes33.57%
▷ Concrete classes8196.43%
▷ Final classes67.41%
Methods1,509
▷ Static methods26017.23%
▷ Public methods1,11673.96%
▷ Protected methods553.64%
▷ Private methods33822.40%
Functions138
▷ Named functions11281.16%
▷ Anonymous functions2618.84%
Constants158
▷ Global constants10667.09%
▷ Class constants5232.91%
▷ Public constants4892.31%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 PNG files occupy 0.65MB with 0.27MB 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%
assets/images/get-started/import-channels.png31.18KB13.77KB▼ 55.84%
assets/vendor/lou-multi-select/img/switch.png0.53KB0.64KB0.00%
assets/images/get-started/tv-archive.png21.80KB11.12KB▼ 49.01%
freemius/assets/img/wp-radio-ads-playaer.png35.40KB15.38KB▼ 56.56%