10% random-tweet-widget

Code Review | Random Tweet Widget

WordPress plugin Random Tweet Widget scored 10% from 54 tests.

About plugin

  • Plugin page: random-tweet-widget
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 13, 2011
  • Latest release: Oct 26, 2022
  • Number of updates: 32
  • Update frequency: every 136.1 days
  • Top authors: whiletrue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 5,345 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/random-tweet-widget/random_tweet_widget.php+261
    Function create_function() is deprecated

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

Server-side resources used by Random Tweet Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.99 ▼33.83
Dashboard /wp-admin2.05 ▼1.267.02 ▼42.09
Posts /wp-admin/edit.php2.05 ▼1.315.33 ▼43.66
Add New Post /wp-admin/post-new.php2.05 ▼3.845.66 ▼137.08
Media Library /wp-admin/upload.php2.05 ▼1.184.71 ▼28.43

Server storage [IO: ▲0.05MB] [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, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_randomtweetwidget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random Tweet Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.32 ▼0.851.62 ▼0.4739.85 ▼3.91
Dashboard /wp-admin2,206 ▲144.87 ▼0.02107.96 ▼12.4043.34 ▲0.84
Posts /wp-admin/edit.php2,086 ▼32.02 ▲0.0340.35 ▲0.8334.12 ▼2.40
Add New Post /wp-admin/post-new.php1,514 ▼2017.69 ▼5.64596.50 ▼58.3047.57 ▼4.30
Media Library /wp-admin/upload.php1,379 ▼94.21 ▲0.01100.45 ▼0.9743.55 ▲2.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/random-tweet-widget/random_tweet_widget.php+261
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_randomtweetwidget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Codebird' not found in wp-content/plugins/random-tweet-widget/lib/class-wp-codebird.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/random-tweet-widget/random_tweet_widget.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

random-tweet-widget/random_tweet_widget.php 92% from 13 tests

The main PHP file in "Random Tweet Widget" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("random-tweet-widget.php" instead of "random_tweet_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin916 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4157393916

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity48.67
▷ Minimum class complexity41.00
▷ Maximum class complexity64.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods39.09%
▷ Public methods1648.48%
▷ Protected methods515.15%
▷ Private methods1236.36%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected