Anspress Deprecated Code
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
To temporarily resolve the “Deprecated” error you’re encountering, you might try the following:
- Update the Plugin: Ensure you are using the latest version of Anspress and any related plugins.
- 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>
- 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