Tag Archives: wordpress

Custom ajax call in woocommerce

sometimes you need to update database via ajax. wordpress has tools to make it easy. Well not that easy… here for example, we want to create a link that when clicked, automatically change the order status of a woocommerce order and insert some notes. In the template, Note that we have to use nonce to … Continue reading

Deploying to wordpress from git

If you are using git and are writing plugins for wordpress, its a hassle to switch between the 2 SCM. Why not commit once and deploy to 2 places? that is what many people are trying to do. this script does exactly that: https://github.com/benbalter/Github-to-WordPress-Plugin-Directory-Deployment-Script Create a plugin first. I suggest using all lowercase, eg blarblar-blarblar-blarblar. … Continue reading

simple ways to optimise wordpress

No you don’t have to use w3tc or wp super cache. wordpress becomes slow when db queries grow. a quick way is to find the expensive queries and speed them up by caching them. for example, transient is also a fantastic way of caching – http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/

Prevent wordpress redirect / rewrite for certain pages

WordPress intelligently creates nice url for seo but there are times when you don’t want wordpress to redirect certain url. For eg, you might have a custom application in a protected area, hence having the old school url like blarblar.php?test=true&page=2 might be easier to work with. The trick lies in the parse_query hook. also avoid … Continue reading

WordPress redirection plugins are the source of all evil

If you have a plugin that does page redirection, it is most likely going to interfere with other plugins you have. Take logging in for example, wp_login hook is called after the common wp_signon function. Most plugin hooks on to wp_login and do a redirection header and an exit after that. This means that other … Continue reading

Troubleshooting wordpress and wordpress plugins

Troubleshooting wordpress and its plugins can be a time consuming and a tedious process. WordPress plugins use hooks to add on new functionalities. The problem is that different plugins have different priorities. Worst still, some commercial plugins have their code obfuscated so its impossible to see what their code is doing. Fortunately, there are still … Continue reading

WordPress redirection after login fails

If you create your own login form or use the wordpress wp_login_form function to create one, you have the option to redirect user to certain pages after login by including a “redirect_to” variable upon submission. If it doesn’t work, it means that you have certain plugins that hook on to the wp_login action. Commercial plugins … Continue reading

Create wordpress language file with poedit

Giving users the ability to translate your plugin is important. So you should be using __, _e, _x …etc in your plugins as myuch as possible. In your plugin folder, create a lang sub-foldder to store your language files. In your init plugin file, make sure you have the localisation code: next download poedit from … Continue reading


Continue reading

Best way to prevent autosave and revisions in wordpress

wordpress by default tries to be clever by saving revisions to your posts frequently. This can be a good thing if everything went kaboom and you won’t loose too much data. The downside is that your database will become bloated really quickly, meaning that queries will become slower as time goes by. To stop wordpress … Continue reading

Page 1 of 41234Next Page »