57% business-hub-toolbox

Code Review | Business Hub Toolbox

WordPress plugin Business Hub Toolbox scored 57% from 54 tests.

About plugin

  • Plugin page: business-hub-toolbox
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.7.2
  • WordPress version: 5.8.1
  • First release: Mar 22, 2017
  • Latest release: Mar 16, 2021
  • Number of updates: 18
  • Update frequency: every 80.9 days
  • Top authors: WpGaint (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 778 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼175.41ms] Passed 4 tests

Server-side resources used by Business Hub Toolbox
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.2624.74 ▲0.08
Dashboard /wp-admin3.03 ▼0.0322.06 ▼26.49
Posts /wp-admin/edit.php3.03 ▼0.0828.82 ▼20.15
Add New Post /wp-admin/post-new.php3.03 ▼2.4121.69 ▼642.33
Media Library /wp-admin/upload.php3.03 ▲0.0225.17 ▼12.66
All Pricing Tables /wp-admin/edit.php?post_type=rws-pricing-table3.0325.69
Add Testimonial /wp-admin/post-new.php?post_type=bht_testimonials3.0324.86
Add Pricing Table /wp-admin/post-new.php?post_type=rws-pricing-table3.0321.32
All Item /wp-admin/edit.php?post_type=bht-event3.0328.12
Add event /wp-admin/post-new.php?post_type=bht-event3.0322.86
Testimonials /wp-admin/edit.php?post_type=bht_testimonials3.0323.88
Settings /wp-admin/edit.php?post_type=bht-event&page=rwsec-setting3.0320.95

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 1 new option
New WordPress options
widget_rwsec_widget

Browser metrics Passed 4 tests

A check of browser resources used by Business Hub Toolbox
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,174 ▲57818.57 ▲2.6017.01 ▲5.9049.74 ▼2.55
Dashboard /wp-admin3,289 ▲3597.51 ▲1.59202.59 ▲26.59120.35 ▲1.78
Posts /wp-admin/edit.php3,090 ▲3514.01 ▲1.29101.96 ▲25.74100.70 ▼2.38
Add New Post /wp-admin/post-new.php1,704 ▲2121.52 ▲5.22291.88 ▼165.54117.17 ▲0.40
Media Library /wp-admin/upload.php1,936 ▲1295.25 ▲0.21157.06 ▼16.30122.47 ▼2.91
All Pricing Tables /wp-admin/edit.php?post_type=rws-pricing-table1,7644.44101.1076.59
Add Testimonial /wp-admin/post-new.php?post_type=bht_testimonials3,1479.56276.01148.75
Add Pricing Table /wp-admin/post-new.php?post_type=rws-pricing-table2,7064.85120.96109.64
All Item /wp-admin/edit.php?post_type=bht-event1,7614.45114.2386.13
Add event /wp-admin/post-new.php?post_type=bht-event3,6289.31286.15205.71
Testimonials /wp-admin/edit.php?post_type=bht_testimonials1,7474.4192.6578.30
Settings /wp-admin/edit.php?post_type=bht-event&page=rwsec-setting1,4543.9185.8491.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-post-type.php+568
    Invalid argument supplied for foreach()
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_rwsec_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bht-event&page=rwsec-setting
    • > Warning in wp-includes/class-wp-post-type.php+568
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/business-hub-toolbox/inc/bht-settings.php
  • 22× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ECA_IMAGE_DIR - assumed 'ECA_IMAGE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-hub-toolbox/inc/bht-meta.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'BHP_DIRinc/TwitterAPIExchange.php' (include_path='.:/usr/share/php') in wp-content/plugins/business-hub-toolbox/inc/bht-showTweets.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/business-hub-toolbox/inc/bht-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/business-hub-toolbox/inc/bht-price-table.php:2
    • > PHP Notice
      Undefined variable: position in wp-content/plugins/business-hub-toolbox/inc/bht-settings.php on line 9
    • > PHP Notice
      Undefined variable: position in wp-content/plugins/business-hub-toolbox/inc/bht-settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/business-hub-toolbox/speakers/repeatable-speaker.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/business-hub-toolbox/inc/bht-event-meta.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/business-hub-toolbox/inc/bht-meta.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/business-hub-toolbox/inc/archive-events.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=bht-event
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/business-hub-toolbox/speakers//js/scripts.js?ver=5.8.1:131:32)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=bht-event
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

business-hub-toolbox/business-hub-toolbox.php Passed 13 tests

The principal PHP file in "Business Hub Toolbox" v. 1.0.4 is loaded by WordPress automatically on each request
81 characters long description:
A plugin to display instagram feeds, twitter feeds, testimonial custom post types

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected8,162 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
CSS105112003,092
JavaScript136169442,544
PHP214914452,526

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity25.00
▷ Minimum class complexity4.00
▷ Maximum class complexity42.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods65
▷ Static methods00.00%
▷ Public methods6396.92%
▷ Protected methods00.00%
▷ Private methods23.08%
Functions22
▷ Named functions22100.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
4 PNG files occupy 0.24MB with 0.16MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/public/images/tweet-bg.png238.44KB79.01KB▼ 66.86%
assets/admin/images/Close.png0.97KB0.61KB▼ 36.60%
speakers/images/image.png2.74KB0.10KB▼ 96.43%
speakers/images/sprite.png6.06KB2.18KB▼ 64.10%