Configuring the bbpnns Reply by Email Webhook

You’ve chosen to use the bbpnns Reply by Email Webhook instead of the WordPress Cron system. Smart choice. Now, every time the Webhook is called, the plugin will check your inbox for the newest replies to be added to your bbpress forums.

[vinyl scratching] Wait, what’s a webhook?

Webhook is nothing but a fancy name for an action taken by a site when a given URL is accessed. In the plugin settings you were given a web address to use.

The trick now is getting that webhook called as frequently as possible without enraging your web host.

Keep reading to learn about our recommended methods of setting up the Webhook calls.

  1. IFTTT
  2. Zapier
  3. Real Cron Jobs

IFTTT

IFTTT stands for If This Then That, and is a free service which lets you connect services according to pre-defined rules, called Applets (they used to be called recipes). You can create your own applets or use any of the many available applets built by IFTTT, service providers, or users like yourself.

IFTTT connects seamlessly with Gmail (and Google Apps, which essentially the same thing), and Office 365 (for paid outlook accounts) but currently does not support checking POP3/IMAP mailboxes. If you need POP3/IMAP direct checks, skip ahead to the Zapier and Real Cron Jobs sections below.

For the purpose of this tutorial, we’ll assume you’re using Gmail. Setting up Outlook 365 (if you have the paid service) should be pretty much the same (we haven’t done it ourselves, to be honest, as we don’t have the paid service).

Here’s what you need to do to get bbpnns Reply by Email running with IFTTT:

  1. Create a free IFTTT account just to use with this plugin, if you don’t already have one. Simply go to https://ifttt.com and follow the signup steps. You can also choose to connect with your Google or Facebook account.
  2. Once your account is set up, go to the Gmail service page: https://ifttt.com/gmail (or https://ifttt.com/office_365_mail if you’re setting up your paid Outlook account).
  3. You can only have one connected Gmail account per IFTTT account, so if you already have Gmail connected with your existing IFTTT account, disconnect it *. Then click the big Connect button.This will take you to the Gmail OAuth screen, where you’ll need to log in with the Gmail account you set up in your bbpnns Reply by Email settings screen, and click  ‘Allow’ when prompted.
  4. That’s it for Gmail. Now we need to tell IFTTT that we want to use Webhooks. Go to https://ifttt.com/maker_webhooks and Click connect, just like you did for Gmail.You will not get any Oauth screens or anything. Just the Webhooks screen without the connect button.
  5. Finally, set up your Applet to call our Webhook when new messages arrive. IFTTT seems to check Gmail every minute, so this is by far the best solution you can get. Click My Applets > Create, or go directly to https://ifttt.com/create. You’ll see the new applet screen:
    Click on the big blue “+ this” link (yes, it’s a link – I was a bit lost way back when I first tried it).
  6. Enter Gmail in the “Choose a Service” screen, and click the Gmail icon.
  7. In the Trigger screen that comes up, select the box that says ‘Any new email in inbox’. You’ll be taken back to the New Applet screen with the ‘+ that’ now linked and the Gmail icon replacing the ‘+ this’. Click ‘+ that’ and type Webhooks. Click the Webhooks icon.
  8. Click the ‘Make a web request’ action box (the only one available at the time we wrote this tutorial).
  9. Enter the bbpnns Reply by Email Webhook URL you were given in the plugin’s settings screen in the URL field. Leave the other fields as they are, as they are not important. Finally, click the ‘Create Action’ button at the bottom of the box.
  10. You’re almost there! You can now choose to change the description of your action and whether to receive notifications when the applet runs. Just click ‘Finish’ to complete the applet creation.

Once your applet is created, you can turn it off or on, and also force check the Gmail account.

* You can take a more complicated approach and share a gmail account by setting up labels for messages that contain <you>+usc_ as the beginning of the “to” field, and have the Gmail trigger run when a message gets labeled, but that’s beyond the scope of this tutorial.

Zapier

