83% fair-analytics

Code Review | Google Analytics alternative – Privacy and legally compliant – Fair Analytics

WordPress plugin Google Analytics alternative – Privacy and legally compliant – Fair Analytics scored83%from 54 tests.

About plugin

  • Plugin page: fair-analytics
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2021
  • Latest release: Feb 15, 2023
  • Number of updates: 95
  • Update frequency: every 5.3 days
  • Top authors: fairanalytics (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /3,137 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼8.18ms] Passed 4 tests

An overview of server-side resources used by Google Analytics alternative – Privacy and legally compliant – Fair Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.68 ▼3.43
Dashboard /wp-admin3.36 ▲0.0645.39 ▼11.72
Posts /wp-admin/edit.php3.41 ▲0.0646.97 ▼11.59
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.35 ▼5.13
Media Library /wp-admin/upload.php3.28 ▲0.0633.37 ▼4.29
Fair Analytics /wp-admin/options-general.php?page=dsgvo-analytics3.2731.43

Server storage [IO: ▲5.38MB] [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: 42 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
dsgvo-analytics-service
dsgvo-analytics-ID
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Google Analytics alternative – Privacy and legally compliant – Fair Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.73 ▼0.554.72 ▲2.7545.42 ▲2.31
Dashboard /wp-admin2,213 ▲254.87 ▼1.00112.44 ▼0.5638.02 ▼9.57
Posts /wp-admin/edit.php2,093 ▲12.05 ▲0.0740.52 ▼0.9536.28 ▼3.02
Add New Post /wp-admin/post-new.php1,536 ▲322.81 ▼0.29674.41 ▼39.1953.42 ▼11.20
Media Library /wp-admin/upload.php1,386 ▼24.29 ▲0.09103.45 ▼18.1947.25 ▼0.71
Fair Analytics /wp-admin/options-general.php?page=dsgvo-analytics9172.0732.0362.43

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fair-analytics/languages/index.php
    • > /wp-content/plugins/fair-analytics/template/index.php
    • > /wp-content/plugins/fair-analytics/assets/index.php
    • > /wp-content/plugins/fair-analytics/fair-analytics.php
    • > /wp-content/plugins/fair-analytics/assets/css/index.php
    • > /wp-content/plugins/fair-analytics/template/main_page.php
    • > /wp-content/plugins/fair-analytics/assets/js/index.php
    • > /wp-content/plugins/fair-analytics/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

fair-analytics/fair-analytics.php 77% from 13 tests

Analyzing the main PHP file in "Google Analytics alternative – Privacy and legally compliant – Fair Analytics" version 1.1.3
It is important to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("fairanalytics")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/fairanalytics")
  • Plugin Name: Keep the plugin name shorter than 70 characters (currently 81 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,464 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS120411639
PO File2184326520
PHP38020226
JavaScript263478
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
6 PNG files occupy 0.32MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/fair-analytics-logo-negative.png9.08KB5.18KB▼ 42.95%
assets/css/check-negative.png3.04KB1.53KB▼ 49.57%
logo.png42.12KB22.98KB▼ 45.44%
assets/css/check-fa.png1.13KB0.40KB▼ 64.25%
assets/css/check-positive.png5.09KB1.13KB▼ 77.89%