Giter VIP home page Giter VIP logo

pmpro-affiliates's People

Contributors

andrewlimaza avatar dparker1005 avatar eighty20results avatar github-actions[bot] avatar ideadude avatar ipokkel avatar jarrydlong avatar kimcoleman avatar kimwhite avatar messica avatar ttshivers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pmpro-affiliates's Issues

Allow Affiliate to see conversion "Report" data

From the blog comments - a Plus user requested the ability to the Member/Affiliate to see the “number of visits” in their Referral Report / Members Front End Report as well as their list of conversions.

The back end site admins can see each individual affiliate generated number of visits in the “Manage Affiliates” tab as per your screen shot above. Site admins can also see each individual Member/Affiliate list of conversions.

They would like the Affiliate Report to also show this data.

Track Free Checkouts As Well

Because the tracking uses the pmpro_after_checkout hook, which isn't fired for free memberships, free memberships are not tracked as affiliate "sales". They should be.

Figure out a way to do this.

Reports

How do affiliates see their own reports?
I don't want to make them administrators

Affiliates credited with checkout as soon as user is sent to PayPal Express

When a user checks out using PayPal Express, PMPro creates an order in pending status and the order is linked to the referring affiliate. After the checkout is complete, PMPro changes that status to success.

The issue here is that our affiliate reports search for all orders linked to an affiliate regardless of status. We should hide orders with pending, review, or refunded status from affiliate reports as those orders were either not complete or were refunded.

This would require adding an extra condition every time that we query the pmpro_membership_orders table.

Repeat checkout not tracked if done from different device

I have a setup where all my levels are not reccurring and they have expiration periods.
I tried registering a new account with an affiliate code from an existing account and the affiliate was tracked.
Then i tried to change my level from this new account from the same pc where i registered with the affiliate code and it was still fine, i was able to see the new payment in the affiliates page of the original account.

