Title: PHP Warning
Last modified: November 26, 2022

---

# PHP Warning

 *  Resolved [mojamba](https://wordpress.org/support/users/mojamba/)
 * (@mojamba)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/)
 * I get the following in my errors_log file:
 * Undefined array key “REQUEST_METHOD” in …/wp-content/plugins/pretty-link/app/
   controllers/PrliAppController.php on line 33
 * Not a big deal but would be good if you fixed that for the next update.

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

 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16242150)
 * Hi there,
 * Could you please let me know what action happens right before this warning is
   triggered? In most cases, the request method should be available unless the site
   is being accessed outside of the browser.
 * Kind regards,
 *  Thread Starter [mojamba](https://wordpress.org/support/users/mojamba/)
 * (@mojamba)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16242754)
 * I cannot answer your question because it is a warning that I am merely noticing
   in my error_log file. I wouldn’t notice it browsing my site anyway as I don’t
   have PHP errors set for that. But it should be a simple fix on your end (check
   that exists first I would think).
 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16269109)
 * Hi there,
 * Unfortunately, I haven’t been able to replicate this. Are you using a server-
   side cron instead of the WordPress cron? However, I’ll get with our development
   team about adding a check to ensure that $_SERVER[‘REQUEST_METHOD’] is set before
   using it.
 * Kind regards,
 *  Thread Starter [mojamba](https://wordpress.org/support/users/mojamba/)
 * (@mojamba)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16269190)
 * Yes, actually, I am using a server-side cron.
 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16270055)
 * Hi there,
 * Thank you for checking that. In the meantime, could you try adding this line 
   to your site’s wp-config.php file and see if that prevents those notices from
   getting logged?
 * `$_SERVER['REQUEST_METHOD'] = array_key_exists( 'REQUEST_METHOD', $_SERVER ) ?
   $_SERVER['REQUEST_METHOD'] : 'GET';`
 * Kind regards,
 *  Thread Starter [mojamba](https://wordpress.org/support/users/mojamba/)
 * (@mojamba)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16271830)
 * I added it but still getting the error notices.
 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16282980)
 * Hi there,
 * Thank you for trying that. If you have access to your site’s filesystem through
   something like cPanel or FTP, could you please open the PrliAppController.php
   file under wp-content/plugins/pretty-link/controllers/ and then on line 33 replace
   this line:
 * `if($_SERVER["REQUEST_METHOD"] == 'GET' && !is_admin()) {`
 * With this:
 * `if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER["REQUEST_METHOD"] == 'GET' &&!
   is_admin()) {`
 * And see if that removes the notice?
 * Kind regards,
 *  Thread Starter [mojamba](https://wordpress.org/support/users/mojamba/)
 * (@mojamba)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16287610)
 * Yes, that seems to have fixed things.
 *  [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * (@tylerthedude)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16355361)
 * Hi there,
 * I just wanted to follow up on this thread and let you know that we’ve released
   a new version of Pretty Links that includes a fix for this warning, so if you
   haven’t already please upgrade to this version (3.3.0) and the warning will no
   longer be logged going forward.
 * Kind regards,

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

The topic ‘PHP Warning’ is closed to new replies.

 * ![](https://ps.w.org/pretty-link/assets/icon-256x256.png?rev=2503434)
 * [PrettyLinks - Affiliate Links, Link Branding, Link Tracking, Marketing and Stripe Payments Plugin](https://wordpress.org/plugins/pretty-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pretty-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pretty-link/)
 * [Active Topics](https://wordpress.org/support/plugin/pretty-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pretty-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pretty-link/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Tyler](https://wordpress.org/support/users/tylerthedude/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-386/#post-16355361)
 * Status: resolved