68% opt-out-for-google-analytics

Code Review | Opt-Out for Google Analytics (DSGVO / GDPR)

WordPress plugin Opt-Out for Google Analytics (DSGVO / GDPR) scored68%from 54 tests.

About plugin

  • Plugin page: opt-out-for-googl...
  • Plugin version: 2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: Apr 13, 2016
  • Latest release: Apr 9, 2023
  • Number of updates: 38
  • Update frequency: every 67.9 days
  • Top authors: schweizersolutions (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

5,000+ active /86,781 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.86MB] [CPU: ▲13.32ms] Passed 4 tests

Server-side resources used by Opt-Out for Google Analytics (DSGVO / GDPR)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.35 ▲0.8854.51 ▲15.51
Dashboard /wp-admin4.17 ▲0.8770.06 ▲20.53
Posts /wp-admin/edit.php4.22 ▲0.8659.87 ▲11.09
Add New Post /wp-admin/post-new.php6.76 ▲0.87105.10 ▲12.33
Media Library /wp-admin/upload.php4.08 ▲0.8548.61 ▲14.33
GA Opt-Out /wp-admin/options-general.php?page=gaoo4.1350.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opt-Out for Google Analytics (DSGVO / GDPR)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲17813.21 ▼1.162.06 ▲0.4432.79 ▼12.42
Dashboard /wp-admin2,272 ▲875.90 ▲0.05102.82 ▲3.0345.57 ▼1.88
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0437.08 ▼3.2934.11 ▼4.18
Add New Post /wp-admin/post-new.php6,355 ▲4,82127.89 ▲4.85889.65 ▲196.1460.83 ▲10.34
Media Library /wp-admin/upload.php1,394 ▲64.23 ▲0.0299.48 ▼9.0445.17 ▲1.60
GA Opt-Out /wp-admin/options-general.php?page=gaoo1,3342.1131.0657.37

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall correctly, leaving 33 files (0.28MB) in the plugin directory
    • (new file) assets/optout-block.js
    • (new file) assets/icon.png
    • (new file) assets/admin.js
    • (new file) assets/public.min.js
    • (new file) assets/index.php
    • (new file) constants.php
    • (new file) assets/public.js
    • (new file) assets/tinymce.js
    • (new file) assets/admin.css
    • (new file) ga-opt-out.php
    • ...
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/opt-out-for-google-analytics/templates/promotion.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant GAOO_LOCALE - assumed 'GAOO_LOCALE' (this will throw an Error in a future version of PHP) in wp-content/plugins/opt-out-for-google-analytics/templates/settings.php on line 1
    • > PHP Notice
      Undefined variable: promo in wp-content/plugins/opt-out-for-google-analytics/templates/promotion.php on line 5
    • > PHP Notice
      Undefined variable: popup in wp-content/plugins/opt-out-for-google-analytics/templates/promotion.php on line 1
    • > PHP Notice
      Undefined variable: popup in wp-content/plugins/opt-out-for-google-analytics/templates/promotion.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/opt-out-for-google-analytics/templates/settings.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/opt-out-for-google-analytics/templates/promotion.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: dsgvo, google analytics, analytics, opt-out, gdpr

opt-out-for-google-analytics/ga-opt-out.php 85% from 13 tests

The principal PHP file in "Opt-Out for Google Analytics (DSGVO / GDPR)" v. 2.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 203 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("opt-out-for-google-analytics.php" instead of "ga-opt-out.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected4,737 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP198031,6234,276
CSS1602248
JavaScript5452205
XML1008

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 153)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity74.83
▷ Minimum class complexity2.00
▷ Maximum class complexity286.00
Average method complexity6.09
▷ Minimum method complexity1.00
▷ Maximum method complexity153.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods174
▷ Static methods3218.39%
▷ Public methods16393.68%
▷ Protected methods31.72%
▷ Private methods84.60%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants18
▷ Global constants18100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png0.59KB0.60KB0.00%