84% goodbarber

Code Review | GoodBarber

WordPress plugin GoodBarber scored84%from 54 tests.

About plugin

  • Plugin page: goodbarber
  • Plugin version: 1.0.24
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 28, 2012
  • Latest release: Oct 19, 2023
  • Number of updates: 30
  • Update frequency: every 132.6 days
  • Top authors: goodbarber (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /63,700 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
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼8.16ms] Passed 4 tests

An overview of server-side resources used by GoodBarber
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2743.03 ▲7.40
Dashboard /wp-admin3.57 ▲0.2347.43 ▼9.15
Posts /wp-admin/edit.php3.62 ▲0.2743.02 ▼4.88
Add New Post /wp-admin/post-new.php6.09 ▲0.2080.77 ▼19.91
Media Library /wp-admin/upload.php3.43 ▲0.2035.96 ▲1.29
GoodBarber Api /wp-admin/options-general.php?page=gb-json-api3.4033.93

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
gb_api_key
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
gb_json_api_controllers

Browser metrics Passed 4 tests

This is an overview of browser requirements for GoodBarber
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.10 ▼0.191.70 ▲0.0644.13 ▲4.65
Dashboard /wp-admin2,196 ▲225.51 ▼0.0784.40 ▼1.4638.76 ▼5.22
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0334.25 ▼2.5835.23 ▼3.74
Add New Post /wp-admin/post-new.php1,529 ▲123.55 ▲0.65680.54 ▲17.8056.30 ▼2.77
Media Library /wp-admin/upload.php1,404 ▲74.29 ▲0.07107.92 ▲4.5047.68 ▲5.68
GoodBarber Api /wp-admin/options-general.php?page=gb-json-api8401.9924.7428.91

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • gb_api_key
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • gb_json_api_controllers
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× 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/goodbarber/gb-json-api.php:95

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

goodbarber/gb-json-api.php 92% from 13 tests

This is the main PHP file of "GoodBarber" version 1.0.24, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("goodbarber.php" instead of "gb-json-api.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
Good job! No executable or dangerous file extensions detected2,243 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP153483932,239
CSS1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity26.38
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods125
▷ Static methods00.00%
▷ Public methods11894.40%
▷ Protected methods75.60%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
PNG images were not found in this plugin