83% simplebannerwidget

Code Review | SimpleBannerWidget

WordPress plugin SimpleBannerWidget scored 83% from 54 tests.

About plugin

  • Plugin page: simplebannerwidget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 30, 2019
  • Latest release: Jul 30, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: tkpea (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 433 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.42ms] Passed 4 tests

Server-side resources used by SimpleBannerWidget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0539.95 ▼0.08
Dashboard /wp-admin3.34 ▲0.0450.20 ▼2.02
Posts /wp-admin/edit.php3.39 ▲0.0445.63 ▼1.59
Add New Post /wp-admin/post-new.php5.94 ▲0.0682.69 ▼12.36
Media Library /wp-admin/upload.php3.26 ▲0.0434.64 ▼1.70

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_simple-banner-widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by SimpleBannerWidget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5113.46 ▼0.831.63 ▼0.4043.41 ▼1.32
Dashboard /wp-admin2,212 ▲274.89 ▼0.93103.60 ▼18.1838.78 ▼6.82
Posts /wp-admin/edit.php2,095 ▲62.03 ▼0.0235.33 ▲0.8234.52 ▲0.60
Add New Post /wp-admin/post-new.php1,520 ▼1323.18 ▼0.12625.92 ▼53.6958.19 ▲1.09
Media Library /wp-admin/upload.php1,394 ▲94.26 ▲0.0894.72 ▼8.2640.87 ▼6.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_simple-banner-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplebannerwidget/wp-simple-banner-widget.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simplebannerwidget/classs/simple-banner-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Edit the widget.), #2 (It looks like this on the front page.)
  • Requires at least: The plugin version is formatted incorrectly
You can look at the official readme.txt

simplebannerwidget/wp-simple-banner-widget.php 92% from 13 tests

The principal PHP file in "SimpleBannerWidget" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simplebannerwidget.php" instead of "wp-simple-banner-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin446 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2142191
PHP2239134
CSS2200120
Markdown1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.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%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.97MB with 0.68MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png728.29KB223.88KB▼ 69.26%
screenshot-1.png266.59KB76.45KB▼ 71.32%