84% gtm-kit

Code Review | GTM Kit - Google Tag Manager integration

WordPress plugin GTM Kit - Google Tag Manager integration scored84%from 54 tests.

About plugin

  • Plugin page: gtm-kit
  • Plugin version: 1.16.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 6, 2022
  • Latest release: Nov 15, 2023
  • Number of updates: 52
  • Update frequency: every 8.4 days
  • Top authors: tlamedia (98.08%)torbenlundsgaard (3.85%)

Code review

54 tests

User reviews

7 reviews

Install metrics

10,000+ active /56,736 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▲1.94ms] Passed 4 tests

Analyzing server-side resources used by GTM Kit - Google Tag Manager integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3635.04 ▼1.13
Dashboard /wp-admin3.67 ▲0.3647.65 ▲1.50
Posts /wp-admin/edit.php3.72 ▲0.3650.13 ▲6.30
Add New Post /wp-admin/post-new.php6.19 ▲0.3094.44 ▲13.86
Media Library /wp-admin/upload.php3.53 ▲0.2934.87 ▲1.10
/wp-admin/options.php?page=gtmkit_setup_wizard3.5533.27
General /wp-admin/admin.php?page=gtmkit_general3.5134.10
Help /wp-admin/admin.php?page=gtmkit_help3.5135.01
Integrations /wp-admin/admin.php?page=gtmkit_integrations3.5136.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 92 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
gtmkit
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for GTM Kit - Google Tag Manager integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲10714.21 ▼0.031.90 ▲0.3539.01 ▼1.68
Dashboard /wp-admin2,242 ▲655.57 ▲0.0395.17 ▼3.2342.49 ▲0.07
Posts /wp-admin/edit.php2,144 ▲411.99 ▼0.0141.87 ▼0.1936.05 ▲0.53
Add New Post /wp-admin/post-new.php6,259 ▲4,73326.24 ▲2.90914.71 ▲249.7059.25 ▲8.97
Media Library /wp-admin/upload.php1,438 ▲414.20 ▼0.01101.87 ▲1.8344.47 ▲0.03
/wp-admin/options.php?page=gtmkit_setup_wizard1,0127.62179.3641.93
General /wp-admin/admin.php?page=gtmkit_general1,1097.7576.5545.53
Help /wp-admin/admin.php?page=gtmkit_help1,0387.5172.0740.35
Integrations /wp-admin/admin.php?page=gtmkit_integrations1,0257.5779.0740.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Integration\\AbstractIntegration' not found in wp-content/plugins/gtm-kit/src/Integration/AbstractEcommerce.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Admin\\AbstractOptionsPage' not found in wp-content/plugins/gtm-kit/src/Admin/IntegrationsOptionsPage.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Admin\\AbstractOptionsPage' not found in wp-content/plugins/gtm-kit/src/Admin/GeneralOptionsPage.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Admin\\AbstractOptionsPage' not found in wp-content/plugins/gtm-kit/src/Admin/HelpOptionsPage.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Integration\\AbstractEcommerce' not found in wp-content/plugins/gtm-kit/src/Integration/EasyDigitalDownloads.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Integration\\AbstractEcommerce' not found in wp-content/plugins/gtm-kit/src/Integration/WooCommerce.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'TLA_Media\\GTM_Kit\\Integration\\AbstractIntegration' not found in wp-content/plugins/gtm-kit/src/Integration/ContactForm7.php:17

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: woocommerce, gtag, ga4, analytics, google tag manager...

gtm-kit/gtm-kit.php Passed 13 tests

The principal PHP file in "GTM Kit - Google Tag Manager integration" v. 1.16.2 is loaded by WordPress automatically on each request
72 characters long description:
Google Tag Manager implementation focusing on flexibility and pagespeed.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin5,427 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
PHP399701,9303,467
Sass325001,092
JavaScript1714478813
XML1336843
JSON1005
SVG5005
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity18.54
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes26
▷ Abstract classes311.54%
▷ Concrete classes2388.46%
▷ Final classes1878.26%
Methods238
▷ Static methods4318.07%
▷ Public methods19381.09%
▷ Protected methods2510.50%
▷ Private methods208.40%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.72MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-2.png121.33KB81.79KB▼ 32.59%
src/images/banner-1544x500.png12.06KB6.15KB▼ 49.00%
assets/images/screenshot-1.png46.71KB29.24KB▼ 37.39%
assets/images/screenshot-3.png27.45KB17.85KB▼ 34.99%
src/images/banner-772x250.png2.24KB2.48KB0.00%