84% google-analytics-opt-out

Code Review | Google Analytics Opt-Out

WordPress plugin Google Analytics Opt-Out scored 84% from 54 tests.

About plugin

  • Plugin page: google-analytics-...
  • Plugin version: 2.3.6
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2013
  • Latest release: Jun 30, 2023
  • Number of updates: 92
  • Update frequency: every 38.3 days
  • Top authors: wp-buddy (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

9,000+ active / 210,007 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.06ms] Passed 4 tests

Server-side resources used by Google Analytics Opt-Out
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1545.89 ▲2.58
Dashboard /wp-admin3.45 ▲0.1546.40 ▼4.22
Posts /wp-admin/edit.php3.57 ▲0.2148.08 ▼1.18
Add New Post /wp-admin/post-new.php6.04 ▲0.1586.88 ▼5.40
Media Library /wp-admin/upload.php3.38 ▲0.1541.28 ▲6.33
Analytics Opt-Out /wp-admin/options-general.php?page=gaoo-options3.4139.33
Opt-Out Settings /wp-admin/admin.php?page=gaoo-options3.4143.15

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Google Analytics Opt-Out
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲10713.29 ▼0.992.02 ▲0.2142.53 ▲2.29
Dashboard /wp-admin2,216 ▲255.85 ▲0.9795.25 ▼9.4938.64 ▼6.80
Posts /wp-admin/edit.php2,102 ▲102.04 ▼0.0133.89 ▼7.0537.41 ▲0.56
Add New Post /wp-admin/post-new.php6,437 ▲4,91720.63 ▼2.65910.16 ▲246.1860.71 ▲14.91
Media Library /wp-admin/upload.php1,404 ▲164.19 ▼0.01103.89 ▲9.3644.91 ▲4.15
Analytics Opt-Out /wp-admin/options-general.php?page=gaoo-options1,5656.59129.1636.84
Opt-Out Settings /wp-admin/admin.php?page=gaoo-options1,5626.64132.0233.74

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 5× 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/google-analytics-opt-out/inc/admin.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-analytics-opt-out/inc/settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/google-analytics-opt-out/inc/functions.php:103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-analytics-opt-out/inc/scripts.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-analytics-opt-out/inc/frontend.php:71

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)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (The Opt-Out link can be added with the Opt-Out block in WordPress new block editor (that came with version 5.0).), #2 (If you're using the classic editor, click this little button to add the shortcode.), #3 (This is how the code looks like), #4 (This is the settings page)
The official readme.txt might help

google-analytics-opt-out/google-analytics-opt-out.php Passed 13 tests

Analyzing the main PHP file in "Google Analytics Opt-Out" version 2.3.6
54 characters long description:
Provides an Opt-Out functionality for Google Analytics

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
Good job! No executable or dangerous file extensions detected12,992 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON20012,128
PHP8197270582
JavaScript64268281
SVG1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions44
▷ Named functions3988.64%
▷ Anonymous functions511.36%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.13MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/optout-editor-icon.png3.06KB0.32KB▼ 89.59%
images/info-icon.png0.29KB0.25KB▼ 14.62%
images/close-icon.png0.24KB0.24KB0.00%
screenshot-4.png14.17KB15.77KB0.00%
screenshot-1.png24.55KB26.47KB0.00%