84% wb-product-enquiry

Code Review | WB Product Enquiry

WordPress plugin WB Product Enquiry scored84%from 54 tests.

About plugin

  • Plugin page: wb-product-enquiry
  • Plugin version: 1.25
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6.1
  • WordPress version: 6.3.1
  • First release: Jan 29, 2021
  • Latest release: Feb 17, 2021
  • Number of updates: 11
  • Update frequency: every 1.7 days
  • Top authors: wojciechborowicz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /553 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by WB Product Enquiry
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.24 ▲0.79
Dashboard /wp-admin3.31 ▲0.0053.01 ▲7.55
Posts /wp-admin/edit.php3.36 ▲0.0046.29 ▼3.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.68 ▼1.90
Media Library /wp-admin/upload.php3.23 ▲0.0033.44 ▼2.27

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WB Product Enquiry
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.37 ▼0.191.71 ▲0.0947.10 ▲6.40
Dashboard /wp-admin2,204 ▲275.66 ▲0.0983.29 ▼3.1837.48 ▼0.06
Posts /wp-admin/edit.php2,106 ▲61.98 ▲0.0234.00 ▼1.6332.50 ▼6.58
Add New Post /wp-admin/post-new.php1,532 ▲622.98 ▼0.25639.08 ▼62.8767.22 ▲2.03
Media Library /wp-admin/upload.php1,406 ▲124.18 ▼0.0196.46 ▼7.3042.65 ▼3.70

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
  • 4× 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/wb-product-enquiry/includes/wb-product-enquiry-mail.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wb-product-enquiry/includes/wb-product-enquiry-frontend.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wb-product-enquiry/includes/wb-product-enquiry-general.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wb-product-enquiry/includes/wb-product-enquiry-admin.php:175

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: contact form, disable cart, product catalog, woocommerce catalog, product enquiry

wb-product-enquiry/wb-product-enquiry.php 92% from 13 tests

The principal PHP file in "WB Product Enquiry" v. 1.25 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected715 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5168101596
CSS22060
JavaScript115059

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions23
▷ Named functions2086.96%
▷ Anonymous functions313.04%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin