Anspress Deprecated Code

301 viewsIssuesdeprecated
0

When is there going to be an update to address depreciated lines of code? I’m seeing the warnings throughout the Anspress pages.
Ex: Deprecated: setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated in /home8/uptaskpr/public_html/wp-content/plugins/anspress-question-answer/includes/class/class-session.php on line 96
Or is there a way I can resolve errors like this, on my end?
Thank you

Answered question
0

To temporarily resolve the “Deprecated” error you’re encountering, you might try the following:

  1. Update the Plugin: Ensure you are using the latest version of Anspress and any related plugins.
  2. Modify the Source Code: If you have knowledge of PHP programming, you could modify the code at line 96 in the class-session.php file to ensure the $domain parameter does not receive a null value. For example:

    <code data-code-tools=""><span class="hljs-title function_ invoke__"></span>

    setcookie($name, $value, $expire, $path, $domain ?: '', $secure, $httponly);

    <span class="hljs-title function_ invoke__"></span>

  3. Disable Error Reporting: If you just want to temporarily hide these warnings, you can add the following line to your wp-config.php file:
    error_reporting(E_ALL & ~E_DEPRECATED);

I hope these suggestions help! If you have any further questions, feel free to share https://anspress.net/questions/question/anspress-deprecated-code/time duration calculator

Answered question
You are viewing 1 out of 1 answers, click here to view all answers.