Title: Undefined array key &#8220;rest_route&#8221;
Last modified: June 25, 2025

---

# Undefined array key “rest_route”

 *  Resolved [Devonto](https://wordpress.org/support/users/devonto/)
 * (@devonto)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-rest_route/)
 * Hello,
 * I’m seeing a PHP warning to the PHP log when browsing the admin of a site.
 *     ```wp-block-code
       PHP message: PHP Warning: Undefined array key "rest_route" in .../public/wp-content/plugins/stellarpay/src/Integrations/WooCommerce/FeatureSupport/ReactBasedPaymentSettings.php on line 114
       ```
   
 * Checking the source within the `isWoocommerceAdminPaymentsProviderRestApiRequest()`
   function on line 110, there’s an assumption that `$GLOBALS['wp']->query_vars['
   rest_route']` exists on line 114.
 * Above this line, there is a check of:
 *     ```wp-block-code
       if (!WC()->is_rest_api_request()) {    return false;}
       ```
   
 * Can this be expanded to also check the variable exists? e.g.
 *     ```wp-block-code
       if (!WC()->is_rest_api_request() || empty( $GLOBALS['wp']->query_vars['rest_route'] )) {    return false;}
       ```
   

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

 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-rest_route/#post-18528101)
 * Hi [@devonto](https://wordpress.org/support/users/devonto/),
 * Glad you reached out, and thanks for reporting this!
   While we haven’t been able
   to reproduce the issue on our end, we’ve prepared a fix to address it proactively,
   and it should be released soon. I’ll circle back here once it’s been deployed.
 * We appreciate your patience!
 *  Thread Starter [Devonto](https://wordpress.org/support/users/devonto/)
 * (@devonto)
 * [11 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-rest_route/#post-18528120)
 * Thanks, appreciated!

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

The topic ‘Undefined array key “rest_route”’ is closed to new replies.

 * ![](https://ps.w.org/stellarpay/assets/icon-256x256.jpg?rev=3207188)
 * [StellarPay - Stripe Payment Gateway for WooCommerce](https://wordpress.org/plugins/stellarpay/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stellarpay/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stellarpay/)
 * [Active Topics](https://wordpress.org/support/plugin/stellarpay/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stellarpay/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stellarpay/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Devonto](https://wordpress.org/support/users/devonto/)
 * Last activity: [11 months, 2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-rest_route/#post-18528120)
 * Status: resolved