84% google-site-kit

Code Review | Site Kit by Google - Analytics, Search Console, AdSense, Speed

WordPress plugin Site Kit by Google - Analytics, Search Console, AdSense, Speed scored84%from 54 tests.

About plugin

  • Plugin page: google-site-kit
  • Plugin version: 1.114.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Oct 31, 2019
  • Latest release: Nov 21, 2023
  • Number of updates: 202
  • Update frequency: every 8.0 days
  • Top authors: flixos90 (81.19%)aaemnnosttv (19.31%)

Code review

54 tests

User reviews

767 reviews

Install metrics

3,000,000+ active /94,479,461 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: ▲4.77MB] [CPU: ▲28.40ms] Passed 4 tests

Server-side resources used by Site Kit by Google - Analytics, Search Console, AdSense, Speed
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.12 ▲4.6668.92 ▲26.58
Dashboard /wp-admin8.14 ▲4.8478.84 ▲28.27
Posts /wp-admin/edit.php8.18 ▲4.8394.01 ▲42.10
Add New Post /wp-admin/post-new.php10.78 ▲4.89119.51 ▲23.88
Media Library /wp-admin/upload.php7.99 ▲4.7669.63 ▲34.87
Dashboard /wp-admin/admin.php?page=googlesitekit-splash9.5198.02

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,287 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
googlesitekit_db_version
widget_recent-comments
can_compress_scripts
googlesitekit_has_connected_admins

Browser metrics Passed 4 tests

Site Kit by Google - Analytics, Search Console, AdSense, Speed: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.26 ▲0.011.66 ▲0.0336.91 ▼8.43
Dashboard /wp-admin2,223 ▲465.66 ▲0.0396.93 ▲1.0941.72 ▼0.81
Posts /wp-admin/edit.php2,131 ▲312.00 ▲0.0541.20 ▲0.7335.38 ▼2.25
Add New Post /wp-admin/post-new.php1,545 ▲1922.60 ▼1.05637.14 ▲18.3357.87 ▲5.19
Media Library /wp-admin/upload.php1,435 ▲384.32 ▲0.1299.13 ▲1.7542.52 ▲0.41
Dashboard /wp-admin/admin.php?page=googlesitekit-splash9969.37305.36104.52

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: 8 options
    • googlesitekit_has_connected_admins
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • googlesitekit_db_version
    • can_compress_scripts
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 990× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Model' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/Analytics/FilterRef.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/google-site-kit/third-party/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Collection' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/SearchConsole/WmxSitemap.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Service' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/TagManager.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Site_Kit\\Modules\\Analytics_4\\Report\\Dimension_Filter\\Filter' not found in wp-content/plugins/google-site-kit/includes/Modules/Analytics_4/Report/Dimension_Filter/In_List_Filter.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Site_Kit\\Core\\Storage\\Options_Interface' not found in wp-content/plugins/google-site-kit/includes/Core/Storage/Encrypted_Options.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit\\Core\\Modules\\Module' not found in wp-content/plugins/google-site-kit/includes/Modules/Site_Verification.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Collection' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1betaListAccountSummariesResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Collection' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/Analytics/Segments.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Google\\Model' not found in wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1betaMeasurementProtocolSecret.php:20

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: adsense, tag-manager, search-console, pagespeed-insights, google...

google-site-kit/google-site-kit.php Passed 13 tests

The entry point to "Site Kit by Google - Analytics, Search Console, AdSense, Speed" version 1.114.0 is a PHP file that has certain tags in its header comment area
125 characters long description:
Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin70,947 lines of code in 1,285 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,2436,43468,38970,316
JavaScript370420612
Dockerfile18010
JSON1006
CSS3003

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.24
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces102
Interfaces59
Traits24
Classes1,149
▷ Abstract classes211.83%
▷ Concrete classes1,12898.17%
▷ Final classes827.27%
Methods8,323
▷ Static methods3093.71%
▷ Public methods7,39288.81%
▷ Protected methods4175.01%
▷ Private methods5146.18%
Functions524
▷ Named functions7714.69%
▷ Anonymous functions44785.31%
Constants476
▷ Global constants5210.92%
▷ Class constants42489.08%
▷ Public constants424100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin