Title: Undefined variable $opts PHP warning
Last modified: April 10, 2023

---

# Undefined variable $opts PHP warning

 *  Resolved [Reuven Karasik](https://wordpress.org/support/users/kinging/)
 * (@kinging)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-opts-php-warning/)
 * Hello,
 * There’s a PHP Warning being raised:
 *     ```wp-block-code
       PHP Warning:  Undefined variable $opts in /var/www/html/.../wp-content/plugins/mailchimp-for-wp/integrations/woocommerce/admin-after.php on line 37
       ```
   
 * The code **does** seem to be using a variable called $opts but nothing defines
   this variable in the file.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-opts-php-warning/#post-16643046)
 * Hey [@kinging](https://wordpress.org/support/users/kinging/),
 * Can you please let us know which version of our plugin you are using and also
   the version of PHP enabled on your server?
 *  Thread Starter [Reuven Karasik](https://wordpress.org/support/users/kinging/)
 * (@kinging)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-opts-php-warning/#post-16643065)
 * Sure,
 *  I’m using the latest version of the plugin, with PHP 8.1.
 * You can see the variable being used here in the latest version:
 * [https://plugins.trac.wordpress.org/browser/mailchimp-for-wp/trunk/integrations/woocommerce/admin-after.php](https://plugins.trac.wordpress.org/browser/mailchimp-for-wp/trunk/integrations/woocommerce/admin-after.php)
 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-opts-php-warning/#post-16644791)
 * Hey [@kinging](https://wordpress.org/support/users/kinging/),
 * I’m trying to replicate this but unable to yet. Have you used any custom code
   to modify our plugin using filters?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Undefined variable $opts PHP warning’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

## Tags

 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 3 replies
 * 2 participants
 * Last reply from: [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-opts-php-warning/#post-16644791)
 * Status: resolved