Tag: wordpress

WordPress voor Android

Ik heb de laatste tijd weinig artikelen gepubliceerd. Een van de redenen is de drempel tot het gaan schrijven. Deze drempel is een stuk lager geworden sinds ik op mijn Google Galaxy Nexus WordPress voor Android heb geïnstalleerd.

De app werkt super goed. Eenvoudig artikelen plaatsen, bewerken en reacties modereren.

Met het wegnemen van deze drempel kan je dus weer vaker een nieuw artikel verwachten. Onderwerpen zat: XBMC, WordPress development, Drupal, web ontwikkelingen, ondernemerschap en natuurlijk muziek.

Nieuwe look

Vandaag kwam ik dit gratis te gebruiken theme (waar je nu naar kijkt) voor WordPress tegen. Nice, clean en lekker leesbaar. Er moest uiteraard nog wel even een vertaalslag overheen, dus mocht je nog iets tegenkomen wat niet klopt: laat me maar weten!

Ook dit theme gebruiken? Het heet Typominima en is gemaakt door QBKL & Blogsessive

Onderweg bloggen met Android

In mijn post over de HTC Hero schreef ik over de must have app’s voor Android. Daar is sinds vandaag nog een bijgekomen: WordPress for Android.

Met deze app, als je XMLRPC hebt toegestaan op je WordPress (/wp-admin/options-writing.php), kan je al je artikelen lezen en bewerken, nieuwe artikelen plaatsen en de reacties lezen en modereren. Heb je dus weer eens een dood momentje (onderweg, op de wc) dan kan je gelijk even je site bijwerken!

WordPress XML response issues (-32700:parse error)

Is wordpress giving you -32700:parse error. not well formed? Or is xmlrpc.php bothering you while getting getCategories function XML RPC call?
I did and i’ve found the problem:

In the IXR_Message class, the class which I use and also is recommended to parse the XML response of xmlrpc.php, uses preg_replace in the function parse() (IXR_Message->parse();). In PHP5 there has been some restrictions introduced to recursive regular expressions with Perl. Some parameters has been introducted to your php.ini (backtrack limit) and one of them is preventing me to interpret the XML-feed I get from my WordPress. Perhaps this one is very big, but i really need it, so:

Change at the beginning of your script your settings for example:
ini_set('pcre.backtrack_limit', 10000000);

You will see that the IXR_Message class is happy with the result it gets from the first lines of its parse function.

If you want to test if the backtrack limit is bothering you use the preg_last_error() function:

if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) {
print 'Backtrack limit was exhausted!';
}

The code in the parse() function is:
$this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);

WordPress slow?

WordPress slow? Check your plugins MySQL database. I’ve checked the slow-log and discovered some slow queries.

I did some very basic adjustments, maybe not all very well overthought, but with dramatically speedup results.

wp_ratings checks a lot on both rating_postid en rating_ip, but by default no index so:
Slow Queries:
SELECT rating_username, rating_rating, rating_ip FROM wp_ratings WHERE rating_postid = 487;
SELECT rating_ip FROM wp_ratings WHERE rating_postid = 487 AND rating_ip = '83.80.25.124';
Solution:
ALTER TABLE `wp_ratings` ADD INDEX ( `rating_postid` )
ALTER TABLE `wp_ratings` ADD INDEX ( `rating_ip` )

wp_term_taxonomy from the very powerfull plugin YARPP (related posts plugin) as explained in http://wordpress.org/support/topic/192707 misses an index
Slow Query:
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') AND tt.count > 0 ORDER BY t.name ASC;
Solution:
ALTER TABLE `wp_term_taxonomy` ADD INDEX ( `taxonomy` )

wp_options doesn’t have an index on autoload (a core query), but the next query runs lots of times. Of course it is cached, but why not speed it up as much as possible.
Slow Query:
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
Solution:
ALTER TABLE `wp_options` ADD INDEX ( `autoload` )

Any comments are very welcome, this are just quick and dirty solutions, that perhaps need more time and study, but for now i’m happy!