Title: faulty code in StatCounter causes php error
Last modified: November 20, 2017

---

# faulty code in StatCounter causes php error

 *  Resolved [abzu2](https://wordpress.org/support/users/abzu2/)
 * (@abzu2)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/)
 * Have installed the BPS Pro plugin that monitors numerous functions of my site.
   Receiving numerous php errors reported related to the StatCounter. Posted the
   issue in the [AIT Forum](https://forum.ait-pro.com/forums/topic/how-to-troubleshoot-php-errors-php-errors-in-your-php-error-log/page/15/#post-34583)
   and the reply is as follows:
 * These php errors look like standard coding issues that need to be fixed in the
   stats-counter plugin. PHP Warning errors are not considered critical errors, 
   but you should get them fixed ASAP. Send/Post these PHP errors to the stats-counter
   plugin folks so they can take care of whatever coding issues need to be fixed.
 * Sample of current StatCounter errors on my site:
 *     ```
       [19-Nov-2017 12:28:55 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND option_value < 1511094531' at line 1 for query SELECT option_name FROM qxd_options WHERE option_name LIKE '_transient_timeout_wpsso_%'; AND option_value < 1511094531; made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WpssoUtil->delete_expired_db_transients, WpssoUtil->get_db_transient_keys
       [19-Nov-2017 12:29:14 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND option_value < 1511094552' at line 1 for query SELECT option_name FROM qxd_options WHERE option_name LIKE '_transient_timeout_wpsso_%'; AND option_value < 1511094552; made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WpssoUtil->delete_expired_db_transients, WpssoUtil->get_db_transient_keys
       [19-Nov-2017 12:52:29 UTC] PHP Warning:  preg_replace(): Compilation failed: nothing to repeat at offset 90 in /home3/abzutwoc/public_html/wp-content/plugins/jetpack/class.photon.php on line 331
       [19-Nov-2017 18:16:12 UTC] PHP Warning:  unlink(/home3/abzutwoc/public_html/wp-content/plugins/stats-counter/flag_init): No such file or directory in /home3/abzutwoc/public_html/wp-content/plugins/stats-counter/wpadm-class-wp.php on line 778
       [19-Nov-2017 20:52:18 UTC] PHP Warning:  preg_replace(): Compilation failed: nothing to repeat at offset 90 in /home3/abzutwoc/public_html/wp-content/plugins/jetpack/class.photon.php on line 331
       [19-Nov-2017 21:45:05 UTC] PHP Warning:  unlink(/home3/abzutwoc/public_html/wp-content/plugins/stats-counter/flag_init): No such file or directory in /home3/abzutwoc/public_html/wp-content/plugins/stats-counter/wpadm-class-wp.php on line 778
       [19-Nov-2017 22:14:11 UTC] PHP Warning:  unlink(/home3/abzutwoc/public_html/wp-content/plugins/stats-counter/flag_init): No such file or directory in /home3/abzutwoc/public_html/wp-content/plugins/stats-counter/wpadm-class-wp.php on line 778
       [20-Nov-2017 00:28:21 UTC] PHP Warning:  unlink(/home3/abzutwoc/public_html/wp-content/plugins/stats-counter/flag_init): No such file or directory in /home3/abzutwoc/public_html/wp-content/plugins/stats-counter/wpadm-class-wp.php on line 778
       [20-Nov-2017 09:36:38 UTC] PHP Warning:  unlink(/home3/abzutwoc/public_html/wp-content/plugins/stats-counter/flag_init): No such file or directory in /home3/abzutwoc/public_html/wp-content/plugins/stats-counter/wpadm-class-wp.php on line 778
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffaulty-code-in-statcounter-causes-php-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/#post-9703559)
 * Hi,
 * I’m the author of WPSSO. I just wanted to write a quick note to let you know 
   the SQL syntax issue quoted above (the extra semi-colon) is fixed in the current
   stable version of WPSSO. 😉
 * js.
 *  Thread Starter [abzu2](https://wordpress.org/support/users/abzu2/)
 * (@abzu2)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/#post-9703574)
 * Thank you for your reply. Just checked and I had v3.48.3. Just updated it to 
   3.48.5
 *  [StatCounterSupport](https://wordpress.org/support/users/statcountersupport/)
 * (@statcountersupport)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/#post-9703706)
 * Hi,
 * Thanks for your message and patience.
 * Are you still seeing this error?
 * _[ [Signature deleted](https://wordpress.org/support/guidelines/#do-not-spam)]_
    -  This reply was modified 6 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 *  Thread Starter [abzu2](https://wordpress.org/support/users/abzu2/)
 * (@abzu2)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/#post-9756114)
 * Solved. Thank you.

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

The topic ‘faulty code in StatCounter causes php error’ is closed to new replies.

 * ![](https://ps.w.org/official-statcounter-plugin-for-wordpress/assets/icon.svg?
   rev=1988081)
 * [StatCounter - Free Real Time Visitor Stats](https://wordpress.org/plugins/official-statcounter-plugin-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/official-statcounter-plugin-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/official-statcounter-plugin-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/official-statcounter-plugin-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/official-statcounter-plugin-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/official-statcounter-plugin-for-wordpress/reviews/)

## Tags

 * [code error](https://wordpress.org/support/topic-tag/code-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 4 replies
 * 3 participants
 * Last reply from: [abzu2](https://wordpress.org/support/users/abzu2/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/faulty-code-in-statcounter-causes-php-error/#post-9756114)
 * Status: resolved