84% lightweight-google-analytics

Code Review | Lightweight Google Analytics

WordPress plugin Lightweight Google Analytics scored 84% from 54 tests.

About plugin

  • Plugin page: lightweight-googl...
  • Plugin version: 1.4.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 24, 2020
  • Latest release: Sep 22, 2023
  • Number of updates: 17
  • Update frequency: every 64.3 days
  • Top authors: someguy9 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active / 3,218 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.69ms] Passed 4 tests

An overview of server-side resources used by Lightweight Google Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.65 ▼1.04
Dashboard /wp-admin3.32 ▲0.0245.90 ▼2.49
Posts /wp-admin/edit.php3.37 ▲0.0249.69 ▲2.96
Add New Post /wp-admin/post-new.php5.90 ▲0.0294.75 ▼2.82
Media Library /wp-admin/upload.php3.24 ▲0.0234.83 ▼0.40
Lightweight Google Analytics /wp-admin/options-general.php?page=lightweight-google-analytics3.2132.17

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Lightweight Google Analytics: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.25 ▼1.404.55 ▲2.7940.29 ▼7.77
Dashboard /wp-admin2,220 ▲294.85 ▼1.03109.49 ▲4.8541.92 ▼2.55
Posts /wp-admin/edit.php2,102 ▲132.03 ▼0.0138.66 ▲2.2737.68 ▲0.68
Add New Post /wp-admin/post-new.php1,527 ▼618.11 ▼5.16668.46 ▼18.5457.73 ▲5.54
Media Library /wp-admin/upload.php1,405 ▲174.18 ▼0.03100.58 ▼1.0444.48 ▼3.69
Lightweight Google Analytics /wp-admin/options-general.php?page=lightweight-google-analytics9522.0322.8234.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightweight-google-analytics/lightweight-google-analytics.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: google analytics plugin, wordpress analytics, google analytics, analytics

lightweight-google-analytics/lightweight-google-analytics.php 92% from 13 tests

"Lightweight Google Analytics" version 1.4.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected283 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17833283

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected