84% button-widget

Code Review | Button Widget

WordPress plugin Button Widget scored84%from 54 tests.

About plugin

  • Plugin page: button-widget
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: WordPress 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Dec 21, 2019
  • Latest release: Dec 22, 2020
  • Number of updates: 13
  • Update frequency: every 28.3 days
  • Top authors: mahdiyazdani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,231 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼11.10ms] Passed 4 tests

This is a short check of server-side resources used by Button Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.12 ▲6.23
Dashboard /wp-admin3.37 ▲0.0348.29 ▼13.84
Posts /wp-admin/edit.php3.43 ▲0.0750.67 ▼10.56
Add New Post /wp-admin/post-new.php5.98 ▲0.0988.25 ▼17.68
Media Library /wp-admin/upload.php3.30 ▲0.0735.32 ▼2.31

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_button_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Button Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.32 ▲0.041.88 ▼0.0443.23 ▲0.40
Dashboard /wp-admin2,195 ▲215.59 ▲0.0190.18 ▼20.0239.28 ▼2.03
Posts /wp-admin/edit.php2,097 ▼62.01 ▲0.0138.94 ▼2.2534.93 ▼0.61
Add New Post /wp-admin/post-new.php1,528 ▲222.50 ▼0.43673.56 ▲25.2050.20 ▼18.66
Media Library /wp-admin/upload.php1,397 ▼34.20 ▲0.0599.08 ▼14.7044.02 ▼3.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_button_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/button-widget/button-widget.php:38

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: widget, wordpress button plugin, call to action, button, callout

button-widget/button-widget.php 85% from 13 tests

The primary PHP file in "Button Widget" version 1.2.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Requires at least: Periods and digits should be used for the required version number (ex. "7.0" instead of "WordPress 5.0")
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.2" instead of "7.2.0")

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 plugin300 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP436185271
JavaScript25823
CSS2086

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.50
▷ Minimum class complexity6.00
▷ Maximum class complexity21.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods13
▷ Static methods215.38%
▷ Public methods1184.62%
▷ Protected methods215.38%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin