Web Projects Outsourcing

Making outdated Block Countries plugin for WordPress work

Attention
You must have a local LAMP installation for painless processing of the following.

Download the plugin from http://www.jasonlitka.com/2007/04/16/wordpress-plugin-block-countries/ . Install in a regular way. Do not go to options now.

Download ip database from http://ip-to-country.webhosting.info/node/view/6

Convert to mysql dump using phpmyadmin interface.

For that, use any local database to create a table:

Uncompress ip-to-country.csv and import it into this table using standard phpMyAdmin interface and watching for the Windows-type line ending in the export file:

Convert ip2country file into Mysql format

Convert ip2country file into Mysql format

Create a local export file :

Upload to server, insert into the WordPress db on server:

Now, make the final modifications to the block countries plugin. Edit the file on server, PATH_TO_WEB_ROOT/wp-content/plugins/block-countries/block-countries.php, change

to:

You can use normal configuration page now enjoying the working interface.

Making outdated block country plugin for Worpress work

Making outdated block country plugin for Worpress work

Please make sure you do not block yourself :mrgreen: . The warning in the plugin reads:

Plugin Warning
If you block the country you are in you will not be able to access your Blog or the Blog’s Site Admin section. If you do it anyway, you can run the MySQL query “DELETE FROM MARKDOWN_HASHc86362c3421349f3283f134bedaa5b36MARKDOWN_HASH WHERE MARKDOWN_HASH16f709d34f3920863720f4ef0af239eaMARKDOWN_HASH LIKE ‘bc_%’;” to restore the plugin settings to their defaults.

As a result of plugin work (I just blocked myself to test), you see a not very beautiful but quite an effective empty page with text: HTTP/1.1 403 Forbidden – Users from your country are not permitted to browse this site.

Enjoy!

One thought on “Making outdated Block Countries plugin for WordPress work

Leave a Reply

Your email address will not be published. Required fields are marked *

11 − nine =