84% crm-hubspot-learndash-integration

Code Review | CRM HubSpot LearnDash Integration

WordPress plugin CRM HubSpot LearnDash Integration scored84%from 54 tests.

About plugin

  • Plugin page: crm-hubspot-learn...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 1, 2019
  • Latest release: Apr 15, 2020
  • Number of updates: 23
  • Update frequency: every 16.5 days
  • Top authors: qfnetwork (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,724 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
Installer ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼12.69ms] Passed 4 tests

A check of server-side resources used by CRM HubSpot LearnDash Integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.21 ▼12.42
Dashboard /wp-admin3.21 ▼0.0934.06 ▼17.34
Posts /wp-admin/edit.php3.28 ▼0.0839.35 ▼9.57
Add New Post /wp-admin/post-new.php5.45 ▼0.4482.12 ▼11.43
Media Library /wp-admin/upload.php3.21 ▼0.0134.10 ▼1.74

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 754 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

CRM HubSpot LearnDash Integration: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.62 ▼0.781.70 ▼0.6046.00 ▼1.39
Dashboard /wp-admin2,206 ▲185.81 ▲0.93100.45 ▼8.6639.84 ▼2.20
Posts /wp-admin/edit.php2,092 ▲62.02 ▲0.0039.50 ▲0.2836.36 ▲0.27
Add New Post /wp-admin/post-new.php1,542 ▲1418.32 ▲0.14589.09 ▼32.3955.12 ▲2.89
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0396.27 ▼6.0339.98 ▼2.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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 shallow check for server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 344× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/twig/twig/src/Extension/DebugExtension.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/twig/twig/src/Test/NodeTestCase.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Error\\Error' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/twig/twig/src/Error/LoaderError.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Timber\\Core' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/timber/timber/lib/MenuItem.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/twig/twig/src/TokenParser/ForTokenParser.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SevenShores\\Hubspot\\Resources\\Resource' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/ryanwinchester/hubspot-php/src/Resources/BlogPosts.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'SevenShores\\Hubspot\\Resources\\Resource' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/ryanwinchester/hubspot-php/src/Resources/HubDB.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SevenShores\\Hubspot\\Resources\\Resource' not found in wp-content/plugins/crm-hubspot-learndash-integration/vendor/ryanwinchester/hubspot-php/src/Resources/Files.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

crm-hubspot-learndash-integration/crm-hubspot-learndash-integration.php Passed 13 tests

The principal PHP file in "CRM HubSpot LearnDash Integration" v. 1.1.0 is loaded by WordPress automatically on each request
51 characters long description:
Integrates your course enrollments with HubSpot CRM

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected39,425 lines of code in 726 files:
LanguageFilesBlank linesComment linesLines of code
PHP6607,61617,01033,128
Markdown261,33304,110
JSON15001,492
Bourne Shell45514255
XML112352233
YAML9352198
make1409

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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.39
Average class complexity6.51
▷ Minimum class complexity1.00
▷ Maximum class complexity172.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces48
Interfaces33
Traits2
Classes603
▷ Abstract classes152.49%
▷ Concrete classes58897.51%
▷ Final classes569.52%
Methods2,441
▷ Static methods30612.54%
▷ Public methods2,05684.23%
▷ Protected methods1897.74%
▷ Private methods1968.03%
Functions281
▷ Named functions15354.45%
▷ Anonymous functions12845.55%
Constants123
▷ Global constants129.76%
▷ Class constants11190.24%
▷ Public constants111100.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