Zapier is another service like IFTTT, where you get to create “Zaps”. Like IFTTT, you can connect to service providers and create triggers. Unlike IFTTT, it lets you connect to IMAP so you can use it for free Outlook/Hotmail accounts and even your hosting provider’s email service if you’re using that. The downside of using Zapier is that it only checks your mailbox in 15 minute intervals instead of every minute, so your forum participants are likely to think something went wrong and re-send the replies over and over. Each email reply will be translated into a forum reply, even if it’s a duplicate.

IMPORTANT: The bbpnns Reply by Email plugin requires an email server that supports “plus aliases”, i.e. sending messages to foo+bar@domain.com is the same as delivering to [email protected] To our knowledge, the only large hosting providers that currently support this are Gmail and Outlook/Hotmail. The plugin will NOT work without it. Only go the IMAP route if you tested “plus alias” support manually or via the plugin settings screen. You’ve been warned :). Continuing…

To set up a Zap to trigger the webhook, follow these steps:

  1. Create a free zapier account if you don’t have one;
  2. Search for IMAP by Zapier app and select it;
  3. Search for Webhooks by Zapier app and select it;
  4. Click the ‘Use this Zap’ button in the box that says ‘Create Webhook post from new IMAP emails’.
  5. Follow the instructions to create the Zap. When prompted to connect an IMAP account, use the IMAP settings that your hosting provider gave you;
  6. Click Save+Continue;
  7. Select Inbox when prompted to select an IMAP folder. Click Continue;
  8. Click Fetch+Continue to test the connection;
  9. If the test is successful, click Continue to set up the Webhook;
  10. The only option now is to “Fire off a single POST request as a form or JSON”. Click Continue;
  11. Enter the Webhook URL you were given in the bbpnns Reply by Email plugin’s settings screen in the Zapier URL field. Click Contiue;
  12. Click Send Test to Webhooks by Zapier. Don’t worry if it says that the test was successful but no data was available. That’s intentional.
  13. Finally, click finish.

Zapier will check the mailbox for new messages every 15 minutes and call our plugin to do the processing.

Real Cron Jobs

The Cron system was designed to let people run programs at given dates/times or intervals (called jobs). It is essential in any Unix or Linux environment, and all decent hosts will let you create new jobs.

WordPress tried its best to create a faux Cron system for those who can’t or don’t want to deal with real Cron systems. However, because it needs to keep its performance good, it can’t simply run indefinitely in the background waiting for whatever date/time there are jobs to run. It only runs when someone visits your site, so even if you have a job that was set to run at, say, noon every day, and your site only receives a visitor at 5PM, that’s when the noon job will run.

You can (and, for bbpnns Reply by Email to work effectively, should) replace the Cron functionality that’s bundled with WordPress with a real Cron job. It’s quite simple and jsut requires editing wp-config.php to disable the internal WP Cron before running your own.

There are several tutorials available on how to do that. I like the one at SiteGround.

Feel free to follow that tutorial to the letter if you want to (to replace WP Cron), especially if you chose to not use the Webhook.

To get bbpnns Reply by Email to work as a Webhook, you’ll need to add the Webhook command that you got in the Settings screen as a new job in the Cron Job screen in cPanel – you don’t need to replace WP Cron at all.

Set it to run as frequently as possible without enraging your hosting provider. SiteGround asks that you don’t run any jobs in intervals smaller than 30 minutes. This is obviously not frequently enough for any good user experience (where’s my email reply? should I send it again?), which is why using Cron Jobs is last on our list.

Conclusion

This concludes our tutorial on how to set up bbpnns Reply by Email to work with Webhooks. We strongly believe that setting up IFTTT with Gmail is the best option to get the smoothest email to reply user experience.

If you still don’t have the bbpnns Reply by Email plugin,

 

 

A Technical SBI! for WordPress Review

SBI! for WP

It’s no secret that I spend my days working for SiteSell. I joined the SiteSell developer team as a Perl programmer in 2010 to work on their SBI! product. This was shortly before starting to develop WordPress plugins during my free time.

