My web development blog collects posts I’ve made solving problems for my clients. There’s hints, tips and code snippets for all the open source frameworks I work with: WordPress, WooCommerce, OpenCart, Drupal, Magento and more. If you have a web development question, get in touch or post a question in the comments, I’ll try my best to help.
Gravity Forms count uploaded files programmatically
Gravity Forms offers a very nice multi-file upload function, allowing multiple images to be attached to a form. This snippet counts the number of uploaded files and submits the count as a read-only field on the form.
Disable Yoast WordPress SEO for certain roles
For some strange reason, Yoast SEO doesn’t set capabilities, so access permissions for SEO functions cannot be limited by role. Here are some workarounds to do that.
WordPress comment tracking in Google Analytics without hacking core
How to track WordPress comments as a Google Analytics goal if your theme uses the WordPress comment_form function. This solution uses jQuery to avoid making changes to core files.
Cleaning up Gravity Forms file uploads
Uploaded files attached to Gravity Form submissions can quickly mount up, filling up server space. Find out how to remove expired form entries, including the attached files; and also to remove any temporary files left over from abandoned submissions.
Customising WooCommerce notification emails with hooks and filters
WooCommerce has many hooks to customise the email notifications sent at various stages of the purchase process, but these are not very well documented. Find out how to use some of these useful filters.
WordPress Contact Form 7 user registration
You can use Contact Form 7 to create a simple membership system for WordPress. Create a user registration form and use this snippet to automatically create user accounts which can be approved in the admin area.
Barclay ePDQ payment gateway for WordPress and WooCommerce 2.1.x
The free Barclays’ ePDQ payment gateway for WooCommerce was never updated to use endpoints for WooCommerce versions 2.1 and greater. Find out how to modify the plugin to use the newer versions.
OpenCart reviews not indexed by Google? Use this vqMod
OpenCart 1.5.x product reviews are displayed using AJAX, which means they cannot be indexed by search engines. This vqmod pulls the comments in as indexable HTML to solve this problem.
Magento bulk product import with images
A post documenting my experience bulk importing many products into Magento 1.7, including dealing with multiple product images, and removing duplicate images from previous imports.