Title: Subscription Widget exception errors under PHP 7.3
Last modified: May 8, 2019

---

# Subscription Widget exception errors under PHP 7.3

 *  [Michael](https://wordpress.org/support/users/eizzumdm/)
 * (@eizzumdm)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/)
 * I guess we will have to update to MailPoet 3 now, once we resolve a conflict 
   with one other plugin (WP Cassify). Here is the error that MailPoet 2 generates
   with every page load that has the embedded MailPoet Subscription Form widget 
   under PHP 7.3 and WordPress 5.2.
 * Exception: Uncaught exception ‘Exception’ with message ‘Template ‘templates/form/
   web/widgets/#type.html’ not found !’ in wp-content/plugins/wysija-newsletters/
   helpers/render_engine.php:723
 * Sample stack trace
    in WYSIJA_help_render_engine::_loadTemplate called at wp-
   content/plugins/wysija-newsletters/helpers/render_engine.php in WYSIJA_help_render_engine::
   _parse called at wp-content/plugins/wysija-newsletters/helpers/render_engine.
   php in WYSIJA_help_render_engine::render called at wp-content/plugins/wysija-
   newsletters/helpers/form_engine.php in WYSIJA_help_form_engine::render_web_body
   called at wp-content/plugins/wysija-newsletters/helpers/form_engine.php in WYSIJA_help_form_engine::
   render_web called at wp-content/plugins/wysija-newsletters/views/front/widget_nl.
   php in WYSIJA_view_front_widget_nl::display called at wp-content/plugins/wysija-
   newsletters/widgets/wysija_nl.php in WYSIJA_NL_Widget::widget called at wp-includes/
   class-wp-widget.php in WP_Widget::display_callback called at wp-includes/widgets.
   php in dynamic_sidebar called at wp-content/themes/modernize/footer.php in require_once
   called at wp-includes/template.php in load_template called at wp-includes/template.
   php in locate_template called at wp-includes/general-template.php in get_footer
   called at wp-content/themes/modernize/page.php in include called at wp-includes/
   template-loader.php in require_once called at wp-blog-header.php in require called
   at index.php

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

 *  [22-7ths](https://wordpress.org/support/users/22-7ths/)
 * (@22-7ths)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-11693502)
 * Yes, this error only shows up when you include widget code on a given page. Didn’t
   think it was Mailpoet-2 at first as the plugin worked fine on another 7.3 site–
   but that site doesn’t display the subscribe widget.
 * Did you happen to pinpoint the code problem? Not sure why it’s feeding it ‘#type.
   html’ as the file? :
 *     ```
               foreach($this->_template_path as $path) {
                   if ($template && file_exists ("$path/$template")) {
                       $file = "$path/$template";
                       return $this->_loadFile ($file);
                   }
               }
               throw new Exception ("Template '$template' not found !");
               return false;
       ```
   
 * $template = “#type.html”?
    `PHP Fatal error: Uncaught Exception: Template 'templates/
   form/web/widgets/#type.html' not found !` Hmmm.
 * I also get a compilation warning apparently before this error each time – not
   sure if related. Error on some PCRE here:
 * `if (preg_match ("'".self::_VAR.self::_MODIFIER."'", $value, $is_var)) {`
    (^
   note – I replaced the 2 backtick characters with single-quotes as the forum editor
   switches code display on off.
 * Log entry: “PHP Warning: preg_match(): Compilation failed: invalid range in character
   class at offset 11”
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
 *  [22-7ths](https://wordpress.org/support/users/22-7ths/)
 * (@22-7ths)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-11693676)
 * Fixed/Solved entire problem – it was the `preg_match` as noted above:
 * LINE 43: /wp-content/plugins/wysija-newsletters/helpers/render_engine.php
 * Look for the “w-” (column 30)-
    Original code: `const _VAR = '([\$#])([\w-_\.]
   +)';`
 * Add a back slash “\” before the “-”
    Updated code: `const _VAR = '([\$#])([\w\-_\.]
   +)';`
 * In php 7.3 `preg_match` needs the dash (“-“) escaped.
 * My widget now works as well.
    No more fatal error exceptions (nor warnings).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
    -  This reply was modified 6 years, 11 months ago by [22-7ths](https://wordpress.org/support/users/22-7ths/).
 *  [Thomas Blomberg](https://wordpress.org/support/users/thomasdk81/)
 * (@thomasdk81)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-11697885)
 * Thank you [@22-7ths](https://wordpress.org/support/users/22-7ths/) !
 *  [Webprom Design](https://wordpress.org/support/users/webprom/)
 * (@webprom)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-11752489)
 * Thank you [@22-7ths](https://wordpress.org/support/users/22-7ths/) ! It works!
 *  [Hirusha Cooray](https://wordpress.org/support/users/hirushacooray/)
 * (@hirushacooray)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-11815061)
 * [@22-7ths](https://wordpress.org/support/users/22-7ths/) It works. Thanks!
 *  [Ghyslain](https://wordpress.org/support/users/ghyslain/)
 * (@ghyslain)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-12041637)
 * Thanks [@eizzumdm](https://wordpress.org/support/users/eizzumdm/) ! it works.
   
   Does someone know if Mailpoet has fixed the issue ?

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

The topic ‘Subscription Widget exception errors under PHP 7.3’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wysija-newsletters_ffddcc.svg)
 * [MailPoet Newsletters (Previous)](https://wordpress.org/plugins/wysija-newsletters/)
 * [Support Threads](https://wordpress.org/support/plugin/wysija-newsletters/)
 * [Active Topics](https://wordpress.org/support/plugin/wysija-newsletters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wysija-newsletters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wysija-newsletters/reviews/)

 * 6 replies
 * 6 participants
 * Last reply from: [Ghyslain](https://wordpress.org/support/users/ghyslain/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/subscription-widget-exception-errors-under-php-7-3/#post-12041637)
 * Status: not resolved