SBI! is a suite of tools to help entrepreneurs build online businesses, regardless of the niche – from cat pictures, to everything asphalt, birthday cakes, costumes – you name it, I’ve seen it! And they’re all very happy campers. SBI! offers them the Action Guide (a huge online book containing steps to follow to get their business up and running), hosting, a site builder, and a ton of other support tools. Perhaps one of the most important is Brainstorm It! – a keyword tool that helps people find their niche and decide which keywords to use in their content, based on interest (monthly searches) and competition (number of sites using the keyword).

One thing SBI! wasn’t prepared to do, however, was help struggling WordPress users with their own sites. So I took it upon myself to try and convince management to address this problem, due to my love of WordPress and its plugin interface.

Fast forward a few years and I find myself as the lead developer for SiteSell’s WordPress division, working on SBI! for WP, an adaptation of the tried and tested SBI! product.

Mike Allton, Susanna Perkins, and myself made up a team tasked with using The Lean Start Up methodology to find out how to best supply SBI! tools to a WordPress audience. After several months talking to bloggers and infopreneurs, we came to the conclusion that adapting Brainstorm It! to work within WordPress would be the best way to get started. And so SBI! for WP was born.

Review of the SBI! for WordPress Initial Process

When a user signs up for SBI! for WP, they get access to a fully revised Action Guide (aka the AG), especially tailored for WordPress users – from choosing hosting to how to select the best plugins . The AG was structured as an online course for ease of use, with completion progress and even a points system.

Once the user is familiar with the steps he needs to take, he can go to the Brainstorm It! tool (on SiteSell’s servers) to set up his niche and Master Keyword List  (the MKL) – a list of up to 5000 keywords related to the business, along with the numbers for interest, competition, and potential.

Review of the SBI! for WP Technical Background

The next step is to download and install the SBI! for WP plugin on their own site (my pride and joy). It’s hard not to get too technical, but this is a technical site so bear with me. I used the MVC Starter Plugin for WordPress (by yours truly), so the code is clean and concise, neatly separated into Models, Views, and Controllers. Communication with SiteSell’s servers is done via back-end API calls, and only when absolutely necessary.

For performance purposes, and as this is purely an Admin tool, it doesn’t even get instantiated on the front end. Once the user installs it, they receive a Welcome admin pointer with the option to take a tour of the settings. When the user connects to SiteSell’s servers, their MKL is downloaded to their site so that they have quick access to the keywords while writing posts or pages (or whatever other Custom Post Type they choose to use the keywords on).

If they want to use a keyword that is not in their MKL, they have the option to add it from the WordPress admin, and both systems are kept in sync. For larger systems that have multiple roles creating/editing content, the admin can choose which roles will have access to the keywords.

When using the keywords in the Edit Post/Page screen, the user also has access to Competitive Insights – a list of sites that use the selected keyword, offering opportunity to reach out and make partnerships. We also keep track of all posts and pages using that keyword within the user’s site.

All in all, SBI! for WP is an awesome service/plugin and I’m tremendously proud to be a part of it!

How to Identify Good WordPress Plugins in 4 Easy Steps

How to Identify Good WordPress Plugins in 4 Easy Steps

Over the past few months I’ve been working with Mike Allton and Susanna Perkins on a project that will try to give info-preneurs using WordPress an edge on creating content for their audience. On one of the less busy days, I wrote the post below detailing how I choose plugins for my clients.


 

How to Identify Good WordPress Plugins in 4 Easy Steps

 

So you’ve finally decided what the focus of your website should be and are ready to set up your WordPress install. You now need to select your theme and a series of plugins to build upon the core functionality you get from WordPress out of the box. With thousands of options to choose from, getting a plugin or theme that will not blow up and bring your site down is a challenge.

There are a few steps you can follow to ensure you have good quality WordPress Plugins for your site. Even if you aren’t a developer and can’t understand a single line of code, using these guidelines as a rule of thumb will give you some level of security.

