Closed n-dawson closed 1 year ago
Hello @n-dawson Thanks for you reporting. We will fix this soon
Hello @n-dawson New version was released and bug was fixed
I'm still getting this error on the lists page. Version 1.9.9
Fatal error: Uncaught Error: Call to undefined function mg_api_get_region() in /app/web/wp-content/plugins/mailgun/mailgun.php:222
Stack trace:
#0 /app/web/wp-content/plugins/mailgun/mailgun.php(286): Mailgun->api_call('lists', Array, 'GET')
#1 /app/web/wp-content/plugins/mailgun/includes/lists-page.php(38): Mailgun->get_lists()
#2 /app/web/wp-content/plugins/mailgun/includes/admin.php(234): include('/app/web/wp-con...')
#3 /app/web/wp-includes/class-wp-hook.php(324): MailgunAdmin->lists_page('')
#4 /app/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#5 /app/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /app/web/wp-admin/admin.php(259): do_action('admin_page_mail...')
#7 {main}
thrown in /app/web/wp-content/plugins/mailgun/mailgun.php on line 222
When you activate the Mailgun plugin alongside any other plugin which attempts to override
wp_mail()
, there's a fatal error on the Settings -> Mailgun Lists page:_Fatal error: Uncaught Error: Call to undefined function mg_api_getregion() in /Users/nathan/Local Sites/mailgun/app/public/wp-content/plugins/mailgun/mailgun.php:221
The line in question is part of the
api_call()
method.mg_api_get_region()
is declared within mg-filter.php but it's possible to end up in a situation where that file is never loaded.From the main plugin file, starting on line 83:
If wp_mail() is declared elsewhere, wp-mail-api.php and in turn mg-filter.php aren't included.
This means the plugin is able to operate in a half loaded state where it's relying on functions that aren't available.
Steps to reproduce:
wp_mail()
. I've included code below. Note that order is important. The plugin has to load BEFORE Mailgun and since they're loaded alphabetically by file/folder name, use something like abc.phpBarebones plugin code: