Title: wordfence syntax error
Last modified: August 21, 2016

---

# wordfence syntax error

 *  [MaryInd](https://wordpress.org/support/users/maryind/)
 * (@maryind)
 * [12 years ago](https://wordpress.org/support/topic/wordfence-syntax-error/)
 * public_html/wp-content/plugins/wordfence/lib/wordfenceClass.php on line 183
 * in facebook and google webmaster preview of my homepage I see this error.. I 
   tried to re install and to cancell all plugins.. nothing.
 * could you help me?
 * thanks
    Mary
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

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

 *  Thread Starter [MaryInd](https://wordpress.org/support/users/maryind/)
 * (@maryind)
 * [12 years ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924680)
 * the homepage is this one.
    [servizio indicizzazione](http://servizioindicizzazione.com)
 * If you try to write it on your wall in face.. [http://servizioindicizzazione.com](http://servizioindicizzazione.com)
   you see the error and not the main page.
 *  Plugin Author [Mark Maunder](https://wordpress.org/support/users/mmaunder/)
 * (@mmaunder)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924818)
 * Please post the full error. I don’t see anything that would cause this in 5.0.7
   which is what you’re presumably running when you reported this:
 * [https://plugins.trac.wordpress.org/browser/wordfence/tags/5.0.7/lib/wordfenceClass.php](https://plugins.trac.wordpress.org/browser/wordfence/tags/5.0.7/lib/wordfenceClass.php)
 * Thanks,
 * Mark.
 *  Thread Starter [MaryInd](https://wordpress.org/support/users/maryind/)
 * (@maryind)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924824)
 * Thank you so much for your reply, Mark.
 * The problem is that I changed my api key several times but the problem is still
   there.
 * Anytime I reactivate Wordfence I delete all data and all tables.. all cache..
   but the problem is still there.
 * It’s unbelieveble.
    If in facebook I post the link [http://servizioindicizzazione.com](http://servizioindicizzazione.com)
   It shows the error.. and not my homepage.. the same in google webmaster..
 * but for example if I analyze my homepage with google speed insight it returns
   my homepage..
 * Moreover this is the error you asked me..
 * : syntax error, unexpected $end in /home/servieom/public_html/wp-content/plugins/
   wordfence/lib/wordfenceClass.php on line 183
 * but I checked it and there is no error along that line..
    (considering the normal
   one)
 * And finally my hosting says it’s not their problem but a problem of my own website..
   
   so what’s wrong with my own website.. Wordfence work well and do not advert about
   any mistakes..
 * In any case thank you very much for your attention.
    You’re great.
 * Kind regards,
 * Mary
 *  Plugin Author [Mark Maunder](https://wordpress.org/support/users/mmaunder/)
 * (@mmaunder)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924826)
 * Hi Mary,
 * OK lets try to keep this short and focused on the issue. Please use your CPanel
   to open the file:
 * /home/servieom/public_html/wp-content/plugins/wordfence/lib/wordfenceClass.php
 * Go to line 183 and post that line and a few lines before and after here. I want
   to examine them.
 * That Wordfence file does not have a variable $end so it sounds like your file
   has been modified.
 * Regards,
 * Mark.
 *  Thread Starter [MaryInd](https://wordpress.org/support/users/maryind/)
 * (@maryind)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924827)
 * Hi Mark,
    thank you so much. these are the lines. 183 in bold
 *     ```
       } catch(Exception $e){
       			wordfence::status(4, 'error', "Could not fetch vulnerability patterns in scheduled job: " . $e->getMessage());
       		}
   
       		$wfdb->queryWrite("delete from $p"."wfLocs where ctime < unix_timestamp() - %d", WORDFENCE_MAX_IPLOC_AGE);
       		$wfdb->truncate($p . "wfBadLeechers"); //only uses date that's less than 1 minute old
       		$wfdb->queryWrite("delete from $p"."wfBlocks where (blockedTime + %s < unix_timestamp()) and permanent=0", wfConfig::get('blockedTime'));
       		$wfdb->queryWrite("delete from $p"."wfCrawlers where lastUpdate < unix_timestamp() - (86400 * 7)");
   
       		$count = $wfdb->querySingle("select count(*) as cnt from $p"."wfHits");
       		if($count > 20000){
       <strong>183</strong>			$wfdb->truncate($p . "wfHits"); //So we don't slow down sites that have very large wfHits tables
       		} else if($count > 2000){
       			$wfdb->queryWrite("delete from $p"."wfHits order by id asc limit %d", ($count - 100));
       		}
   
       /*
       		$count6 = $wfdb->querySingle("select count(*) as cnt from $p"."wfPerfLog");
       		if($count6 > 20000){
       			$wfdb->truncate($p . "wfPerfLog"); //So we don't slow down sites that have very large wfHits tables
       		} else if($count6 > 2000){
       			$wfdb->queryWrite("delete from $p"."wfPerfLog order by id asc limit %d", ($count6 - 100));
       		}
       ```
   
 * _[Moderator Note: Please post code & markup between backticks or use the code
   button. Your posted code may now have been permanently damaged by the forum’s
   parser.]_

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

The topic ‘wordfence syntax error’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [MaryInd](https://wordpress.org/support/users/maryind/)
 * Last activity: [11 years, 12 months ago](https://wordpress.org/support/topic/wordfence-syntax-error/#post-4924827)
 * Status: not resolved