83% gtm-code-visibility

Code Review | GTM Code Visibility

WordPress plugin GTM Code Visibility scored83%from 54 tests.

About plugin

  • Plugin page: gtm-code-visibility
  • Plugin version: 0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Mar 20, 2019
  • Latest release: Mar 10, 2021
  • Number of updates: 5
  • Update frequency: every 144.6 days
  • Top authors: Off Site Services (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /782 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.26ms] Passed 4 tests

A check of server-side resources used by GTM Code Visibility
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.30 ▼5.05
Dashboard /wp-admin3.32 ▼0.0247.20 ▼13.71
Posts /wp-admin/edit.php3.38 ▲0.0248.07 ▲1.49
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.78 ▼15.77
Media Library /wp-admin/upload.php3.25 ▲0.0234.13 ▲2.26

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

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

Browser metrics Passed 4 tests

Checking browser requirements for GTM Code Visibility
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3113.28 ▼1.101.56 ▼0.4837.78 ▼9.73
Dashboard /wp-admin2,208 ▲205.85 ▲0.74111.54 ▼5.6340.11 ▼3.54
Posts /wp-admin/edit.php2,091 ▲22.02 ▲0.0339.89 ▲3.0834.24 ▼2.42
Add New Post /wp-admin/post-new.php1,586 ▲7222.52 ▲5.04632.02 ▼63.1238.77 ▼17.11
Media Library /wp-admin/upload.php1,390 ▲54.21 ▲0.0299.27 ▼3.7144.19 ▲1.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/gtm-code-visibility/gtm_add.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Simply paste Google Tag Manager code into GTM code fields)
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
You can take inspiration from this readme.txt

gtm-code-visibility/gtm_add.php 92% from 13 tests

The main PHP script in "GTM Code Visibility" version 0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("gtm-code-visibility.php" instead of "gtm_add.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin77 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2152248
JavaScript18329

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods00.00%
▷ Private methods233.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png51.13KB27.08KB▼ 47.04%