10% tag-manager-web-analytics-for-amp

Code Review | Google Tag Manager & Google Analytics for AMP

WordPress plugin Google Tag Manager & Google Analytics for AMP scored10%from 54 tests.

About plugin

  • Plugin page: tag-manager-web-a...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 1, 2017
  • Latest release: Mar 1, 2017
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: MartijnScheijbeler (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,061 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/tag-manager-web-analytics-for-amp/admin/misc.php+11
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.22ms] Passed 4 tests

Analyzing server-side resources used by Google Tag Manager & Google Analytics for AMP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.436.20 ▼35.31
Dashboard /wp-admin2.05 ▼1.268.38 ▼41.80
Posts /wp-admin/edit.php2.05 ▼1.317.34 ▼47.93
Add New Post /wp-admin/post-new.php2.05 ▼3.847.46 ▼95.85
Media Library /wp-admin/upload.php2.05 ▼1.186.64 ▼30.68
Dashboard /wp-admin/admin.php?page=gtm-ga-amp2.057.29
Google Analytics /wp-admin/admin.php?page=google-analytics2.056.83
Google Tag Manager /wp-admin/admin.php?page=google-tag-manager2.058.68

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Google Tag Manager & Google Analytics for AMP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.25 ▼1.121.98 ▲0.3343.13 ▲1.89
Dashboard /wp-admin2,237 ▲495.79 ▼0.0396.35 ▼4.2640.95 ▼2.74
Posts /wp-admin/edit.php2,120 ▲311.99 ▼0.0638.55 ▼2.3431.91 ▼3.51
Add New Post /wp-admin/post-new.php1,558 ▲4423.40 ▲5.88584.47 ▼97.7459.16 ▲5.34
Media Library /wp-admin/upload.php1,422 ▲314.24 ▲0.0396.88 ▲1.5943.20 ▼2.43
Dashboard /wp-admin/admin.php?page=gtm-ga-amp8942.1822.9027.60
Google Analytics /wp-admin/admin.php?page=google-analytics9862.1522.7130.13
Google Tag Manager /wp-admin/admin.php?page=google-tag-manager8322.0623.5628.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/tag-manager-web-analytics-for-amp/admin/misc.php+11
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=google-tag-manager
    • > Notice in wp-content/plugins/tag-manager-web-analytics-for-amp/admin/gtm.php+25
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=google-analytics
    • > Warning in wp-admin/includes/template.php+1771
    call_user_func() expects parameter 1 to be a valid callback, function 'gtm_ga_amp_ga_section_cd_cb' not found or invalid function name

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
Almost there! Just fix the following items
  • 5× 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/tag-manager-web-analytics-for-amp/admin/ga.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tag-manager-web-analytics-for-amp/admin/gtm.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tag-manager-web-analytics-for-amp/public/ga.php:170
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tag-manager-web-analytics-for-amp/public/gtm.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/tag-manager-web-analytics-for-amp/admin/misc.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

tag-manager-web-analytics-for-amp/gtm-ga-wordpress-amp.php 92% from 13 tests

The primary PHP file in "Google Tag Manager & Google Analytics for AMP" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tag-manager-web-analytics-for-amp.php" instead of "gtm-ga-wordpress-amp.php")

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
Success! There were no dangerous files found in this plugin472 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP974143472

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected