Introduce new test_admin_has_caps() test
Fix undefined property
Rework affwp_add_referral() to allow an affiliate id or a user id to be passed. Closes #390
Take coupon codes into account when calculating the referral totals in WooCommerce. #375