Arrow

Image not displaying | Peter's Custom Anti-Spam for WordPress | Forum

Back to the custom anti-spam plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Image not displaying
October 14, 2007
3:50 pm
James
Guest

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?

October 14, 2007
3:53 pm
Peter
Admin
Forum Posts: 841
Offline

Maybe for some reason the GD Library or FreeType has suddenly been disabled? Check Manage > Custom anti-spam in your WordPress admin interface first. Also, check your root folder to see if there's an error log there. Can you send your site address so that I can take a look?

October 30, 2007
4:21 pm
webhead
Guest

Same problem. I'm running the latest WP and just installed the plugin today. Both IE 6 and Firefox show the alt text. I have GD library, free type, and get_option, and made sure I was not logged in. I looked for an error log but don't see it yet.

October 30, 2007
4:30 pm
Peter
Admin
Forum Posts: 841
Offline

Can you please post your site address?

Currently I have absolutely no idea what the problem could be.

October 30, 2007
4:37 pm
webhead
Guest

Sure, sorry...
http://www.fether.net

October 30, 2007
4:55 pm
Peter
Admin
Forum Posts: 841
Offline

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.

October 30, 2007
5:01 pm
webhead
Guest

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?

October 30, 2007
5:27 pm
Peter
Admin
Forum Posts: 841
Offline

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.

October 30, 2007
6:04 pm
webhead
Guest

Well!

-- changing the path had no effect

-- running the "test" works, even with the existing path
test link

October 30, 2007
6:19 pm
Peter
Admin
Forum Posts: 841
Offline
10

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.

October 30, 2007
7:07 pm
webhead
Guest
11

The "Peter..." statement appears in the test code, so that's enabled.

But I noticed this in the source code of my blog page:
[Image Can Not Be Found]

Shouldn't there be something more like:
[Image Can Not Be Found]

October 30, 2007
7:27 pm
Peter
Admin
Forum Posts: 841
Offline
12

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', and the like in the code tag are preserved, yay

October 30, 2007
7:36 pm
webhead
Guest
13

That one works too, so it's not playing nice with WP.

October 30, 2007
7:40 pm
Peter
Admin
Forum Posts: 841
Offline
14

Awesome, we're getting somewhere! I'll have to call it a day, though. Maybe we can pick this back up tomorrow...

October 30, 2007
7:41 pm
webhead
Guest
15

K.

October 31, 2007
6:49 pm
Peter
Admin
Forum Posts: 841
Offline
16

For any readers, we continued this discussion via e-mail and couldn't figure out the problem :(

November 12, 2007
2:16 pm
Flexo
Guest
17

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.

November 12, 2007
10:15 pm
Peter
Admin
Forum Posts: 841
Offline
18

It's a server setting that I haven't been able to figure out :(

If anybody who has a similar problem is willing to give me temporary access to their site, I'll be happy to check it out.

November 17, 2007
3:04 pm
Sue
Guest
19

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.

November 17, 2007
3:34 pm
Peter
Admin
Forum Posts: 841
Offline
20

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.