89% peanut-butter-bar-smooth-version

Code Review | Peanut Butter Bar (smooth version)

WordPress plugin Peanut Butter Bar (smooth version) scored 89% from 54 tests.

About plugin

  • Plugin page: peanut-butter-bar...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.5
  • WordPress version: 6.3.1
  • First release: Aug 11, 2014
  • Latest release: Apr 4, 2016
  • Number of updates: 27
  • Update frequency: every 22.3 days
  • Top authors: andrewcouch (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 7,226 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.18MB] [CPU: ▼0.60ms] Passed 4 tests

A check of server-side resources used by Peanut Butter Bar (smooth version)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.59 ▼1.32
Dashboard /wp-admin3.51 ▲0.2050.00 ▲3.11
Posts /wp-admin/edit.php3.62 ▲0.2647.60 ▲3.49
Add New Post /wp-admin/post-new.php6.09 ▲0.2083.29 ▼4.67
Media Library /wp-admin/upload.php3.43 ▲0.2036.64 ▲0.46
Peanut Butter Bar Settings /wp-admin/options-general.php?page=pbbsmooth3.4032.72

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
pbb_settings_smoothdbver
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Peanut Butter Bar (smooth version)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲13013.60 ▼1.085.48 ▲3.3543.34 ▼2.61
Dashboard /wp-admin2,210 ▲255.80 ▲0.8998.59 ▼16.6740.06 ▼10.94
Posts /wp-admin/edit.php2,093 ▲72.03 ▲0.0333.39 ▼0.7635.65 ▼1.88
Add New Post /wp-admin/post-new.php1,536 ▲1623.27 ▲0.11672.26 ▼10.8257.36 ▼4.81
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.1596.96 ▼12.6843.46 ▼1.08
Peanut Butter Bar Settings /wp-admin/options-general.php?page=pbbsmooth1,0392.3428.9032.85

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • pbb_settings_smoothdbver

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

peanut-butter-bar-smooth-version/pbb-smooth.php 85% from 13 tests

The principal PHP file in "Peanut Butter Bar (smooth version)" v. 1.2.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("peanut-butter-bar-smooth-version.php" instead of "pbb-smooth.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin1,039 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP71163281,036
JavaScript2022
CSS1011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity31.00
▷ Minimum class complexity5.00
▷ Maximum class complexity93.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods51
▷ Static methods23.92%
▷ Public methods4486.27%
▷ Protected methods00.00%
▷ Private methods713.73%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
pbb-sprites.png3.96KB2.98KB▼ 24.69%
pbb-icon.png13.88KB5.94KB▼ 57.23%
pbb-check.png0.41KB0.40KB▼ 1.67%