25 Ekim 2010 Pazartesi

Wordpress 3.0, qTranslate ve Yetki Hatası

Eğer siteleriniz ve/ya projelerinizde qTranslate kullanıyorsanız ve özellikle bunu Wordpress 3.0 sürümü ile yapıyorsanız mutlaka "Bu sayfaya erişmek için yeterli izniniz yok" hatası almışsısnızdır. Kendisi pek tuhaf bir sorundur, projelerde çok dilli yapıyı kullanamaz hale gelişmiştim, taki dün gece bunu kafaya takıp peşine düşene kadar. Wordpress'in orasını burasını kurcalamak, arkaplanında dönen pek çok şeyle ilgili bilgi sahibi de olmamı sağladı bu arada. Sorunun kaynağı yerelleştirme dosyalarında ortaya çıktı: $wp_default_secret_key değişkeninde. Şöyleki; qTranslate dili değiştirdikçe $wp_default_secret_key değişkenindeki varsayılan metin de değişiyor, bu da güvenlik karmaşık değerinin (md5 ile elde edilen) her dilde farklılık göstermesine neden oluyor. Çözümü için,

wp-content\languages klasörüne gidip "xx_XX.php" dosyalarını bulmanız gerekiyor,

bu dosyaları (örneğin: tr_TR.php yada es_ES.php vs.) notepad gibi bir editörle açıp

$wp_default_secret_key = "eşsiz karakter kümenizi buraya yerleştirin";

satırını şöyle değiştirmeniz gerekiyor:

$wp_default_secret_key = "put your unique phrase here";

Bu kadar. "put your unique phrase here" metni wp içerisinde varsayılan olarak kullanılan değerden başka bir şey değil. Eğer http://api.wordpress.org/secret-key/1.1/ adresinden özel değerler almadıysanız sorun bu şekilde çözülebilir.

Sorunun çözümünde katkısı olmadı ümidiyle.

Wordpress 3.0, qTranslate and Permisson Error

You must faced an permission error if you use qTranslate with wordpress 3.0.x. I searched it a lot of time and found nothing. It was weird until last night, I traced everything after it -by the way I learned many things that what happening behind wordpress:)- and finally grab the point what causes that error: localization files! Solution is simple: Just go to

wp-content\languages and find "xx_XX.php" files

and open it with notepad (or tools like that), you will see:

$wp_default_secret_key = "eşsiz karakter kümenizi buraya yerleştirin";

The text must change depend on localization. Change it like that:

$wp_default_secret_key = "put your unique phrase here";

"put your unique phrase here" is the point. qTranslate change it with your current localization text and that cause md5 hash change every time. "put your unique phrase here" is the default text if you dont use a new hashs with http://api.wordpress.org/secret-key/1.1/.

I hope this helps!