10% bon-toolkit

Code Review | Bon Toolkit

WordPress plugin Bon Toolkit scored10%from 54 tests.

About plugin

  • Plugin page: bon-toolkit
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2013
  • Latest release: Jun 7, 2015
  • Number of updates: 105
  • Update frequency: every 6.2 days
  • Top authors: nackle2k10 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /18,063 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/bon-toolkit/bon-toolkit.php+410
    Uncaught Error: Call to undefined function bon_toolkit_set_options() in wp-content/plugins/bon-toolkit/bon-toolkit.php:410
    Stack trace:
    #0 wp-content/plugins/bon-toolkit/bon-toolkit.php(156): BON_Toolkit->get_option_array()
    #1 wp-includes/class-wp-hook.php(310): BON_Toolkit->activate()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.79ms] Passed 4 tests

Server-side resources used by Bon Toolkit
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.39 ▼11.77
Dashboard /wp-admin3.31 ▲0.0045.27 ▼5.15
Posts /wp-admin/edit.php3.36 ▲0.0051.11 ▲7.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.05 ▼13.36
Media Library /wp-admin/upload.php3.23 ▲0.0032.97 ▼0.88

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 98 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Bon Toolkit: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.80 ▲0.421.98 ▲0.2041.09 ▼6.29
Dashboard /wp-admin2,203 ▲154.84 ▼0.04113.53 ▼4.0839.61 ▼8.38
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0540.67 ▼2.2235.56 ▼0.86
Add New Post /wp-admin/post-new.php1,537 ▼523.36 ▲4.72655.43 ▼23.8152.21 ▼13.60
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.03103.43 ▲6.7747.70 ▲5.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 29× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-flickr.php
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-archives.php
    • > /wp-content/plugins/bon-toolkit/includes/tinymce/init.php
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-calendar.php
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-contactform.php
    • > /wp-content/plugins/bon-toolkit/includes/classes/class-quiz.php
    • > /wp-content/plugins/bon-toolkit/includes/posttypes/quiz.php
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-nav-menu.php
    • > /wp-content/plugins/bon-toolkit/includes/widgets/widget-dribbble.php
    • > /wp-content/plugins/bon-toolkit/includes/posttypes/testimonial.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bon-toolkit/bon-toolkit-core-functions.php:144
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bon-toolkit/includes/shortcodes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bon_toolkit_get_prefix() in wp-content/plugins/bon-toolkit/includes/builder/builder.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% 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:
  • Screenshots: Please add images for these screenshots: #1 (The Bon Toolkit widget will appear in your list of available widgets.), #2 (A view of the available settings for the Toolkit.), #3 (Widgets that will appear in your Widgets area once activated.), #4 (Retina social icons widget active in a footer.)
The official readme.txt might help

bon-toolkit/bon-toolkit.php Passed 13 tests

The main file in "Bon Toolkit" v. 1.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
65 characters long description:
Various widgets, shortcodes and elements for your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin12,784 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP392,1262,0187,240
PO File31,1331,5722,375
CSS1012961,285
JavaScript94838966
SVG300918

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity18.16
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes25.41%
▷ Concrete classes3594.59%
▷ Final classes00.00%
Methods272
▷ Static methods103.68%
▷ Public methods25493.38%
▷ Protected methods93.31%
▷ Private methods93.31%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
18 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-testi.png1.84KB1.00KB▼ 45.54%
assets/images/marker-orange.png4.82KB2.01KB▼ 58.35%
assets/images/icon-poll.png2.10KB1.47KB▼ 30.02%
assets/images/icon-quiz.png2.20KB1.41KB▼ 35.73%
assets/images/icon-listings.png2.32KB1.36KB▼ 41.21%