72% cp-referrer-and-conversions-tracking

Code Review | CP Referrer and Conversion Tracking

WordPress plugin CP Referrer and Conversion Tracking scored 72% from 54 tests.

About plugin

  • Plugin page: cp-referrer-and-c...
  • Plugin version: 1.01.08
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Feb 26, 2020
  • Latest release: Jul 13, 2021
  • Number of updates: 10
  • Update frequency: every 50.2 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 1,293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.95MB] [CPU: ▼184.20ms] Passed 4 tests

A check of server-side resources used by CP Referrer and Conversion Tracking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.65 ▼0.1818.98 ▼27.11
Dashboard /wp-admin2.70 ▼0.3518.52 ▼36.26
Posts /wp-admin/edit.php2.70 ▼0.4019.76 ▼18.23
Add New Post /wp-admin/post-new.php2.70 ▼2.7319.74 ▼655.21
Media Library /wp-admin/upload.php2.70 ▼0.3018.66 ▼15.28
CP Referrer Tracking /wp-admin/admin.php?page=cp_reftrack2.8817.92
Tracking Logs /wp-admin/admin.php?page=cp_reftrack_list2.7017.49
Tracking Stats /wp-admin/admin.php?page=cp_reftrack_report2.7021.04
CP Referrer Tracking /wp-admin/options-general.php?page=cp_reftrack2.8816.93
I Need Help /wp-admin/admin.php?page=cp_reftrack_support2.7020.42
Referral Sources /wp-admin/admin.php?page=cp_reftrack_parameters2.7018.05
Conversions /wp-admin/admin.php?page=cp_reftrack_conversions2.7021.26
General Settings /wp-admin/admin.php?page=cp_reftrack_settings2.7019.27
Add Ons /wp-admin/admin.php?page=cp_reftrack_addons2.8821.49

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 48 new files
Database: 3 new tables, no new options
New tables
wp_cpreftrack_logs
wp_cpreftrack_conversions
wp_cpreftrack_registeredrefs

Browser metrics Passed 4 tests

An overview of browser requirements for CP Referrer and Conversion Tracking
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,748 ▲15215.92 ▲0.507.86 ▼3.4246.06 ▼13.31
Dashboard /wp-admin3,064 ▲1306.08 ▲0.14136.45 ▼13.85117.26 ▼1.97
Posts /wp-admin/edit.php2,808 ▲692.69 ▼0.0070.36 ▲3.7295.44 ▼4.09
Add New Post /wp-admin/post-new.php1,726 ▲4318.75 ▼0.02380.32 ▼4.03113.89 ▼0.19
Media Library /wp-admin/upload.php1,873 ▲665.03 ▼0.01151.24 ▲4.94123.82 ▲1.49
CP Referrer Tracking /wp-admin/admin.php?page=cp_reftrack1,2362.3765.0270.52
Tracking Logs /wp-admin/admin.php?page=cp_reftrack_list1,3012.3758.7688.88
Tracking Stats /wp-admin/admin.php?page=cp_reftrack_report1,7602.5164.37121.57
CP Referrer Tracking /wp-admin/options-general.php?page=cp_reftrack1,2362.3658.5970.46
I Need Help /wp-admin/admin.php?page=cp_reftrack_support1,6633.4096.4388.15
Referral Sources /wp-admin/admin.php?page=cp_reftrack_parameters1,3402.3857.06100.27
Conversions /wp-admin/admin.php?page=cp_reftrack_conversions1,2942.3964.3483.33
General Settings /wp-admin/admin.php?page=cp_reftrack_settings1,1802.3759.7182.02
Add Ons /wp-admin/admin.php?page=cp_reftrack_addons1,2972.3664.96108.53

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
The following items require your attention
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_cpreftrack_logs
    • wp_cpreftrack_conversions
    • wp_cpreftrack_registeredrefs

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_addons
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-main-class.inc.php+155
    Undefined index: HTTP_REFERER
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cp_reftrack
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-list.inc.php+100
    Undefined variable: item
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cp_reftrack
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-list.inc.php+100
    Trying to get property 'id' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_conversions
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-conversions-list.inc.php+4
    Undefined index: cal
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_conversions
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-conversions-list.inc.php+9
    Undefined index: p
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_conversions
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-conversions-list.inc.php+128
    Undefined index: dfrom
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_conversions
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-conversions-list.inc.php+128
    Undefined index: dto
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_report
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-report.inc.php+34
    Undefined index: search
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_report
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-full-stats.inc.php+69
    Undefined variable: str
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_settings
    • > Notice in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-settings.inc.php+57
    Undefined variable: message

SRP 50% 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
Almost there! Just fix the following items
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-conversions-list.inc.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-report.inc.php:6
    • > PHP Notice
      Undefined index: cal in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-full-stats.inc.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-referrer-tracking-plugin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cp-referrer-and-conversions-tracking/addons/cfte.addon.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cp-referrer-and-conversions-tracking/addons/woocommerce.addon.php:30
    • > PHP Notice
      Undefined index: cal in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-admin-int-message-list.inc.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cp-referrer-and-conversions-tracking/cp-addons.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cp-referrer-and-conversions-tracking/addons/wptsbk.addon.php:30

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_reftrack_report
    • > Network (severe)
    wp-content/plugins/cp-referrer-and-conversions-tracking/js/excanvas.min.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: referer, logs, marketing, referrer, conversion...

cp-referrer-and-conversions-tracking/cp-referrer-tracking-plugin.php 92% from 13 tests

The main file in "CP Referrer and Conversion Tracking" v. 1.01.08 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cp-referrer-and-conversions-tracking.php" instead of "cp-referrer-tracking-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin3,729 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP238432112,647
CSS5731651,082
JavaScript1010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.85
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods89
▷ Static methods00.00%
▷ Public methods8898.88%
▷ Protected methods00.00%
▷ Private methods11.12%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/cupertino/images/ui-icons_2694e8_256x240.png4.27KB4.11KB▼ 3.78%
css/cupertino/images/ui-icons_3d80b3_256x240.png5.23KB4.11KB▼ 21.49%
css/cupertino/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png0.18KB0.08KB▼ 51.93%
css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png0.12KB0.18KB0.00%