84% fathom-analytics

Code Review | Fathom Analytics for WP

WordPress plugin Fathom Analytics for WP scored84%from 54 tests.

About plugin

  • Plugin page: fathom-analytics
  • Plugin version: 3.2.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Nov 13, 2023
  • Number of updates: 53
  • Update frequency: every 35.6 days
  • Top authors: convaventures (83.02%)DvanKooten (18.87%)

Code review

54 tests

User reviews

12 reviews

Install metrics

8,000+ active /45,195 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: ▲0.07MB] [CPU: ▼5.10ms] Passed 4 tests

An overview of server-side resources used by Fathom Analytics for WP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.06 ▼4.09
Dashboard /wp-admin3.37 ▲0.0745.50 ▼6.59
Posts /wp-admin/edit.php3.49 ▲0.1349.87 ▲5.76
Add New Post /wp-admin/post-new.php5.95 ▲0.0785.34 ▼8.19
Media Library /wp-admin/upload.php3.30 ▲0.0734.59 ▼1.52
Fathom Analytics /wp-admin/options-general.php?page=fathom-analytics3.2630.77

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
fathom_exclude_roles
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Fathom Analytics for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.34 ▼0.001.67 ▼0.2739.82 ▼5.60
Dashboard /wp-admin2,202 ▲255.63 ▲0.0095.57 ▼3.3042.66 ▼1.79
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0639.92 ▲0.7634.96 ▲0.09
Add New Post /wp-admin/post-new.php1,529 ▲323.06 ▼0.27627.13 ▼130.9551.63 ▼1.31
Media Library /wp-admin/upload.php1,407 ▲104.26 ▼0.0096.27 ▼2.6141.84 ▲0.18
Fathom Analytics /wp-admin/options-general.php?page=fathom-analytics8732.0128.4734.00

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • fathom_exclude_roles
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/fathom-analytics/fathom-analytics.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 uses markdown syntax to describe your plugin to the world
7 plugin tags: google analytics, stats, privacy, website analytics, web analytics...

fathom-analytics/fathom-analytics.php Passed 13 tests

The primary PHP file in "Fathom Analytics for WP" version 3.2.1 is used by WordPress to initiate all plugin functionality
77 characters long description:
Fathom analytics is a simple, GDPR-compliant alternative to Google Analytics.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected283 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP163158216
Markdown141048
SVG10015
JavaScript2174

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants330.00%
▷ Class constants770.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.08MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png61.53KB61.50KB0.06%
fathom.png0.74KB0.45KB▼ 39.29%
screenshot-1.png19.99KB19.98KB0.06%