Releases: mnestorov/wp-multisite-cookie-manager
Releases · mnestorov/wp-multisite-cookie-manager
2.1.3
2.1.2
2.1.1
2.1
- Provide a button on an plugin admin page that, when pressed, will clear the cookies with the unique cookie name from the database.
- The
mn_handle_clear_cookies_request
function is hooked to theadmin_init
action, and checks if the "Clear Cookies" button was pressed. - If the button was pressed, it checks the nonce for security, calls the
mn_clear_cookies
function to clear cookies from the database, and displays a success message usingadd_settings_error
.
- The
2.0.4
2.0.3
2.0.2
Additional functionality added
- The
cookie_value
of the custom cookie will contain both the session ID and geolocation data, which can be parsed on the server or client-side as needed.- The
mn_get_geolocation_data()
function is called to obtain the geolocation data. - The session ID is either retrieved from an existing cookie or generated anew using
wp_generate_uuid4()
. - The cookie_value is constructed as a JSON object containing the session ID and geolocation data.
- The
setcookie()
function is called to set the custom cookie with the new cookie_value. - Optionally, a separate session ID cookie is set if it doesn’t already exist.
- The
- Modify the Database Table Structure:
- Update the database table structure to include new columns for storing geo-location and session data.
- Log Geo-location and Session Data:
- Update the
mn_log_cookie_usage()
function to log geo-location and user session data along with the cookie data.
- Update the
- Display Geo-location and Session Data:
- Update the
mn_cookie_reporting_page()
function to display the geo-location and session data in the Cookie Report table.
- Update the
2.0.1
2.0
Major bug fixes and improvements, adding of additional error checking, sanitize JSON data, changing the name of the cookie
- Sanitize and handle the JSON data correctly when saving and retrieving it from the database.
- Enable error reporting to catch any PHP errors or warnings that might be occurring.
- Display the raw data being saved to the database on the settings page for debugging purposes.
- Modifying
mn_get_cookie_expiration
andmn_cookie_settings_page
functions to useget_blog_option
andupdate_blog_option
instead ofget_site_option
andupdate_site_option
. - The cookie name will have the format
__site_name_blog_id
, wheresite_name
is the name of the site (with spaces replaced by underscores and converted to lowercase), andblog_id
is the ID of the current blog. - Added more detailed explanation of how the plugin works in to the README.md file.