Title: PHP 8.0 Warning Message
Last modified: June 15, 2022

---

# PHP 8.0 Warning Message

 *  [gatfuts](https://wordpress.org/support/users/gatfuts/)
 * (@gatfuts)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-8-0-warning-message/)
 * Hello,
 * Since updated to PHP 8.0, I am getting a couple of PHP warning messages in my
   WP error_log related to Cookie Notice. This is using the latest v2.3.0 of the
   plugin.
    `PHP Warning: Undefined array key "refuse_opt" in /home/deleted/public_html/
   wp-content/plugins/cookie-notice/includes/frontend.php on line 173` `PHP Warning:
   Undefined array key "refuse_opt" in /home/deleted/public_html/wp-content/plugins/
   cookie-notice/includes/frontend.php on line 177`
 * I have set WP_DEBUG = true in my wp-config, but the warning messages do not appear
   on the frontend of the site.
    These PHP warning messages aren’t written to error_log
   when visiting the site, clicking on the cookie notice banner, or even saving 
   the Cookie Notice settings. So I don’t quite know what action is causing them
   to initiate, but they seem to occur randomly every few hours.
 * Line 173:
    `. ( $options['refuse_opt'] === true ? '<a href="#" id="cn-refuse-
   cookie" data-cookie-set="refuse" class="cn-set-cookie ' . $options['button_class'].(
   $options['css_class'] !== '' ? ' cn-button-custom ' . $options['css_class'] :'').'"
   aria-label="' . esc_attr( $options['refuse_text'] ) . '"' . ( $options['css_class']
   == '' ? ' style="background-color: ' . esc_attr( $options['colors']['button']).'"':'').'
   >' . esc_html( $options['refuse_text'] ) . '</a>' : '' )` Line 177: `' . ( $options['
   refuse_opt'] === true && $options['revoke_cookies'] == true ?`
 * Is there a quick and easy syntax fix to stop these warnings from filling up my
   log file?
 * Thank you

Viewing 1 replies (of 1 total)

 *  Thread Starter [gatfuts](https://wordpress.org/support/users/gatfuts/)
 * (@gatfuts)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-8-0-warning-message/#post-15775435)
 * No response yet, so went about fixing it myself. Change line 173 to:
    `. ( (isset(
   $options['refuse_opt']) && $options['refuse_opt'] === true) ? '<a href="#" id
   ="cn-refuse-cookie" data-cookie-set="refuse" class="cn-set-cookie ' . $options['
   button_class'] . ( $options['css_class'] !== '' ? ' cn-button-custom ' . $options['
   css_class'] : '' ) . '" aria-label="' . esc_attr( $options['refuse_text'] ) .'"'.(
   $options['css_class'] == '' ? ' style="background-color: ' . esc_attr( $options['
   colors']['button'] ) . '"' : '' ) . '>' . esc_html( $options['refuse_text'] ).'
   </a>' : '' )`
 * And line 177 to:
    `' . ( (isset($options['refuse_opt']) && $options['refuse_opt']
   === true && $options['revoke_cookies'] == true) ?`

Viewing 1 replies (of 1 total)

The topic ‘PHP 8.0 Warning Message’ is closed to new replies.

 * ![](https://ps.w.org/cookie-notice/assets/icon-256x256.png?rev=3549327)
 * [Compliance by Hu-manity.co](https://wordpress.org/plugins/cookie-notice/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-notice/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-notice/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-notice/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-notice/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-notice/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [gatfuts](https://wordpress.org/support/users/gatfuts/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/php-8-0-warning-message/#post-15775435)
 * Status: not resolved