84% gtm-cookie-consent

Code Review | GTM Cookie Consent

WordPress plugin GTM Cookie Consent scored 84% from 54 tests.

About plugin

  • Plugin page: gtm-cookie-consent
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 17, 2018
  • Latest release: Nov 28, 2018
  • Number of updates: 10
  • Update frequency: every 1.1 days
  • Top authors: nftycreative (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 741 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.62ms] Passed 4 tests

An overview of server-side resources used by GTM Cookie Consent
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0455.96 ▼3.57
Dashboard /wp-admin3.32 ▲0.0254.86 ▼4.34
Posts /wp-admin/edit.php3.44 ▲0.0851.23 ▼3.81
Add New Post /wp-admin/post-new.php5.92 ▲0.04100.17 ▲10.26
Media Library /wp-admin/upload.php3.25 ▲0.0244.23 ▲5.25
GTM Cookie Consent /wp-admin/options-general.php?page=cookie-consent-gtm3.2238.95

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for GTM Cookie Consent
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲9913.51 ▲0.363.19 ▲0.6744.42 ▼3.16
Dashboard /wp-admin2,229 ▲235.08 ▼0.80111.05 ▲1.0240.48 ▲0.71
Posts /wp-admin/edit.php2,114 ▲252.32 ▲0.2742.89 ▲7.8235.08 ▲1.48
Add New Post /wp-admin/post-new.php1,532 ▼1023.52 ▲0.23756.26 ▲56.8839.94 ▼19.31
Media Library /wp-admin/upload.php1,414 ▲324.55 ▲0.30109.36 ▼3.4248.97 ▲3.64
GTM Cookie Consent /wp-admin/options-general.php?page=cookie-consent-gtm1,2522.3953.7730.37

Uninstaller [IO: ✅] [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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Almost there! Just fix the following items
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gtm-cookie-consent/inc/gtm.php
    • > /wp-content/plugins/gtm-cookie-consent/inc/settings.php
    • > /wp-content/plugins/gtm-cookie-consent/inc/scripts.php
    • > /wp-content/plugins/gtm-cookie-consent/gtm-cookie-consent.php
    • > /wp-content/plugins/gtm-cookie-consent/inc/styles.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: cookies, cookie-law, gtm, gdpr, cookie-consent

gtm-cookie-consent/gtm-cookie-consent.php Passed 13 tests

"GTM Cookie Consent" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
104 characters long description:
Simple GDPR-compliant cookie consent for Google Tag Manager, built on Cookie Consent JS by insights.com.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin285 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP57481278
JavaScript2006
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.20
▷ Minimum class complexity2.00
▷ Maximum class complexity12.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods15
▷ Static methods1066.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin