84% google-tag-manager

Code Review | Google Tag Manager

WordPress plugin Google Tag Manager scored84%from 54 tests.

About plugin

  • Plugin page: google-tag-manager
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.4.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2012
  • Latest release: Apr 30, 2020
  • Number of updates: 9
  • Update frequency: every 307.2 days
  • Top authors: georgestephanis (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

20,000+ active /157,685 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.63ms] Passed 4 tests

A check of server-side resources used by Google Tag Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.24 ▼0.62
Dashboard /wp-admin3.33 ▲0.0346.48 ▼0.16
Posts /wp-admin/edit.php3.38 ▲0.0248.96 ▼0.70
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.83 ▼25.05
Media Library /wp-admin/upload.php3.25 ▲0.0237.54 ▲4.70

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Google Tag Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.321.59 ▼0.0442.14 ▲3.80
Dashboard /wp-admin2,203 ▲145.92 ▲0.9697.42 ▼23.3436.33 ▼7.99
Posts /wp-admin/edit.php2,092 ▲62.05 ▲0.0537.99 ▼1.0537.38 ▲4.05
Add New Post /wp-admin/post-new.php1,534 ▲2023.48 ▲5.85665.61 ▼43.5353.97 ▲3.03
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0495.53 ▼11.3642.37 ▼2.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/google-tag-manager/google-tag-manager.php:17

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

readme.txt Passed 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
6 plugin tags: genesis, theme hook alliance, analytics, tag manager, google...

google-tag-manager/google-tag-manager.php 92% from 13 tests

"Google Tag Manager" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 209 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin51 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151151

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected