78% wp-global-site-tag

Code Review | WP Global Site Tag

WordPress plugin WP Global Site Tag scored78%from 54 tests.

About plugin

  • Plugin page: wp-global-site-tag
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Dec 15, 2017
  • Latest release: Jan 30, 2022
  • Number of updates: 31
  • Update frequency: every 48.6 days
  • Top authors: digitalapps (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10,000+ active /56,430 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.72ms] Passed 4 tests

This is a short check of server-side resources used by WP Global Site Tag
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0935.41 ▼5.31
Dashboard /wp-admin3.42 ▲0.1256.19 ▲0.32
Posts /wp-admin/edit.php3.54 ▲0.1854.94 ▲4.64
Add New Post /wp-admin/post-new.php6.00 ▲0.12101.80 ▲0.65
Media Library /wp-admin/upload.php3.35 ▲0.1237.18 ▲1.45
WP Global Site Tag /wp-admin/options-general.php?page=wp-global-site-tag-settings-page3.3337.59

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Global Site Tag
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.47 ▼0.809.13 ▲7.1743.24 ▼3.50
Dashboard /wp-admin2,206 ▲185.81 ▲0.89104.55 ▼9.7540.62 ▼4.72
Posts /wp-admin/edit.php2,095 ▲62.04 ▲0.0532.98 ▼2.0334.74 ▼1.11
Add New Post /wp-admin/post-new.php1,533 ▲2023.34 ▲5.71683.89 ▲35.1563.25 ▲6.68
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.02100.27 ▼7.5548.25 ▲1.73
WP Global Site Tag /wp-admin/options-general.php?page=wp-global-site-tag-settings-page9092.1424.9128.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-global-site-tag/public/partials/wp-global-site-tag-public-display.php
    • > /wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-section-advanced.php
    • > /wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-section-basic.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-page-sidebar.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-field-editor.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-field-text.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-global-site-tag/admin/partials/wp-global-site-tag-admin-page-settings.php:33

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #3 is required in wp-global-site-tag/assets to your readme.txt
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-global-site-tag === )
You can look at the official readme.txt

wp-global-site-tag/wp-global-site-tag.php Passed 13 tests

"WP Global Site Tag" version 1.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
102 characters long description:
WP Global Site Tag (gtag.js) plugin - Analytics replacement from Google. Supports multiple properties.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin584 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP17304740560
CSS23418
JavaScript24546

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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.24
Average class complexity7.12
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods3879.17%
▷ Protected methods00.00%
▷ Private methods1020.83%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/adunblocker-pro@2x.png40.87KB16.32KB▼ 60.08%
admin/img/adunblocker-pro.png34.64KB14.19KB▼ 59.05%