�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�
Warning: session_start(): Session cannot be started after headers have already been sent in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 135
0x0x
PHP 8.2.31
Preview: upgrade.php Size: 35.91 KB
/home/m/c/i/mciraet/www/wp-content/plugins/complianz-gdpr/upgrade.php
<?php
defined( 'ABSPATH' ) or die();
add_action( 'init', 'cmplz_check_upgrade', 10, 2 );

/**
 * Run an upgrade procedure if the version has changed
 */
function cmplz_check_upgrade() {
	// only run upgrade check if cron, or if admin.
	if ( ! is_admin() && ! wp_doing_cron() ) {
		return;
	}

	$prev_version = get_option( 'cmplz-current-version', false );
	$force        = isset( $_GET['cmplz_upgrade'] ) && cmplz_user_can_manage();
	$new_version  = CMPLZ_VERSION;
	// strip off everything after '#'
	if ( strpos( $new_version, '#' ) !== false ) {
		$new_version = substr( $new_version, 0, strpos( $new_version, '#' ) );
	}

	if ( ! $force && $prev_version === $new_version ) {
		return;
	}

	// trigger table upgrades
	do_action( 'cmplz_install_tables' );

	/**
	 * Set a "first version" variable, so we can check if some notices need to be shown
	 */
	if ( ! $prev_version ) {
		update_option( 'cmplz_first_version', $new_version, false );
	}

	/*
	 * change googlemaps into google-maps
	 * */
	if ( $prev_version
		&& version_compare( $prev_version, '4.0.0', '<' )
	) {
		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['thirdparty_services_on_site']['googlemaps'] )
			&& $wizard_settings['thirdparty_services_on_site']['googlemaps']
				== 1
		) {
			unset( $wizard_settings['thirdparty_services_on_site']['googlemaps'] );
			$wizard_settings['thirdparty_services_on_site']['google-maps'] = 1;
			update_option( 'complianz_options_wizard', $wizard_settings );
		}
	}

	/**
	 * upgrade existing eu and uk settings to separate uk optinstats
	 */

	if ( $prev_version
		&& version_compare( $prev_version, '4.0.0', '<' )
	) {
		if ( cmplz_has_region( 'eu' ) && cmplz_has_region( 'uk' ) ) {
			$banners = cmplz_get_cookiebanners();
			foreach ( $banners as $banner ) {
				$banner                            = cmplz_get_cookiebanner( $banner->ID );
				$banner->use_categories_optinstats
						= $banner->use_categories;
				$banner->save();
			}
		}
	}

	/**
	 * migrate to anonymous if anonymous settings are selected
	 */

	if ( $prev_version
		&& version_compare( $prev_version, '4.0.4', '<' )
	) {
		$selected_stat_service = cmplz_get_option( 'compile_statistics' );
		if ( $selected_stat_service === 'google-analytics'
			|| $selected_stat_service === 'matomo'
			|| $selected_stat_service === 'google-tag-manager'
		) {
			$service_name
				= COMPLIANZ::$banner_loader->convert_slug_to_name( $selected_stat_service );

			// check if we have other types of this service, to prevent double services here.
			$service_anonymized = new CMPLZ_SERVICE( $service_name . ' (anonymized)' );
			$service            = new CMPLZ_SERVICE( $service_name );

			// check if we have two service types. If so, just delete the anonymized one
			if ( $service_anonymized->ID && $service->ID ) {
				$service_anonymized->delete();
			} elseif ( $service_anonymized->ID && ! $service->ID ) {
				// just one. If it's the anonymous service, rename, and save it.
				$service_anonymized->name = $service_name;
				$service_anonymized->save();
			}
		}
	}

	/**
	 * upgrade publish date to more generic unix
	 */

	if ( $prev_version
		&& version_compare( $prev_version, '4.2', '<' )
	) {
		$publish_date = strtotime( get_option( 'cmplz_publish_date' ) );
		if ( intval( $publish_date ) > 0 ) {
			update_option(
				'cmplz_publish_date',
				intval( $publish_date )
			);
		}
	}

	/**
	 * upgrade to new custom and generated document settings
	 */
	if ( $prev_version
		&& version_compare( $prev_version, '4.4.0', '<' )
	) {
		// upgrade cookie policy setting to new field
		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['cookie-policy-type'] ) ) {
			$value = $wizard_settings['cookie-policy-type'];
			unset( $wizard_settings['cookie-policy-type'] );
			// upgrade cookie policy custom url
			if ( $value === 'custom' ) {
				$url = cmplz_get_option( 'custom-cookie-policy-url' );
				update_option( 'cmplz_cookie-statement_custom_page', $url );
				unset( $wizard_settings['custom-cookie-policy-url'] );
			} else {
				$value = 'generated';
			}
		} else {
			$value = 'generated';
		}

		$wizard_settings['cookie-statement'] = $value;
		$wizard_settings['impressum']        = 'none';

		// upgrade privacy statement settings
		$value = $wizard_settings['privacy-statement'];

		if ( $value === 'yes' ) {
			$value = 'generated';
		} else {
			$wp_privacy_policy = get_option( 'wp_page_for_privacy_policy' );
			if ( $wp_privacy_policy ) {
				$value = 'custom';
				update_option( 'cmplz_privacy-statement_custom_page', $wp_privacy_policy );
			} else {
				$value = 'none';
			}
		}
		$wizard_settings['privacy-statement'] = $value;

		// upgrade disclaimer settings
		$value = $wizard_settings['disclaimer'];
		if ( $value === 'yes' ) {
			$value = 'generated';
		} else {
			$value = 'none';
		}
		$wizard_settings['disclaimer'] = $value;

		// save the data
		update_option( 'complianz_options_wizard', $wizard_settings );
	}

	/**
	 * upgrade to new category field
	 */
	if ( $prev_version
		&& version_compare( $prev_version, '4.6.0', '<' )
	) {

		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID, false );
				++$banner->banner_version;
				if ( $banner->use_categories ) {
					$banner->use_categories = 'legacy';
				} else {
					$banner->use_categories = 'no';
				}
				if ( $banner->use_categories_optinstats ) {
					$banner->use_categories_optinstats = 'legacy';
				} else {
					$banner->use_categories_optinstats = 'no';
				}
				// also set the deny button to banner color, to make sure users start with correct colors
				$banner->functional_background_color = $banner->colorpalette_background['color'];
				$banner->functional_border_color     = $banner->colorpalette_background['border'];
				$banner->functional_text_color       = $banner->colorpalette_text['color'];
				$banner->save();
			}
		}
	}

	/**
	 * migrate policy id to network option for multisites
	 */

	if ( $prev_version && version_compare( $prev_version, '4.6.7', '<' )
	) {
		if ( is_multisite() ) {
			update_site_option( 'complianz_active_policy_id', get_option( 'complianz_active_policy_id', 1 ) );
		}
	}

	/**
	 * migrate odd numbers
	 */
	if ( $prev_version && version_compare( $prev_version, '4.6.8', '<' )
	) {
		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = cmplz_get_cookiebanner( $banner_item->ID );
				if ( $banner->banner_width % 2 == 1 ) {
					++$banner->banner_width;
				}
				$banner->save();
			}
		}
	}

	if ( $prev_version
			&& version_compare( $prev_version, '4.7.1', '<' )
	) {
		// upgrade cookie policy setting to new field
		$wizard_settings                            = get_option( 'complianz_options_wizard' );
		$wizard_settings['block_recaptcha_service'] = 'yes';
		update_option( 'complianz_options_wizard', $wizard_settings );
	}

	if ( $prev_version
		&& version_compare( $prev_version, '4.9.6', '<' )
	) {
		// this branch aims to revoke consent and clear all cookies. We increase the policy id to do this.
		COMPLIANZ::$banner_loader->upgrade_active_policy_id();
	}

	/**
	 * upgrade to new cookie banner, and 5.0 message option
	 */

	if ( $prev_version && version_compare( $prev_version, '5.0.0', '<' ) ) {
		update_option( 'cmplz_upgraded_to_five', true, false );

		// clear notices cache, as the array structure has changed
		delete_transient( 'complianz_warnings' );
		global $wpdb;

		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID, false );
				$sql    = $wpdb->prepare( "select * from {$wpdb->prefix}cmplz_cookiebanners where ID = %s", $banner_item->ID );
				$result = $wpdb->get_row( $sql );

				if ( $result ) {
					// reset to arrays
					if ( ! is_array( $banner->colorpalette_background ) ) {
						$banner->colorpalette_background = array();
					}
					if ( ! is_array( $banner->colorpalette_text ) ) {
						$banner->colorpalette_text = array();
					}
					if ( ! is_array( $banner->colorpalette_toggles ) ) {
						$banner->colorpalette_toggles = array();
					}
					if ( ! is_array( $banner->colorpalette_button_accept ) ) {
						$banner->colorpalette_button_accept = array();
					}
					if ( ! is_array( $banner->colorpalette_button_deny ) ) {
						$banner->colorpalette_button_deny = array();
					}
					if ( ! is_array( $banner->colorpalette_button_settings ) ) {
						$banner->colorpalette_button_settings = array();
					}
					$banner->colorpalette_background['color']   = empty( $result->popup_background_color ) ? '#f1f1f1' : $result->popup_background_color;
					$banner->colorpalette_background['border']  = empty( $result->popup_background_color ) ? '#f1f1f1' : $result->popup_background_color;
					$banner->colorpalette_text['color']         = empty( $result->popup_text_color ) ? '#191e23' : $result->popup_text_color;
					$banner->colorpalette_text['hyperlink']     = empty( $result->popup_text_color ) ? '#191e23' : $result->popup_text_color;
					$banner->colorpalette_toggles['background'] = empty( $result->slider_background_color ) ? '#21759b' : $result->slider_background_color;
					$banner->colorpalette_toggles['bullet']     = empty( $result->slider_bullet_color ) ? '#ffffff' : $result->slider_bullet_color;
					$banner->colorpalette_toggles['inactive']   = empty( $result->slider_background_color_inactive ) ? '#555' : $result->slider_background_color_inactive;

					$consenttypes = cmplz_get_used_consenttypes();
					$optout_only  = false;
					if ( in_array( 'optout', $consenttypes ) && count( $consenttypes ) === 1 ) {
						$optout_only = true;
					}

					if ( $banner->use_categories === 'no' || $optout_only ) {
						$banner->colorpalette_button_accept['background'] = empty( $result->button_background_color ) ? '#21759b' : $result->button_background_color;
						$banner->colorpalette_button_accept['border']     = empty( $result->border_color ) ? '#21759b' : $result->border_color;
						$banner->colorpalette_button_accept['text']       = empty( $result->button_text_color ) ? '#ffffff' : $result->button_text_color;
					} else {
						$banner->colorpalette_button_accept['background'] = empty( $result->accept_all_background_color ) ? '#21759b' : $result->accept_all_background_color;
						$banner->colorpalette_button_accept['border']     = empty( $result->accept_all_border_color ) ? '#21759b' : $result->accept_all_border_color;
						$banner->colorpalette_button_accept['text']       = empty( $result->accept_all_text_color ) ? '#ffffff' : $result->accept_all_text_color;
					}
					$banner->colorpalette_button_deny['background'] = empty( $result->functional_background_color ) ? '#f1f1f1' : $result->functional_background_color;
					$banner->colorpalette_button_deny['border']     = empty( $result->functional_border_color ) ? '#f1f1f1' : $result->functional_border_color;
					$banner->colorpalette_button_deny['text']       = empty( $result->functional_text_color ) ? '#21759b' : $result->functional_text_color;

					$banner->colorpalette_button_settings['background'] = empty( $result->button_background_color ) ? '#f1f1f1' : $result->button_background_color;
					$banner->colorpalette_button_settings['border']     = empty( $result->border_color ) ? '#21759b' : $result->border_color;
					$banner->colorpalette_button_settings['text']       = empty( $result->button_text_color ) ? '#21759b' : $result->button_text_color;
					if ( $banner->theme === 'edgeless' ) {
						$banner->buttons_border_radius = array(
							'top'    => '0',
							'right'  => '0',
							'bottom' => '0',
							'left'   => '0',
							'type'   => 'px',
						);
					}

					$banner->save();
				}
			}
		}
		/**
		 * Move custom scripts from 'wizard' to 'custom-scripts'
		 */
		// upgrade cookie policy setting to new field
		$wizard_settings = get_option( 'complianz_options_wizard' );
		$custom_scripts  = array();
		if ( isset( $wizard_settings['statistics_script'] ) ) {
			$custom_scripts['statistics_script'] = $wizard_settings['statistics_script'];
		}
		if ( isset( $wizard_settings['cookie_scripts'] ) ) {
			$custom_scripts['cookie_scripts'] = $wizard_settings['cookie_scripts'];
		}
		if ( isset( $wizard_settings['cookie_scripts_async'] ) ) {
			$custom_scripts['cookie_scripts_async'] = $wizard_settings['cookie_scripts_async'];
		}
		if ( isset( $wizard_settings['thirdparty_scripts'] ) ) {
			$custom_scripts['thirdparty_scripts'] = $wizard_settings['thirdparty_scripts'];
		}
		if ( isset( $wizard_settings['thirdparty_iframes'] ) ) {
			$custom_scripts['thirdparty_iframes'] = $wizard_settings['thirdparty_iframes'];
		}
		unset( $wizard_settings['statistics_script'] );
		unset( $wizard_settings['cookie_scripts'] );
		unset( $wizard_settings['cookie_scripts_async'] );
		unset( $wizard_settings['thirdparty_scripts'] );
		unset( $wizard_settings['thirdparty_iframes'] );
		update_option( 'complianz_options_custom-scripts', $custom_scripts );
		update_option( 'complianz_options_wizard', $wizard_settings );
	}

	if ( $prev_version && version_compare( $prev_version, '5.1.0', '<' ) ) {
		update_option( 'cmplz_first_version', '5.0.0', false );
	}

	/**
	 * restore dropshadow in TCF banner.
	 */
	if ( $prev_version
		&& version_compare( $prev_version, '5.1.2', '<' )
	) {
		if ( cmplz_tcf_active() ) {
			$banners = cmplz_get_cookiebanners();
			if ( $banners ) {
				foreach ( $banners as $banner_item ) {
					$banner                 = new CMPLZ_COOKIEBANNER( $banner_item->ID, false );
					$banner->use_box_shadow = true;
					$banner->save();
				}
			}
		}
	}

	if ( $prev_version
		&& version_compare( $prev_version, '5.2.0', '<' )
	) {
		if ( cmplz_tcf_active() ) {
			$banners = cmplz_get_cookiebanners();
			if ( $banners ) {
				foreach ( $banners as $banner_item ) {
					$banner                               = new CMPLZ_COOKIEBANNER( $banner_item->ID, false );
					$banner->colorpalette_button_accept   = array(
						'background' => '#333',
						'border'     => '#333',
						'text'       => '#fff',
					);
					$banner->colorpalette_button_settings = array(
						'background' => '#fff',
						'border'     => '#333',
						'text'       => '#333',
					);
					$banner->save();
				}
			}
		}
	}

	/**
	 * Change metakeys for eu dataleaks from '{metakey}' to '{metakey}-eu' for consistency between dataleaks .
	 */
	if ( $prev_version
		&& version_compare( $prev_version, '5.4.0', '<' )
	) {
		$args = array(
			'numberposts' => - 1,
			'post_type'   => 'cmplz-dataleak',
			'tax_query'   => array(
				array(
					'taxonomy' => 'cmplz-region',
					'field'    => 'slug',
					'terms'    => 'eu',
				),
			),
		);

		$posts     = get_posts( $args );
		$meta_keys = array(
			'security-incident-occurred',
			'type-of-dataloss',
			'reach-of-dataloss',
			'risk-of-data-loss',
			'what-occurred',
			'consequences',
			'measures',
			'measures_by_person_involved',
			'conclusion',
		);
		foreach ( $posts as $post ) {
			foreach ( $meta_keys as $meta_key ) {
				$value = get_post_meta( $post->ID, $meta_key, true );
				if ( $value ) {
					update_post_meta( $post->ID, $meta_key . '-eu', $value );
				}
			}
		}

		$wizard_settings = get_option( 'complianz_options_wizard' );
		// upgrade to checkboxes structure.
		$value_eu = $value_uk = false;
		if ( isset( $wizard_settings['dpo_or_gdpr'] ) ) {
			$value_eu = $wizard_settings['dpo_or_gdpr'];
		}

		if ( isset( $wizard_settings['dpo_or_uk_gdpr'] ) ) {
			$value_uk = $wizard_settings['dpo_or_uk_gdpr'];
		}
		if ( ! is_array( $value_eu ) ) {
			$new_value = array(
				'dpo'         => 0,
				'dpo_uk'      => 0,
				'gdpr_rep'    => 0,
				'uk_gdpr_rep' => 0,
			);
			if ( $value_eu ) {
				$new_value[ $value_eu ] = 1;
			}
			if ( $value_uk ) {
				if ( $value_uk === 'dpo' ) {
					$value_uk = 'dpo_uk';
				}
				$new_value[ $value_uk ] = 1;
			}
			// none is not applicable anymore, as it's  multischeckbox
			unset( $new_value['none'] );

			$wizard_settings['dpo_or_gdpr'] = $new_value;
			unset( $wizard_settings['dpo_or_uk_gdpr'] );

			if ( isset( $wizard_settings['ca_name_address_accountable_person'] ) ) {
				$address = preg_split( '#\n(?!s)#', $wizard_settings['ca_name_address_accountable_person'] );
				$name    = isset( $address[0] ) ? $address[0] : '';
				unset( $address[0] );
				$address                                       = implode( "\n", $address );
				$wizard_settings['ca_name_accountable_person'] = $name;
				$wizard_settings['ca_address_accountable_person'] = $address;
			}

			update_option( 'complianz_options_wizard', $wizard_settings );
		}
	}

	if ( $prev_version
		&& version_compare( $prev_version, '5.5.0', '<' )
	) {
		$wizard_settings   = get_option( 'complianz_options_wizard' );
		$settings_settings = get_option( 'complianz_options_settings' );
		if ( isset( $wizard_settings['use_cdb_api'] ) ) {
			$settings_settings['use_cdb_api']   = $wizard_settings['use_cdb_api'];
			$settings_settings['use_cdb_links'] = $wizard_settings['use_cdb_links'];
		}
		unset( $wizard_settings['use_cdb_api'] );
		unset( $wizard_settings['use_cdb_links'] );
		update_option( 'complianz_options_wizard', $wizard_settings );
		update_option( 'complianz_options_settings', $settings_settings );
	}

	if ( $prev_version
		&& version_compare( $prev_version, '5.5.0', '<' )
	) {
		$wizard_settings = get_option( 'complianz_options_wizard' );

		$share_data_us = $share_data_eu = 2;
		if ( isset( $wizard_settings['share_data_other_us'] ) ) {
			$share_data_us = intval( $wizard_settings['share_data_other_us'] );
		}
		if ( isset( $wizard_settings['share_data_other'] ) ) {
			$share_data_eu = intval( $wizard_settings['share_data_other'] );
		}
		// share data other parties: indien een van beide "yes", nieuwe yes. Indien een van beide limited, nieuwe "limited". anders no.
		if ( $share_data_us === 1 || $share_data_eu === 1 ) {
			$share_data = 1;
		} elseif ( $share_data_us === 3 || $share_data_eu === 3 ) {
			$share_data = 3;
		} else {
			$share_data = 2;
		}
		$wizard_settings['share_data_other'] = $share_data;
		$us_processors                       = isset( $wizard_settings['processor_us'] ) ? $wizard_settings['processor_us'] : array();
		$eu_processors                       = isset( $wizard_settings['processor'] ) ? $wizard_settings['processor'] : array();
		foreach ( $us_processors as $us_processor ) {
			// check if it's already in the list
			$key = array_search( $us_processor['name'], array_column( $eu_processors, 'name' ) );
			if ( $key !== false ) {
				unset( $us_processors[ $key ] );
			}
		}

		// now add the remaining values to the EU list
		$eu_processors                = array_merge( $eu_processors, $us_processors );
		$wizard_settings['processor'] = $eu_processors;

		$us_thirdparties = isset( $wizard_settings['thirdparty_us'] ) ? $wizard_settings['thirdparty_us'] : array();
		$eu_thirdparties = isset( $wizard_settings['thirdparty'] ) ? $wizard_settings['thirdparty'] : array();
		foreach ( $us_thirdparties as $us_thirdparty ) {
			// check if it's already in the list
			$key = array_search( $us_thirdparty['name'], array_column( $eu_thirdparties, 'name' ) );
			if ( $key !== false ) {
				unset( $us_thirdparties[ $key ] );
			}
		}
		// now add the remaining values to the EU list
		$eu_thirdparties               = array_merge( $eu_thirdparties, $us_thirdparties );
		$wizard_settings['thirdparty'] = $eu_thirdparties;
		unset( $wizard_settings['thirdparty_us'] );
		unset( $wizard_settings['processor_us'] );

		update_option( 'complianz_options_wizard', $wizard_settings );
	}

	if ( $prev_version && version_compare( $prev_version, '6.0.0', '<' ) ) {
		$custom_scripts = get_option( 'complianz_options_custom-scripts' );

		$scripts['add_script']       = array();
		$scripts['block_script']     = array();
		$scripts['whitelist_script'] = array();

		if ( ! empty( $custom_scripts['cookie_scripts'] ) ) {
			$scripts['add_script'][] = array(
				'name'               => 'Scripts',
				'editor'             => $custom_scripts['cookie_scripts'],
				'async'              => '0',
				'category'           => 'marketing',
				'enable_placeholder' => '0',
				'placeholder_class'  => '',
				'placeholder'        => '',
				'enable_dependency'  => '0',
				'dependency'         => '',
				'enable'             => '1',
			);
		}

		if ( ! empty( $custom_scripts['cookie_scripts_async'] ) ) {
			$scripts['add_script'][] = array(
				'name'               => 'Async scripts',
				'editor'             => $custom_scripts['cookie_scripts_async'],
				'async'              => '1',
				'category'           => 'marketing',
				'enable_placeholder' => '0',
				'placeholder_class'  => '',
				'placeholder'        => '',
				'enable_dependency'  => '0',
				'dependency'         => '',
				'enable'             => '1',
			);
		}

		if ( ! empty( $custom_scripts['statistics_script'] ) ) {
			$scripts['add_script'][] = array(
				'name'               => 'Statistics scripts',
				'editor'             => $custom_scripts['statistics_script'],
				'async'              => '0',
				'category'           => 'statistics',
				'enable_placeholder' => '0',
				'placeholder_class'  => '',
				'placeholder'        => '',
				'enable_dependency'  => '0',
				'dependency'         => '',
				'enable'             => '1',
			);
		}

		if ( ! empty( $custom_scripts['thirdparty_scripts'] ) ) {
			$scripts['block_script'][] = array(
				'name'               => 'Third party scripts',
				'urls'               => explode( ',', $custom_scripts['thirdparty_scripts'] ),
				'category'           => 'marketing',
				'enable_placeholder' => '0',
				'placeholder_class'  => '',
				'placeholder'        => '',
				'enable'             => '1',
			);
		}

		if ( ! empty( $custom_scripts['thirdparty_iframes'] ) ) {
			$scripts['block_script'][] = array(
				'name'               => 'Third party iframes',
				'urls'               => explode( ',', $custom_scripts['thirdparty_iframes'] ),
				'category'           => 'marketing',
				'enable_placeholder' => '0',
				'placeholder_class'  => '',
				'placeholder'        => '',
				'enable'             => '1',
			);
		}
		update_option( 'complianz_options_custom-scripts', $scripts );

		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID );
				switch ( $banner->use_categories ) {
					case 'no':
						$banner->use_categories = 'no';
						break;
					case 'legacy':
					case 'visible':
						$banner->use_categories = 'save-preferences';
						break;
					default:
						$banner->use_categories = 'view-preferences';
				}

				switch ( $banner->position ) {
					case 'top':
						$banner->position = 'bottom';
						break;
					case 'bottom':
					case 'bottom-left':
					case 'bottom-right':
						break;
					default:
						$banner->position = 'center';
				}

				switch ( $banner->checkbox_style ) {
					case 'classic':
						$banner->checkbox_style = 'classic';
						break;
					default:
						$banner->checkbox_style = 'slider';
				}

				if ( ! is_serialized( $banner->border_width ) ) {
					$banner->border_width = array(
						'top'    => 0,
						'right'  => 0,
						'bottom' => 0,
						'left'   => 0,
					);
				}

				if ( ! isset( $banner->border_width['top'] ) ) {
					$banner->border_width['top'] = 0;
				}
				if ( ! isset( $banner->border_width['right'] ) ) {
					$banner->border_width['right'] = 0;
				}
				if ( ! isset( $banner->border_width['bottom'] ) ) {
					$banner->border_width['bottom'] = 0;
				}
				if ( ! isset( $banner->border_width['left'] ) ) {
					$banner->border_width['left'] = 0;
				}

				if ( ! is_serialized( $banner_item->dismiss ) ) {
					$banner->revoke = array(
						'text' => $banner_item->revoke,
						'show' => ! $banner_item->hide_revoke,
					);
				}

				if ( ! is_serialized( $banner_item->header ) ) {
					if ( strlen( $banner_item->header ) < 4 ) {
						$banner->header = array(
							'text' => '',
							'show' => false,
						);
					} else {
						$banner->header = array(
							'text' => $banner_item->header,
							'show' => true,
						);
					}
				}

				if ( ! is_serialized( $banner_item->accept_informational ) ) {
					$banner->accept_informational = array(
						'text' => $banner_item->accept_informational,
						'show' => true,
					);
				}

				if ( ! is_serialized( $banner_item->category_prefs ) ) {
					$banner->category_prefs = array(
						'text' => $banner_item->category_prefs,
						'show' => true,
					);
				}

				if ( ! is_serialized( $banner_item->category_stats ) ) {
					$banner->category_stats = array(
						'text' => $banner_item->category_stats,
						'show' => true,
					);
				}

				if ( ! is_serialized( $banner_item->category_all ) ) {
					$banner->category_all = array(
						'text' => $banner_item->category_all,
						'show' => true,
					);
				}

				$banner->use_box_shadow = true;
				$banner->use_logo       = 'hide';
				$banner->close_button   = false;
				$banner->save();
			}
		}

		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['compile_statistics'] ) && $wizard_settings['compile_statistics'] === 'yes-anonymous' ) {
			$wizard_settings['compile_statistics'] = 'yes';
			update_option( 'complianz_options_wizard', $wizard_settings );
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.0.0', '>=' ) ) {
		$warning_id         = 'upgraded_to_6';
		$dismissed_warnings = get_option( 'cmplz_dismissed_warnings', array() );
		if ( ! in_array( $warning_id, $dismissed_warnings ) ) {
			$dismissed_warnings[] = $warning_id;
			update_option( 'cmplz_dismissed_warnings', $dismissed_warnings );
			delete_transient( 'complianz_warnings' );
			delete_transient( 'complianz_warnings_admin_notices' );
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.0.2', '<' ) ) {
		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID );
				if ( $banner->banner_width == 476 ) {
					$banner->banner_width = 526;
					$banner->save();
				}
			}
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.0.8', '<' ) ) {
		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID );
				if ( $banner->use_categories === 'hidden' ) {
					$banner->use_categories = 'view-preferences';
					$banner->save();
				}
			}
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.1.0', '<' ) ) {
		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner                  = new CMPLZ_COOKIEBANNER( $banner_item->ID );
				$banner->legal_documents = true;
				$banner->save();
			}
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.1.4.1', '<' ) ) {
		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['create_banner_elementor'] ) ) {
			if ( $wizard_settings['create_banner_elementor'] === 'yes' ) {
				update_option( 'cmplz_elementor_banner_dropped', true );
			}
			$wizard_settings['create_banner_elementor'] = 'no';
			update_option( 'complianz_options_wizard', $wizard_settings );
			$post_id = get_option( 'cmplz_elementor_autogenerated' );
			$args    = array(
				'post_status' => 'draft',
				'ID'          => $post_id,
			);
			wp_update_post( $args );
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.2.2', '<' ) ) {
		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['data_request_forms'] ) ) {
			$wizard_settings['datarequest'] = $wizard_settings['data_request_forms'];
			unset( $wizard_settings['data_request_forms'] );
			update_option( 'complianz_options_wizard', $wizard_settings );
		}
	}

	// 6.3 United States Upgrade
	if ( $prev_version && version_compare( $prev_version, '6.3.0', '<' ) ) {
		$wizard_settings = get_option( 'complianz_options_wizard' );
		if ( isset( $wizard_settings['california'] ) && $wizard_settings['california'] === 'yes' ) {
			unset( $wizard_settings['california'] );
			$wizard_settings['us_states']['cal'] = 1;
		}

		$mapping_array = array(
			'1'  => array( 'first-lastname', 'address' ),
			'2'  => array( 'marital-status' ),
			'5'  => array( 'date-of-birth' ),
			'6'  => array( 'accountname-alias' ),
			'7'  => array( 'sex' ),
			'3'  => array( 'email' ),
			'15' => array( 'phone' ),
			'8'  => array( 'ip' ),
			'4'  => array( 'financial-information' ),
			'10' => array( 'medical' ),
			'11' => array( 'internet' ),
			'9'  => array( 'geo' ),
			'12' => array( 'photos' ),
			'13' => array( 'social-media' ),
			'14' => array( 'criminal' ),
		);
		foreach ( COMPLIANZ::$config->purposes as $key => $label ) {
			if ( ! isset( $wizard_settings[ $key . '_retain_data' ] ) ) {
				$wizard_settings[ $key . '_retain_data' ] = '1';
			}

			if ( isset( $wizard_settings[ $key . '_data_purpose' ] ) ) {
				$values = $wizard_settings[ $key . '_data_purpose' ];
				foreach ( $values as $value => $enabled ) {
					$enabled = $enabled === '1';
					if ( $enabled && isset( $mapping_array[ $value ] ) ) {
						$new_values = $mapping_array[ $value ];
						foreach ( $new_values as $new_value ) {
							$wizard_settings[ $key . '_data_purpose_us' ][ $new_value ] = 1;
						}
					}
				}
				unset( $wizard_settings[ $key . '_data_purpose' ] );
			}
			if ( isset( $wizard_settings[ $key . '_data_purpose_us' ] ) ) {
				$values = $wizard_settings[ $key . '_data_purpose_us' ];
				foreach ( $values as $value => $enabled ) {
					$enabled = $enabled === '1';
					if ( $enabled && $value === 'any-other' ) {
						unset( $wizard_settings[ $key . '_data_purpose_us' ][ $value ] );
					}
				}
			}
		}
		update_option( 'complianz_options_wizard', $wizard_settings );

		$banners = cmplz_get_cookiebanners();
		if ( $banners ) {
			foreach ( $banners as $banner_item ) {
				$banner = new CMPLZ_COOKIEBANNER( $banner_item->ID );
				$revoke = $banner_item->revoke;
				if ( is_serialized( $revoke ) ) {
					$revoke = unserialize( $revoke );
				}
				if ( isset( $revoke['text'] ) ) {
					$banner->revoke = $revoke['text'];
				}
				if ( isset( $revoke['show'] ) ) {
					if ( $revoke['show'] == '1' ) {
						$banner->manage_consent_options = 'hover-hide-mobile';
					} else {
						$banner->manage_consent_options = 'hide-everywhere';
					}
				}
				$banner->save();
			}
		}
	}

	if ( $prev_version && version_compare( $prev_version, '6.3.2', '<' ) ) {
		// upgrade statistics a/b testing
		$general_settings = get_option( 'complianz_options_settings' );
		if ( isset( $general_settings['a_b_testing'] ) && $general_settings['a_b_testing'] ) {
			$general_settings['a_b_testing_buttons'] = true;
		}
		update_option( 'complianz_options_settings', $general_settings );
	}

	if ( $prev_version && version_compare( $prev_version, '6.3.7', '<' ) ) {
		$wizard_settings                          = get_option( 'complianz_options_wizard', array() );
		$wizard_settings['enable_cookie_banner']  = 'yes';
		$wizard_settings['enable_cookie_blocker'] = 'yes';
		update_option( 'complianz_options_wizard', $wizard_settings );

		$settings              = get_option( 'complianz_options_settings', array() );
		$settings['safe_mode'] = $settings['disable_cookie_block'] ?? false;
		if ( isset( $settings['disable_cookie_block'] ) ) {
			unset( $settings['disable_cookie_block'] );
		}
		update_option( 'complianz_options_settings', $settings );
	}

	// regenerate css
	// $banners = cmplz_get_cookiebanners();
	// if ( $banners ) {
	// foreach ( $banners as $banner_item ) {
	// $banner = new CMPLZ_COOKIEBANNER( $banner_item->ID );
	// $banner->save();
	// }
	// }

	// ensure new capability
	if ( $prev_version && version_compare( $prev_version, '6.4.1', '<' ) ) {
		cmplz_add_manage_privacy_capability();
	}

	if ( $force || ( $prev_version && version_compare( $prev_version, '7.0.0', '<' ) ) ) {
		set_transient( 'cmplz_redirect_to_settings_page', true, HOUR_IN_SECONDS );
		// create new options array
		$options = get_option( 'cmplz_options', array() );
		if ( ! is_array( $options ) ) {
			$options = array();
		}

		$default_id = cmplz_get_default_banner_id();
		$banner     = new CMPLZ_COOKIEBANNER( $default_id );
		if ( $banner->disable_cookiebanner ) {
			cmplz_update_option_no_hooks( 'enable_cookie_banner', 'no' );
		}

		$license = get_site_option( 'cmplz_license_key' );
		if ( $license && ! is_multisite() ) {
			$options['license'] = $license;
		}

		$migrate_js_enabled = false;
		$old_settings_array = array( 'complianz_options_settings', 'complianz_options_wizard' );
		$wiz                = get_option( 'complianz_options_settings' );
		$use_country        = $wiz['use_country'] ?? false;
		foreach ( $old_settings_array as $old_setting ) {
			$settings = get_option( $old_setting, array() );
			foreach ( $settings as $id => $value ) {
				// if type is multicheckbox, change [key1 = 1, key2=1] structure to [key1, key2]
				$id    = strtolower( $id );
				$field = cmplz_get_field( $id );
				// tcf fields are not loaded yet, because the upgrade is not completed, so iab_enabled will always return false.
				// as a workaround we check if the id starts with tcf_
				if ( strpos( $id, 'tcf_' ) !== false ) {
					$field = $id === 'tcf_lspact' ? array( 'type' => 'radio' ) : array( 'type' => 'multicheckbox' );
				}
				if ( $field ) {
					$type = $field['type'];
					// regions is default radio, but multicheckbox when use_country is enabled
					if ( $id === 'regions' && $use_country ) {
						$type = 'multicheckbox';
					}
					if ( $type === 'multicheckbox' && is_array( $value ) ) {

						$value = array_filter(
							$value,
							static function ( $item ) {
								return $item == 1;
							}
						);
						$value = array_keys( $value );
					}
					if ( $id === 'which_personal_data_secure' ) {
						$new = array();
						if ( isset( $value['1'] ) || isset( $value['16'] ) ) {
							$new[] = '1';
						}
						if ( isset( $value['2'] ) || isset( $value['4'] ) ) {
							$new[] = '2';
						}
						if ( isset( $value['3'] ) || isset( $value['15'] ) ) {
							$new[] = '3';
						}
						if ( isset( $value['6'] ) ) {
							$new[] = '5';
						}
						if ( isset( $value['5'] ) ) {
							$new[] = '7';
						}
						if ( isset( $value['7'] ) ) {
							$new[] = '8';
						}
						if ( isset( $value['8'] ) || isset( $value['9'] ) || isset( $value['10'] ) || isset( $value['11'] ) || isset( $value['14'] ) || isset( $value['17'] ) ) {
							$new[] = '4';
						}
						$value = $new;
					}
					$options[ $id ] = $value;
				}
				if ( $id === 'enable_migrate_js' && $value ) {
					$migrate_js_enabled = true;
				}
			}
		}

		if ( ! empty( $options ) ) {
			update_option( 'cmplz_options', $options );
		}

		if ( $migrate_js_enabled ) {
			$dismissed_warnings = get_option( 'cmplz_dismissed_warnings', array() );
			if ( ! in_array( 'migrate_js', $dismissed_warnings ) ) {
				$dismissed_warnings[] = 'migrate_js';
				update_option( 'cmplz_dismissed_warnings', $dismissed_warnings, false );
			}
		}
		// set an activated time, which is used in the cookie scan and geo ip downloads
		update_option( 'cmplz_activation_time', strtotime( '-1 week' ), false );
	}

	// disable tcf for free users
	if ( $prev_version && version_compare( $prev_version, '7.0.3', '<' ) ) {
		$options = get_option( 'cmplz_options', array() );
		if ( ! defined( 'cmplz_premium' ) ) {
			$options['uses_ad_cookies_personalized'] = 'no';
			update_option( 'cmplz_options', $options );
		}
	}

	// Re-save all banners to regenerate CSS and clear caches
	if ( $prev_version && version_compare( $prev_version, '7.4.5', '<' ) ) {
		cmplz_resave_all_banners();
	}

	// Invalidate active checks scan UUID so that pre-HMAC-deploy webhooks
	// cannot be forged against a known UUID after the HMAC code ships.
	// cmplz_wsc_checks_scan_createdAt is preserved — cooldown stays intact,
	// preventing an unexpected checks scan + notification email on upgrade.
	if ( $prev_version && version_compare( $prev_version, '7.6.1', '<' ) ) {
		delete_option( 'cmplz_wsc_checks_scan_id' );
	}

	// regenerate cookie policy snapshot.
	update_option( 'cmplz_generate_new_cookiepolicy_snapshot', true, false );

	// always clear warnings cache on update
	delete_transient( 'complianz_warnings' );
	delete_transient( 'complianz_warnings_admin_notices' );
	do_action( 'cmplz_upgrade', $prev_version );
	update_option( 'cmplz-current-version', $new_version );
}

Directory Contents

Dirs: 20 × Files: 19
Name Size Perms Modified Actions
assets DIR
- drwxr-xr-x 2026-08-19 22:05:56
Edit Download
config DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
cookie DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
cron DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
DNSMPD DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
documents DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
gutenberg DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
languages DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
mailer DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
progress DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
rest-api DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
settings DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
templates DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
upgrade DIR
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
- drwxr-xr-x 2026-08-19 22:05:57
Edit Download
17.92 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
3.51 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
33.90 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
1.49 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
3.81 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
5.72 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
14.61 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
175 B lrw-r--r-- 2026-08-19 22:05:57
Edit Download
84.74 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
28 B lrw-r--r-- 2026-08-19 22:05:57
Edit Download
17.98 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
374 B lrw-r--r-- 2026-08-19 22:05:57
Edit Download
2.17 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
39.56 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
686 B lrw-r--r-- 2026-08-19 22:05:57
Edit Download
4.75 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
6.46 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
35.91 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
2.45 KB lrw-r--r-- 2026-08-19 22:05:57
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI