84% integration-with-hubspot-forms

Code Review | Integration with Hubspot Forms

WordPress plugin Integration with Hubspot Forms scored 84% from 54 tests.

About plugin

  • Plugin page: integration-with-...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 5.8.1
  • First release: Feb 15, 2016
  • Latest release: Sep 8, 2017
  • Number of updates: 30
  • Update frequency: every 19.0 days
  • Top authors: minnur (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 4,867 total downloads

Benchmarks

Plugin footprint 83% 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.03MB] [CPU: ▼78.69ms] Passed 4 tests

An overview of server-side resources used by Integration with Hubspot Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2041.80 ▲21.18
Dashboard /wp-admin3.14 ▲0.0945.70 ▼4.19
Posts /wp-admin/edit.php3.17 ▲0.062,228.04 ▲2,185.61
Add New Post /wp-admin/post-new.php5.05 ▼0.38299.86 ▼356.67
Media Library /wp-admin/upload.php3.10 ▲0.1058.99 ▲24.91
Hubspot Forms /wp-admin/options-general.php?page=EmbedHubspotForms3.0631.96

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 2 new options
New WordPress options
widget_wp_integrationhubspotformswidget
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Integration with Hubspot Forms: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,694 ▲9815.92 ▼0.108.91 ▼1.0948.81 ▼1.59
Dashboard /wp-admin2,988 ▲586.11 ▲0.10132.61 ▼22.44118.26 ▲0.86
Posts /wp-admin/edit.php1,182 ▼1,5572.14 ▼0.5833.40 ▼31.8351.89 ▼41.77
Add New Post /wp-admin/post-new.php635 ▼1,0372.21 ▼16.6120.44 ▼362.180.22 ▼104.98
Media Library /wp-admin/upload.php1,824 ▲175.06 ▲0.01141.62 ▼16.23119.38 ▼2.54
Hubspot Forms /wp-admin/options-general.php?page=EmbedHubspotForms1,1502.0972.5378.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_wp_integrationhubspotformswidget
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/integration-with-hubspot-forms/templates/widget-form.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/integration-with-hubspot-forms/includes/EmbedHubspotFormsWidget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/integration-with-hubspot-forms/integration-hubspot-forms.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/integration-with-hubspot-forms/templates/settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/integration-with-hubspot-forms/templates/popup.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: forms, embed forms, hubspot, salesforce, third-party service...

integration-with-hubspot-forms/integration-hubspot-forms.php 85% from 13 tests

The main PHP file in "Integration with Hubspot Forms" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("integration-with-hubspot-forms.php" instead of "integration-hubspot-forms.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected416 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP653130340
JavaScript2221162
CSS13414

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity16.50
▷ Minimum class complexity14.00
▷ Maximum class complexity19.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin