Archive for the 'wordpress' Category

Alerta para quem usa Wordpress

Se você usa Wordpress, faça uma busca no Yahoo! (não adianta no Google) por “link:http://kvantservice.com/ + o nome do seu site/blog” (sem as aspas) e veja se seu site aparece nos resultados. Se aparecer, verifique se existe um link para “kvantservice.com” escondido no código fonte da página principal. Fiz uma busca agora e existem mais de 11.000 sites com o link.

Nesse tópico estão discutindo sobre o assunto e tentando descobrir se é uma falha de segurança do Wordpress ou do servidor onde o site está hospedado. De acordo com um dos posters, uma solução é remover todo o código relativo à postagem remota do arquivo “xmlrpc.php”, já que é assim que os links escondidos são adicionados.

Wordpress vulnerability: links on Google results being redirected to spam sites

It’s kinda “old”, but just read now on this message that there’s a serious vulnerability going on with Wordpress: if your site was hacked, when a user clicks a Google search result pointing to your site, he’ll be redirected to another site.

The two sites that the users are being redirected to are “your-needs.info” and, most recently, “anyresults.net”. On the amazing Alexa graph below, the red line is a well-known site with ~90k unique monthly (confirmed), the blue line is for “your-needs.info” and the green/yellish is for “anyresults.net”.

It seems that there’s no official word on the case yet, but some people posted suposted solutions in the thread about the problem. Not working for eveyone, though.

So, if your site traffic drop heavily without apparent reasons, check your Google links.

Post Image plugin updated to work with Wordpress >= 2.5

Post Image is a great Wordpress plugin that displays an image attached to a post without you having to add the <img> tag to the post content. It’s great to list the posts with a thumbnail on the site and display the full sized image in the post page.

The last version of Post Image wasn’t working because Wordpress 2.5 changed how thumbnails are named, so I made a small change in the code. It’s working great for me, but since I only tested on one site, it may contain bugs that will destroy your whole life. Please leave a comment if you find one.

If you wan’t to try it, download the modified version (1.2) clicking here. For a reference on how to use it, see the original page.

Thumbnail naming scheme changed in Wordpress 2.5

On Wordpress versions prior to 2.5, if you uploaded an image named “photo.png”, the thumbnail would be named “photo.thumbnail.png”. With version 2.5, there’s a new naming scheme where instead of “thumbnail” we have the dimensions of the image, like in “photo-150×143.png”. It’s not a big of a change, but a lot of plugins that were hardcoded to point to the files with “thumbnail” stopped working.

Fortunately, the solution is quite simple. Wordpress stores the filename of the thumbnails in the field “_wp_attachment_metadata” on the table “wp_postmeta”. This field is serialized with a lot of other information about the image, so you have to use unserialize on field value and extract the name of the thumbnail from the returned array.

Problemas com caracteres estranhos ao mover o banco de dados do Wordpress

Se você está tentando mover um banco de dados do Wordpress (de versão anterior à 2.2) e está tendo problemas com caracteres estranhos (encodings, character set, collation), tente fazer o dump a partir da linha de comando setando o character set a ser usado. Exemplo:

mysqldump --default_character_set=latin1 banco > dump.sql

E depois importar usando a mesma opção:

mysql --default_character_set=latin1 banco < dump.sql

No meu caso o character set era latin1, mas obviamente você precisar ver qual está sendo usado em suas tabelas. Se você criar um novo banco usando UTF-8, terá de substituir o character set especificado nas queries de criação de tabelas, antes de fazer a importação, e usar utf8 no lugar de latin1 ao importar.

WordPress 2.3 vulnerability allows blogroll spam

After upgrading WP to 2.3 I wasn’t expecting find 100+ spam links in my blogroll today. It seems that the code of the link manager wasn’t checking if the user had the permission to manage links. The fixed file can be found here. You should replace the “link.php” of your 2.3 WordPress instalation with that code. I found the solution on this topic.

UPDATE: I found another 41 spam links today after the “link.php” fix. According to that forum post the fix should have worked, but it didn’t. While an official solution don’t come out, I’ll change the theme code so it display the blogroll with static HTML instead of grabing the links from the database.

UPDATE 2 (2007-11-22): no more spams here, don’t know why.