These are the steps I take when helping my clients decide whether to adopt a plugin or not.

1. Check What Others Have To Say

With close to 40,000 plugins at the time of this writing, WordPress.org offers the ability for users to rate plugins. In the early days, it was possible to select the number of stars for a plugin without commenting on it. To make things fair for authors, people now have to state why they are casting their votes and the authors have the chance to defend themselves, if needed. Plugins with too many low-star ratings should raise a red flag, as long as the comments actually make sense. Be careful of detractors that are only out to troll authors without actually trying to provide constructive criticism.

2. Authors Should Provide (Fast) Support

WordPress.org also offers support forums where users can ask authors for help. Some authors choose to provide support on their own sites. Personally, I think this is valid for paid plugins, but free plugins support should be kept where the free plugins are downloaded. Look for how many resolved topics there are in the recent past, and the time it takes for authors to reply. Authors get notified of new topics immediately, and should have a good reason to not reply within a reasonable time frame.

3. Plugins/Themes Should Be Updated Frequently

Let me take a poetic license here… Code is a Living Entity. There’s seldom such a thing as writing a plugin and never touching it again. It is virtually impossible for any piece of code to not need updates from time to time. With the wide variety of environments out there, there’s bound to be a scenario where a bug patch is needed. Also, WordPress.org is always releasing new updates to the core, and plugins and themes need to keep up. The plugin page will tell you when it was last updated, and up to which version of WordPress it has been tested with.

4. Check For Coding Best Practices

Granted, this part is a bit harder to do if you are not a developer. There are, however, a few things you can look for to identify a well written piece of software. You can find the source code in the “Developers” section of the plugin page in WordPress.org.

Code is like a house – Keep it clean or it’ll become full of bugs. Proper spacing and indentation helps developers to easily understand what each part of the code does, as well as the intention of the previous developer when writing that piece. Another thing that helps understand code is commenting. If you look at the core WordPress files, you’ll see that they went to great lengths to properly document what each piece should do. No author remembers EVERYTHING they had in mind when writing code. If they say they do, run away – they’re either lying or they’re dangerously smart and might try to take over the world.

Object Oriented code is a Good Thing– Gone are the days when people could write code without structure. If you see words like class, static, public, private, protected, or extends, it is quite likely that the developer knew what s/he was doing. For the simpler plugins, this might be overkill as it usually comes hand-in-hand with more files and folders and it might be like killing a fly with a shotgun, but the danger of PHP is that it is so easy to use that it becomes easy to write BAD code.

Closing PHP tags are tricky – PHP comes with open and close tags, <?php and ?> respectively. Any white space after a close tag will be rendered by the web server, many times prematurely. If you see errors such as ‘headers already sent’, the culprit is likely to be white space after a closing PHP tag. Using closing tags at the end of a PHP file is not only unnecessary, but frowned upon. It’s better to see a comment indicating the end of file, than an actual closing tag.

Code should be tested – There are several techniques to test software. WordPress comes with a suite of test files that run via phpunit, a robust PHP testing tool. Plugins and themes should be tested, too. Look for a directory called ‘test’, or simply ‘t’ containing at least one PHP file.

Conclusion

Even if you follow all of these steps to the letter, you might still come across a bug. However, it is much less likely to happen and, if it does, you should be able to get fast support from the author. After all, you did follow step 2, right?

MVC Starter Plugin for WordPress: Parent Class Overview

Inheritance with MVC Starter Plugin for WordPress

Except for Models, all classes in MVC Starter Plugin for WordPress are extensions of the Parent Class, defined in plugin-name.php. This makes it possible to call methods like load_lib() from anywhere in the child classes. This is important also because MVCSP works with singletons whenever possible.

Yes, I’m aware of the war regarding singletons, but when you look at debug logs and see that WordPress reloads your plugin at least twice in some cases, you really want to make sure that you’re not doing things more often than you should. If you still want to avoid singletons in load_lib(), you can. Refer to the section on that method to know more.

