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 scored 84% from 54 tests.

About plugin

  • Plugin page: google-site-kit
  • Plugin version: 1.70.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 5.9.2
  • First release: Oct 31, 2019
  • Latest release: Mar 14, 2022
  • Number of updates: 153
  • Update frequency: every 6.7 days
  • Top authors: flixos90 (100%)

Code review

54 tests

User reviews

482 reviews

Install metrics

2,000,000+ active / 33,862,390 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.23MB] [CPU: ▼278.24ms] Passed 4 tests

An overview of 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 /7.72 ▲4.2179.34 ▲29.69
Dashboard /wp-admin7.61 ▲4.2060.27 ▲26.52
Posts /wp-admin/edit.php7.90 ▲4.2662.42 ▲24.42
Add New Post /wp-admin/post-new.php11.23 ▲4.26121.30 ▼1,187.49
Media Library /wp-admin/upload.php7.56 ▲4.2647.10 ▲23.61
Dashboard /wp-admin/admin.php?page=googlesitekit-splash8.7959.90

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 1,153 new files
Database: no new tables, 2 new options
New WordPress options
googlesitekit_db_version
googlesitekit_has_connected_admins

Browser metrics Passed 4 tests

An overview of browser requirements for Site Kit by Google - Analytics, Search Console, AdSense, Speed
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,809 ▲5516.23 ▲0.195.54 ▼0.562.41 ▼0.13
Dashboard /wp-admin2,934 ▲766.18 ▲0.12118.80 ▼22.02157.69 ▼4.09
Posts /wp-admin/edit.php2,731 ▲433.25 ▲0.0269.01 ▲4.42146.27 ▲6.05
Add New Post /wp-admin/post-new.php1,724 ▲6322.47 ▲6.87410.60 ▲31.91169.80 ▲18.02
Media Library /wp-admin/upload.php1,743 ▲455.57 ▲0.01143.82 ▼1.57189.98 ▲1.85
Dashboard /wp-admin/admin.php?page=googlesitekit-splash1,22011.97250.08167.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • googlesitekit_has_connected_admins
    • googlesitekit_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 878× GET requests to PHP files have triggered server-side errors or warnings (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/PagespeedInsights/Categories.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/PeopleService/UpdateContactPhotoRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/google-site-kit/third-party/monolog/monolog/src/Monolog/Handler/LogglyHandler.php:22
    • > 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/TagManager/ListAccountsResponse.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/AnalyticsReporting/SegmentDefinition.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/Adsense/AdClient.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/google-site-kit/third-party/guzzlehttp/guzzle/src/Exception/ConnectException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Site_Kit_Dependencies\\Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/google-site-kit/third-party/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Site_Kit_Dependencies\\GuzzleHttp\\Event\\SubscriberInterface' not found in wp-content/plugins/google-site-kit/third-party/google/auth/src/Subscriber/AuthTokenSubscriber.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Site_Kit_Dependencies\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/google-site-kit/third-party/monolog/monolog/src/Monolog/Handler/SamplingHandler.php:28

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: pagespeed-insights, search-console, optimize, tag-manager, google...

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

"Site Kit by Google - Analytics, Search Console, AdSense, Speed" version 1.70.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin64,267 lines of code in 1,150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,1005,50860,21263,092
JavaScript370405636
reStructuredText9263333517
Python14019
CSS3003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.41
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces100
Interfaces69
Traits28
Classes1,008
▷ Abstract classes262.58%
▷ Concrete classes98297.42%
▷ Final classes686.92%
Methods7,556
▷ Static methods2913.85%
▷ Public methods6,68188.42%
▷ Protected methods3915.17%
▷ Private methods4846.41%
Functions435
▷ Named functions388.74%
▷ Anonymous functions39791.26%
Constants336
▷ Global constants92.68%
▷ Class constants32797.32%
▷ Public constants327100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin