84% bns-add-widget

Code Review | BNS Add Widget

WordPress plugin BNS Add Widget scored84%from 54 tests.

About plugin

  • Plugin page: bns-add-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.5
  • WordPress version: 6.3.1
  • First release: Feb 11, 2010
  • Latest release: Feb 21, 2016
  • Number of updates: 24
  • Update frequency: every 91.8 days
  • Top authors: cais (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /24,823 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.68ms] Passed 4 tests

An overview of server-side resources used by BNS Add Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0551.73 ▲9.11
Dashboard /wp-admin3.35 ▲0.0045.89 ▼18.32
Posts /wp-admin/edit.php3.40 ▲0.0447.73 ▲3.10
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.15 ▼16.42
Media Library /wp-admin/upload.php3.27 ▲0.0433.97 ▲0.91

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for BNS Add Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.20 ▼0.041.62 ▼0.0240.19 ▼2.00
Dashboard /wp-admin2,192 ▲155.49 ▼0.1787.26 ▼7.9940.13 ▼1.87
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0934.80 ▼6.5633.43 ▼6.89
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▼0.27689.52 ▲36.0963.94 ▲10.92
Media Library /wp-admin/upload.php1,403 ▲34.21 ▼0.0396.70 ▼3.8543.30 ▼0.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/bns-add-widget/bns-add-widget.php:90

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: translation-ready, widget, admin, plugin-only, footer

bns-add-widget/bns-add-widget.php Passed 13 tests

This is the main PHP file of "BNS Add Widget" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
45 characters long description:
Add a widget area to the footer of any theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin202 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP189208146
PO File1131453
CSS17173

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
No PNG files were detected