84% scand-easy-ga-toolkit

Code Review | Easy Google Analytics Toolkit

WordPress plugin Easy Google Analytics Toolkit scored84%from 54 tests.

About plugin

  • Plugin page: scand-easy-ga-too...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2018
  • Latest release: Apr 13, 2023
  • Number of updates: 21
  • Update frequency: every 89.4 days
  • Top authors: scandltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,576 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.19MB] [CPU: ▼20.84ms] Passed 4 tests

Analyzing server-side resources used by Easy Google Analytics Toolkit
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.27 ▲5.85
Dashboard /wp-admin3.12 ▼0.2330.68 ▼31.76
Posts /wp-admin/edit.php3.26 ▼0.1130.30 ▼17.24
Add New Post /wp-admin/post-new.php5.50 ▼0.3971.22 ▼29.24
Media Library /wp-admin/upload.php3.20 ▼0.0327.30 ▼5.13

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Google Analytics Toolkit
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲3113.32 ▼0.9722.24 ▲20.3843.01 ▲4.70
Dashboard /wp-admin2,221 ▲465.75 ▲0.0398.98 ▼0.7442.48 ▲2.55
Posts /wp-admin/edit.php2,129 ▲292.24 ▲0.2435.79 ▲1.5035.61 ▼2.01
Add New Post /wp-admin/post-new.php1,546 ▲1822.77 ▼0.48577.92 ▼80.1952.31 ▼0.71
Media Library /wp-admin/upload.php1,425 ▲314.18 ▼0.0297.91 ▼2.3441.73 ▼4.70

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_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: event in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Scand_Easy_GA_Toolkit_Validator' not found in wp-content/plugins/scand-easy-ga-toolkit/includes/class-scand-easy-ga-toolkit-event-validator.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Scand_Easy_GA_Toolkit_Gtag' not found in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php:11
    • > PHP Notice
      Undefined variable: event in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php on line 8
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php on line 8
    • > PHP Notice
      Undefined variable: event in wp-content/plugins/scand-easy-ga-toolkit/includes/views/_custom_event_preview.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Scand_Easy_GA_Toolkit_Validator_Interface' not found in wp-content/plugins/scand-easy-ga-toolkit/includes/class-scand-easy-ga-toolkit-validator.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/scand-easy-ga-toolkit/includes/views/main.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Scand_Easy_GA_Toolkit_Base' not found in wp-content/plugins/scand-easy-ga-toolkit/includes/class-scand-easy-ga-toolkit-gtag.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt is a good inspiration

scand-easy-ga-toolkit/scand-easy-ga-toolkit.php Passed 13 tests

The entry point to "Easy Google Analytics Toolkit" version 1.0.6 is a PHP file that has certain tags in its header comment area
116 characters long description:
Scand Easy Google Analytics Toolkit makes it super easy to integrate Google Analytics tracking code in your web-site

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 plugin2,414 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP141802531,564
JavaScript1360425
CSS1580246
PO File18199179

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.90
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.01
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes9
▷ Abstract classes222.22%
▷ Concrete classes777.78%
▷ Final classes00.00%
Methods96
▷ Static methods88.33%
▷ Public methods7780.21%
▷ Protected methods1919.79%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants1055.56%
▷ Class constants844.44%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin