Happy to contribute to this awesome software!
The most common method to use AJAX in WordPress is using admin-ajax.php + WordPress hook system.
And one of the recommended method to get this file URL is by using
wp_localize_script(). This method is explained in details in my other tutorial WordPress AJAX for Beginners.
However, there is an alternative method.
Today I just reached 10.000+ Active Installs ! (WordPress themes and plugins total)
I know it’s not that impressive. but 😏 YEY! anyway.
it’s pretty embarrassing actually. 15 plugins and 10 themes.
but still happy for this milestone. 0
In WordPress we have a lot of options to create contact forms. But I can’t seem to find the best solutions. I even think to create my own contact forms plugin.
My Requirements Are:
Not only in form output/front-end. Administration panel need to work in mobile devices. Well, at least usable, I understand that some features might need to be hidden/disabled in small screen devices for usability and UX. But not broken.
- Use WordPress UI:
Seamless integration with WordPress, native-feel. I’m not a fan of app-like fancy UI. Professional. No excessive branding with cute icon/logo. If possible no cross-selling of add-ons/upgrade (or easy way to disable it).
- Simple and easy to use:
User need to be able to use it without the need to learn proper form HTML markup.
- Little to no learning curve:
No excessive features, I just need a contact form not a shopping cart, not a user registration form. If the code base is extendable and able to do all this via add-on that’s a plus. But it’s not necessary and not needed in the “core” plugins.
- Theme and Template Friendly:
Can be added in a page template, any template file, no need to be in the “loop”. Simple shortcode to display the form should work with do_shortcode() function.
So, basically, something basic that I can use on my clients site and that’s it.
Of course anti spam features (maybe custom honey pot or integration with recaptcha/akismet) is also a requirements.
Here are several of my issue with current contact forms solutions (not in particular order):
I didn’t ask this question a lot. But recently a client linked to an article, possibly to make sure I didn’t ask for their estimate budget for the project (which is fine):
The article covers some valid points. Asking budget question might be a sign for:
- Lack of knowledge
- Signal of deception
- No value
- No due diligence, etc.
But I don’t always agree. In some case asking for budget is totally fine.
I feel like I should celebrate 🍻
Before you read this tutorial, please read earlier tutorial: WordPress AJAX for Beginners.
In this tutorial, I will explain several method in how to secure AJAX request using nonce.
Here’s a guide to debug if you have bug on your WordPress website:
In my new plugin f(x) Maps, I create a location search with ability to get current address/location using HTML 5 Geolocation and Google Maps Geocoding API. And in this post I want to share how I did it.
In recent projects I use AJAX more, and I think it’s time to share my knowledge. This tutorial is just a simple guide to understand the basic about using AJAX in WordPress.
To follow this tutorial you will need to understand the basic of:
- Simple PHP
- How form works
- Register and Enqueue Scripts in WordPress
- Register WordPress shortcode (example plugin)
WordPress plugin have a activation method, It’s very useful, and we can use it for various things.
One of the popular method in plugin, is “Activation Redirect”, this is a method used by a lot ( I mean **A LOT**) of popular plugins to redirect user to plugin settings page, setup page, or even plugin about page (of course, within the admin panel) when user activate plugin.
This is (probably) useful for user on-boarding purpose, annoy user, keep the user inform about the feature of the plugin or help them setup the pages required by the plugin or install additional plugins/add-on.
Note: I actually really hate it when plugin/theme author did this. But in some case it could be useful.
Usually plugin use register_activation_hook() function to do this. But theme don’t have similar method/function. However, there’s a workaround for that.
Sometime we need to save API key, or password, for external services in our WordPress plugin. It’s problematic, since we have to use that key to make API connection, but we don’t want to save it in plain text (because it’s just plain dumb). So we need a way to encrypt this key and save it to database, and decrypt it to use.