package playne

imports "programmer"

Category: Wordpress

  • WordPress – Stop screwing with the timezone!

    So my dates were not displaying correctly and it turns out that WordPress is to blame. After checking the data and finding that it was correct, I was confused as to why a wordpress page was displaying the wrong date for a correct unix timestamp. WordPress was screwing with the timezone setting of PHP. This…

  • wpsc_update_custom_meta() nukes my custom post meta data

    So today I was rather perplexed as to why my custom meta box on my post edit page was not playing ball. It would be set to a value and always stay at it, delete it from the database and give it a different value – and it would keep that too.St Since I had…

  • WordPress, WP E-Commerce and the lack of ASYNC AJAX

    Now Normally the A in AJAX means Asynchronous, meaning you can have several requests going at once, so it was very confused as to why my AJAX wasn’t. My WordPress plugin is a long running import process and I decided to use AJAX so that I can provide timely feedback to the user as to…

  • You do not have sufficient permissions to access this page.

    Note to self: do not use non prefixed global variables in your wordpress plugin. It causes all sorts of chaos. For example – gett the error “You do not have sufficient permissions to access this page.” whenever you load a page that is not your plugins. For those playing at home, this is the code…

  • Get the WordPress Plugin URL

    So today I was writing a plugin that belongs in the tools section of the wordpress admin and I found myself wondering how to get the URL of the plugin.

  • The case of the misbehaving wp e-commerce price sort

    So we had an interesting issue where sorting product by price was not working correctly for wp e-commerce products. The sorting was happening but MySQL was sorting the wp-postmeta.meta_value as a string, so 12.95 was coming AFTER 123. The solution is nice and simple $query->set(‘orderby’,’meta_value_num’); $query->set(‘order’,’ASC’); This way the MySQL does this: was: ORDER BY…

  • beware the trailing slash…

    So, we had an interesting issue with wordpress plugins not using the correct path, so we had busted URLs for their resources. for example: <img src=’http://example.com/wp-content/plugins/var/www/example.com/htdocs/wp-content/plugins/myplugin/logo.png’ alt=’plugin logo’/> Now, this is obviously ideal since the resource was not being loaded (bad mkay). The fix is only 1 character believe it or not. Removing the trailing…

  • register_activation_hook() not working

    Fixing register_activation_hook() not working

  • Another Lazy Weekend

    So here I am, chilling out – thinking how to make wordpress behave nicely with a software load balancing reverse proxy, particularly Varnish Cache. Why you may ask – well I need to get the best performance I can out of my shiny new web setup  at work and Varnish Cache by default does not cache…

  • Getting it on…

    So I have finally gone and done it – I have put WordPress on my website in an attempt to have some not so static content. Let’s see how this goes