83% cf7-hubspot-forms-add-on-for-contact-form-7

Code Review | CF7 HubSpot Forms Add-on For Contact Form 7

WordPress plugin CF7 HubSpot Forms Add-on For Contact Form 7 scored 83% from 54 tests.

About plugin

  • Plugin page: cf7-hubspot-forms...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Aug 20, 2016
  • Latest release: Aug 21, 2016
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: ahmadkarim (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active / 5,948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by CF7 HubSpot Forms Add-on For Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.51 ▲2.40
Dashboard /wp-admin3.31 ▲0.0054.68 ▼0.76
Posts /wp-admin/edit.php3.36 ▲0.0053.99 ▼18.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.05 ▼9.89
Media Library /wp-admin/upload.php3.23 ▲0.0041.55 ▲5.90

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

CF7 HubSpot Forms Add-on For Contact Form 7: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▼013.23 ▲0.062.11 ▲0.1842.84 ▲1.85
Dashboard /wp-admin2,203 ▼35.84 ▼0.01103.59 ▼4.1839.24 ▼0.11
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0839.58 ▼4.1334.88 ▼3.04
Add New Post /wp-admin/post-new.php1,533 ▼023.28 ▲0.06760.87 ▲32.0761.43 ▲5.93
Media Library /wp-admin/upload.php1,391 ▼04.21 ▼0.02108.24 ▲3.0949.40 ▲6.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-hubspot-forms-add-on-for-contact-form-7/cf7-hubspot-forms-addon.php on line 15
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/cf7-hubspot-forms-add-on-for-contact-form-7/cf7-hubspot-forms-addon.php on line 15
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-hubspot-forms-add-on-for-contact-form-7/cf7-hubspot-forms-addon.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/cf7-hubspot-forms-add-on-for-contact-form-7/cf7-hubspot-forms-addon.php:17

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)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Invalid URI found ("")
  • Screenshots: Add an image for screenshot #1 (screenshot-1.jpg)
The official readme.txt might help

cf7-hubspot-forms-add-on-for-contact-form-7/cf7-hubspot-forms-addon.php 85% from 13 tests

This is the main PHP file of "CF7 HubSpot Forms Add-on For Contact Form 7" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 206 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("cf7-hubspot-forms-add-on-for-contact-form-7.php" instead of "cf7-hubspot-forms-addon.php")

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 detected384 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP49110260
CSS13682
JavaScript132042

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.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
There were not PNG files found in your plugin