84% leadin

Code Review | HubSpot - CRM, Email Marketing, Live Chat, Forms & Analytics

WordPress plugin HubSpot - CRM, Email Marketing, Live Chat, Forms & Analytics scored84%from 54 tests.

About plugin

  • Plugin page: leadin
  • Plugin version: 10.2.16
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2014
  • Latest release: Nov 21, 2023
  • Number of updates: 458
  • Update frequency: every 7.7 days
  • Top authors: leadin (40.39%)HubSpotDev (33.62%)AndyGCook (26.42%)

Code review

54 tests

User reviews

200 reviews

Install metrics

300,000+ active /12,458,049 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.12MB] [CPU: ▲9.49ms] Passed 4 tests

A check of server-side resources used by HubSpot - CRM, Email Marketing, Live Chat, Forms & Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.94 ▼1.60
Dashboard /wp-admin3.44 ▲0.1364.01 ▲10.79
Posts /wp-admin/edit.php3.55 ▲0.1968.62 ▲20.22
Add New Post /wp-admin/post-new.php6.07 ▲0.19103.05 ▲8.54
Media Library /wp-admin/upload.php3.36 ▲0.1357.12 ▲24.81

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 272 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
leadin_activation_time
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for HubSpot - CRM, Email Marketing, Live Chat, Forms & Analytics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12614.72 ▲0.451.54 ▼0.0227.49 ▼11.85
Dashboard /wp-admin2,293 ▲1126.05 ▲0.39101.44 ▼8.1282.84 ▲43.16
Posts /wp-admin/edit.php2,202 ▲1022.59 ▲0.6247.40 ▲5.9539.85 ▲1.57
Add New Post /wp-admin/post-new.php6,374 ▲4,84824.08 ▲0.951,103.56 ▲455.9860.65 ▲11.17
Media Library /wp-admin/upload.php1,489 ▲894.54 ▲0.31117.95 ▲16.28101.82 ▲57.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Leadin\\api\\Base_Api_Controller' not found in wp-content/plugins/leadin/public/admin/modules/api/class-internal-tracking-api-controller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Leadin\\client\\HubSpot_Base_Api_Client' not found in wp-content/plugins/leadin/public/admin/modules/client/class-contacts-api-client.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/leadin/public/admin/widgets/class-elementormeeting.php:10
    • > PHP Warning
      require_once(LEADIN_PLUGIN_DIR/public/includes/api-loader.php): failed to open stream: No such file or directory in wp-content/plugins/leadin/public/class-leadin.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'LEADIN_PLUGIN_DIR/public/includes/api-loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/leadin/public/class-leadin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Leadin\\api\\Base_Api_Controller' not found in wp-content/plugins/leadin/public/admin/modules/api/class-user-meta-api-controller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Base_Data_Control' not found in wp-content/plugins/leadin/public/admin/widgets/class-elementorformselect.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Leadin\\api\\Base_Api_Controller' not found in wp-content/plugins/leadin/public/admin/modules/api/class-hublet-api-controller.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Leadin\\add_action() in wp-content/plugins/leadin/public/includes/api-loader.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Leadin\\api\\Base_Api_Controller' not found in wp-content/plugins/leadin/public/admin/modules/api/class-portal-api-controller.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

leadin/leadin.php 92% from 13 tests

The primary PHP file in "HubSpot - CRM, Email Marketing, Live Chat, Forms & Analytics" version 10.2.16 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)

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
Success! There were no dangerous files found in this plugin45,329 lines of code in 192 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript88,1609,25536,419
TypeScript94434494,188
PHP647161,6383,193
PO File8352408816
CSS88697528
SVG65290
JSON20075
XML10015
Markdown1205

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes00.00%
Methods305
▷ Static methods18259.67%
▷ Public methods26386.23%
▷ Protected methods61.97%
▷ Private methods3611.80%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants72
▷ Global constants912.50%
▷ Class constants6387.50%
▷ Public constants63100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/hubspot-form.png27.27KB7.19KB▼ 73.62%
public/assets/images/hubspot-meetings.png31.44KB11.58KB▼ 63.16%
public/assets/images/hubspot-team-profile.png39.10KB16.99KB▼ 56.56%