78% customerlabs-actionrecorder

Code Review | CustomerLabs CDP

WordPress plugin CustomerLabs CDP scored78%from 54 tests.

About plugin

  • Plugin page: customerlabs-acti...
  • Plugin version: 1.8.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.1
  • WordPress version: 6.3.1
  • First release: Apr 1, 2019
  • Latest release: Feb 8, 2023
  • Number of updates: 28
  • Update frequency: every 50.3 days
  • Top authors: clabsvishnuprasad (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.22ms] Passed 4 tests

Analyzing server-side resources used by CustomerLabs CDP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.41 ▼0.97
Dashboard /wp-admin3.33 ▲0.0357.85 ▲10.96
Posts /wp-admin/edit.php3.38 ▲0.0351.39 ▲2.67
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.82 ▼9.26
Media Library /wp-admin/upload.php3.26 ▲0.0335.28 ▲2.69
Customerlabs CDP /wp-admin/options-general.php?page=cltracker3.2431.65

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
cltracker_wordpress_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

CustomerLabs CDP: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.23 ▼0.151.70 ▼0.0339.77 ▼0.22
Dashboard /wp-admin2,207 ▲195.84 ▼0.03112.51 ▲8.7542.25 ▼3.78
Posts /wp-admin/edit.php2,093 ▲12.01 ▲0.0135.74 ▼4.8032.89 ▼5.73
Add New Post /wp-admin/post-new.php1,536 ▲2223.02 ▲5.57660.15 ▼30.3856.39 ▼14.98
Media Library /wp-admin/upload.php1,392 ▲14.22 ▼0.04105.06 ▲5.3943.18 ▼0.99
Customerlabs CDP /wp-admin/options-general.php?page=cltracker9322.0522.0028.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/customerlabs-actionrecorder/templates/identify.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/customerlabs-actionrecorder/ActionRecorder.php:699
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/customerlabs-actionrecorder/class.cltracker-cookie.php:97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/customerlabs-actionrecorder/templates/tracking_code.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CLTracker_ECommerce' not found in wp-content/plugins/customerlabs-actionrecorder/integrations/ecommerce/woocommerce.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CLTracker_WordPress' not found in wp-content/plugins/customerlabs-actionrecorder/templates/track.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/customerlabs-actionrecorder/templates/settings.php:2

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: event tracking, no code alternative

customerlabs-actionrecorder/ActionRecorder.php 92% from 13 tests

"CustomerLabs CDP" version 1.8.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("customerlabs-actionrecorder.php" instead of "ActionRecorder.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,095 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP102983891,007
Markdown142088

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.28
Average class complexity13.83
▷ Minimum class complexity4.00
▷ Maximum class complexity30.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods59
▷ Static methods2440.68%
▷ Public methods5694.92%
▷ Protected methods00.00%
▷ Private methods35.08%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin