84% host-analyticsjs-local

Code Review | CAOS | Host Google Analytics Locally

WordPress plugin CAOS | Host Google Analytics Locally scored84%from 54 tests.

About plugin

  • Plugin page: host-analyticsjs-...
  • Plugin version: 4.7.12
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: May 6, 2016
  • Latest release: Nov 8, 2023
  • Number of updates: 523
  • Update frequency: every 5.2 days
  • Top authors: DaanvandenBergh (100%)

Code review

54 tests

User reviews

126 reviews

Install metrics

20,000+ active /1,537,457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.06ms] Passed 4 tests

A check of server-side resources used by CAOS | Host Google Analytics Locally
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.47 ▼3.71
Dashboard /wp-admin3.40 ▲0.1047.20 ▼2.16
Posts /wp-admin/edit.php3.52 ▲0.1648.99 ▼4.07
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.81 ▼6.31
Media Library /wp-admin/upload.php3.33 ▲0.1035.74 ▲1.93
Optimize Google Analytics /wp-admin/options-general.php?page=host_analyticsjs_local3.3132.97

Server storage [IO: ▲0.18MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
caos_settings
caos_db_version
theysaidso_admin_options
can_compress_scripts
caos_cron_file_aliases

Browser metrics Passed 4 tests

This is an overview of browser requirements for CAOS | Host Google Analytics Locally
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8414.22 ▼0.131.80 ▲0.0538.85 ▼4.92
Dashboard /wp-admin2,196 ▲195.61 ▼0.0691.07 ▼9.3944.48 ▼2.10
Posts /wp-admin/edit.php2,104 ▲41.96 ▲0.0138.60 ▼0.7635.25 ▼2.60
Add New Post /wp-admin/post-new.php1,529 ▲323.25 ▲0.27587.65 ▼63.2547.16 ▼8.40
Media Library /wp-admin/upload.php1,395 ▼24.21 ▼0.0699.07 ▼2.6741.23 ▼2.45
Optimize Google Analytics /wp-admin/options-general.php?page=host_analyticsjs_local1,1351.8023.6962.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • caos_cron_file_aliases
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • caos_settings
    • can_compress_scripts
    • caos_db_version
    • widget_theysaidso_widget
    • db_upgraded

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)
Even though everything seems fine, this is not 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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'CAOS_Admin_Settings_Builder' not found in wp-content/plugins/host-analyticsjs-local/includes/admin/settings/class-advanced.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CAOS_Admin_Settings_Builder' not found in wp-content/plugins/host-analyticsjs-local/includes/admin/settings/class-basic.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CAOS_Admin_Settings_Builder' not found in wp-content/plugins/host-analyticsjs-local/includes/admin/settings/class-help.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

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
9 plugin tags: analytics, leverage browser cache, locally, woocommerce, minimize external requests...

host-analyticsjs-local/host-analyticsjs-local.php Passed 13 tests

"CAOS | Host Google Analytics Locally" version 4.7.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
128 characters long description:
Completely optimize Google Analytics 4 for your WordPress Website - host gtag.js locally or use Minimal Analytics and much more!

Code Analysis Passed 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
There were no executable files found in this plugin2,486 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP305741,5232,145
LESS12717120
CSS2018107
JavaScript2163375
XML19339

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.70
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods168
▷ Static methods1710.12%
▷ Public methods13379.17%
▷ Protected methods31.79%
▷ Private methods3219.05%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants45
▷ Global constants817.78%
▷ Class constants3782.22%
▷ Public constants37100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png5.29KB2.98KB▼ 43.74%