Support for PHP < 5.3

MVC Starter Plugin for WordPress comes with a bootstrap() method that instantiates/serves singletons. It relies on the native function get_called_class(), which was made available in PHP version 5.3. For those few who still run on PHP 5.2 and under, I strongly recommend that you have your hosting company upgrade or switch hosting companies to a more serious one. If that’s not a possibility, you can still use this Starter Plugin because it implements its own get_called_class() if the native one doesn’t exist. Like all methods, it is slower than native calls, so it really is better if you upgrade to a modern PHP version.

Best practices

In order to keep my code easily maintainable, I tend to follow these guidelines:

  • Place add_action and add_filter calls in the __construct() of Controllers
  • Make sure to check that admin-related logic is indeed running under the admin with checks to parent::is_admin().
  • Do the same for front-end logic, checking that parent::is_admin() is false.
  • Avoid having calls to non-controller methods inside the Parent Class constructor, with the odd exception of an abstract class that needs to be loaded beforehand.
  • NEVER have a closing PHP tag at the end of any file. Nobody likes to deal with “headers already sent” errors caused by extra space or newlines that shouldn’t be there. Instead, use a comment to indicate that the file has finished.
/* End of file file-name.php */
/* Location: plugin-dir/file-name.php */

Let me know if there are any other best practices you’d like me to add here.

MVC Starter Plugin for WordPress: Set Up

Template Variables

After you download the MVC Starter Plugin for WordPress, you’ll need to replace a few template variables across all existing files with values of your choosing. They are:

PLUGIN_NAME, PLUGIN_DESC, PluginClass, and <plugin-dir>

  • PLUGIN_NAME: The actual name of your plugin. This will appear in the Installed Plugins screen and in the Admin -> Settings submenu.
  • PLUGIN_DESC: The description of the plugin. This will appear in the Installed Plugins screen.
  • PluginClass: The overall class of your plugin. MVCSP is Object Oriented and all Controllers, DAOs, and Views should extend the parent class.
  • <plugin-dir>: MVCSP borrowed the end-of-file style from CodeIgniter, in the sense that it does not close PHP tags but instead has a comment to indicate that the file is not truncated. The <plugin-dir> tag is only used as part of that comment.

The Set-Up Helper Script

There are several methods to replace the template variables with your desired values. I personally like to use grep or find piped into a Perl one-liner. To make things easier, I included a setup.pl script which takes a few parameters and runs some shell commands in the background. This only works for people using Mac or Linux machines, or probably Windows with Cygwin (not having used Windows in years, I haven’t had a chance to test it). Run it without any parameters and this is what you get:

Usage: perl ./setup.pl --long-name="The Plugin Name" --desc="Full Plugin Description" --class-name="DesiredPHPClassName"

All 3 parameters are required. Use a valid class name or your plugin will throw an error during activation.

The parameters are self-explanatory.

Note: Once you’ve run the setup.pl script, the file plugin-name.php will be renamed to whatever name of the domain is. So suppose you extract the Starter Plugin zip file contents in to a directory called my-plugin, the file plugin-name.php will be renamed to my-plugin.php. WordPress will then have my-plugin/my-plugin.php as the plugin signature.

That’s all there is to setting up the Starter Plugin. You can now activate it in your Admin -> Installed Plugins.

If you want to set up your plugin to run tests, refer the Running Tests section.

MVC Starter Plugin for WordPress

A Little Background

This is the seventh anniversary of UseStrict Consulting. It was born out of my passion for Perl, long before I ever thought of writing plugins for WordPress.

A lot has changed since then – I fell in love with building WordPress plugins in 2011. Like with Perl back in 1998, it started as an itch that needed scratching. My first plugin wasn’t a simple task. I wanted to get live shipping rates from Canada Post to use on my wife’s online pharmacy running eShop. The end result was messy, but it worked… and still does!

Fast forward 4 years. Enter the MVC Starter Plugin for WordPress.

