72% livetwitch

Code Review | LiveTwitch

WordPress plugin LiveTwitch scored 72% from 54 tests.

About plugin

  • Plugin page: livetwitch
  • Plugin version: 0.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.0.3
  • WordPress version: 5.8.1
  • First release: Dec 16, 2018
  • Latest release: Jan 26, 2019
  • Number of updates: 9
  • Update frequency: every 4.8 days
  • Top authors: sksni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 905 total downloads

Benchmarks

Plugin footprint 83% 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.17MB] [CPU: ▼136.80ms] Passed 4 tests

Server-side resources used by LiveTwitch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.99 ▲0.1640.68 ▲6.61
Dashboard /wp-admin3.29 ▲0.231,054.21 ▲1,007.68
Posts /wp-admin/edit.php3.33 ▲0.2245.36 ▼0.74
Add New Post /wp-admin/post-new.php5.57 ▲0.1497.07 ▼551.66
Media Library /wp-admin/upload.php3.16 ▲0.1534.92 ▼1.40
LiveTwitch /wp-admin/options-general.php?page=twitch_live3.1028.65
Add New /wp-admin/post-new.php?post_type=twitch3.1943.51
Twitch /wp-admin/edit.php?post_type=twitch3.2037.97

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 1 new option
New WordPress options
widget_livetwitchwidget

Browser metrics Passed 4 tests

A check of browser resources used by LiveTwitch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,856 ▲28416.24 ▲0.7113.37 ▲4.0351.69 ▲1.74
Dashboard /wp-admin3,013 ▲825.86 ▼0.28144.41 ▼2.34108.82 ▼1.54
Posts /wp-admin/edit.php2,779 ▲402.71 ▼0.02102.46 ▲31.6188.84 ▲2.91
Add New Post /wp-admin/post-new.php1,698 ▲1518.82 ▼0.02390.10 ▼13.11103.69 ▼7.73
Media Library /wp-admin/upload.php1,773 ▼345.03 ▲0.02156.16 ▼7.23115.38 ▼2.89
LiveTwitch /wp-admin/options-general.php?page=twitch_live1,1082.0951.1882.23
Add New /wp-admin/post-new.php?post_type=twitch2,0963.3483.74106.83
Twitch /wp-admin/edit.php?post_type=twitch1,4362.6368.4371.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_livetwitchwidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twitch_live
    • > Notice in wp-content/plugins/livetwitch/admin/class-twitch-admin.php+117
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/livetwitch/admin/partials/twitch-admin-display.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/livetwitch/includes/class-twitch-widget_old.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/livetwitch/includes/class-twitch.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/livetwitch/includes/class-twitch.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/livetwitch/includes/class-twitch-widget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === livetwitch === )
Please take inspiration from this readme.txt

livetwitch/live-twitch.php 85% from 13 tests

"LiveTwitch" version 0.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: The principal plugin file should be the same as the plugin slug ("livetwitch.php" instead of "live-twitch.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,042 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP15235622867
CSS2108172
JavaScript1103

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.30
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods62
▷ Static methods914.52%
▷ Public methods5283.87%
▷ Protected methods00.00%
▷ Private methods1016.13%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin