Optimization

Estimated reading: 3 minutes 879 views

Optimizing myCred

myCred was built on a “opt-in” principle, meaning that by default, everything is turned off and only some core features are enabled.

 

When you install myCred and finish the setup by creating your first point type, myCred will add three main features:

  • Ability for each user on your website to have a point balance.
  • Ability for admins to edit balances and
  • A log to keep track of your users balance adjustments.

 

The rest of the features are mainly Automatic Points via Hooks and Add-ons you enable.

Hooks

When it comes to automatic points via Hooks, it is important that you only have the hooks you want to use active. This will cut down on tasks that the plugin might need to perform. As of version 1.7, this is done by making sure only the hooks you use is in the Active sidebar.

Add-ons

It is very important that you only enable add-ons you are using! You might have enabled add-ons to test them out, and they are still sitting there, enabled and consuming resources. Go to your Add-ons page and make sure you disable the add-ons you do not use.

Point Types

Each point type you setup on your website will use resources, so the more types you have setup, the more resources will be required. Technically there is no limit to how many point types you setup but sooner or later you will reach limits on memory or CPU load limits. The number of types you can have is arbitrary and depend on factors like:

  • The number of active features that are enabled for each point type.
  • The total number of transactions your server has to process.
  • The frequency of these transactions.
  • The number of plugins you have installed on your website along with how much resources they consume.
  • Your theme.
  • Your actual server and it’s allocated resources / capabilities.

Exclusions

If there is a certain set of users that have nothing to do with points, they should be excluded. This will prevent their actions from triggering anything myCred related, which in turn saves your server from having to perform extra tasks.

 

myCred can exclude automatically your Administrators and Editor accounts while you can also provide a comma separated list of IDs to ignore. If you need to exclude users based some other details e.g. WordPress role or membership, you can use the mycred_exclude_user filter.