83% wk-google-analytics

Code Review | Google Analytics and Google Tag Manager

WordPress plugin Google Analytics and Google Tag Manager scored83%from 54 tests.

About plugin

  • Plugin page: wk-google-analytics
  • Plugin version: 1.11.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jul 25, 2016
  • Latest release: Aug 9, 2023
  • Number of updates: 119
  • Update frequency: every 21.6 days
  • Top authors: webkinder (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

20,000+ active /366,702 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼7.23ms] Passed 4 tests

This is a short check of server-side resources used by Google Analytics and Google Tag Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2044.83 ▲3.05
Dashboard /wp-admin3.50 ▲0.1554.29 ▼9.94
Posts /wp-admin/edit.php3.61 ▲0.2551.60 ▲1.49
Add New Post /wp-admin/post-new.php6.10 ▲0.2191.09 ▼19.55
Media Library /wp-admin/upload.php3.42 ▲0.1936.67 ▼0.90
Google Analytics /wp-admin/options-general.php?page=google_analytics3.3938.62

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 128 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Google Analytics and Google Tag Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.88 ▲0.6710.12 ▲8.3043.57 ▲3.10
Dashboard /wp-admin2,196 ▲165.48 ▼0.1890.36 ▼5.2838.02 ▼7.35
Posts /wp-admin/edit.php2,101 ▲12.00 ▲0.0640.05 ▼0.7636.39 ▼2.57
Add New Post /wp-admin/post-new.php1,536 ▲123.11 ▲4.88677.37 ▲49.8158.96 ▼22.07
Media Library /wp-admin/upload.php1,401 ▲14.19 ▲0.01104.80 ▲8.7346.76 ▲1.96
Google Analytics /wp-admin/options-general.php?page=google_analytics9102.0632.2627.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 96× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wk-google-analytics/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

wk-google-analytics/wk-ga.php 77% from 13 tests

The principal PHP file in "Google Analytics and Google Tag Manager" v. 1.11.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 187 characters long)
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wk-google-analytics.php" instead of "wk-ga.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin4,120 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
PHP1136521,0823,131
PO File396104598
JavaScript23518204
JSON100153
CSS113634

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity3.09
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes103
▷ Abstract classes10.97%
▷ Concrete classes10299.03%
▷ Final classes10.98%
Methods157
▷ Static methods2012.74%
▷ Public methods11170.70%
▷ Protected methods3824.20%
▷ Private methods85.10%
Functions10
▷ Named functions220.00%
▷ Anonymous functions880.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.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