Can you move your cursor over the captcha image, right click and select “open image in a new tab (or window)”. Does it look fine or all messed-up too?
Thread Starter
Mirko
(@mirkodii)
Copy the code below, save it to a file and name it ‘font.php’:
<?php
require './wp-config.php';
header( 'Content-Type: image/png' );
$im = imagecreatetruecolor( 400, 30 );
$white = imagecolorallocate( $im, 255, 255, 255 );
$grey = imagecolorallocate( $im, 128, 128, 128 );
$black = imagecolorallocate( $im, 0, 0, 0 );
imagefilledrectangle( $im, 0, 0, 399, 29, $white );
$text = 'Testing font...';
$font = WP_PLUGIN_DIR .'/ninjafirewall/lib/share/font.ttf';
imagettftext( $im, 20, 0, 11, 21, $grey, $font, $text );
imagettftext( $im, 20, 0, 10, 20, $black, $font, $text );
imagepng( $im );
imagedestroy( $im );
Upload that file into the root folder of WordPress, then access it http://example.com/font.php. Do you see the “Test font…” message?
Thread Starter
Mirko
(@mirkodii)
Maybe the font file, “ninjafirewall/lib/share/font.ttf”, is corrupted?
We just released v4.5, can you update and test again? If the file is corrupted, the new version will reinstall it.
Thread Starter
Mirko
(@mirkodii)
Hi,
just installed the new version and tested but unfortunately still messed up…
Is it your own server or a shared hosting account?
Did you or your host upgrade PHP or make some changes to it?
The example I gave you is the one from the PHP manual ( https://www.php.net/manual/en/function.imagettftext.php ) but obviously, it doesn’t work anymore on your server.
Thread Starter
Mirko
(@mirkodii)
It is on a shared server but we did not get any info about PHP upgrades or re-configurations.
Will check with them.
Thanks for your support.