[wp-trac] [WordPress Trac] #52117: hooks used in wp_mail suddenly stopped seeing constants after update.

WordPress Trac noreply at wordpress.org
Sat Dec 19 01:37:49 UTC 2020


#52117: hooks used in wp_mail suddenly stopped seeing constants after update.
-----------------------------------+-----------------------------
 Reporter:  jmarshall9120          |      Owner:  (none)
     Type:  defect (bug)           |     Status:  new
 Priority:  normal                 |  Milestone:  Awaiting Review
Component:  General                |    Version:
 Severity:  normal                 |   Keywords:
  Focuses:  template, performance  |
-----------------------------------+-----------------------------
 I'm getting this bug after updating to the latest wp version 5.6.

 It looks like my templates that used to work on wp_mail calls have broken.
 Its odd, because  I can get my constants that are declared in wp-
 config.php from my templates, but they don't seem to be recognized within
 in the pluggable php core anymore.  Have a look at the error:


 {{{
 ( ! ) Warning: Use of undefined constant SMTP_FROM - assumed 'SMTP_FROM'
 (this will throw an Error in a future version of PHP) in
 C:\xampp\apps\wordpress\htdocs\wp-content\themes\porto-child\functions.php
 on line 27
 Call Stack
 #       Time    Memory  Function        Location
 1       0.4016  415752  {main}( )       ...\index.php:0
 2       0.4018  417320  require( 'C:\xampp\apps\wordpress\htdocs\wp-blog-
 header.php' )  ...\index.php:17
 3       0.4020  428544  require_once( 'C:\xampp\apps\wordpress\htdocs\wp-
 load.php' )    ...\wp-blog-header.php:13
 4       0.4022  446648  require_once( 'C:\xampp\apps\wordpress\htdocs\wp-
 config.php' )  ...\wp-load.php:37
 5       0.4027  521712  require_once( 'C:\xampp\apps\wordpress\htdocs\wp-
 settings.php' )        ...\wp-config.php:109
 6       0.8790  50953056        do_action( )    ...\wp-settings.php:568
 7       0.8790  50953432        WP_Hook->do_action( )   ...\plugin.php:478
 8       0.8790  50953432        WP_Hook->apply_filters( )       ...\class-
 wp-hook.php:311
 9       0.9003  51087008        WC_Form_Handler::checkout_action( )
 ...\class-wp-hook.php:287
 10      0.9017  51333928        WC_Checkout->process_checkout( )
 ...\class-wc-form-handler.php:369
 11      1.2388  52568184        WC_Checkout->process_order_payment( )
 ...\class-wc-checkout.php:1171
 12      1.2393  52568560        WC_Gateway_COD->process_payment( )
 ...\class-wc-checkout.php:959
 13      1.2479  52577192
 Automattic\WooCommerce\Admin\Overrides\Order->update_status( )  ...\class-
 wc-gateway-cod.php:326
 14      1.2583  52562072
 Automattic\WooCommerce\Admin\Overrides\Order->save( )   ...\class-wc-
 order.php:333
 15      1.2797  52628984
 Automattic\WooCommerce\Admin\Overrides\Order->status_transition( )
 ...\class-wc-order.php:221
 16      1.3707  52677736        do_action( )    ...\class-wc-order.php:372
 17      1.3707  52678112        WP_Hook->do_action( )   ...\plugin.php:478
 18      1.3707  52678112        WP_Hook->apply_filters( )       ...\class-
 wp-hook.php:311
 19      1.3707  52679240        WC_Emails::send_transactional_email( )
 ...\class-wp-hook.php:287
 20      1.3845  53319584        do_action_ref_array( )  ...\class-wc-
 emails.php:170
 21      1.3845  53319584        WP_Hook->do_action( )   ...\plugin.php:544
 22      1.3845  53319584        WP_Hook->apply_filters( )       ...\class-
 wp-hook.php:311
 23      1.3845  53320712        WC_Email_New_Order->trigger( )  ...\class-
 wp-hook.php:287
 24      1.4179  53456800        WC_Email_New_Order->send( )     ...\class-
 wc-email-new-order.php:98
 25      1.4338  53677824        wp_mail( )      ...\class-wc-email.php:653
 26      1.4366  53681976        apply_filters( )
 ...\pluggable.php:352
 27      1.4366  53682384        WP_Hook->apply_filters( )
 ...\plugin.php:206
 28      1.4366  53683888        set_wp_mail_from( )     ...\class-wp-
 hook.php:287
 }}}

 If I hard code the smtp creds into my functions.php it works.  I've also
 tested on simple templates with out plugins, but this error message seemed
 the cleanest since it unequivocally shows the include wp-config.php call.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52117>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list