10% twiget

Code Review | Twiget Twitter Widget

WordPress plugin Twiget Twitter Widget scored10%from 54 tests.

About plugin

  • Plugin page: twiget
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.8
  • WordPress version: 6.3.1
  • First release: Jan 14, 2013
  • Latest release: Dec 13, 2013
  • Number of updates: 16
  • Update frequency: every 20.9 days
  • Top authors: prasannasp (62.5%)silverks (43.75%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /53,454 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/twiget/twiget.php+61
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.71MB] [CPU: ▼46.09ms] Passed 4 tests

An overview of server-side resources used by Twiget Twitter Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.87 ▼31.07
Dashboard /wp-admin2.30 ▼1.0010.51 ▼39.22
Posts /wp-admin/edit.php2.30 ▼1.0611.90 ▼27.79
Add New Post /wp-admin/post-new.php2.30 ▼3.5911.93 ▼86.28
Media Library /wp-admin/upload.php2.30 ▼0.9310.87 ▼22.01
Twiget Settings /wp-admin/options-general.php?page=twiget/options.php2.3012.16

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
twiget_options
db_upgraded
widget_twiget-widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Twiget Twitter Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6713.30 ▼1.491.80 ▼0.0642.27 ▼3.92
Dashboard /wp-admin2,219 ▲285.82 ▼0.04105.90 ▼8.6239.27 ▼2.74
Posts /wp-admin/edit.php2,105 ▲161.99 ▼0.0639.56 ▼3.0635.10 ▼1.41
Add New Post /wp-admin/post-new.php1,558 ▲3918.15 ▼4.99597.70 ▼22.8477.77 ▲14.53
Media Library /wp-admin/upload.php1,401 ▲164.22 ▲0.02105.30 ▲4.2043.72 ▲0.02
Twiget Settings /wp-admin/options-general.php?page=twiget/options.php9952.0723.9732.88

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
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Twiget_Twitter_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_twiget-widget
    • can_compress_scripts

Smoke tests 50% 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)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=twiget/options.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Twiget_Twitter_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/twiget/widgets.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twiget/options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/twiget/twiget.php:27

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: twitter widget, widget, tweets, sidebar, twitter

twiget/twiget.php Passed 13 tests

The main file in "Twiget Twitter Widget" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
54 characters long description:
A widget to display the latest Twitter status updates.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,320 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP62253961,022
PO File16363190
JavaScript113768
CSS10040

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.85
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods80
▷ Static methods1012.50%
▷ Public methods6986.25%
▷ Protected methods22.50%
▷ Private methods911.25%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png32.59KB11.83KB▼ 63.71%
screenshot-3.png14.58KB14.06KB▼ 3.55%
screenshot-4.png8.59KB8.53KB▼ 0.78%
screenshot-1.png10.78KB10.67KB▼ 1.08%