84% sb-banner-widget

Code Review | SB Banner Widget

WordPress plugin SB Banner Widget scored84%from 54 tests.

About plugin

  • Plugin page: sb-banner-widget
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2014
  • Latest release: Apr 9, 2015
  • Number of updates: 11
  • Update frequency: every 16.1 days
  • Top authors: skylarkcob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,703 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.26ms] Passed 4 tests

An overview of server-side resources used by SB Banner Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0143.82 ▲4.18
Dashboard /wp-admin3.32 ▲0.0148.70 ▼2.96
Posts /wp-admin/edit.php3.37 ▲0.0145.99 ▼8.10
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.32 ▼5.96
Media Library /wp-admin/upload.php3.24 ▲0.0137.41 ▼0.00

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for SB Banner Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.352.06 ▲0.3939.43 ▼6.20
Dashboard /wp-admin2,198 ▲185.69 ▲0.0187.25 ▼6.8142.00 ▼2.46
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0137.48 ▲2.3335.43 ▲0.50
Add New Post /wp-admin/post-new.php1,545 ▲1922.98 ▲5.21675.48 ▼27.1560.90 ▲5.04
Media Library /wp-admin/upload.php1,397 ▼64.20 ▼0.0399.36 ▼13.8745.13 ▼9.59

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 7× 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/sb-banner-widget/inc/class-sb-banner-widget.php:2
    • > PHP Fatal error
      require(): Failed opening required 'SB_BANNER_WIDGET_INC_PATH/sb-plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/sb-banner-widget/inc/sb-plugin-load.php on line 2
    • > PHP Warning
      Use of undefined constant SB_BANNER_WIDGET_INC_PATH - assumed 'SB_BANNER_WIDGET_INC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sb-banner-widget/inc/sb-plugin-load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-banner-widget/inc/sb-plugin-hook.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sb-banner-widget/inc/sb-plugin-install.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/sb-banner-widget/sb-banner-widget.php:19
    • > PHP Warning
      require(SB_BANNER_WIDGET_INC_PATH/sb-plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/sb-banner-widget/inc/sb-plugin-load.php on line 2

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 97% 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:
  • Screenshots: Please add an image for screenshot #1 (SB Banner widget on sidebar area.)
You can look at the official readme.txt

sb-banner-widget/sb-banner-widget.php Passed 13 tests

"SB Banner Widget" version 1.0.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
85 characters long description:
SB Banner Widget is a plugin that allows to add banner widget on your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected194 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62312148
JavaScript13046

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.79KB5.72KB▼ 41.61%