84% sugoi-tag-inserter

Code Review | Sugoi Tag Inserter: GTM & gtag.js Made Easy

WordPress plugin Sugoi Tag Inserter: GTM & gtag.js Made Easy scored84%from 54 tests.

About plugin

  • Plugin page: sugoi-tag-inserter
  • Plugin version: 1.0.6
  • PHP compatiblity: 1.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.1
  • WordPress version: 6.3.1
  • First release: Mar 27, 2019
  • Latest release: Apr 11, 2019
  • Number of updates: 17
  • Update frequency: every 0.9 days
  • Top authors: akira71s (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /5,152 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Sugoi Tag Inserter: GTM & gtag.js Made Easy
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0727.24 ▼14.62
Dashboard /wp-admin3.34 ▲0.0452.15 ▲1.31
Posts /wp-admin/edit.php3.39 ▲0.0445.91 ▼6.04
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.86 ▼12.17
Media Library /wp-admin/upload.php3.26 ▲0.0449.81 ▲15.14
Sugoi Tag Inserter for Google Ads & Analytics /wp-admin/options-general.php?page=sugoi-tag-inserter3.3036.46

Server storage [IO: ▲0.17MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • Illegal file modification detected: 2 files (0.00KB) outside of "wp-content/plugins/sugoi-tag-inserter/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/sugoi-tag-inserter/_modules/icons/icon-256\303\227256.png"
    • (new file) "wp-content/plugins/sugoi-tag-inserter/_modules/icons/icon-128\303\227128.png"
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Sugoi Tag Inserter: GTM & gtag.js Made Easy: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.37 ▼0.191.74 ▲0.1631.65 ▼8.32
Dashboard /wp-admin2,208 ▲285.59 ▼0.0196.81 ▲4.9853.97 ▲8.26
Posts /wp-admin/edit.php2,110 ▲102.02 ▲0.0637.81 ▲1.2244.29 ▲9.01
Add New Post /wp-admin/post-new.php1,688 ▲15922.62 ▼0.49657.25 ▲15.9969.55 ▲13.65
Media Library /wp-admin/upload.php1,410 ▲74.16 ▼0.02103.27 ▼4.0953.85 ▲7.49
Sugoi Tag Inserter for Google Ads & Analytics /wp-admin/options-general.php?page=sugoi-tag-inserter1,0542.2128.6681.46

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 detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sugoi-tag-inserter/_modules/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sugoi-tag-inserter/sugotag.php:210

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: google analytics, google, google tag manager, google ads, gtm

sugoi-tag-inserter/sugotag.php 92% from 13 tests

The main PHP script in "Sugoi Tag Inserter: GTM & gtag.js Made Easy" version 1.0.6 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sugoi-tag-inserter.php" instead of "sugotag.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected528 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP33972260
JavaScript12211181
CSS212647
Markdown19040

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.50
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_modules/icons/icon-256×256.png17.04KB4.66KB▼ 72.62%
_modules/icons/icon-128×128.png1.98KB1.01KB▼ 49.02%
_modules/icons/icon_128.png1.98KB1.01KB▼ 49.02%