78% guidant

Code Review | WP Guidant | Guided Selling & Product Recommendation Quiz Plugin

WordPress plugin WP Guidant | Guided Selling & Product Recommendation Quiz Plugin scored78%from 54 tests.

About plugin

  • Plugin page: guidant
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 5, 2021
  • Latest release: Nov 16, 2023
  • Number of updates: 20
  • Update frequency: every 38.6 days
  • Top authors: wpcommerz (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

200+ active /3,945 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.66MB] [CPU: ▼1.83ms] 75% from 4 tests

An overview of server-side resources used by WP Guidant | Guided Selling & Product Recommendation Quiz Plugin
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 972.77ms on /wp-admin/admin.php?page=guidant-useful-plugins)
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6844.00 ▲2.44
Dashboard /wp-admin3.96 ▲0.6649.67 ▼2.21
Posts /wp-admin/edit.php4.01 ▲0.6554.56 ▲6.98
Add New Post /wp-admin/post-new.php6.54 ▲0.6685.08 ▼14.51
Media Library /wp-admin/upload.php3.88 ▲0.6540.11 ▲9.00
Useful Plugins /wp-admin/admin.php?page=guidant-useful-plugins4.08972.77
WP Guidant /wp-admin/admin.php?page=guidant-dashboard3.9843.42

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 117 new files
Database: no new tables, 22 new options
New WordPress options
wpguidant_guide_settings
wpguidant_conditions
theysaidso_admin_options
wpguidant_guides
wpguidant_element_settings
wpguidant_result_settings
widget_recent-posts
wpguidant_field_settings
wpguidant_submissions
wpguidant_condition_settings
...

Browser metrics Passed 4 tests

WP Guidant | Guided Selling & Product Recommendation Quiz Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,000 ▲23813.41 ▼0.939.63 ▲7.6742.59 ▼0.67
Dashboard /wp-admin2,278 ▲1015.58 ▼0.1497.79 ▼7.8681.83 ▲39.13
Posts /wp-admin/edit.php2,199 ▲991.99 ▲0.0336.34 ▼1.4734.47 ▼0.48
Add New Post /wp-admin/post-new.php1,618 ▲9223.04 ▼0.04704.12 ▲5.4867.41 ▲7.00
Media Library /wp-admin/upload.php1,495 ▲924.08 ▼0.11102.93 ▲0.1179.36 ▲37.62
Useful Plugins /wp-admin/admin.php?page=guidant-useful-plugins1,0742.1130.5334.15
WP Guidant /wp-admin/admin.php?page=guidant-dashboard5,2509.04170.7581.37

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 did not uninstall successfully, leaving 22 options in the database
    • wpguidant_element_settings
    • db_upgraded
    • wpguidant_guides
    • wpguidant_elements
    • widget_recent-posts
    • widget_theysaidso_widget
    • wpguidant_results
    • wpguidant_condition_settings
    • wpguidant_fields
    • wpguidant_guide_settings
    • ...

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/guidant/backend/templates/views/header.php
    • > /wp-content/plugins/guidant/backend/templates/modals/popup_pro.php
    • > /wp-content/plugins/guidant/backend/templates/dashboard.php
    • > /wp-content/plugins/guidant/frontend/api/guidant_guide_submission.php
    • > /wp-content/plugins/guidant/backend/templates/modals/popup_pro_x.php
  • 131× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'GUIDANT_PATHbackend/templates/views/header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/guidant/backend/templates/dashboard.php on line 4
    • > PHP Warning
      Use of undefined constant GUIDANT_PATH - assumed 'GUIDANT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/guidant/backend/templates/dashboard.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/guidant/backend/api/guides_create.php:4
    • > PHP Warning
      include(GUIDANT_PATHbackend/templates/modals/update_field.php): failed to open stream: No such file or directory in wp-content/plugins/guidant/backend/templates/dashboard.php on line 27
    • > PHP Warning
      include(): Failed opening 'GUIDANT_PATHbackend/templates/modals/update_field.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/guidant/backend/templates/dashboard.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/guidant/backend/api/filters_delete.php:4
    • > PHP Warning
      include(GUIDANT_PATHbackend/templates/modals/create_field.php): failed to open stream: No such file or directory in wp-content/plugins/guidant/backend/templates/dashboard.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/guidant/backend/api/conditions_delete.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/guidant/backend/api/logic_elements_suggestions.php:6
    • > PHP Notice
      Undefined variable: single_element in wp-content/plugins/guidant/frontend/templates/views/single_form_element.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #10, #11, #12, #13, #14, #2, #3, #4, #5, #6, #7, #8, #9 in guidant/assets to your readme.txt
Please take inspiration from this readme.txt

guidant/guidant.php 92% from 13 tests

The entry point to "WP Guidant | Guided Selling & Product Recommendation Quiz Plugin" version 1.1.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected12,636 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
PHP832,1358417,404
JavaScript14812362,878
CSS6334712,038
Markdown1820255
SVG70061

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity48.85
▷ Minimum class complexity1.00
▷ Maximum class complexity237.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods212
▷ Static methods10.47%
▷ Public methods17883.96%
▷ Protected methods62.83%
▷ Private methods2813.21%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/empty_img.png0.86KB0.48KB▼ 44.47%