MVC Starter Plugin for WordPress

The MVC Starter Plugin for WordPress is the result of best practices adopted from CodeIgniter, Catalyst, and of course, the WordPress Codex. It is a robust Object Oriented Model/View/Controller framework for WordPress plugins. I haven’t released it to Github yet, as it’d be nice to get some peer feedback before I do that.

The framework comes with a few handy methods and classes, as well as test files which can serve as templates for your own tests. They are designed to work with the WordPress Unit Test Suite and phpunit. I’ll be adding the documentation below as time permits, but feel free to download MVC Starter Plugin and play around with it!

Documentation

  1. Download
  2. Set Up
  3. The Parent Class
    1. Overview
    2. Method: bootstrap()
    3. Method: __construct()
    4. Method: is_admin()
    5. Method: load_lib()
    6. Method: load_all()
    7. Method: render_template()
    8. Method: set_env()
    9. Method: get_env()
    10. Method: log_msg()
  4. Admin Notices Controller
    1. The Notice Pool
    2. Method: set_notice()
  5. The Settings API
    1. Setting Controller Class
    2. Settings DAO and Model Classes
    3. The Settings View
  6. Ajax
    1. The Ajax Controller
    2. The Ajax Request Model

bbPress Notify (No Spam) – Opt Out Add-on

bbPress Notify (No spam) was originally built to let admins know when there is a new message in the forums. Over time, it was modified to notify other roles chosen by the Admin. This add-on allows users to opt-out of notifications.

Version 1.0 has arrived!

Version 1.0 is now available at a special price – only $14.99. This is what you get for that price:

  1. 2 available email template tags for unsubscribe URLs:
    1. [opt-out-url-wp] – gets converted into the wp-admin/profile.php URL
    2. [opt-out-url-bbpress] – gets converted into the bbPress profile URL for that user
  2. Your subscribers can opt-out in either profile screen (WP or bbPress). You choose the one that fits you best (for those who have plugins that disable /wp-admin/profile.php for certain users)
  3. bbPress Subscriptions screen will tell your subscriber whether he has opted out.
  4. From your subscriber’s point of view, nothing happens if he is not part of one of the roles selected to receive notifications.
  5. This price is for version 1.0 only. Once I add more functionality, the price goes up for new buyers.

Please sign up below to receive updates regarding the development process.

Cheers,
Vinny

eShop PayPal Pro Merchant Gateway

eShop PayPal Pro Merchant Gateway allows you to collect Credit Card payments without the need for your client to leave your site.

Installation

  1. Download eshop-paypal-pro.zip and upload it to to your blog’s wp-content/plugins directory;
  2. Activate the plugin in your Plugin Admin interface;
  3. Go to the Settings -> eShop -> Merchant Gateways and enter your sandbox and live PayPal credentials.

Overview

eShop for WordPress comes with basic PayPal support out of the box. This means that your client gets sent to PayPal to make their payments and has the option of not returning. With eShop PayPal Pro Merchant Gateway plugin, you can collect the payment directly from the checkout page, no redirections to outside servers whatsoever.

For PCI compliance, no Credit Card data gets stored. It is up to you, however, to set up SSL on the checkout page.

Settings

Once you activate this plugin, a new section is shown under Settings -> eShop -> Merchant Gateways.

eShop PayPal Pro Settings

Tick the ‘Accept payment by PayPal Pro’ box and enter your Sandbox and Live PayPal credentials (API Username, API Password, and Signature). If you don’t use PayPal Payments Pro yet, click here to learn more about it.

Tick the credit cards that you want to use – note that PayPal does not allow American Express and Discover in certain regions. Make sure to test those cards before going live. Test credit card numbers can be found here.

Click ‘Save Changes’ and you’re good to go.

Checkout

When your clients reach the checkout page, they will see the Credit Card option as one of the payment methods. If it is the only active option, the CC fields will be visible. The type of credit card is identified automatically when the clients type in the number. If there are more Payment options, the fields will only be displayed if the clients click on the CC radio button.

