Wp foreign characters, Php, Creating Tables
By · CommentsI knocked myself around trying to figure out why my plugin was not coping with ‘foreign’, multi byte, Greek, Japanese, Chinese characters. Those damn questions marks ‘????’ – I had it all sorted before in another plugin – what was going on here ? I had all the multi-byte functions happening. Then I remembered – the database tables – of course!
Default Mysql
MySQL’s default database charset is usually latin1 and thecollation is latin1_swedish_ci. This can vary based on server configuration. This is usually set before wordpress is installed.
Default wordpress
WordPress usually creates it’s table with charset utf8 and collation utf8_general_ci. You can overwrite this in the config file.
See http://codex.wordpress.org/Editing_wp-config.php#Database_character_set.
Fix your wordpress database
You can Alter the database after the fact. This will help the plugins who haven’t figured out that many of us (you?) haven’t set up our databases as well as they could be.
ALTER DATABASE yourdb CHARACTER SET utf8 COLLATE utf8_general_ci;
Plugin authors
Make life easy on your self and others when creating custom tables. Have a look at the wordpress db schema. Note that there is a global $charset_collate. Use it!
global $wpdb, $charset_collate;
if ($wpdb->get_var("show tables like '$table_name'") != $table_name) {
$sql = "CREATE TABLE " . $table_name . " (
id bigint NOT NULL AUTO_INCREMENT,
field1 text NOT NULL,
field2 text NOT NULL,
PRIMARY KEY (id) )
".$charset_collate. ";";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
error_log($table_name.' not created');
return false;
}
else return true;
Resources:
- http://codex.wordpress.org/Editing_wp-config.php#Database_character_set
- http://hakre.wordpress.com/2010/12/26/wordpress-database-charset-and-collation-configuration/
- http://dev.mysql.com/doc/refman/5.5/en/charset.html
Registrations temporarily suspended
By · CommentsRegistrations temporarily suspended due to spam bot attack.
Please use contact form http://webdesign.anmari.com/about/contact/ to request access until later.
I dislike captcha’s even google’s ‘digitise the old books’ one and they don’t work that well.
Have looked at various other methods over the years – decided I’d rather put up with a few spamster users. Today just got a bit much!
Seems it is not just me. Scritch and Scratch having some fun (not) too.
Comparison of Event Calendar Plug-ins
By · CommentsA quick look in no particular order (except mine first of course) . Yes I am checking out the competition – I love developing, but need to get some return on it. Hence some research on what others are doing.
Update as at: Feb 2012
- free at wordpress (4 star rating, 2012 updates)
- input via ics file subscription
- most customisable calendars, agendas, schedules etc, variety of views
- date navigation and pagination
- widgets
- paid addon to the above ($40)
- full event creation, custom post types, taxonomies, locations
- filtering
- filters, pluggable functions
- variety of map plugin integrations
- multi lingual integration
- produce ics feeds
- uses wordpress as intended so you get benefits of being able to integrate other plugins
event espresso ($$$!)
- lite version at wordpress (3 star rating)
- paid version not cheap (lots of addons – top price $500, base at $90)
- registration, ticketing, payment gateways
- recurring events an addon
- free version at wordpress (5 star rating, 2012 update)
- is it error prone? (7 brokens for last version, but 13 works)
- paid support at $120 hour
- recurring, ics import/export, variety of views, widgets
- free version at wordpress (4 star rating, last update 2010/10)
- paid version $75
- bookings, paypal
- free version at wordpress (4 star rating, last update 2012)
- sounds fairly full featured, views, recurring, customisable
- user guide at $20
- free at wordpress (4 star, but last update 2010)
- free version at wordpress (3 star)
- create and present calendar for events
- free version at wordpress (3 star, last 2009)
- event registration
WordPress plugins to avoid
By · Commentshttp://www.exploit-db.com lists vulnerabilities found in various wordpress plugins.
Trackback Spam Notifications
By · CommentsIt is always the ‘old’ stuff that gets you.
I thought I had done such a great job tightening up things and then seemed to get hit with some repetitive trackback spam notifications. Since the notifications are coming from one of MY websites, they don’t get marked easily as spam.
A few minutes of googling and a timely post at question-defence.com, published a few days ago pin pointed the problem (Many thanks to google for thier quick search index updating!.. remember the old days?)
Ping status = ‘open’
Many existing posts still had their ping status set to open. So to stop trackback spam in it’s tracks (ha! lqtm), take action as follows:
Future posts:
- Go to WordPress settings > Discussions >
- untick “Allow Link Notifications From Other Blogs”
Past Posts:
- Hop into your phpmyadmin
- Find your posts table, note the name with your sites prefix
- Goto the SQL view, type in
update prefix-posts set ping_status = 'closed';
and you are done. All posts and custom post types now set to NOT accept trackbacks.





