10% simple-twitchtv-widget

Code Review | Simple Twitch.TV Widget

WordPress plugin Simple Twitch.TV Widget scored10%from 54 tests.

About plugin

  • Plugin page: simple-twitchtv-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.3.1
  • WordPress version: 6.3.1
  • First release: Aug 24, 2015
  • Latest release: Oct 2, 2015
  • Number of updates: 12
  • Update frequency: every 3.3 days
  • Top authors: judahnator (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,617 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/simple-twitchtv-widget/simple_twitchtv_widget.php+49
    Methods with the same name as their class will not be constructors in a future version of PHP; STTW_Twitch_Widget has a deprecated constructor

Server metrics [RAM: ▼1.93MB] [CPU: ▼51.79ms] Passed 4 tests

This is a short check of server-side resources used by Simple Twitch.TV Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.4010.30 ▼27.09
Dashboard /wp-admin2.08 ▼1.265.25 ▼52.38
Posts /wp-admin/edit.php2.08 ▼1.276.95 ▼38.65
Add New Post /wp-admin/post-new.php2.08 ▼3.806.33 ▼89.02
Media Library /wp-admin/upload.php2.08 ▼1.155.19 ▼26.50
STTW Twitch Options /wp-admin/options-general.php?page=sttw_twitch_options2.087.02

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 9 new options
New WordPress options
widget_sttw_twitch_widget
can_compress_scripts
sttw_twitch_users
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
sttw_twitch_number
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Twitch.TV Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.29 ▼1.081.77 ▲0.0444.73 ▲0.57
Dashboard /wp-admin2,204 ▲135.83 ▲0.9898.57 ▼1.2537.07 ▼5.85
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.0139.29 ▼5.4433.56 ▼2.64
Add New Post /wp-admin/post-new.php1,545 ▲2618.82 ▼4.20638.88 ▼33.1162.07 ▲4.42
Media Library /wp-admin/upload.php1,386 ▼24.20 ▼0.0295.25 ▼3.5839.31 ▼5.14
STTW Twitch Options /wp-admin/options-general.php?page=sttw_twitch_options8042.0323.9625.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/simple-twitchtv-widget/simple_twitchtv_widget.php+49
    Methods with the same name as their class will not be constructors in a future version of PHP; STTW_Twitch_Widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_sttw_twitch_widget
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sttw_twitch_options
    • > Deprecated in wp-content/plugins/simple-twitchtv-widget/simple_twitchtv_widget.php+49
    Methods with the same name as their class will not be constructors in a future version of PHP; STTW_Twitch_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=sttw_twitch_options
    • > Deprecated in wp-content/plugins/simple-twitchtv-widget/simple_twitchtv_widget.php+85
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=sttw_twitch_options
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in STTW_Twitch_Widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=sttw_twitch_options
    • > Notice in wp-content/plugins/simple-twitchtv-widget/settings.php+4
    Undefined index: sttw_twitch_number

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: sttw_twitch_number in wp-content/plugins/simple-twitchtv-widget/settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-twitchtv-widget/settings.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-twitchtv-widget/widget.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention: The official readme.txt is a good inspiration

simple-twitchtv-widget/simple_twitchtv_widget.php 85% from 13 tests

The primary PHP file in "Simple Twitch.TV Widget" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 178 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-twitchtv-widget.php" instead of "simple_twitchtv_widget.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
Success! There were no dangerous files found in this plugin186 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32314186

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png3.40KB0.47KB▼ 86.03%