83% gtmpluswp

Code Review | GTM+ WordPress

WordPress plugin GTM+ WordPress scored83%from 54 tests.

About plugin

  • Plugin page: gtmpluswp
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-5.3
  • WordPress version: 6.3.1
  • First release: Jul 31, 2019
  • Latest release: Aug 1, 2019
  • Number of updates: 8
  • Update frequency: every 1.3 days
  • Top authors: mark-k (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /723 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.56MB] [CPU: ▼15.80ms] Passed 4 tests

An overview of server-side resources used by GTM+ WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.59 ▲4.92
Dashboard /wp-admin3.42 ▲0.1243.13 ▼8.46
Posts /wp-admin/edit.php3.53 ▲0.1846.43 ▲0.18
Add New Post /wp-admin/post-new.php3.29 ▼2.5935.64 ▼53.35
Media Library /wp-admin/upload.php3.34 ▲0.1132.30 ▼1.58
GTM /wp-admin/options-general.php?page=gtm4wordpress3.3131.39

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3,775 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for GTM+ WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.80 ▲0.421.80 ▲0.0243.56 ▲3.08
Dashboard /wp-admin2,210 ▲224.84 ▼0.03106.84 ▲0.6540.90 ▼3.70
Posts /wp-admin/edit.php2,090 ▲12.05 ▼0.0139.54 ▼1.6434.77 ▼2.18
Add New Post /wp-admin/post-new.php1,517 ▲323.44 ▲5.78691.32 ▼0.9462.68 ▲6.83
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.0497.68 ▼9.6245.35 ▲2.72
GTM /wp-admin/options-general.php?page=gtm4wordpress9182.0626.0428.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3560× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gtmpluswp/vendor/google/auth/tests/Credentials/UserRefreshCredentialsTest.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/ServiceBroker/GoogleIamV1Policy.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/ServiceUsage/Type.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/Testing/GoogleAuto.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/Manager/DiskAttachment.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/Analytics/Resource/Data.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/Manager/ReplicaPoolParams.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/AdExchangeBuyer/CreativeNativeAdImage.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/gtmpluswp/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/gtmpluswp/vendor/google/apiclient-services/src/Google/Service/Analytics/EntityUserLinkEntity.php:18

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 issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: wordpress, tag management, tag container, google tag manager, gtm

gtmpluswp/gtm4wordpress.php 62% from 13 tests

This is the main PHP file of "GTM+ WordPress" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "4.3.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gtmpluswp.php" instead of "gtm4wordpress.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 149 characters long)

Code Analysis 97% from 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 detected259,898 lines of code in 3,744 files:
LanguageFilesBlank linesComment linesLines of code
PHP3,68416,411118,210253,979
Markdown331,45004,585
JSON18001,164
YAML419097
XML47064
make1409

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.60
▷ Minimum class complexity1.00
▷ Maximum class complexity628.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces39
Interfaces28
Traits6
Classes3,675
▷ Abstract classes100.27%
▷ Concrete classes3,66599.73%
▷ Final classes100.27%
Methods25,796
▷ Static methods1490.58%
▷ Public methods25,32698.18%
▷ Protected methods2110.82%
▷ Private methods2591.00%
Functions292
▷ Named functions7826.71%
▷ Anonymous functions21473.29%
Constants830
▷ Global constants212.53%
▷ Class constants80997.47%
▷ Public constants809100.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
No PNG files were detected