72% gbi-buy-now

Code Review | Garber Buy Now Button

WordPress plugin Garber Buy Now Button scored72%from 54 tests.

About plugin

  • Plugin page: gbi-buy-now
  • Plugin version: 1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.2
  • WordPress version: 6.3.1
  • First release: Jun 25, 2021
  • Latest release: Apr 5, 2022
  • Number of updates: 18
  • Update frequency: every 16.2 days
  • Top authors: gbidiego (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,777 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.13MB] [CPU: ▼10.77ms] Passed 4 tests

An overview of server-side resources used by Garber Buy Now Button
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.6018.43 ▼21.27
Dashboard /wp-admin3.33 ▲0.0348.89 ▼2.77
Posts /wp-admin/edit.php3.38 ▲0.0344.66 ▼1.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0379.61 ▼17.41
Media Library /wp-admin/upload.php3.25 ▲0.0336.87 ▲4.71
GBI Buy Now /wp-admin/admin.php?page=gbi-buy-now3.2429.00
Options /wp-admin/admin.php?page=gbi-options3.2530.73

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

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

Browser metrics Passed 4 tests

Garber Buy Now Button: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,479 ▼26713.17 ▼1.580.64 ▼1.1620.56 ▼22.07
Dashboard /wp-admin2,229 ▲415.80 ▲0.7795.38 ▼19.3036.99 ▼10.22
Posts /wp-admin/edit.php2,109 ▲202.05 ▲0.0133.97 ▼3.1933.93 ▲0.35
Add New Post /wp-admin/post-new.php1,552 ▲1923.18 ▲0.02665.38 ▼23.5364.57 ▲13.25
Media Library /wp-admin/upload.php1,408 ▲234.09 ▼0.1094.35 ▼7.9043.10 ▼4.19
GBI Buy Now /wp-admin/admin.php?page=gbi-buy-now7872.0222.4421.91
Options /wp-admin/admin.php?page=gbi-options8222.0324.1021.73

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=gbi-options
    • > Notice in wp-content/plugins/gbi-buy-now/admin/options.php+7
    Undefined index: titulo_boton

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/gbi-buy-now/gbi_buy_now.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gbi-buy-now/admin/options.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gbi-buy-now/funciones/hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gbi-buy-now/funciones/funciones.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gbi-buy-now/includes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gbi-buy-now/admin/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gbi-buy-now/scripts.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

gbi-buy-now/gbi_buy_now.php 85% from 13 tests

The principal PHP file in "Garber Buy Now Button" v. 1.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gbi-buy-now.php" instead of "gbi_buy_now.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
There were no executable files found in this plugin212 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP73113131
PO File1111238
JavaScript13027
CSS11016

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 images were found in this plugin