QA plugin caused 500 Internal Server Error

Plugin worked fine, I put 100+ questions in it and suddenly whole wordpress broke. Error report said ”PHP message: PHP Parse error: syntax error, unexpected ‘:wink:’ in /wp-content/plugins/qa/core/core.php on line 544″. I looked up a code through IDE and I found this function:

function the_title( $the_title ) {
global $wp_query;
//var_dump($wp_query);
if ( in_the_loop() && is_archive( 'question' ) ) {
$qa_class = ( is_question_answered() ) ? "qa-answered-icon" : "qa-unanswered-icon";
$qa_status = '<div class="qa-status-icon ' . $qa_class . '"></div>';

return ();
} else {
return ();
}
}

Line 544 is return (); statement and it’s invalid code according to IDE syntax checker.

Can you look it up and solve this issue?

  • Luís Lopes
    • QA

    Hi Gabriel ,

    Hope you’re doing well today!

    You made modifications in the code, the original one is:

    function the_title( $the_title ) {

    global $wp_query;

    //var_dump($wp_query);

    if ( in_the_loop() && is_archive( 'question' ) ) {

    $qa_class = ( is_question_answered() ) ? "qa-answered-icon" : "qa-unanswered-icon";

    $qa_status = '<div class="qa-status-icon ' . $qa_class . '"></div>';

    return $qa_status . $the_title;

    } else {

    return $the_title;

    }

    }

    I am unaware what modifications were made and their purpose, however change both “returns” from:

    return ();

    to

    return ;

    I hope this information has been helpful. If I can help you in this or other questions, please let me know!

    Cheers, Luís