Banking Add-on

The banking add-on is a complex mathematical add-on that allows you to pay compound interest on users point balances, setup a central bank or setup recurring point payouts for your users.

This add-on has received a mayor rewrite in version 1.7 introducing new features and improvements.

Installation

Once the add-on is enabled, a new Banking menu becomes available for each point type you have installed. This allows you to enable and setup services for each point type.

The myCRED Banking add-on screen.

Central Banking Service

By default, points are created from “thin air” when users gain points and when a user looses points, the points are simply deleted. The central banking service allows you create x amount of points that are instead used to give to users. When a user spends or looses points, the points are deposited back into the central bank account.

This of course means that if the “central bank” runs out of points, then no more points are given to users until points are either deposited back to the central account or if you add points manually to the account.

This works by you nominating a particular user account on your website to act as the “central bank”. You then add points to this account to get started. Finally you will need to tell myCRED which user account this is and the plugin does the rest.

myCRED Central Banking settings.

Make sure you do not nominate a user account that is set to be excluded to serve as the Central Bank account!

If you want to be able to give points to users manually without involving the central bank account, make sure you set to “Ignore Manual Adjustments” in your service settings!

The WordPress CRON

1.7 Cron schedule warning.

Both the Recurring Payouts and Compound Interest services uses the WordPress CRON to manage when to compound or when to payout. If you have disabled the CRON on your website, these services will not work. Furthermore, it is important to remember that these scheduled jobs will not run on time if your website has no visits at the scheduled moment. So if you schedule something to run for example at noon, but no one visits the website until an hour later, the scheduled job will run first then. There are solutions to this using alternative CRONs or server scripts.

As of version 1.7, if you have disabled the built-in CRON, a warning message will be shown when you look at the services settings. This warning will appear even if you are using alternative CRON solutions.

Troubleshooting

If your website receives no visitors when the schedule is supposed to run, the recurring payout will not start. Furthermore on websites where the CRON is stuck on a scheduled event, the recurring payout schedule (along with other schedules) will not run either.

Compound Interest Service

The Compound Interest service allows you to payout interest on your users points balances. Interest is compounded daily and you can select if you want to payout weekly, monthly, quarterly or annually.

You can set the interest rate both globally and individually for each user. You can also select if users must have a minimum amount of points for interest to compound on their account and select which users to exclude based on user ID or by role.

myCRED compound interest settings.

The Daily Compound Schedule

When you enable the add-on for the first time, we are required to set when you want to start compounding interest on accounts. This is done by setting the year, month, day and hour and of course it must be in the future and not in the past.

Once started, you will see the date for the next schedule faded in the table. You can at any time, change this by entering in a new year, month, day and time. Even if you only want to change one field, all fields must be filled out!

Payout Schedule

You can select to payout daily, weekly, monthly, quarterly, biannually or annually. To enable this add-on you must set the first payout date and based on your “Payout Frequency” settings, the service will schedule the next one once it completes the first one. Do not schedule payout to run on the same hour as the compound schedule! Preferably, the compounding should run before payout, both running at the same time will result in incorrect payouts.

Just like the Daily Compound Schedule, you can change the payout schedule at any time.

Recurring Payout Service

As the name suggests, this service allows you to setup recurring payouts for your users. As of version 1.7, you can setup multiple recurring payouts for each point type and no longer just one per type.

The service must be enabled for your schedules to run! Disabling the service will not delete your schedules but they will stop working. When you re-enable the service, your scheduled payouts will be re-scheduled. If the service has been disabled long enough that one or more scheduled payouts have missed their date, they will be disabled and you will be required to delete them and create new ones.

Recurring payout overview.

As of version 1.7, you can add a new recurring payout using the “Add New” button.

Each recurring payout can be setup hourly, daily, weekly, monthly, quarterly, biannually and annually with technically an unlimited number of repeats (but one must be set). You an exclude or include users by ID and/or roles and set a minimum and/or maximum balance requirement to get points.

Add New Recurring Payout

At a bear minimum, you are required to give your payout a title, set the amount you want to give, how often, what to show in the users log for each payout, the start date and the number of times to repeat. Once the payout reaches the repeat limit you set, it will disable itself after the last run.

As of version 1.7, you can also set a limit to which of your users will receive these points. You can set the following limitations:

  • Require a minimum and/or maximum balance.
  • Require users to have a certain role (Include) or exclude users based on their rank (Exclude).
  • Limit payout to a list of user IDs (Include) or exclude a list of IDs (Exclude). This list must be a comma separated list of the numeric IDs of the users without any empty space.

If you are using the Central Banking Service, you can also select if you want to pay users even if the central bank runs out of funds. This settings will not be visible if the service is not used.

Note that users you have excluded from your point type will also be excluded by this service!

New recurring payout setup modal.

The user role include / exclude option requires WordPress 4.4 or higher to work!

You can always check the latest status of any recurring payout.

Viewing a Schedule

As of version 1.7, you can select to “View” each scheduled payout you have setup. This popup will display the current status of your setup. Besides the setup, you can also see:

  • The total amount of points that the setup has paid out till this day.
  • The total number of completed payouts. ( runs x eligible users at each run ).
  • The total number of misses.
  • The number of runs that remain.

A “miss” is an instance where someone we requested to pay did not receive their points. This can be due to the user being excluded, custom code on your site is declining the payout or if you use the central banking service, the central bank has run out of funds (and you selected to honour this).

Large Websites

By default, both the Compound Interest and Recurring Payout services will only run a maximum 1500 users in each scheduled instance. If more then 1500 balances need to be compounded or paid, the add-on will schedule a new instance 2 min after the original starting point. It will continue to do this until everyone has been processed.

This is to prevent the script from timing-out on large sites. You can change this value using the mycred_recurring_max_limit or the mycred_compound_max_limit filters.

It is especially important to keep in mind when setting up an hourly recurring payout. With a limit of 1500, you can maximum pay 45000 users before the scripts starts over.

Last edited August 12, 2016