83% klaviyo

Code Review | Klaviyo

WordPress plugin Klaviyo scored83%from 54 tests.

About plugin

  • Plugin page: klaviyo
  • Plugin version: 3.3.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Apr 11, 2012
  • Latest release: Nov 16, 2023
  • Number of updates: 98
  • Update frequency: every 43.2 days
  • Top authors: klaviyo (71.43%)bialecki (29.59%)

Code review

54 tests

User reviews

15 reviews

Install metrics

30,000+ active /597,116 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.27MB] [CPU: ▼7.32ms] Passed 4 tests

Analyzing server-side resources used by Klaviyo
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3044.98 ▲4.64
Dashboard /wp-admin3.62 ▲0.2747.51 ▼15.32
Posts /wp-admin/edit.php3.67 ▲0.3151.06 ▲3.68
Add New Post /wp-admin/post-new.php6.15 ▲0.2683.60 ▼21.77
Media Library /wp-admin/upload.php3.48 ▲0.2539.20 ▲4.15
Help /wp-admin/admin.php?page=klaviyo_help3.4433.66
Settings /wp-admin/admin.php?page=klaviyo_settings3.4433.72

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 9 new options
New WordPress options
widget_klaviyo_embedemailsignup_widget
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_klaviyo_emailsignup_widget
woocommerce_klaviyo_version

Browser metrics Passed 4 tests

Checking browser requirements for Klaviyo
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲2914.14 ▼0.571.63 ▼0.4643.75 ▼1.56
Dashboard /wp-admin2,221 ▲415.54 ▼0.1192.53 ▼6.8869.56 ▲31.12
Posts /wp-admin/edit.php2,132 ▲291.97 ▲0.0339.96 ▼0.2833.87 ▼1.17
Add New Post /wp-admin/post-new.php1,701 ▲17522.32 ▼0.92768.46 ▲114.2054.98 ▼9.89
Media Library /wp-admin/upload.php1,426 ▲294.18 ▼0.01102.01 ▲2.4478.69 ▲35.30
Help /wp-admin/admin.php?page=klaviyo_help8992.0025.9929.98
Settings /wp-admin/admin.php?page=klaviyo_settings9932.0031.4535.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_klaviyo_emailsignup_widget
    • db_upgraded
    • widget_klaviyo_embedemailsignup_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/klaviyo/includes/admin/class-kl-plugins-screen-updates.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'Automattic\\WooCommerce\\Blocks\\Integrations\\IntegrationInterface' not found in wp-content/plugins/klaviyo/includes/blocks/CheckoutIntegration.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/klaviyo/inc/kla-widgets.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/klaviyo/includes/admin/partials/wc-v1-auth-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/klaviyo/includes/wck-checkout-block.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/klaviyo/includes/wck-added-to-cart.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/klaviyo/includes/wck-viewed-product.php:12

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woocommerce, marketing, analytics, email, klaviyo

klaviyo/klaviyo.php 77% from 13 tests

The principal PHP file in "Klaviyo" v. 3.3.3 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 200 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/i18n/languages/" does not exist

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
Good job! No executable or dangerous file extensions detected2,373 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP243981,3141,978
JavaScript63070219
CSS117386
SVG10056
JSON10034

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.79
▷ Minimum class complexity3.00
▷ Maximum class complexity25.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods90
▷ Static methods77.78%
▷ Public methods7785.56%
▷ Protected methods44.44%
▷ Private methods910.00%
Functions47
▷ Named functions3880.85%
▷ Anonymous functions919.15%
Constants47
▷ Global constants714.89%
▷ Class constants4085.11%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
signup_screenshot.png44.28KB12.75KB▼ 71.20%
screenshot.png74.17KB21.92KB▼ 70.45%
img/klaviyo-logo.png0.20KB0.16KB▼ 18.93%