10% live-tv

Code Review | LIVE TV

WordPress plugin LIVE TV scored10%from 54 tests.

About plugin

  • Plugin page: live-tv
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.8
  • WordPress version: 6.3.1
  • First release: Jan 18, 2017
  • Latest release: Aug 25, 2018
  • Number of updates: 9
  • Update frequency: every 64.4 days
  • Top authors: omarteacher (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /7,284 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/live-tv/index.php+23
    Undefined variable: pageid1

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.99ms] Passed 4 tests

This is a short check of server-side resources used by LIVE TV
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.65 ▼32.91
Dashboard /wp-admin2.05 ▼1.264.89 ▼46.64
Posts /wp-admin/edit.php2.05 ▼1.316.44 ▼44.30
Add New Post /wp-admin/post-new.php2.05 ▼3.846.99 ▼100.09
Media Library /wp-admin/upload.php2.05 ▼1.184.87 ▼29.73

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
livelivetv_page_name
widget_recent-comments
widget_theysaidso_widget
widget_live_tv
widget_recent-posts
livelivetv_page_id
livelivetv_page_title
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for LIVE TV
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4914.35 ▲0.092.60 ▲1.0342.65 ▲2.76
Dashboard /wp-admin2,210 ▲335.61 ▼0.0579.74 ▼16.0672.09 ▲27.69
Posts /wp-admin/edit.php2,118 ▲211.97 ▼0.0040.31 ▲1.1536.70 ▼2.51
Add New Post /wp-admin/post-new.php1,562 ▲3618.18 ▼5.34651.16 ▼5.7550.95 ▼0.22
Media Library /wp-admin/upload.php1,418 ▲274.15 ▼0.1298.47 ▼3.5079.54 ▲31.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/live-tv/index.php+23
    Undefined variable: pageid1
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_live_tv
    • widget_theysaidso_widget
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/live-tv/remotelist.php
    • > /wp-content/plugins/live-tv/list.php
    • > /wp-content/plugins/live-tv/play.php
    • > /wp-content/plugins/live-tv/wwidgetopen.php
    • > /wp-content/plugins/live-tv/open.php
    • > /wp-content/plugins/live-tv/live.php
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined index: url in wp-content/plugins/live-tv/play.php on line 82
    • > PHP Notice
      Undefined variable: app in wp-content/plugins/live-tv/play.php on line 132
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/live-tv/index.php:25
    • > PHP Warning
      Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-tv/play.php on line 132
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/live-tv/remotelist.php on line 75
    • > PHP Notice
      Undefined index: url in wp-content/plugins/live-tv/open.php on line 86
    • > PHP Notice
      Undefined index: HTTP_REFERER in wp-content/plugins/live-tv/wwidgetopen.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/live-tv/widget.php:11
    • > PHP Notice
      Undefined index: sawir in wp-content/plugins/live-tv/open.php on line 83
    • > PHP Notice
      Undefined index: sawir in wp-content/plugins/live-tv/open.php on line 83

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 93% 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
Attributes that require attention:
  • Tags: Please delete some tags, you are using 30 tag instead of maximum 10
You can look at the official readme.txt

live-tv/index.php 92% from 13 tests

The principal PHP file in "LIVE TV" v. 1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("live-tv.php" instead of "index.php")

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
No dangerous file extensions were detected803 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP813858742
JavaScript311546
CSS10015

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.50
▷ Minimum class complexity7.00
▷ Maximum class complexity12.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
10 PNG files occupy 0.23MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu.png97.38KB34.20KB▼ 64.88%
images/tvbg.png14.82KB0.15KB▼ 98.97%
images/share.png24.91KB9.94KB▼ 60.08%
images/play.png32.09KB11.97KB▼ 62.71%
images/widgetadding.png55.01KB20.70KB▼ 62.38%