58% ga-backend-tracking

Code Review | Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin

WordPress plugin Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin scored 58% from 54 tests.

About plugin

  • Plugin page: ga-backend-tracking
  • Plugin version: 2.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Nov 18, 2018
  • Latest release: Jul 17, 2021
  • Number of updates: 53
  • Update frequency: every 18.4 days
  • Top authors: nikelschubert (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 1,614 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.38MB] [CPU: ▼133.03ms] Passed 4 tests

Analyzing server-side resources used by Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.07 ▲0.3540.21 ▲15.65
Dashboard /wp-admin3.50 ▲0.4458.06 ▲10.41
Posts /wp-admin/edit.php3.55 ▲0.4455.38 ▲7.55
Add New Post /wp-admin/post-new.php5.78 ▲0.35105.29 ▼560.71
Media Library /wp-admin/upload.php3.38 ▲0.3848.34 ▲10.64
GA Backend Tracking /wp-admin/options-general.php?page=nsc_gabt_settings3.3835.14

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲13616.43 ▲1.0510.51 ▼0.7151.08 ▲2.64
Dashboard /wp-admin2,975 ▲395.91 ▼0.03155.48 ▼12.55109.61 ▼7.51
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0065.48 ▼8.4693.51 ▲6.14
Add New Post /wp-admin/post-new.php1,686 ▲318.53 ▼0.06412.47 ▼11.14107.89 ▼2.39
Media Library /wp-admin/upload.php1,812 ▲55.03 ▲0.01163.56 ▼10.89118.13 ▼7.44
GA Backend Tracking /wp-admin/options-general.php?page=nsc_gabt_settings1,1222.3370.8681.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/ga-backend-tracking/uninstall.php+7
    Constant NSC_GABT_PLUGINPATH already defined
  • The plugin did not uninstall correctly, leaving 16 files (0.13MB) in the plugin directory
    • (new file) class/class_nsc_gabt_backend.php
    • (new file) class/class_nsc_gabt_collect_data.php
    • (new file) class/class_nsc_gabt_extension_blacklist.php
    • (new file) class/class-de-nikelschubert-nsc_gabt.php
    • (new file) class/class_nsc_gabt_collect_data_order.php
    • (new file) botregexp.txt
    • (new file) admin/js/admin.js
    • (new file) admin/tpl/admin.php
    • (new file) class/class_nsc_gabt_cid_manager.php
    • (new file) LICENCE
    • ...
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ga-backend-tracking/uninstall.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16
    • > PHP Notice
      Trying to get property 'tabs' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_gabt' not found in wp-content/plugins/ga-backend-tracking/class/class_nsc_gabt_backend.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_gabt' not found in wp-content/plugins/ga-backend-tracking/class/class_nsc_gabt_frontend.php:3
    • > PHP Notice
      Trying to get property 'active_tab_index' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

ga-backend-tracking/nsc_google_analytics_backend-tracking.php 92% from 13 tests

The main file in "Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin" v. 2.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ga-backend-tracking.php" instead of "nsc_google_analytics_backend-tracking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,871 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11233531,406
JSON100386
JavaScript111879

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity23.89
▷ Minimum class complexity11.00
▷ Maximum class complexity46.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods97
▷ Static methods00.00%
▷ Public methods6465.98%
▷ Protected methods44.12%
▷ Private methods2929.90%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin