83% really-simple-google-tag-manager

Code Review | Really Simple Google Tag Manager

WordPress plugin Really Simple Google Tag Manager scored83%from 54 tests.

About plugin

  • Plugin page: really-simple-goo...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 15, 2020
  • Latest release: Aug 8, 2023
  • Number of updates: 16
  • Update frequency: every 60.4 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /9,768 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.18MB] [CPU: ▼2.36ms] 75% from 4 tests

A check of server-side resources used by Really Simple Google Tag Manager
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,345.96ms on /wp-admin/admin.php?page=simple-tag-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1743.03 ▼2.27
Dashboard /wp-admin3.48 ▲0.1850.43 ▼1.57
Posts /wp-admin/edit.php3.60 ▲0.2455.65 ▲5.80
Add New Post /wp-admin/post-new.php6.07 ▲0.1888.03 ▼11.41
Media Library /wp-admin/upload.php3.41 ▲0.1847.28 ▲12.22
Recommendations /wp-admin/admin.php?page=simple-tag-recommendations7.691,345.96
Google Tag Manager /wp-admin/admin.php?page=simple-googletag-setting-page3.3834.73

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Really Simple Google Tag Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.24 ▼0.321.74 ▼0.0744.15 ▼1.69
Dashboard /wp-admin2,208 ▲315.51 ▼0.1189.94 ▼13.2760.74 ▲17.61
Posts /wp-admin/edit.php2,136 ▲362.01 ▲0.0139.10 ▼4.0134.41 ▼0.21
Add New Post /wp-admin/post-new.php1,700 ▲17222.25 ▼0.50739.36 ▲86.6672.85 ▲17.98
Media Library /wp-admin/upload.php1,424 ▲244.25 ▲0.08113.93 ▲12.5980.92 ▲34.07
Recommendations /wp-admin/admin.php?page=simple-tag-recommendations2,9282.2234.4673.02
Google Tag Manager /wp-admin/admin.php?page=simple-googletag-setting-page8572.0524.8126.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/really-simple-google-tag-manager/includes/class.simple-googletag.php:29
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/really-simple-google-tag-manager/includes/class.simple-googletag.php on line 28
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/really-simple-google-tag-manager/includes/class.simple-googletag.php on line 28
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/really-simple-google-tag-manager/includes/class.simple-googletag.php on line 28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: google tag manager, googletag, google, tagmanager, really simple google tag manager

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

The main file in "Really Simple Google Tag Manager" v. 1.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin853 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4130104714
JavaScript12825105
YAML22034

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.33
▷ Minimum class complexity4.00
▷ Maximum class complexity46.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
21 PNG files occupy 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/icon-256x256.png2.18KB1.47KB▼ 32.59%
admin/assets/images/extensions/swatchly-pro.png13.99KB5.41KB▼ 61.37%
(invalid) admin/assets/images/extensions/was-this-helpful.png1.21KB0.00KB▼ 100.00%
(invalid) admin/assets/images/extensions/docus-pro.png3.98KB0.00KB▼ 100.00%
.wordpress-org/banner-772x250.png10.57KB5.06KB▼ 52.11%