Wordpress error when sending comment - wordpress

I'm using the default comments template, on my own self-built theme. When I send a comment I get the following error message:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_set_comment_cookies' not found or invalid function name in /home/mattator/public_html/wp-includes/plugin.php on line 403
Warning: Cannot modify header information - headers already sent by (output started at /home/mattator/public_html/wp-includes/plugin.php:403) in /home/mattator/public_html/wp-includes/pluggable.php on line 881
couldn't find a call to the funciton 'wp_set_comment_cookies' anywhere in the code. It is noteworthy that despite the error message the comment is being sent properly. I also tried to disable all plugins but the problem persists.
Any ideas would be appreciated.

May be you have some extra white space before
<?php
tag in starting of a theme file
Thanks

Well, I experimented a little bit, and as turns out the problem was a call to the function "nocache_headers()", in Line 18 of the file "wp-comments-post.php" which lies at WP root directory.
I deleted it, and voila, everything works. Not sure why though.

Related

WP Contact form is not working, Spinning wheel forever after submitting form

I have created a contact form on our website, I thought it worked in the past, but now when you click the submit button nothing happens and a blue spinning wheel comes up and nothing happens.
Does anyone know what it can be? Some manage to fix it by deleting the password-protect plugin but I do not have that enabled.
Java error from console
Link to the website with the contact form: https://www.hamarbilpleie.no/kontakt-oss/
Dubug plugin result
[03-Mar-2021 20:31:48 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/2/h/hamarbilpleie/www/wp-content/themes/carservice/contact_form.php on line 261
[03-Mar-2021 20:31:48 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to cs_phpmailer_init() must be an instance of PHPMailer, instance of PHPMailer\PHPMailer\PHPMailer given, called in /home/2/h/hamarbilpleie/www/wp-includes/class-wp-hook.php on line 287 and defined in /home/2/h/hamarbilpleie/www/wp-content/themes/carservice/functions.php:298 Stack trace:
#0 /home/2/h/hamarbilpleie/www/wp-includes/class-wp-hook.php(287): cs_phpmailer_init(Object(PHPMailer\PHPMailer\PHPMailer))
#1 /home/2/h/hamarbilpleie/www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#2 /home/2/h/hamarbilpleie/www/wp-includes/plugin.php(551): WP_Hook->do_action(Array)
#3 /home/2/h/hamarbilpleie/www/wp-includes/pluggable.php(494): do_action_ref_array('phpmailer_init', Array)
#4 /home/2/h/hamarbilpleie/www/wp-content/themes/carservice/contact_form.php(280): wp_mail(Array, 'Foresp\xC3\xB8rsel fr...', 'F\xC3\xB8lgende henve...', Array)
#5 /home/2/h/hamarbilpleie/www/wp-includes/class-wp-hook.php(287): cs_theme_contact_form('')
#6 /home/2/h/hamarbilple in /home/2/h/hamarbilpleie/www/wp-content/themes/carservice/functions.php on line 298
Probably you are having a bug in Javascript. What you have to do is, open up the Developer Tools in your browser, then goto Console tab. You would find the error messages there. Copy that error and share it with us.
EDIT
I can see that there's a 500 Internal Server Error (based on the screenshot you provided) when the data is submitted to the server. What you have to do is, see if there's any error log created inside your server. It would have some information regarding what is causing the issue. Please share it with us. If you are not able to see it, please follow this: Debugging in WordPress
EDIT 2
It appears that you are having two issues in your theme's functions.php file. It's using one depreciated function and for the other probably because of old code. The line numbers are #261 and #298 (/wp-content/themes/carservice/functions.php). The easy would be to ask your theme developer to get it fixed for you. If you have the update available for your theme and plugins, make sure you update it. Kindly note that, if you have done any modifications on the functions.php file, instead of doing it in a child theme, those changes would be overwritten when you update the theme.
After some digging and discussion, I found out that the theme had not been updated for ages. But to find an update for this was not easy. For some reason, it did not automatically update from WP. But it is fixed now. Thanks for the tips and hints, guys.

WordPress Fatal Error Class 'wpforge_walker' not found line 317

I'm receiving the following error on my WordPress website:
Fatal error: Class 'wpforge_walker' not found in
/home/content/25/11572025/html/site/wp-content/themes/wp-starter/content-nav.php
on line 317
On my FTP File Manager, line 317 on "content-nav.php" shows the following:
'walker' => new wpforge_walker( array(
After reading on this issue other forums mentioned how removing the parenthesis might solve the problem. Accordingly, this is how I saved the "content-nav.php" file:
'walker' => new wpforge_walker
After refreshing my website, it is showing the following error:
Parse error: syntax error, unexpected ''in_top_bar''
(T_CONSTANT_ENCAPSED_STRING), expecting ')' in
/home/content/25/11572025/html/site/wp-content/themes/wp-starter/content-nav.php
on line 319
I went back to my FTP File Manager and put back the "( array(" into the "content-nav.php" file and now I'm back to my initial problem.
Any assistance would be appreciated. Thanks!
You are using the Theme wp-starter, can you share any more info about it, developer, website, etc.?
Share a bigger chunk of code from content-nav.php, for example rows 300 till 350. Make sure you include the complete block of code.
Removing ( array( will result in another error. This is normal because it will completely break the function.
Some info about the error.
The code wants to load the class wpforge_walker, but it isn't available. Something went wrong with including the file that contains that particular class.
In the error log, do you see another returning log (notice or something else) before the fatal error? I'm looking for an include_once() / No such file or directory error, or something like that.
Another option is to re-upload ALL theme files, maybe an update or something else did not complete correctly. You can overwrite all theme files savely.
Edit: re-upload all theme files fixed the problem.
Disable theme to get WP admin access.
Using FTP or a hosting filemanager you can rename the theme folder, example 'wp-starter-off'.
WP will then deactivate the theme and you can access WP again.
Regards, Bjorn

Error Message displayed in footer. Notice: ob_end_flush(): fail in public_html/wp-includes/functions.php on line 3464

Can anybody help me in finding the solution for this kind of error in Wordpress?
Notice: ob_end_flush(): fail in /home/yatra/public_html/wp- includes/functions.php on line 3464
Apparently zlib.output_compression is active on your server.
It's part of a bug #18525. You can do the following:
Disable zlib.output_compression, by adding: ini_set('zlib.output_handler', '');
Apply the patch provided there and report back on that ticket if it works.
Disable notices.

Drupal site webpages getting 500 in google

I am working on a site that is having issues when google tries to crawl over it. (I just inherited this site.) Google is returning a 500 error that it can not find the page. I have done some debug but I am stumped on what more to do.
Here is what I know:
When google crawls the site it gets a 500 from some pages. All the pages with the error seem to be "~/content/~" pages.
When I try to manual fetch the page I also get the 500 error message.
The issue only happens sometimes.
Viewing the webpage in a browser gives no indication that anything is wrong.
This is the error message from my error log.
[17-Jul-2013 21:29:58] PHP Parse error: syntax error, unexpected $end in
/home/~/public_html/sites/all/modules/ctools/plugins/access/php.inc(55) : eval()'d code on line 1
Sometime it says line 1 or line 2.
If I comment out the line below, the error goes away. I don't know what the function below does and if getting rid of it does any harm.
// Provide a summary description based upon the checked roles.
function ctools_php_ctools_access_summary($conf, $contexts)
{
return !empty($conf['description']) ? check_plain($conf['description']) : t('No description');
}
I spoke with the hosting company and they said everything is "OK" on their end.
I submitted a question to the google forums and all the tools that they had me run against the site seemed to return successful information.
The problem seems like its getting progressively worse over time.
The apache log does not have any error messages in it.
From the durpal Admin panel - Node template. When I select contexts for the column variant sometimes I get the WSOD.
I don't see any php code anywhere that could be causing an error.
Does anyone have any ideas what could be going on?
PHP Parse error: syntax error, unexpected $end.... if it's the case
means that PHP has finished analyzing your code, but you forgot to close a symbol somewhere in your page or in those that are included.
Check:
you may forgot to close a quote, so PHP continues to analyze your code until it finds the closing quotation-mark.
You may forgot to close a bracket, so from the last opening, PHP thinks all the code that follows as part of a block that never ends.
You may forgot to close a parenthesis, so from the last open parenthesis, it thinks all the code that follows as part of it and that is not ending.
You may forgot a comma

PHP Warning/Error on Wordpress Site

I'm getting this warning message on a Wordpress I have just setup:
http://wptest.paddingtonterraces.com.au/
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'gllr_add_script' was given in /home/paddingt/public_html/wptest/wp-includes/plugin.php on line 403
Anyone know how to sort this one out?
Deactive your plugins and theme and activate them one by one so you will find out which component causes the problem or which plugin does the function comes from.
It's looking for a function named gllr_add_script... does that function exist?

Resources