Skip to content

Commit

Permalink
Add uninstall.php to delete options when plugin is uninstalled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 committed Jun 2, 2023
1 parent 2a02dcd commit 167aa14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.1] - 2023-01-30
## [3.1.0] - 2023-06-02
### Added
- Add `uninstall.php` to delete options when plugin is uninstalled.

## [3.0.1] - 2023-30-01
### Fixed
- Prevent SecurityErrors when access to `window.localStorage` is not allowed.

Expand Down
4 changes: 2 additions & 2 deletions required-google-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Plugin Name: Google Analytics
* Plugin URI: https://github.com/wearerequired/required-google-analytics
* Description: Adds Google's global site tag (gtag.js) to your site, the modern way.
* Version: 3.0.1
* Version: 3.1.0
* Author: required
* Author URI: https://required.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* Copyright (c) 2018-2022 required (email: info@required.ch)
* Copyright (c) 2018-2023 required (email: info@required.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
Expand Down
11 changes: 11 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Functionality that is executed when the plugin is uninstalled via built-in WordPress commands.
*/

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}

delete_option( 'required_ga_property_id' );
delete_option( 'required_ga4_measurement_id' );

0 comments on commit 167aa14

Please sign in to comment.