Then when i tried to change the membership again from the second account but on a different device (one that doesn't have the cookie set), the order was not processed as an affiliate order, im not able to see it in the affiliates page of the first account nor in the admin panel. Also checked the database and it seems that the affiliate_id field is not set for this particular order.

I think that an extension is required, that will make sure that the first time when a cookie is detected, a new column is added to the users table, which column contains the affiliate code the user has registered with. And on subsequent transactions, if the cookie is not present or no longer valid, this field will be checked and the order awarded to the referrer that has this code

Add Hook for Custom Code to Add Columns to the Admin Tables

Is your feature request related to a problem? Please describe.
We want to keep this plugin as lightweight as possible. Specifically, we do not have any plans to add the concept of a commission percentage or a calculation of someone's payouts.

We could, though, add a hook so custom code can add columns to the tables in the admin for the "Manage Affiliates" screen or the "Reports" screen.

Users could then add a custom admin-only field using Register Helper OR set a sitewide default based on the level of the conversion. Then use this new hook to show the affiliate's rate on the all view, and a calculated commission on the report view.

Describe the solution you'd like
Add a hook to the "Manage Affiliates" screen and the "Reports" screen for the header row, and each data row. We also need to account for the report export to CSV and include this data in that export.

The approach will be similar to these hooks on the core PMPro Discount Codes screens: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/adminpages/discountcodes.php#L791 and https://github.com/strangerstudios/paid-memberships-pro/blob/dev/adminpages/discountcodes.php#L955

And this filter for the CSV Orders Export: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/adminpages/orders-csv.php#L349

Once we code this, let's include writing up the recipe to add additional columns to show the Affiliate's referral rate (pulled from a site global fixed rate in the recipe) and on the report screen, a calculation of the affiliate payout for the referral.

Question: should we consider a hook on the frontend output of the shortcode, too, so that sites can show the commission there?

Add affiliate commission rate option

Is your feature request related to a problem? Please describe.
It would be nice to set a commission rate before an affiliate is created.

Describe the solution you'd like
Allow site owners to have an option to set the commission rate.

This came up in ticket 475898.

Adding this string `&pa=marypmpro` returns a "page not found"

Describe the bug
The and (&) &pa=marypmpro string returns a page not found both on local and live sites. Using the question mark string ?pa=marypmpro works as intended.

To Reproduce
Steps to reproduce the behavior:

  1. Activate PMPro Affiliates Add On
  2. Add new affiliate
  3. copy the affiliate link and replace ? with the & string and add to any page on your site or homepage
  4. See error " Page Not Found"

Screenshots
Screen Shot 2021-03-09 at 9 41 59 PM

Expected behavior
The & string should work as stated on our front end Affiliates reports page.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin and PMPro Affiliates Add On is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

``` WordPress version - 5.6.2 PHP version - 7.4.14 Paid Memberships Pro - 2.5.6 PMPro Affiliates Add On - 0.4.1 ```

All of our affiliate add ons use the same affiliate_id DB column in the orders table to track things.

Describe the bug
All of our affiliate add ons use the same affiliate_id DB column in the orders table to track things.

And so if you have more than one of these add ons running at the same time, the reports will double count orders for each affiliate system.

For example, on our site we used AffiliateWP for affiliates, but also used the lightweight affiliate tracking plugin to track some random landing pages set up for special occasions. If the affiliate ID 27 was already being used for the other affiliate app, there would already be orders tracked for a newly created affiliate with ID 27.

The work around now is to make sure that you affiliate IDs don't overlap. You can do something to make sure one or the other affiliate apps starts their IDs at 10000 or something to avoid the overlap.

We could append an affiliate app slug to the affiliate_id column in the DB. And update all code to use that. We'd have to update the affiliate plugins. We would have to update existing orders. Most of the affiliate plugins also log a note. So we can double check the note before adjusting the affiliate_id column.

BUG: Recurring orders may not continue to be tracked for affiliate

pmpro_affiliates_pmpro_added_order() runs on pmpro_added_order hook, so after the order is added to the database.

It looks like this code should get the affiliate for previous orders in the subscription, but the SQL query gets the most recent order, which is the one that was just added, so it will never find an affiliate:

if(!empty($order->subscription_transaction_id))
{
$lastorder = $wpdb->get_row("SELECT affiliate_id, affiliate_subid FROM $wpdb->pmpro_membership_orders WHERE user_id = '" . esc_sql($order->user_id) . "' ORDER BY id DESC LIMIT 1");
if(!empty($lastorder->affiliate_id))
{
$affiliate_id = $lastorder->affiliate_id;
$affiliate_subid = $lastorder->affiliate_subid;
$affiliate_code = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_affiliates WHERE id = '" . esc_sql($affiliate_id) . "' LIMIT 1");
}
}

Suggested fix is to update the SQL query to find any order for that user with an identical subscription ID to the order being added that also has a non-empty affiliate. This should also make this excerpt of code MMPU-compatible.

PMPRO and Affiliates Pro

I have installed both affiliates pro, Pmpro and the woocommerce integrated plugin
I have membership levels

Upon check out, the systems records the new member and their subscription
however, it does not record for affiliates pro the membership and the amount they are due
Do I need to create products that are identified as membership in woocommerce products
in order for affiliates pro to record the values of the memberships?

Under woocommerce I do not have products defined
only memberships in membership pro and the correct pages associated with them.
thanks

PHP 8.0 causes error

Describe the bug
A customer (ticket 448247) ran into this error after upgrading to PHP 8.0:

Warning: Undefined array key “edit” in /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-auto-renewal-checkbox/pmpro-auto-renewal-checkbox.php on line 38

To Reproduce
Steps to reproduce the behavior on customer site:

  1. Activate Paid Memberships Pro, and Affiliates Add On Add On
  2. Set PHP version to PHP 8.0 or higher, see the following error on the main (paid) checkout page:

Warning: Undefined array key “pmpro_affiliates_recurring” in /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php on line 187 Warning: Cannot modify header information – headers already sent by (output started at /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php:187) in /usr/www/users/x/y.x.com/wp-includes/pluggable.php on line 1421 Warning: Cannot modify header information – headers already sent by (output started at /usr/www/users/x/y.x.com/wp-content/plugins/pmpro-affiliates/pmpro-affiliates.php:187) in /usr/www/users/x/y.x.com/wp-includes/pluggable.php on line 1424

Expected behavior
There should not be an error.

Isolating the problem:

  • Deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro, and Affiliates Add On 0.5 is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • Can reproduce this bug consistently using the steps above.

This came up in ticket 441951, but I have not been able to replicate this.

WordPress Environment

Paid Memberships Pro 2.9.5, Affiliates Add On 0.5, WordPress 6.0.2, PHP 8.0.22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.