Title: Receiving a PHP Warning
Last modified: May 24, 2018

---

# Receiving a PHP Warning

 *  Resolved [linzD](https://wordpress.org/support/users/linzd/)
 * (@linzd)
 * [8 years ago](https://wordpress.org/support/topic/receiving-a-php-warning/)
 * Our site is throwing this warning.
 * PHP Warning: A non-numeric value encountered in /home/benefacto/public_html/wp-
   content/plugins/simple-urls/plugin.php on line 203
 * Which is related to this line:
 * update_post_meta( $wp_query->post->ID, ‘_surl_count’, $count + 1 );
 * I think this is because $count is probably a string, not an integer.
 * Please fix.

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

 *  [Andrea Rennick](https://wordpress.org/support/users/andrea_r/)
 * (@andrea_r)
 * [8 years ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10318552)
 * Thanks, we’ll pass this on to the devs.
 *  Thread Starter [linzD](https://wordpress.org/support/users/linzd/)
 * (@linzd)
 * [8 years ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10318557)
 * Ta
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [8 years ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10325118)
 * I’ve filed an issue and pull request for this:
 * – [https://github.com/copyblogger/simple-urls/issues/10](https://github.com/copyblogger/simple-urls/issues/10)
   –
   [https://github.com/copyblogger/simple-urls/pull/11](https://github.com/copyblogger/simple-urls/pull/11)
 * I don’t have a timeline for any plugin updates, but if you’d like to test a version
   with the fix it’s [available here](https://github.com/nickcernis/simple-urls/archive/fix-non-numeric-warning.zip).
 * Thank you again for the report, linzD.
 *  [chrispking](https://wordpress.org/support/users/chrispking/)
 * (@chrispking)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10391034)
 * Hi
 * I was getting the same intermittent error outlined by linzD.
 * I’ve uploaded the version provided by Nick. When I activated it, I got a Fatal
   Error warning. I proceeded to go into Settings > Permalinks and save. It seems
   to be working.
 * Do you know when you’ll push a new tested version of the plug-in?
 * Thanks in advance.
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10391055)
 * Hi, [@chrispking](https://wordpress.org/support/users/chrispking/). I don’t have
   a release date for this yet. Thank you for testing and confirming the fix worked,
   though!
 *  [chrispking](https://wordpress.org/support/users/chrispking/)
 * (@chrispking)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479137)
 * Hi [@modernnerd](https://wordpress.org/support/users/modernnerd/) & [@andrea_r](https://wordpress.org/support/users/andrea_r/)
 * I’m getting the php warnings again while using the version 0.9.7 which I downloaded
   from above. It’s happened twice in the space of a few hours while I’ve been working
   on one of my sites. Both times I’ve gone into Settings > Permalinks and saved.
 * Using Simple URLs on three sites built with Studiopress. No doubt losing revenue
   now.
 * Is there a proper fix coming soon? Or should I find an alternative? Will it be
   supported going forward with the change of Studiopress ownership?
 * I’m using WordPress 4.9.7. Full text of the warning message:
 * Warning: A non-numeric value encountered in /home/[mysite]/public_html/wp-content/
   plugins/simple-urls/plugin.php on line 203
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/[my site]/public_html/wp-content/plugins/simple-urls/plugin.php:203)
   in /home/[mysite]/public_html/wp-content/plugins/simple-urls/pluggable.php on
   line 1219
 * Thanks
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479174)
 * Hi, [@chrispking](https://wordpress.org/support/users/chrispking/).
 * Sorry that you’re still encountering this. Please could you confirm that line
   202 of simple-urls/plugin.php looks like this?
 * `$count = isset( $wp_query->post->_surl_count ) ? (int) $wp_query->post->_surl_count:
   0;`
 * You should no longer see the above error if that line from the fix is in place.
 * You’ll continue to see new themes and plugins from StudioPress, and existing 
   themes and plugins will be supported and updated. I don’t have a timeline for
   the Simple URLs update just yet.
 *  [chrispking](https://wordpress.org/support/users/chrispking/)
 * (@chrispking)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479233)
 * Hi Nick
 * Thanks for your quick response, much appreciated.
 * To answer your question. Yes and No!
 * I have two versions of Simple URLs appearing:
 * 1. Editing simple-urls-fix-non-numeric-warning/plugin.php (inactive)
    Select 
   plugin to edit:
 * $count = isset( $wp_query->post->_surl_count ) ? (int) $wp_query->post->_surl_count:
   0;
 * 2. Editing simple-urls/plugin.php (active)
 * $count = isset( $wp_query->post->ID ) ? get_post_meta( $wp_query->post->ID, ‘
   _surl_count’, true ) : 0;
 * I assume the patched version did not overwrite the previous version and it’s 
   inactive.
 * Help! What should I do?
 * Thanks!
 * Chris
 *  [chrispking](https://wordpress.org/support/users/chrispking/)
 * (@chrispking)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479241)
 * To clarify, I have two versions appearing in the Plug-Ins > Editor (drop down).
 * But only one version in the standard back-end of WP which is showing 0.9.7.
 * Thanks
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479275)
 * Thanks for your research, [@chrispking](https://wordpress.org/support/users/chrispking/)!
 * The active version is missing the patch, just as you suggested.
 * You could:
 * 1. Take a full site backup.
    2. Deactivate the plugin. 3. Delete the `wp-content/
   plugins/simple-urls` folder using an FTP application or your web host’s file 
   manager. 4. With FTP, rename the folder at `wp-content/plugins/simple-urls-fix-
   non-numeric-warning` to `simple-urls`. 5. Reactivate the plugin.
 * That will make the folder containing the fix the active version.
 *  [chrispking](https://wordpress.org/support/users/chrispking/)
 * (@chrispking)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479794)
 * Hi [@modernnerd](https://wordpress.org/support/users/modernnerd/)
 * Thanks.
 * Have you received many other reports from publishers experiencing similar issues?
 * I’ve recently moved hosts to SiteGround and my folder structure looks similar
   to the one outlined by linzD. Would hosting configuration cause something like
   this to occur?
 * If I can do the above quickly (I’m not technical) I’ll do that, otherwise I’ll
   look for an alternative.
 * Thanks for your help.
 * Chris
 *  [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479832)
 * We’ve not seen many reports of this so far, but it can occur on sites running
   PHP 7.1 or higher for links with a visit count of 0.
 * If your host updated to PHP 7.1+, that would explain why the error’s appearing
   now when it was not present before.
 * SiteGround offers a file manager in their control panel if you did not want to
   use FTP to delete/rename the plugin folders: [https://www.siteground.com/tutorials/cpanel/file-manager/](https://www.siteground.com/tutorials/cpanel/file-manager/)

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

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

 * ![](https://ps.w.org/simple-urls/assets/icon-256x256.png?rev=2765250)
 * [Simple URLs - Link Cloaking, Product Displays, and Affiliate Link Management](https://wordpress.org/plugins/simple-urls/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-urls/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-urls/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-urls/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-urls/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-urls/reviews/)

## Tags

 * [StudioPress](https://wordpress.org/support/topic-tag/studiopress/)

 * 12 replies
 * 4 participants
 * Last reply from: [Nick C](https://wordpress.org/support/users/modernnerd/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/receiving-a-php-warning/#post-10479832)
 * Status: resolved