Slow WordPress site and Failing Contact-Form-7
Had a problem with our WordPress website recently where is just suddenly slowed down. Every page used to load in less than 2 seconds but now takes between 6 and 10 seconds just to complete the initial GET response. I've tried several things to troubleshoot and fix this including drilling through long log files, restarting services, disabling/enabling plugins and themes, and even setting up Caching on this small site, to no success.
After many hours, I gave up and decided to look at another issue that's popped up on the site - the Contact-Form-7 Captcha stopped working. It would just show a spinning wheel and will get stuck there. Even if I put in the correct captcha key on the form, the email gets sent out but the form stays on with the spinning wheel, so there's no visual acknowledgement to the user.
Have gone to google and found a suggestion here to change the permissions on the dynamically created captcha image and text files.
From line 70 onwards of \wp-content\plugins\really-simple-captcha\really-simple-captcha.php:
Change this:
/* Mode of temporary image files */
$this->file_mode = 0444;
/* Mode of temporary answer text files */
$this->answer_file_mode = 0440;
To this:
/* Mode of temporary image files */
$this->file_mode = 0777;
/* Mode of temporary answer text files */
$this->answer_file_mode = 0770;
That got the contact form working again but the site was still slow.
Having seen the folder containing the captcha image and text files during troubleshooting, I knew that the number of files have already grown since this issue started (around Jun 2014). So I decided to go back in there (\wp-content\uploads\wpcf7_captcha\) and clean it up - delete all the old files. Tested the site again to make sure that didn't break anything and I was very surprised to see that the pages are loading up fast again. Who knew that files in the captcha temp folder would affect the site's performance.
After many hours, I gave up and decided to look at another issue that's popped up on the site - the Contact-Form-7 Captcha stopped working. It would just show a spinning wheel and will get stuck there. Even if I put in the correct captcha key on the form, the email gets sent out but the form stays on with the spinning wheel, so there's no visual acknowledgement to the user.
Have gone to google and found a suggestion here to change the permissions on the dynamically created captcha image and text files.
From line 70 onwards of \wp-content\plugins\really-simple-captcha\really-simple-captcha.php:
Change this:
/* Mode of temporary image files */
$this->file_mode = 0444;
/* Mode of temporary answer text files */
$this->answer_file_mode = 0440;
To this:
/* Mode of temporary image files */
$this->file_mode = 0777;
/* Mode of temporary answer text files */
$this->answer_file_mode = 0770;
That got the contact form working again but the site was still slow.
Having seen the folder containing the captcha image and text files during troubleshooting, I knew that the number of files have already grown since this issue started (around Jun 2014). So I decided to go back in there (\wp-content\uploads\wpcf7_captcha\) and clean it up - delete all the old files. Tested the site again to make sure that didn't break anything and I was very surprised to see that the pages are loading up fast again. Who knew that files in the captcha temp folder would affect the site's performance.
Comments
Post a Comment