Credit Card Option with Hidden Fields

Credit Card Option with Hidden Fields

Credit Card Fields Displayed

Credit Card Fields Displayed

Fields Shown Automatically

Fields shown automatically when it is the only option available

Confirmation Page

The confirmation page will show only the last four digits of the credit card number and card type.

Confirmation Page Data

Confirmation Page Data

eShop Multi-Currencies Plugin for WordPress

eShop Multi-Currencies plugin allows you to offer your products using over 165 currencies, with automatic exchange rate updates.

Installation

  1. Download eshop-multi-currency.zip and upload it to to your blog’s wp-content/plugins directory;
  2. Activate the plugin in your Plugin Admin interface;
  3. Go to Settings -> eShop -> Currencies tab to customize your settings.

Overview

eShop Multi-Currencies plugin for WordPress gives you the ability to offer multiple currencies to your visitors. Select from over 165 currencies and display your chosen ones via a widget or shortcode. eShop’s default currency settings (base currency and base currency symbol) are moved to the new Currencies tab under eShop -> Settings, where you can also select whether to fetch exchange rates via OpenExchangeRates.org. Display allowed currencies using either a shortcode or a widget.

Settings

Once you activate this plugin, a new Tab is shown under Settings -> eShop -> Currencies.

The new currencies tab on the far right.

The new currencies tab on the far right.

Base Currency

You will also find that the currency symbol and currency options that were originally under ‘General’ and ‘Merchant Gateways’ tabs, respectively, have been moved to the new tab under the ‘eShop Base Currency’ box.

eShop Base Currency Settings

eShop Base Currency Settings

In addition to those two items, you can also select to have the plugin always send the base currency to the merchant gateway, or whatever currency the client has selected. CAVEAT: This is a potentially dangerous option, depending on the merchant gateway. Potential issues include failed transaction due to currency not accepted by the gateway, failed transaction due to given currency different from base currency without explicit acceptance in the gateway settings (outside of eShop), or even additional currency conversion fees. Make sure you know what you’re doing and test it out in a sandbox before using this option.

Open Exchange Rates

When dealing with multiple currencies, the system needs to know the exchange rates for each selected option. The plugin comes with integration with http://openexchangerates.org and instructions on how to get a free account. Due to performance reasons, exchange rates are not fetched in real time, but scheduled from hourly to monthly. You can also force the system to update on demand.

Open Exchange Rates

Allowed Currencies

The next section is for the actual allowed currencies. Choose as many currencies as you want (remember to play by your Merchant Gateway’s rules), and set the name, symbol, conversion rate (if you’re not using OXR as that sets it for you). You can also adjust fixed rates and percentages if you feel you need to. If you want to deactivate a currency without actually removing it, just toggle the ‘Active’ checkbox.

Allowed Currencies

Allowed Currencies

 eShop Orders Screen

To help you keep track of the currencies the sales have been made in (for those passing the non-base currency to the Merchant Gateways), All orders screens have been updated to display the 3-letter currency code instead of the base currency’s symbol.

User Preferences

Currency preference is kept via a cookie in your customer’s browser. When he completes the payment and opts to create an account, the preferred currency is stored and is viewable/modifiable under your customer’s profile screen.

Shortcode and Widget

You can place the currency selector drop-down anywhere you want by using the [emc-currency-selector] shortcode, or the special widget provided by the plugin. To add it directly to your theme, call

<?php echo do_shortcode('[emc-currency-selector]'); ?>

Requirements

This plugin uses shortcode_exists(), which was added in WP 3.6. It has been tested with WP v4.1 and newer.

Bugs

This plugin has been tested extensively. We do our best to provide as bug-free code as possible, but we cannot possibly test with all the different scenarios in the wild. If you find a bug, please let us know via our contact form.

Thanks

We’d like to thank Triple Ace Games for helping fund this project. Feel free to pay them a visit as they have some pretty cool products :).