83% bh-pricing-table

Code Review | BH Pricing Table

WordPress plugin BH Pricing Table scored 83% from 54 tests.

About plugin

  • Plugin page: bh-pricing-table
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 6.3.1
  • First release: Jul 30, 2016
  • Latest release: Sep 3, 2021
  • Number of updates: 29
  • Update frequency: every 64.2 days
  • Top authors: masumbd (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,697 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.73ms] Passed 4 tests

A check of server-side resources used by BH Pricing Table
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.95 ▼6.49
Dashboard /wp-admin3.37 ▲0.0646.25 ▼5.87
Posts /wp-admin/edit.php3.42 ▲0.0650.59 ▲0.87
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.61 ▼7.28
Media Library /wp-admin/upload.php3.29 ▲0.0634.65 ▲0.74
All Items /wp-admin/edit.php?post_type=bh_pricing3.3334.78
Add New /wp-admin/post-new.php?post_type=bh_pricing3.3241.75

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BH Pricing Table
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.12 ▼1.171.67 ▼0.3041.77 ▼2.53
Dashboard /wp-admin2,243 ▲615.89 ▲0.98103.06 ▼13.4841.87 ▼4.32
Posts /wp-admin/edit.php2,123 ▲342.00 ▲0.0137.38 ▼1.7939.41 ▲7.39
Add New Post /wp-admin/post-new.php1,448 ▼8522.47 ▼0.67555.85 ▼108.0544.02 ▼12.46
Media Library /wp-admin/upload.php1,419 ▲374.19 ▼0.0593.65 ▼3.3042.86 ▼2.11
All Items /wp-admin/edit.php?post_type=bh_pricing1,0961.9832.8033.86
Add New /wp-admin/post-new.php?post_type=bh_pricing1,4302.5047.6057.57

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bh-pricing-table/bh_pricing_opt.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bh-pricing-table/plugin_main.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bh-pricing-table/custom_posts.php:57

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 87% from 29 tests

readme.txt 88% 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 need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt is a good inspiration

bh-pricing-table/plugin_main.php 85% from 13 tests

"BH Pricing Table" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bh-pricing-table.php" instead of "plugin_main.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 detected1,274 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS212211,035
PHP36237239

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.23MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png64.43KB20.56KB▼ 68.09%
screenshot-1.png55.70KB22.63KB▼ 59.38%
screenshot-3.png62.96KB25.20KB▼ 59.98%
screenshot-2.png55.66KB20.70KB▼ 62.81%