84% twitch-status

Code Review | Twitch Status

WordPress plugin Twitch Status scored84%from 54 tests.

About plugin

  • Plugin page: twitch-status
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 18, 2014
  • Latest release: Jun 7, 2020
  • Number of updates: 42
  • Update frequency: every 51.9 days
  • Top authors: nicolas.bernier (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /25,106 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼6.04ms] Passed 4 tests

Server-side resources used by Twitch Status
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1642.41 ▼1.33
Dashboard /wp-admin3.45 ▲0.1044.71 ▼17.66
Posts /wp-admin/edit.php3.57 ▲0.2049.51 ▲1.04
Add New Post /wp-admin/post-new.php6.05 ▲0.1692.89 ▼6.19
Media Library /wp-admin/upload.php3.38 ▲0.1437.83 ▲3.17
Twitch status /wp-admin/options-general.php?page=twitch_status3.3433.13

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 11 new options
New WordPress options
widget_twitch-status_widget
twitch_status_token
widget_recent-comments
twitch_status_token_expiration
twitch_status_token_type
widget_theysaidso_widget
widget_recent-posts
twitch_status_channels
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for Twitch Status
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.15 ▼0.142.66 ▲0.7745.14 ▲5.05
Dashboard /wp-admin2,218 ▲485.63 ▲0.0881.77 ▼18.9738.01 ▼3.08
Posts /wp-admin/edit.php2,106 ▲91.99 ▼0.0338.46 ▲3.6134.93 ▼2.62
Add New Post /wp-admin/post-new.php1,535 ▲722.94 ▼0.19575.04 ▼80.6959.29 ▲10.55
Media Library /wp-admin/upload.php1,412 ▲154.19 ▲0.0196.51 ▲1.7641.25 ▲1.22
Twitch status /wp-admin/options-general.php?page=twitch_status8821.9921.7035.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 11 options in the database
    • db_upgraded
    • widget_recent-comments
    • twitch_status_token
    • widget_recent-posts
    • twitch_status_channels
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_twitch-status_widget
    • twitch_status_token_expiration
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 3× 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/twitch-status/includes/twitch-status-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twitch-status/includes/twitch-status-options.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/twitch-status/twitch-status.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

twitch-status/twitch-status.php Passed 13 tests

The main PHP file in "Twitch Status" ver. 1.5.1 adds more information about the plugin and also serves as the entry point for this plugin
43 characters long description:
Insert Twitch.tv online status in WordPress

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
Everything looks great! No dangerous files found in this plugin1,645 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP3130159552
CSS76553382
HTML120282
JavaScript25842182
PO File14057113
JSON200107
SVG10027

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity5.40
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions2371.88%
▷ Anonymous functions928.12%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.03MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/live-button.png2.28KB1.11KB▼ 51.20%
assets/GlitchBadge_Purple_256px.png15.26KB0.84KB▼ 94.46%
assets/GlitchBadge_White_256px.png15.25KB0.75KB▼ 95.12%