84% multi-google-analytics

Code Review | Multiple Google Analytics Trackers

WordPress plugin Multiple Google Analytics Trackers scored84%from 54 tests.

About plugin

  • Plugin page: multi-google-anal...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2016
  • Latest release: Sep 11, 2017
  • Number of updates: 37
  • Update frequency: every 8.5 days
  • Top authors: Ahrengot (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /3,573 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.49ms] Passed 4 tests

This is a short check of server-side resources used by Multiple Google Analytics Trackers
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.21 ▼3.63
Dashboard /wp-admin3.35 ▲0.0450.40 ▼5.79
Posts /wp-admin/edit.php3.40 ▲0.0450.10 ▲2.78
Add New Post /wp-admin/post-new.php5.95 ▲0.0687.56 ▼3.32
Media Library /wp-admin/upload.php3.27 ▲0.0440.32 ▲3.42
Google Analytics /wp-admin/options-general.php?page=google-analytics3.2430.19

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
ahr_ga_ids
ahr_ga_location
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Multiple Google Analytics Trackers
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.491.68 ▼0.2944.83 ▼0.12
Dashboard /wp-admin2,202 ▲255.64 ▲0.0784.79 ▼8.6942.23 ▲1.65
Posts /wp-admin/edit.php2,107 ▲71.95 ▼0.0437.99 ▲1.6834.25 ▼1.75
Add New Post /wp-admin/post-new.php1,540 ▲1418.28 ▼4.88657.75 ▼25.0165.67 ▲11.81
Media Library /wp-admin/upload.php1,404 ▲44.16 ▼0.0196.61 ▼21.5740.31 ▼7.84
Google Analytics /wp-admin/options-general.php?page=google-analytics9062.0940.2934.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • ahr_ga_ids
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • ahr_ga_location

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/multi-google-analytics/frontend/ga-script.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/multi-google-analytics/admin/activation-notice.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/multi-google-analytics/admin/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/multi-google-analytics/google-analytics.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: tracking, analytics, google analytics, stats, google...

multi-google-analytics/google-analytics.php 92% from 13 tests

Analyzing the main PHP file in "Multiple Google Analytics Trackers" version 1.1.2
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("multi-google-analytics.php" instead of "google-analytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin630 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript14249283
PHP53515194
PO File1185072
CSS211056
JSON10025

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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 files were detected