62% mixpanel-integration

Code Review | MixPanel

WordPress plugin MixPanel scored62%from 54 tests.

About plugin

  • Plugin page: mixpanel-integration
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2014
  • Latest release: Mar 27, 2015
  • Number of updates: 11
  • Update frequency: every 12.5 days
  • Top authors: jittarao (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /9,016 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.89MB] [CPU: ▼31.82ms] Passed 4 tests

An overview of server-side resources used by MixPanel
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0525.97 ▼15.11
Dashboard /wp-admin3.05 ▼0.2525.94 ▼24.83
Posts /wp-admin/edit.php3.05 ▼0.3024.82 ▼21.85
Add New Post /wp-admin/post-new.php3.05 ▼2.8323.76 ▼65.50
Media Library /wp-admin/upload.php3.05 ▼0.1821.83 ▼14.12
Mixpanel Options /wp-admin/options-general.php?page=mixpanel-admin3.0524.71

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

MixPanel: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.23 ▼1.151.60 ▼0.1538.23 ▼14.29
Dashboard /wp-admin2,207 ▲165.80 ▲0.90103.90 ▼15.7341.62 ▼5.38
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0140.10 ▲1.5834.69 ▲1.00
Add New Post /wp-admin/post-new.php6,305 ▲4,77119.37 ▼4.12903.36 ▲213.1660.72 ▲2.98
Media Library /wp-admin/upload.php1,395 ▲74.13 ▼0.0498.65 ▼14.6542.84 ▼2.30
Mixpanel Options /wp-admin/options-general.php?page=mixpanel-admin7972.0323.8127.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/mixpanel-integration/mixpanel.php+86
    Undefined index: token_id
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=mixpanel-admin
    • > Notice in wp-content/plugins/mixpanel-integration/mixpanel.php+86
    Undefined index: token_id
    • > GET request to /wp-admin/options-general.php?page=mixpanel-admin
    • > Notice in wp-content/plugins/mixpanel-integration/mixpanel.php+97
    Undefined index: debug_mode
    • > GET request to /wp-admin/options-general.php?page=mixpanel-admin
    • > Notice in wp-content/plugins/mixpanel-integration/mixpanel.php+108
    Undefined index: subdomain_cookie
    • > GET request to /wp-admin/options-general.php?page=mixpanel-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=mixpanel-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mixpanel-integration/mixpaneljs.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 4
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mixpanel-integration/page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function jittarao\\is_admin() in wp-content/plugins/mixpanel-integration/mixpanel.php:21
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 10
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/mixpanel-integration/mixpaneljs.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mixpanel-integration/meta-box.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: funnels, kissmetrics, analytics, mixpanel, metrics

mixpanel-integration/mixpanel.php 92% from 13 tests

The main PHP script in "MixPanel" version 1.5.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mixpanel-integration.php" instead of "mixpanel.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected192 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP42629181
Markdown16011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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