83% ga-code-management

Code Review | Google Analytics Code Management

WordPress plugin Google Analytics Code Management scored83%from 54 tests.

About plugin

  • Plugin page: ga-code-management
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2017
  • Latest release: Apr 5, 2023
  • Number of updates: 31
  • Update frequency: every 66.2 days
  • Top authors: kinjaldalwadi (80.65%)viitorcloudvc (19.35%)kinjaldalwadivc (6.45%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,117 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.91ms] Passed 4 tests

Analyzing server-side resources used by Google Analytics Code Management
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.37 ▼2.20
Dashboard /wp-admin3.33 ▲0.0345.50 ▼2.59
Posts /wp-admin/edit.php3.38 ▲0.0246.00 ▼0.19
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.07 ▼10.66
Media Library /wp-admin/upload.php3.25 ▲0.0234.43 ▲0.03
Add Analytics Code /wp-admin/options-general.php?page=add_analytics_codes3.2231.23
Add Analytics Code Plugin Dashboard /wp-admin/index.php?page=add-analytics-code-abouts3.2236.48

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Google Analytics Code Management
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13813.97 ▼0.408.35 ▲6.3242.42 ▼5.73
Dashboard /wp-admin2,221 ▲364.84 ▼0.02104.68 ▲1.2839.76 ▼2.39
Posts /wp-admin/edit.php2,101 ▲122.00 ▲0.0236.58 ▼4.2133.01 ▼3.08
Add New Post /wp-admin/post-new.php1,524 ▼1817.69 ▼0.68678.65 ▲66.0048.84 ▼11.01
Media Library /wp-admin/upload.php1,400 ▲124.23 ▲0.0795.70 ▼8.4942.52 ▼1.02
Add Analytics Code /wp-admin/options-general.php?page=add_analytics_codes7992.0525.8530.33
Add Analytics Code Plugin Dashboard /wp-admin/index.php?page=add-analytics-code-abouts8762.1423.3339.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ga-code-management/admin/partials/analytics-code-management-admin-display.php
    • > /wp-content/plugins/ga-code-management/public/partials/analytics-code-management-public-display.php

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 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

ga-code-management/analytics-code-management.php 85% from 13 tests

This is the main PHP file of "Google Analytics Code Management" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ga-code-management.php" instead of "analytics-code-management.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected368 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13164573345
CSS22817
JavaScript24546

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.29
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/analytics.png7.02KB2.48KB▼ 64.72%
admin/images/analytics-2.png11.87KB4.39KB▼ 62.98%
admin/images/analytics-1.png5.85KB1.82KB▼ 68.89%
Analytics Code Management Screenshot.png12.94KB6.90KB▼ 46.72%