Title: Undefined index: REQUEST_METHOD
Last modified: May 15, 2018

---

# Undefined index: REQUEST_METHOD

 *  [Armands](https://wordpress.org/support/users/armandsdz/)
 * (@armandsdz)
 * [8 years ago](https://wordpress.org/support/topic/undefined-index-request_method-3/)
 * Hi!
 * If WP Cron is being called from CLI, variable $_SERVER[‘REQUEST_METHOD’] is not
   being set and then iThemes Security generates this all the time:
    PHP Notice:
   Undefined index: REQUEST_METHOD in /wp-content/plugins/better-wp-security/core/
   modules/ssl/class-itsec-ssl.php on line 72
 * Probably need to add additional check if this variable is set before checking
   it’s value.
 * Thanks!

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

 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [8 years ago](https://wordpress.org/support/topic/undefined-index-request_method-3/#post-10281201)
 * Nice one …
 * No need for an additional check. Simply change the order of the conditions in
   the class-itsec-ssl.php file from :
 *     ```
       } else if ( 'enabled' === $settings['require_ssl'] &&
                      'GET' === $_SERVER['REQUEST_METHOD'] &&
                        ( ! defined( 'WP_CLI' ) || ! WP_CLI ) ) {
       ```
   
 * to:
 *     ```
       } else if ( 'enabled' === $settings['require_ssl'] &&
                     ( ! defined( 'WP_CLI' ) || ! WP_CLI ) && 
                         'GET' === $_SERVER['REQUEST_METHOD'] ) {
       ```
   
 * This way the last condition won’t be evaluated in a CLI request.
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [8 years ago](https://wordpress.org/support/topic/undefined-index-request_method-3/#post-10389943)
 * Allthough unmentioned in the 7.0.0 Changelog this issue was fixed (exactly as
   described in my previous post) in the 7.0.0 release.

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

The topic ‘Undefined index: REQUEST_METHOD’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [nlpro](https://wordpress.org/support/users/nlpro/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/undefined-index-request_method-3/#post-10389943)
 * Status: not resolved