Support » Fixing WordPress » Broken stats field in control panel of WP 2.1

  • Resolved domenSLO


    The following error appeared after I upgraded to 2.1

    Parse error: syntax error, unexpected ‘,’ in /home/savicd/public_html/wp/wp-includes/gettext.php(313) : eval()’d code on line 1

    Parse error: syntax error, unexpected ‘,’ in /home/savicd/public_html/wp/wp-includes/gettext.php(313) : eval()’d code on line 1

    Any clues? The stats are functioning (number of posts, number of comments), just this error won`t go away.


Viewing 10 replies - 1 through 10 (of 10 total)
  • me too, im having this problem with 2.1

    I have the same error. I disabled my localization (WP_LANG on wp-config.php) and the error is gone for the time being.

    wow. you are true, i desabled too my (WP_LANG)-it was in spanish- and its fine everything. but, well its not ok, i mean, my other blogs are ok, and this one was the only having this problem.



    I have the same problem, but I don’t want disable my spanish language file…



    sorry for double post. my solution below-



    I figured a temporary solution is a new ‘str_replace’ added to the ‘gettext.php’ in the wp-includes folder (function select_string()):

    // NEW AT LINE 306
    $string = str_replace(’,’,”;”,$string);

    That does it for me at the moment with a german localization.

    Rodrigo M


    Your solution works perfectly peter-noster.

    I’ ve published it in spanish in my blog.
    (solución en castellano):

    Thanks a lot



    Erm…can you put that in a more “verbose” mode? Not very good with php and when I added your line to the line 306 in the gettext.php, everything crashed.

    So..little more help pls. 🙂



    Here is the complete code of the function select_string. Replace this (make sure to do a back up):

    * Detects which plural form to take
    * @access private
    * @param n count
    * @return int array index of the right plural form
    function select_string($n) {
    $string = $this->get_plural_forms();
    $string = str_replace(‘nplurals’,”\$total”,$string);
    $string = str_replace(“n”,$n,$string);
    $string = str_replace(‘plural’,”\$plural”,$string);

    // New
    $string = str_replace(‘,’,”;”,$string);

    # poEdit doesn’t put any semicolons, which
    # results in parse error in eval
    $string .= ‘;’;

    $total = 0;
    $plural = 0;


    if ($plural >= $total) $plural = $total – 1;
    return $plural;

    Hope it works for you. Otherwise download my version of the gettext.php here and replace it:



    Thanks a million, peter-noster. Your file did the trick!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Broken stats field in control panel of WP 2.1’ is closed to new replies.