Changeset 3465485
- Timestamp:
- 02/20/2026 04:21:14 AM (5 weeks ago)
- Location:
- cookie-notice/trunk
- Files:
-
- 4 edited
-
cookie-notice.php (modified) (3 diffs)
-
includes/welcome-api.php (modified) (4 diffs)
-
js/admin.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookie-notice/trunk/cookie-notice.php
r3458232 r3465485 3 3 Plugin Name: Cookie Notice & Compliance for GDPR / CCPA 4 4 Description: Cookie Notice allows you to you elegantly inform users that your site uses cookies and helps you comply with GDPR, CCPA and other data privacy laws. 5 Version: 2.5.1 25 Version: 2.5.13 6 6 Author: Hu-manity.co 7 7 Author URI: https://hu-manity.co/ … … 30 30 * 31 31 * @class Cookie_Notice 32 * @version 2.5.1 232 * @version 2.5.13 33 33 */ 34 34 class Cookie_Notice { … … 153 153 'activation_datetime' => 0 154 154 ], 155 'version' => '2.5.1 2'155 'version' => '2.5.13' 156 156 ]; 157 157 -
cookie-notice/trunk/includes/welcome-api.php
r3458232 r3465485 950 950 $blocking = get_option( 'cookie_notice_app_blocking', [] ); 951 951 952 // set cache purge transient to force widget to refresh 953 if ( $network ) 954 set_site_transient( 'cookie_notice_config_update', time(), DAY_IN_SECONDS ); 955 else 956 set_transient( 'cookie_notice_config_update', time(), DAY_IN_SECONDS ); 957 958 $response = [ 959 'success' => true, 960 'message' => esc_html__( 'Configuration synced successfully.', 'cookie-notice' ), 961 'timestamp' => ! empty( $blocking['lastUpdated'] ) ? $blocking['lastUpdated'] : '' 962 ]; 952 // debug: include blocking data in response when debug mode is enabled 953 $debug = $cn->options['general']['debug_mode'] ? [ 954 'app_id' => $app_id, 955 'status_data' => $status_data, 956 'blocking' => $blocking, 957 'providers_count' => ! empty( $blocking['providers'] ) ? count( $blocking['providers'] ) : 0, 958 'patterns_count' => ! empty( $blocking['patterns'] ) ? count( $blocking['patterns'] ) : 0, 959 ] : null; 960 961 // check if sync was successful 962 if ( ! empty( $status_data ) && is_array( $status_data ) && ! empty( $status_data['status'] ) && $status_data['status'] === 'active' ) { 963 // set cache purge transient to force widget to refresh 964 if ( $network ) 965 set_site_transient( 'cookie_notice_config_update', time(), DAY_IN_SECONDS ); 966 else 967 set_transient( 'cookie_notice_config_update', time(), DAY_IN_SECONDS ); 968 969 $response = [ 970 'success' => true, 971 'message' => esc_html__( 'Configuration synced successfully.', 'cookie-notice' ), 972 'timestamp' => ! empty( $blocking['lastUpdated'] ) ? $blocking['lastUpdated'] : '' 973 ]; 974 } else { 975 $response = [ 976 'error' => esc_html__( 'Failed to sync configuration. Please check your app ID and try again.', 'cookie-notice' ) 977 ]; 978 } 979 980 if ( $debug ) 981 $response['debug'] = $debug; 963 982 break; 964 983 } … … 1247 1266 } 1248 1267 1249 if ( $json ) 1268 // for GET requests, append params as query string instead of body 1269 if ( $api_args['method'] === 'GET' ) 1270 $api_url = add_query_arg( $api_params, $api_url ); 1271 elseif ( $json ) 1250 1272 $api_args['body'] = wp_json_encode( $api_params ); 1251 1273 else … … 1533 1555 ] 1534 1556 ); 1557 1558 // debug: log raw Designer API response 1559 if ( $cn->options['general']['debug_mode'] ) { 1560 error_log( '[Cookie Notice] get_app_config - AppID: ' . $app_id ); 1561 error_log( '[Cookie Notice] get_app_config - Designer API response: ' . wp_json_encode( $response ) ); 1562 } 1535 1563 1536 1564 // get status data … … 1647 1675 update_option( 'cookie_notice_app_blocking', $result, false ); 1648 1676 } 1677 1678 // debug: log what gets stored 1679 if ( $cn->options['general']['debug_mode'] ) { 1680 error_log( '[Cookie Notice] get_app_config - Stored providers count: ' . count( $result['providers'] ) ); 1681 error_log( '[Cookie Notice] get_app_config - Stored patterns count: ' . count( $result['patterns'] ) ); 1682 error_log( '[Cookie Notice] get_app_config - Stored blocking data: ' . wp_json_encode( $result ) ); 1683 } 1649 1684 } else { 1685 if ( $cn->options['general']['debug_mode'] ) { 1686 error_log( '[Cookie Notice] get_app_config - No data in response. Error: ' . ( ! empty( $response->error ) ? $response->error : 'unknown' ) ); 1687 } 1688 1650 1689 if ( ! empty( $response->error ) ) { 1651 1690 if ( $response->error == 'App is not puplised yet' ) -
cookie-notice/trunk/js/admin.js
r3458232 r3465485 720 720 } 721 721 } ).done( function( response ) { 722 if ( response && response.debug ) { 723 console.log( '[Cookie Notice] sync_config response:', response ); 724 console.log( '[Cookie Notice] App ID:', response.debug.app_id ); 725 console.log( '[Cookie Notice] Status data:', response.debug.status_data ); 726 console.log( '[Cookie Notice] Blocking data:', response.debug.blocking ); 727 console.log( '[Cookie Notice] Providers count:', response.debug.providers_count ); 728 console.log( '[Cookie Notice] Patterns count:', response.debug.patterns_count ); 729 } 722 730 if ( response && response.success ) { 723 731 // update last synced timestamp -
cookie-notice/trunk/readme.txt
r3458232 r3465485 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.9 7 Stable tag: 2.5.1 27 Stable tag: 2.5.13 8 8 License: MIT License 9 9 License URI: http://opensource.org/licenses/MIT
Note: See TracChangeset
for help on using the changeset viewer.