10% rimons-twitter-widget

Code Review | Rimons Twitter Widget

WordPress plugin Rimons Twitter Widget scored10%from 54 tests.

About plugin

  • Plugin page: rimons-twitter-wi...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-4.7.3
  • WordPress version: 6.3.1
  • First release: Dec 11, 2011
  • Latest release: Apr 16, 2017
  • Number of updates: 38
  • Update frequency: every 51.4 days
  • Top authors: Rimon_Habib (65.79%)infocoolsms (36.84%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /30,760 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php+12
    Use of undefined constant BNCF_ROOT - assumed 'BNCF_ROOT' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.86MB] [CPU: ▼55.11ms] Passed 4 tests

Server-side resources used by Rimons Twitter Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.324.55 ▼37.79
Dashboard /wp-admin2.16 ▼1.185.55 ▼60.23
Posts /wp-admin/edit.php2.16 ▼1.196.19 ▼42.10
Add New Post /wp-admin/post-new.php2.16 ▼3.735.61 ▼80.32
Media Library /wp-admin/upload.php2.16 ▼1.075.89 ▼25.76

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Rimons Twitter Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.19 ▼1.191.67 ▼0.1539.29 ▼5.85
Dashboard /wp-admin2,218 ▲305.80 ▼0.06101.62 ▼22.5338.51 ▼1.95
Posts /wp-admin/edit.php2,107 ▲182.06 ▲0.0938.05 ▼3.0832.81 ▼1.61
Add New Post /wp-admin/post-new.php1,543 ▲2323.35 ▲0.10622.41 ▼40.4953.59 ▲4.02
Media Library /wp-admin/upload.php1,406 ▲154.22 ▼0.0693.64 ▼6.4342.10 ▼6.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php+12
    Use of undefined constant BNCF_ROOT - assumed 'BNCF_ROOT' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • rtw_admin_notice
    • widget_rtw_twitter_widget
    • widget_recent-posts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant BNCF_ROOT - assumed 'BNCF_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php:17
    • > PHP Warning
      Use of undefined constant BNCF_ROOT - assumed 'BNCF_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php on line 14
    • > PHP Warning
      Use of undefined constant BNCF_ROOT - assumed 'BNCF_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/rimons-twitter-widget/rimons-twitter-widget.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rimons-twitter-widget/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === rimons-twitter-widget === )
You can take inspiration from this readme.txt

rimons-twitter-widget/rimons-twitter-widget.php 92% from 13 tests

The main file in "Rimons Twitter Widget" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 271 characters long)

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
No dangerous file extensions were detected505 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP212925416
CSS210089

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity7.40
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/twitter-widget-logo.png0.87KB0.76KB▼ 12.40%