74% live-badge-twitch

Code Review | Live Stream Badge

WordPress plugin Live Stream Badge scored74%from 54 tests.

About plugin

  • Plugin page: live-badge-twitch
  • Plugin version: 1.0
  • PHP compatiblity: 7.2.21+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.3
  • WordPress version: 6.3.1
  • First release: Dec 4, 2019
  • Latest release: Dec 4, 2019
  • Number of updates: 9
  • Update frequency: every 0.6 days
  • Top authors: dancedric (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /682 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.95MB] [CPU: ▼42.55ms] Passed 4 tests

This is a short check of server-side resources used by Live Stream Badge
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.20 ▼0.29
Dashboard /wp-admin3.00 ▼0.3426.78 ▼40.08
Posts /wp-admin/edit.php3.00 ▼0.3521.83 ▼31.25
Add New Post /wp-admin/post-new.php3.00 ▼2.8821.35 ▼88.71
Media Library /wp-admin/upload.php3.00 ▼0.2325.91 ▼10.15

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_live_stream_badge_widget
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Live Stream Badge
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.34 ▼0.011.78 ▼0.1844.32 ▲1.69
Dashboard /wp-admin2,211 ▲345.62 ▼0.0186.80 ▼8.9142.63 ▼0.62
Posts /wp-admin/edit.php2,116 ▲161.97 ▲0.0335.53 ▼4.9132.79 ▼3.30
Add New Post /wp-admin/post-new.php1,539 ▲1123.37 ▲0.33662.98 ▼24.3653.92 ▲3.28
Media Library /wp-admin/upload.php1,416 ▲164.23 ▲0.02103.65 ▼12.9442.93 ▼4.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_live_stream_badge_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/live-badge-twitch/index.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: button, twitch, live, badge

live-badge-twitch/index.php 92% from 13 tests

This is the main PHP file of "Live Stream Badge" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("live-badge-twitch.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected156 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12319131
CSS10025

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.33MB with 0.23MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png117.90KB35.61KB▼ 69.80%
assets/screenshot-2.png92.82KB25.97KB▼ 72.02%
assets/img/RegisterYourApplication.png127.07KB35.92KB▼ 71.73%