Image not displaying | Peter's Custom Anti-Spam for WordPress | Forum
Back to the custom anti-spam plugin page
3:50 pm
Seems the captcha image is not displaying. It worked when I first installed the plugin but now it just displays the ALT text.
When try to view the generated image from the URL directly
(http://www.example.com/?antiselect=12) no image is displayed, no errors either.
The tables exist (wp_cas_count, and wp_cas_image)
Using version 2.9.5
Any Ideas?
Hmmm, weird. The audio file works fine so the plugin is installed and operating properly. Maybe it's a conflicting plugin (unlikely)? Try temporarily disabling other plugins. Otherwise, I suspect it's an obscure flag on the GD Library that isn't right, as there are no error messages.
I'm afraid I can't be of any help unless I have access to your server and can test various bits of code in the plugin :(
Although I'd love to hear if anybody has any solutions.
5:01 pm
The only plugin I have that seems remotely likely to cause a problem would be akismet, but disabling it didn't help.
The person who referred me to this plugin is running it successfully on an older version of WP. I'd have to guess that it's something with the new version.
I've done some coding and know php, is there something I can try?
I don't think it's a problem with WordPress because I'm running 2.3 on this blog and 2.3.1 on workblog.theblog.ca and they both work.
However, yes, I thank you for your willingness to try and test things out!
First, try editing this setting to provide the absolute path to the plugin directory:
Change:
$cas_fontpath = str_replace('\\\\', '/', dirname(__FILE__)) . '/';
To:
$cas_fontpath = '/home/yourpath/to/plugin/';
Failing that, try entering gibberish into that setting:
$cas_fontpath = '/home/yourpath/to/nonexistentfolder';
That should default to not use any fonts.
Then, try putting this code in a php file:
http://www.theblog.ca/antispamtest.txt
And put that php file in the same folder as beattty.ttf, then run it. See if there is any output.
6:04 pm
Well!
-- changing the path had no effect
-- running the "test" works, even with the existing path
test link
The plot thickens... in the plugin, all of the code is found in the "if" statement below this comment:
// Output the antispam image
In the test, I simply copied that code and hacked out some random parts. Maybe you don't have imagettfbbox enabled? Try:
if (function_exists('imagettfbbox')) print 'Peter is stupid! It is enabled!';
If you're feeling adventurous, compare the test code to the code in the image generation "if" statement and try to see where the code fails. Or we can keep going back and forth (although I have to concentrate on my day job for the next few hours), as long as you're up for it.
No, that image code is fine...
OK, let's go back to basics.
Try this code in your custom anti-spam plugin directory:
http://www.theblog.ca/antispamtest.txt
It represents the full image generation script, completely removed from any WordPress interaction. If it works, then there's a problem with interacting with WordPress (perhaps when accessing the database). If it doesn't work, then it's a problem with the image generation itself, and then we have to somehow strip away parts of the code one by one to see where it disagrees with your server.
Side note: I forgot about the tag in this forum!
"Quotes", 'single quotes',
2:16 pm
That's a shame, because I have the same problem (WordPress latest version, hosted on MediaTemple). The plugin used to work when my site was hosted on DreamHost with a previous version of WordPress. I've had to remove the plugin because too many people couldn't see the image and they didn't see the alt text to listen to the audio.
3:04 pm
Now I have a problem with it not displaying on my contact page and faq page with Wordpress 2.3.1. And I didn't used to, using WordPress 2.2.3.
I had a server crash and got mad and moved my site to a different place, and of course installed this most wonderful of plugins. All the libraries etc. are there and it shows up in comments, but the pages aren't showing it, and it used to.
Right now I have 200+ "questions" sitting in my approve page for the faqs, and let's not even talk about my inbox.
Am I missing something here to set it to work with pages/contact forms? It used to work beautifully with them.
Do you mean the image is not showing up at all or it is showing up as a broken image? If it is the first case, try the manual insert method, which involves editing your comment template.