├── languages
├── pmpro-affiliates.mo
├── pmpro-affiliates-de_DE.mo
├── pmpro-affiliates.pot
├── pmpro-affiliates.po
└── pmpro-affiliates-de_DE.po
├── includes
├── css
│ └── frontend.css
├── updates
│ └── upgrade_0_6.php
├── blocks.php
└── js
│ └── admin.js
├── blocks
└── build
│ └── pmpro_affiliates_report
│ ├── index.asset.php
│ ├── block.json
│ ├── index.js.map
│ └── index.js
├── adminpages
├── settings.php
├── report-csv.php
├── report.php
└── affiliates.php
├── readme.txt
├── pages
└── report.php
└── pmpro-affiliates.php
/languages/pmpro-affiliates.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/strangerstudios/pmpro-affiliates/HEAD/languages/pmpro-affiliates.mo
--------------------------------------------------------------------------------
/includes/css/frontend.css:
--------------------------------------------------------------------------------
1 | .pmpro_affiliates-table {
2 | max-height: 500px;
3 | overflow-y: auto;
4 | overflow-x: hidden;
5 | }
6 |
--------------------------------------------------------------------------------
/languages/pmpro-affiliates-de_DE.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/strangerstudios/pmpro-affiliates/HEAD/languages/pmpro-affiliates-de_DE.mo
--------------------------------------------------------------------------------
/blocks/build/pmpro_affiliates_report/index.asset.php:
--------------------------------------------------------------------------------
1 | array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'c5ab3cdc9d6d77c51ae8');
2 |
--------------------------------------------------------------------------------
/includes/updates/upgrade_0_6.php:
--------------------------------------------------------------------------------
1 | hide_errors();
9 |
10 | $affiliate_options = get_option( 'pmpro_affiliates_options', false );
11 |
12 | if ( ! $affiliate_options ) {
13 | $affiliate_options = array();
14 | }
15 |
16 | // Let's not run this code if we are running a later version.
17 | if ( $affiliate_options['db_version'] >= 0.6 ) {
18 | return;
19 | }
20 |
21 | // Add the commissionrate column.
22 | $sqlQuery = "
23 | ALTER TABLE `" . $wpdb->pmpro_affiliates . "` ADD `commissionrate` decimal(10,2) NOT NULL DEFAULT '0.00' AFTER `enabled`;
24 | ";
25 | $wpdb->query( $sqlQuery );
26 |
27 | $affiliate_options['db_version'] = '0.6';
28 | update_option( 'pmpro_affiliates_options', $affiliate_options, false );
29 |
30 | return 0.6;
31 | }
--------------------------------------------------------------------------------
/blocks/build/pmpro_affiliates_report/block.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schemas.wp.org/trunk/block.json",
3 | "apiVersion": 2,
4 | "name": "pmpro-affiliates/pmpro-affiliates-report",
5 | "version": "1.0.0",
6 | "title": "PMPro: Affiliates Report",
7 | "icon": "editor-table",
8 | "description": "Frontend affilaites report for PMPro.",
9 | "supports": {
10 | "html": false
11 | },
12 | "category": "pmpro",
13 | "textdomain": "pmpro-affiliates",
14 | "attributes": {
15 | "back_link": {
16 | "type": "boolean",
17 | "default": true
18 | },
19 | "export_csv": {
20 | "type": "boolean",
21 | "default": true
22 | },
23 | "help": {
24 | "type": "boolean",
25 | "default": true
26 | },
27 | "show_conversion_table": {
28 | "type": "boolean",
29 | "default": false
30 | },
31 | "show_commissions_table": {
32 | "type": "boolean",
33 | "default": false
34 | },
35 | "code": {
36 | "type": "boolean",
37 | "default": false
38 | },
39 | "subid": {
40 | "type": "boolean",
41 | "default": false
42 | },
43 | "name": {
44 | "type": "boolean",
45 | "default": false
46 | },
47 | "user_login": {
48 | "type": "boolean",
49 | "default": true
50 | },
51 | "date": {
52 | "type": "boolean",
53 | "default": true
54 | },
55 | "membership_level": {
56 | "type": "boolean",
57 | "default": true
58 | },
59 | "show_commission": {
60 | "type": "boolean",
61 | "default": false
62 | },
63 | "total": {
64 | "type": "boolean",
65 | "default": true
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/includes/blocks.php:
--------------------------------------------------------------------------------
1 | 'pmpro_affiliates_block_report',
11 | 'render_callback' => 'pmpro_affiliates_report_shortcode',
12 | 'attributes' => array(
13 | 'back_link' => array(
14 | 'type' => 'boolean',
15 | 'default' => true,
16 | ),
17 | 'export_csv' => array(
18 | 'type' => 'boolean',
19 | 'default' => true,
20 | ),
21 | 'help' => array(
22 | 'type' => 'boolean',
23 | 'default' => true,
24 | ),
25 | 'code' => array(
26 | 'type' => 'boolean',
27 | 'default' => false,
28 | ),
29 | 'subid' => array(
30 | 'type' => 'boolean',
31 | 'default' => false,
32 | ),
33 | 'name' => array(
34 | 'type' => 'boolean',
35 | 'default' => false,
36 | ),
37 | 'user_login' => array(
38 | 'type' => 'boolean',
39 | 'default' => true,
40 | ),
41 | 'date' => array(
42 | 'type' => 'boolean',
43 | 'default' => true,
44 | ),
45 | 'membership_level' => array(
46 | 'type' => 'boolean',
47 | 'default' => true,
48 | ),
49 | 'show_conversion_table' => array(
50 | 'type' => 'boolean',
51 | 'default' => false,
52 | ),
53 | 'show_commissions_table' => array(
54 | 'type' => 'boolean',
55 | 'default' => false,
56 | ),
57 | 'show_commission' => array(
58 | 'type' => 'boolean',
59 | 'default' => true,
60 | ),
61 | 'total' => array(
62 | 'type' => 'boolean',
63 | 'default' => true,
64 | )
65 | )
66 | )
67 | );
68 | }
69 | add_action( 'init', 'pmpro_affiliates_register_block_type' );
70 |
71 | /**
72 | * Enqueue the Block Scripts for both blocks.
73 | *
74 | * @since 1.2
75 | */
76 | function pmpro_affiliates_block_scripts() {
77 | wp_enqueue_script(
78 | 'pmpro_affiliates_block_report',
79 | plugins_url( 'blocks/build/pmpro_affiliates_report/index.js', __DIR__ ),
80 | plugins_url( 'blocks/build/pmpro_affiliates_report/index.asset.php', __DIR__),
81 | array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components', 'wp-i18n' ),
82 | PMPRO_AFFILIATES_VERSION
83 | );
84 |
85 | }
86 | add_action( 'enqueue_block_editor_assets', 'pmpro_affiliates_block_scripts' );
--------------------------------------------------------------------------------
/includes/js/admin.js:
--------------------------------------------------------------------------------
1 | jQuery(document).ready(function () {
2 | // Functionality to mark commission as paid for a particular order.
3 | jQuery('.pmpro_affiliates_mark_as_paid').on('click', function (e) {
4 | e.preventDefault();
5 |
6 | var data = {
7 | action: 'pmpro_affiliates_mark_as_paid',
8 | order_id: jQuery(this).attr('order_id'),
9 | paid_status: pmpro_affiliates_admin.paid_status,
10 | _wpnonce: jQuery(this).attr('_wpnonce')
11 | }
12 |
13 | jQuery.ajax({
14 | url: pmpro_affiliates_admin.ajaxurl,
15 | type: 'POST',
16 | timeout: 2000,
17 | dataType: 'html',
18 | data: data,
19 | error: function (xml) {
20 | alert('Error marking as paid.');
21 | },
22 | success: function (responseHTML) {
23 | if (responseHTML == 'error') {
24 | alert('Error marking item as paid.');
25 | } else {
26 | jQuery('#order_' + data.order_id).html(data.paid_status);
27 | }
28 | }
29 | });
30 | });
31 |
32 |
33 | // Functionality to reset paid commissions to unpaid for a particular order.
34 | jQuery('.pmpro_affiliates_reset_paid_status').on('click', function (e) {
35 | e.preventDefault();
36 |
37 | var data = {
38 | action: 'pmpro_affiliates_reset_paid_status',
39 | order_id: jQuery(this).attr('order_id'),
40 | reset_status: pmpro_affiliates_admin.reset_status,
41 | _wpnonce: jQuery(this).attr('_wpnonce')
42 | }
43 |
44 | jQuery.ajax({
45 | url: pmpro_affiliates_admin.ajaxurl,
46 | type: 'POST',
47 | timeout: 2000,
48 | dataType: 'html',
49 | data: data,
50 | error: function (xml) {
51 | alert('Error resetting order.');
52 | },
53 | success: function (responseHTML) {
54 | if (responseHTML == 'error') {
55 | alert('Error resetting paid status.');
56 | } else {
57 | jQuery('#order_' + data.order_id).html(data.reset_status);
58 | }
59 | }
60 | });
61 | });
62 |
63 | // Functionality for autocomplete search via AJAX using autocomplete jQuery
64 | jQuery(function () {
65 | var searchRequest;
66 | jQuery('#affiliateuser').autocomplete({
67 | delay: 500,
68 | source: function (term, suggest) {
69 | try { searchRequest.abort(); } catch (e) { }
70 | searchRequest = jQuery.post(pmpro_affiliates_admin.ajaxurl,
71 | {
72 | search: term.term,
73 | action: 'pmpro_affiliates_autocomplete_user_search',
74 | search_nonce: pmpro_affiliates_admin.search_nonce
75 | },
76 | function (res) {
77 | suggest(res.data);
78 | });
79 | }
80 | });
81 | });
82 | }); //end of document ready
83 |
--------------------------------------------------------------------------------
/adminpages/settings.php:
--------------------------------------------------------------------------------
1 | $pmpro_affiliates_singular_name,
38 | 'pmpro_affiliates_plural_name' => $pmpro_affiliates_plural_name,
39 | 'pmpro_affiliates_recurring' => $pmpro_affiliates_recurring,
40 | );
41 | update_option("pmpro_affiliates_settings", $pmpro_affiliates_settings);
42 |
43 | ?>
44 |
47 |
50 |
51 |
86 |
--------------------------------------------------------------------------------
/adminpages/report-csv.php:
--------------------------------------------------------------------------------
1 | get_row( "SELECT * FROM $wpdb->pmpro_affiliates WHERE id = '" . intval( $affiliate_id ) . "' LIMIT 1" );
14 | if ( ! empty( $affiliate ) && ! empty( $affiliate->id ) ) {
15 | $code = $affiliate->code;
16 | $name = $affiliate->name;
17 | $affiliateuser = $affiliate->affiliateuser;
18 | $trackingcode = $affiliate->trackingcode;
19 | $cookiedays = $affiliate->cookiedays;
20 | $enabled = $affiliate->enabled;
21 | }
22 | }
23 |
24 | // Only admins can get this.
25 | if ( ! function_exists( 'current_user_can' )
26 | || ( ! current_user_can( 'manage_options' ) && ! current_user_can( 'pmpro_affiliates_report_csv' ) && ( $report != 'all' && $current_user->user_login != $affiliate->affiliateuser ) )
27 | ) {
28 | die( esc_html__( 'You do not have permissions to perform this action.', 'pmpro-affiliates' ) );
29 | }
30 |
31 | $sql_query = "SELECT o.id as order_id, a.code, a.commissionrate, o.affiliate_subid as subid, a.name, u.user_login, o.user_id, o.membership_id, UNIX_TIMESTAMP(o.timestamp) as timestamp, " . esc_sql( 'o.' . pmpro_affiliates_get_commission_calculation_source() ) . " as total, o.status, om.meta_value as affiliate_paid
32 | FROM $wpdb->pmpro_membership_orders o
33 | LEFT JOIN $wpdb->pmpro_affiliates a
34 | ON o.affiliate_id = a.id
35 | LEFT JOIN $wpdb->users u
36 | ON o.user_id = u.ID
37 | LEFT JOIN $wpdb->pmpro_membership_ordermeta om
38 | ON o.id = om.pmpro_membership_order_id
39 | AND om.meta_key = 'pmpro_affiliate_paid'
40 | WHERE o.affiliate_id <> ''
41 | AND o.affiliate_id IS NOT NULL
42 | AND o.affiliate_id <> 0
43 | AND o.status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')";
44 |
45 |
46 | if ( $report !== 'all' ) {
47 | $sql_query .= " AND a.id = '" . esc_sql( $report ) . "' ";
48 | }
49 | $affiliate_orders = $wpdb->get_results( $sql_query );
50 |
51 | // Begin output.
52 | header( 'Content-type: text/csv' );
53 | header( 'Content-Disposition: attachment; filename=affiliates_report.csv' );
54 |
55 | // Headings.
56 | $headings = array(
57 | 'code',
58 | 'sub_id',
59 | 'user_id',
60 | 'user_login',
61 | 'affiliate_name',
62 | 'date',
63 | 'commission_rate',
64 | 'commission_earned',
65 | 'total',
66 | );
67 |
68 | /**
69 | * Filter the headings for the CSV export.
70 | *
71 | * @param array $headings The headings for the CSV export.
72 | *
73 | * @return array The modified headings.
74 | */
75 | $headings = apply_filters( 'pmpro_affiliate_list_csv_extra_columns', $headings ); // Add to the string.
76 |
77 | echo implode( ',', $headings ) . "\n";
78 |
79 | if ( ! empty( $affiliate_orders ) ) {
80 | global $pmpro_currency_symbol;
81 | foreach ( $affiliate_orders as $order ) {
82 | $level = pmpro_getLevel( $order->membership_id );
83 |
84 | $pmpro_affiliate_report_data = array(
85 | pmpro_enclose( $order->code ),
86 | pmpro_enclose( $order->subid ),
87 | pmpro_enclose( (int) $order->user_id ),
88 | pmpro_enclose( $order->user_login ),
89 | pmpro_enclose( $order->name ),
90 | pmpro_enclose( date_i18n( 'Y-m-d', $order->timestamp ) ),
91 | pmpro_enclose( $order->commissionrate * 100 ) . '%',
92 | pmpro_enclose( number_format( $order->total * $order->commissionrate, 2 ) ),
93 | pmpro_enclose( $order->total ),
94 | );
95 |
96 | /**
97 | * Filter the data for the CSV export.
98 | *
99 | * @param array $pmpro_affiliate_report_data The data for the CSV export.
100 | * @param object $order The order object.
101 | * @param object $level The membership level object.
102 | * @return array The modified data.
103 | */
104 | $pmpro_affiliate_report_data = apply_filters( 'pmpro_affiliate_list_csv_extra_column_data', $pmpro_affiliate_report_data, $order, $level );
105 |
106 | echo implode( ',', $pmpro_affiliate_report_data ) . "\n";
107 | }
108 | }
109 |
110 | /**
111 | * Enclose a string in double quotes.
112 | *
113 | * @param string $s The string to enclose.
114 | *
115 | * @return string The enclosed string.
116 | */
117 | function pmpro_enclose( $s ) {
118 | return '"' . str_replace( '"', '\\"', $s ) . '"';
119 | }
120 |
--------------------------------------------------------------------------------
/adminpages/report.php:
--------------------------------------------------------------------------------
1 | get_row("SELECT * FROM $wpdb->pmpro_affiliates WHERE id = '" . intval($affiliate_id) . "' LIMIT 1");
16 | if(!empty($affiliate) && !empty($affiliate->id))
17 | {
18 | $code = $affiliate->code;
19 | $name = $affiliate->name;
20 | $affiliateuser = $affiliate->affiliateuser;
21 | $trackingcode = $affiliate->trackingcode;
22 | $cookiedays = $affiliate->cookiedays;
23 | $enabled = $affiliate->enabled;
24 | }
25 | }
26 | ?>
27 |
28 | Report
29 |
35 |
36 |
40 |
41 |
44 |
45 | ID ) ) . '">' . esc_html( $affiliate_user_object->display_name ) . '';
49 | } else {
50 | $affiliate_user_shown = esc_html( stripslashes( $affiliateuser ) );
51 | }
52 |
53 | if ( ! empty( $name ) ) {
54 | echo "". esc_html( sprintf( esc_html__("Business/Contact Name: %s", 'pmpro-affiliates' ), stripslashes($name) ) ) . "
";
55 | }
56 |
57 | if ( ! empty( $affiliateuser ) ) {
58 | // The $affiliate_user_shown is escaped before echoing it out.
59 | echo "" . esc_html( ucwords($pmpro_affiliates_singular_name) ) . " ". esc_html__("User:", 'pmpro-affiliates' )." " . wp_kses_post( $affiliate_user_shown ) . "
";
60 | }
61 | ?>
62 |
63 | pmpro_membership_orders o
67 | LEFT JOIN $wpdb->pmpro_affiliates a
68 | ON o.affiliate_id = a.id
69 | LEFT JOIN $wpdb->users u
70 | ON o.user_id = u.ID
71 | LEFT JOIN $wpdb->pmpro_membership_ordermeta om
72 | ON o.id = om.pmpro_membership_order_id
73 | AND om.meta_key = 'pmpro_affiliate_paid'
74 | WHERE o.affiliate_id <> ''
75 | AND o.affiliate_id IS NOT NULL
76 | AND o.affiliate_id <> 0
77 | AND o.status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')";
78 |
79 | if ( $report != "all" ) {
80 | $sqlQuery .= " AND a.id = '" . esc_sql($report) . "' ";
81 | }
82 | $affiliate_orders = $wpdb->get_results($sqlQuery);
83 |
84 | // Show a message of there are no affiliate orders.
85 | if ( empty( $affiliate_orders ) ) { ?>
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
107 |
108 |
109 |
110 | membership_id );
114 | // Get the affiliate paid status and generate a mark as paid link if not paid. Add nonce.
115 | $affiliate_paid = $order->affiliate_paid;
116 | if ( $affiliate_paid == '1' ) {
117 | $nonce = wp_create_nonce( 'pmpro_affiliates_reset_paid_status' );
118 | $affiliate_paid = esc_html__( 'Paid', 'pmpro-affiliates' );
119 | $affiliate_paid .= ' [x ]' ;
120 | } else {
121 | $nonce = wp_create_nonce( 'pmpro_affiliates_mark_as_paid' );
122 | $affiliate_paid = '' . esc_html__( 'Mark as Paid', 'pmpro-affiliates' ) . ' ';
123 | }
124 | ?>
125 |
126 | affiliate_id ) ) . "'>" . esc_html( $order->code ) . "";
127 | if ( $order->subid ) {
128 | echo '';
129 | echo '' . esc_html__( 'Sub-ID', 'pmpro-affiliates' ) . ': ' . esc_html( $order->subid );
130 | echo ' ';
131 | }
132 | ?>
133 |
134 | order_id ) ) . "'>" . esc_html( $order->order_code ) . ""; ?>
135 | name ) ? esc_html( stripslashes($order->name) ) : '';?>
136 |
137 | user_id ) ) {
139 | if ( ! empty( get_user_by( 'id', $order->user_id ) ) ) { ?>
140 | user_login ); ?>
141 | user_login );
144 | }
145 | } else { ?>
146 | []
149 |
150 |
151 | name );
154 | } elseif ( $order->membership_id > 0 ) { ?>
155 | []
156 |
160 |
161 | timestamp ) );?>
162 | commissionrate * 100 );?>%
163 | total * $order->commissionrate ) ); ?>
164 | total ) ); ?>
165 | order_id ) . '">' . $affiliate_paid . ''; ?>
166 |
174 |
175 |
178 |
179 |
180 |
183 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | === Paid Memberships Pro - Affiliates Add On ===
2 | Contributors: strangerstudios
3 | Tags: pmpro, paid memberships pro, ecommerce, affiliates
4 | Requires at least: 5.2
5 | Tested up to: 6.8
6 | Stable tag: 0.7
7 |
8 | Create affiliate accounts with unique referrer URLs to track membership checkouts.
9 |
10 | == Description ==
11 |
12 | Create affiliate accounts and codes. If a code is passed to a page as a parameter, a cookie is set. If a cookie is present after checkout, the order is awarded to the affiliate account.
13 |
14 | You must have the latest version of Paid Memberships Pro installed (currently 1.4.7).
15 |
16 | Story
17 | * Admin creates affiliate account and code.
18 | * If affiliate code is passed as a parameter, a cookie is set for the specified number of days.
19 | * If a cookie is present after checkout, the order is awarded to the affiliate.
20 | * Reports in the admin, showing orders for each affiliate.
21 | * Associate an affiliate with a user to give that user access to view reports.
22 |
23 | Questions
24 | * Allow setting of fees?
25 | * Track recurring orders?
26 | * Affiliate reports in front end or back end? How much to show affiliates.
27 |
28 | == Installation ==
29 |
30 | 1. Upload the `pmpro-affiliates` directory to the `/wp-content/plugins/` directory of your site.
31 | 1. Activate the plugin through the 'Plugins' menu in WordPress.
32 | 1. Manage affiliates through the "affiliates" admin page added under Memberships.
33 | 1. Affiliate URLs will look like http://site.com/?pa=AFFILIATECODE
34 | 1. You can add a "subid" to the URL on the fly for more granular tracking http://site.com/?pa=AFFILIATECODE&subid=TEST1
35 | 1. Create a page with the [pmpro_affiliates_report] shortcode and direct your affiliate users to that page.
36 |
37 | == Frequently Asked Questions ==
38 |
39 | = I found a bug in the plugin. =
40 |
41 | Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/strangerstudios/pmpro-affiliates/issues
42 |
43 | = I need help installing, configuring, or customizing the plugin. =
44 |
45 | Please visit our premium support site at http://www.paidmembershipspro.com for more documentation and our support forums.
46 |
47 | == Changelog ==
48 | = 0.7 - 2025-04-09 =
49 | * ENHANCEMENT: Improved frontend styling for PMPro V3.1+. Includes updates to overall CSS classes used. (@kimcoleman)
50 | * ENHANCEMENT: Added frontend "show_conversion_table" attribute to the report shortcode. Allowing affiliates to see their commission rate, visits and conversion rate percentage. (@andrewlimaza)
51 | * ENHANCEMENT: Now defaults to 5% as the commission rate when creating a new affiliate. New filter added `pmpro_affiliate_default_commission_rate` (@andrewlimaza)
52 | * REFACTOR: General code improvements to shortcode attributes that expect boolean values ( @andrewlimaza)
53 | * BUG FIX: Fixed an issue where recurring orders were not being tracked correctly for affiliates. #60 (@dwanjuki)
54 |
55 | = 0.6.2 - 2025-03-13 =
56 | * SECURITY: Improved the escaping of strings throughout the plugin. #58 (@dparker1005)
57 | * ENHANCEMENT: Added a new filter `pmpro_affiliates_commission_calculation_source` to allow calculating commissions based on the order total or subtotal. #53 (@JarrydLong)
58 | * BUG FIX: Fixed an issue where orders that were not associated with affiliates would still show in the affiliates report. #55 (@dparker1005)
59 | * BUG FIX: Fixed an issue where some strings would not be translated. #57 (@andrewlimaza)
60 |
61 | = 0.6.1 - 2024-01-05 =
62 | * ENHANCEMENT: Updating `` tags to `` tags for better accessibility. #51 (@kimwhite)
63 | * BUG FIX: Fixed a warning on the reports page when the affiliate name was missing from the report. #52 (@andrewlimaza)
64 | * BUG FIX: Fixed an issue with exporting the affiliates CSV wouldn't include the affiliates name. #52 (@andrewlimaza)
65 | * REFACTOR: Now using the `pmpro_default_discount_code` filter for sites using PMPro v3.0+ instead of setting discount code by altering request variables. #50 (@dparker1005)
66 |
67 | = 0.6 -2023-01-10 =
68 | * SECURITY: General improvements to sanitization and escaping of strings and SQL queries.
69 | * ENHANCEMENT: Added ability to track commission rate and mark affiliate commission/orders as paid or reset them to unpaid. Defaults to 0% to keep backwards compatibility.
70 | * ENHANCEMENT: Added "PMPro Affiliates Report" block.
71 | * ENHANCEMENT: Improved frontend affiliate report to be responsive for mobile devices.
72 | * ENHANCEMENT: Added the ability to search for affiliates based on the affiliate name or email within the admin area.
73 | * ENHANCEMENT: General improvements to UI/UX of the affiliates admin area. Added various links to navigate between affiliate and user information more easily.
74 | * ENHANCEMENT: Added autocomplete username functionality when creating an affiliate.
75 | * ENHANCEMENT: Improved logic to figure out affiliate orders during checkout (Only loads relevant code on the checkout page).
76 | * ENHANCEMENT: Added filter 'pmpro_affiliates_autocomplete_user_search_limit' to adjust the number of users returned in the autocomplete search when adding an affiliate. Defaults to 25.
77 |
78 | = 0.5 - 2022-01-29 =
79 | * BUG FIX: Fixed warning and broken functionality for the "View All" back link for frontend user affiliate reports.
80 | * BUG FIX/ENHANCEMENT: Now localizing dates using the date_i18n() function.
81 | * BUG FIX/ENHANCEMENT: Fixed incorrect textdomain for a few localized strings.
82 | * BUG FIX/ENHANCEMENT: Improved "How to Create Links" language for the frontend affiliate report.
83 | * ENHANCEMENT: Implemented the WP POT/PO/MO Generator action.
84 | * ENHANCEMENT: Added `pmpro_affiliate_report_extra_cols_header` and `pmpro_affiliate_report_extra_cols_body` hooks to show extra data on the Reports table in WP admin.
85 | * ENHANCEMENT: Added `pmpro_affiliate_extra_cols_header` and `pmpro_affiliate_extra_cols_body` hooks to show extra data on the Affiliates table in WP admin.
86 | * ENHANCEMENT: Added `pmpro_affiliate_list_csv_extra_columns` and `pmpro_affiliate_list_csv_extra_column_data` filters to add extra data to the Affiliate report export to CSV.
87 | * ENHANCEMENT: Added `pmpro_affiliate_default_cookie_duration` filter adjust the cookie days default value when manually creating a new affiliate.
88 |
89 | = 0.4.1 - 2021-01-19 =
90 | * BUG FIX/ENHANCEMENT: Adjusted queries to only include credit for orders not in specific statuses.
91 | * ENHANCEMENT: Added `pmpro_affiliates_new_code` filter to allow custom code to modifty the generated Affiliate Codes.
92 | * ENHANCEMENT: Now generating the affiliate codes using the pmpro_getDiscountCode function.
93 | * ENHANCEMENT: Localized the plugin for translation.
94 | * ENHANCEMENT: Added 'Membership Level' to the Affiliate Report admin page and export CSV.
95 |
96 | = 0.4 - 2020-07-13 =
97 | * BUG FIX: Fixed issue where recurring orders weren't tracked as affiliate sales even if you set an affiliate to get credit for renewals.
98 | * BUG FIX: No longer overriding the default character set when adding the DB tables on install.
99 | * ENHANCEMENT: Moved some links on the affiliates page in the dashboard to "row actions".
100 | * ENHANCEMENT: Added an !!ORDER_AMOUNT!! variable to use in the tracking code.
101 | * REFACTOR: Created functions to get options and settings, avoiding warnings in different versions of PHP.
102 |
103 | = .3.1 =
104 | * BUG/ENHANCEMENT: Updating the "Affiliates" submenu page to support PMPro v2.0+ Dashboard menu.
105 | * ENHANCEMENT: Adding filter 'pmproaf_default_cookie_duration' for adjusting default cookie duration.
106 | * ENHANCEMENT: Updated Plugin URI, Author, and internal links to documentation pages.
107 |
108 | = .3 =
109 | * BUG FIX: Removed "trying" from the frontend affiliates page. (Thanks, ttshivers on GitHub)
110 | * BUG FIX/ENHANCEMENT: Now also checking the $post->post_content_filtered value when looking for the pmpro_affiliates_report shortcode. This helps with certain themes (e.g. Layers) that may have empty post_content. (Thanks, ttshivers on GitHub)
111 | * ENHANCEMENT: Now set a membership level to generate an affiliate for the user after membership checkout.
112 | * ENHANCEMENT: Set the frontend "Affiliate Report" page under Memberships > Page Settings.
113 | * ENHANCEMENT: Now you can customize the name your "program" (i.e. Affiliates, Referrals, Invitations), from the Memberships > Affiliates admin page.
114 | * ENHANCEMENT: Added row alternate coloring in admin report views.
115 |
116 | = .2.5 =
117 | * ENHANCEMENT: Now tracks visits as well as conversions.
118 | * ENHANCEMENT: Added Delete link to Affiliates admin page.
119 |
120 | = .2.4.1 =
121 | * BUG FIX: Replaced $wpdb->escape calls with esc_sql to avoid notice.
122 |
123 | = .2.4 =
124 | * BUG FIX: Fixed SQL bug that came up on some setups (typically Windows-based) where affiliates wouldn't insert. (Thanks, Jose Fernandez)
125 |
126 | = .2.3 =
127 | * ENHANCEMENT: Added affiliates link to admin bar.
128 | * ENHANCEMENT: Affiliate report export to CSV.
129 | * ENHANCEMENT: Frontend report for designated affiliate users.
130 |
131 | = .2.2 =
132 | * BUG FIX/ENHANCEMENT: Added a check to the notification code in the settings header so it wouldn't display NULL in the notification space if WP passes that back.
133 | * ENHANCEMENT: Will add a $0 invoice if someone checks out for a free level with an affiliate code set.
134 |
135 | = .2.1 =
136 | * BUG FIX/ENHANCEMENT: When checking for an affiliate id on a previous order, checking by user_id instead of subscription_transaction_id. This means that affiliates will be given credit when users upgrade... not just recurring invoices from the original subscription.
137 |
138 | = .2 =
139 | * ENHANCEMENT: Now adds the affiliate id to any order after is is "added" via the pmpro_added_order hook. This means that recurring payment orders will be marked with the affiliate id if you have your IPN handler, Silent Post URL, or Stripe Web Hook setup properly.
140 | * ENHANCEMENT: Affiliate codes are now linked to discount codes with the same code. If an affiliate code is passed, it will automatically use the discount code with the same value. If a discount code is used, it will apply the affiliate code with the same value (unless another affiliate code is already being used).
141 |
142 | = .1 =
143 | * Initial release.
144 |
--------------------------------------------------------------------------------
/blocks/build/pmpro_affiliates_report/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"pmpro_affiliates_report/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AACV;AAEjE,SAASK,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EACzC,MAAM;IAAEC,SAAS;IAAEC,UAAU;IAAEC,IAAI;IAAEC,sBAAsB;IAAEC,qBAAqB;IAAEC,IAAI;IAAEC,KAAK;IAAEC,IAAI;IAAEC,UAAU;IAAEC,IAAI;IAAEC,gBAAgB;IAAEC,eAAe;IAAEC;EAAM,CAAC,GAAGd,UAAU;EAChL,MAAMe,UAAU,GAAGnB,sEAAa,CAAC;IAAEoB,SAAS,EAAE;EAAsB,CAAC,CAAC;EAEtE,OAAQ,CACJC,oDAAA,CAACtB,sEAAiB;IAACuB,GAAG,EAAE;EAAW,GAC/BD,oDAAA,CAACnB,4DAAS;IAACoB,GAAG,EAAE,UAAW;IAACC,KAAK,EAAEzB,mDAAE,CAAC,UAAU,EAAE,kBAAkB;EAAE,GAClEuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,WAAY;IACjBE,KAAK,EAAE1B,mDAAE,CAAC,WAAW,EAAE,kBAAkB,CAAE;IAC3C2B,OAAO,EAAEnB,SAAU;IACnBoB,QAAQ,EAAEpB,SAAS,IAAI;MAAED,aAAa,CAAC;QAAEC;MAAU,CAAC,CAAC;IAAC,CAAE;IACxDE,IAAI,EAAEV,mDAAE,CAAC,mBAAmB,EAAE,kBAAkB;EAAE,CACrD,CAAC,EACFuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,YAAa;IAClBE,KAAK,EAAE1B,mDAAE,CAAC,YAAY,EAAE,kBAAkB,CAAE;IAC5C2B,OAAO,EAAElB,UAAW;IACpBmB,QAAQ,EAAEnB,UAAU,IAAI;MAAEF,aAAa,CAAC;QAAEE;MAAW,CAAC,CAAC;IAAC,CAAE;IAC1DC,IAAI,EAAEV,mDAAE,CAAC,sBAAsB,EAAE,kBAAkB;EAAE,CACxD,CAAC,EACFuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,MAAO;IACZE,KAAK,EAAE1B,mDAAE,CAAC,MAAM,EAAE,kBAAkB,CAAE;IACtC2B,OAAO,EAAEjB,IAAK;IACdkB,QAAQ,EAAElB,IAAI,IAAI;MAAEH,aAAa,CAAC;QAAEG;MAAK,CAAC,CAAC;IAAC,CAAE;IAC9CA,IAAI,EAAEV,mDAAE,CAAC,mBAAmB,EAAE,kBAAkB;EAAE,CACrD,CAAC,EACFuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,uBAAwB;IAC7BE,KAAK,EAAE1B,mDAAE,CAAC,uBAAuB,EAAE,kBAAkB,CAAE;IACvD2B,OAAO,EAAEf,qBAAsB;IAC/BgB,QAAQ,EAAEhB,qBAAqB,IAAI;MAAEL,aAAa,CAAC;QAAEK;MAAsB,CAAC,CAAC;IAAC,CAAE;IAChFF,IAAI,EAAEV,mDAAE,CAAC,2BAA2B,EAAE,kBAAkB;EAAE,CAC7D,CAAC,EACFuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,wBAAyB;IAC9BE,KAAK,EAAE1B,mDAAE,CAAC,wBAAwB,EAAE,kBAAkB,CAAE;IACxD2B,OAAO,EAAEhB,sBAAuB;IAChCiB,QAAQ,EAAEjB,sBAAsB,IAAI;MAAEJ,aAAa,CAAC;QAAEI;MAAuB,CAAC,CAAC;IAAC,CAAE;IAClFD,IAAI,EAAEV,mDAAE,CAAC,2BAA2B,EAAE,kBAAkB;EAAE,CAC7D,CACM,CAAC,EACZuB,oDAAA,CAACnB,4DAAS;IAACoB,GAAG,EAAE,cAAe;IAACC,KAAK,EAAEzB,mDAAE,CAAC,cAAc,EAAE,kBAAkB;EAAE,GAC1EuB,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,MAAO;IACZE,KAAK,EAAE1B,mDAAE,CAAC,MAAM,EAAE,kBAAkB,CAAE;IACtC2B,OAAO,EAAEd,IAAK;IACde,QAAQ,EAAEf,IAAI,IAAI;MAAEN,aAAa,CAAC;QAAEM;MAAK,CAAC,CAAC;IAAC;EAAE,CACjD,CAAC,EACFU,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,QAAS;IACdE,KAAK,EAAE1B,mDAAE,CAAC,QAAQ,EAAE,kBAAkB,CAAE;IACxC2B,OAAO,EAAEb,KAAM;IACfc,QAAQ,EAAEd,KAAK,IAAI;MAAEP,aAAa,CAAC;QAAEO;MAAM,CAAC,CAAC;IAAC;EAAE,CACnD,CAAC,EACFS,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,MAAO;IACZE,KAAK,EAAE1B,mDAAE,CAAC,MAAM,EAAE,kBAAkB,CAAE;IACtC2B,OAAO,EAAEZ,IAAK;IACda,QAAQ,EAAEb,IAAI,IAAI;MAAER,aAAa,CAAC;QAAEQ;MAAK,CAAC,CAAC;IAAC;EAAE,CACjD,CAAC,EACFQ,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,YAAa;IAClBE,KAAK,EAAE1B,mDAAE,CAAC,YAAY,EAAE,kBAAkB,CAAE;IAC5C2B,OAAO,EAAEX,UAAW;IACpBY,QAAQ,EAAEZ,UAAU,IAAI;MAAET,aAAa,CAAC;QAAES;MAAW,CAAC,CAAC;IAAC;EAAE,CAC7D,CAAC,EACFO,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,MAAO;IACZE,KAAK,EAAE1B,mDAAE,CAAC,MAAM,EAAE,kBAAkB,CAAE;IACtC2B,OAAO,EAAEV,IAAK;IACdW,QAAQ,EAAEX,IAAI,IAAI;MAAEV,aAAa,CAAC;QAAEU;MAAK,CAAC,CAAC;IAAC;EAAE,CACjD,CAAC,EACFM,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,kBAAmB;IACxBE,KAAK,EAAE1B,mDAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAE;IAClD2B,OAAO,EAAET,gBAAiB;IAC1BU,QAAQ,EAAEV,gBAAgB,IAAI;MAAEX,aAAa,CAAC;QAAEW;MAAiB,CAAC,CAAC;IAAC;EAAE,CACzE,CAAC,EACFK,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,WAAY;IACjBE,KAAK,EAAE1B,mDAAE,CAAC,YAAY,EAAE,kBAAkB,CAAE;IAC5C2B,OAAO,EAAER,eAAgB;IACzBS,QAAQ,EAAET,eAAe,IAAI;MAAEZ,aAAa,CAAC;QAAEY;MAAgB,CAAC,CAAC;IAAC;EAAE,CACvE,CAAC,EACFI,oDAAA,CAACpB,gEAAa;IACVqB,GAAG,EAAE,OAAQ;IACbE,KAAK,EAAE1B,mDAAE,CAAC,OAAO,EAAE,kBAAkB,CAAE;IACvC2B,OAAO,EAAEP,KAAM;IACfQ,QAAQ,EAAER,KAAK,IAAI;MAAEb,aAAa,CAAC;QAAEa;MAAM,CAAC,CAAC;IAAC;EAAE,CACnD,CACM,CACI,CAAC,EACpBG,oDAAA;IAAKC,GAAG,EAAE,MAAO;IAAA,GAAKH;EAAU,GAC5BE,oDAAA;IAAMC,GAAG,EAAE,OAAQ;IAACF,SAAS,EAAC;EAAmB,GAAEtB,mDAAE,CAAC,iCAAiC,EAAE,kBAAkB,CAAQ,CAAC,EACpHuB,oDAAA;IAAMC,GAAG,EAAE,UAAW;IAACF,SAAS,EAAC;EAAsB,GAAEtB,mDAAE,CAAC,QAAQ,EAAE,kBAAkB,CAAQ,CAC/F,CAAC,CACT;AACL;AAEA,iEAAeK,IAAI;;;;;;;;;;ACzGnB;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AAClB;AACV;AAE1BwB,oEAAiB,CAACC,6CAAa,EAAE;EAC7BC,IAAI,EAAE1B,6CAAI;EACV2B,IAAI,EAAEA,CAAA,KAAM;AAChB,CAAC,CAAC,C","sources":["webpack://pmpro-affiliates/./blocks/src/pmpro_affiliates_report/edit.js","webpack://pmpro-affiliates/external window [\"wp\",\"blockEditor\"]","webpack://pmpro-affiliates/external window [\"wp\",\"blocks\"]","webpack://pmpro-affiliates/external window [\"wp\",\"components\"]","webpack://pmpro-affiliates/external window [\"wp\",\"i18n\"]","webpack://pmpro-affiliates/external window \"React\"","webpack://pmpro-affiliates/webpack/bootstrap","webpack://pmpro-affiliates/webpack/runtime/compat get default export","webpack://pmpro-affiliates/webpack/runtime/define property getters","webpack://pmpro-affiliates/webpack/runtime/hasOwnProperty shorthand","webpack://pmpro-affiliates/webpack/runtime/make namespace object","webpack://pmpro-affiliates/./blocks/src/pmpro_affiliates_report/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { ToggleControl, PanelBody } from '@wordpress/components';\n\nfunction Edit({ attributes, setAttributes }) {\n const { back_link, export_csv, help, show_commissions_table, show_conversion_table, code, subid, name, user_login, date, membership_level, show_commission, total } = attributes\n const blockProps = useBlockProps({ className: \"pmpro-block-element\" });\n\n return ([\n \n \n { setAttributes({ back_link }) }}\n help={__('Show a back link?', 'pmpro-affiliates')}\n />\n { setAttributes({ export_csv }) }}\n help={__('Show Export CSV link', 'pmpro-affiliates')}\n />\n { setAttributes({ help }) }}\n help={__('Show a help table', 'pmpro-affiliates')}\n />\n { setAttributes({ show_conversion_table }) }}\n help={__('Show the conversion table', 'pmpro-affiliates')}\n />\n { setAttributes({ show_commissions_table }) }}\n help={__('Show the commission table', 'pmpro-affiliates')}\n />\n \n \n { setAttributes({ code }) }}\n />\n { setAttributes({ subid }) }}\n />\n { setAttributes({ name }) }}\n />\n { setAttributes({ user_login }) }}\n />\n { setAttributes({ date }) }}\n />\n { setAttributes({ membership_level }) }}\n />\n { setAttributes({ show_commission }) }}\n />\n { setAttributes({ total }) }}\n />\n \n ,\n \n {__('Paid Memberships Pro Affiliates', 'pmpro-affiliates')} \n {__('Report', 'pmpro-affiliates')} \n
\n ]);\n}\n\nexport default Edit;","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from \"@wordpress/blocks\";\nimport metadata from \"./block.json\";\nimport Edit from \"./edit\";\n\nregisterBlockType(metadata.name, {\n edit: Edit,\n save: () => null\n});"],"names":["__","InspectorControls","useBlockProps","ToggleControl","PanelBody","Edit","attributes","setAttributes","back_link","export_csv","help","show_commissions_table","show_conversion_table","code","subid","name","user_login","date","membership_level","show_commission","total","blockProps","className","createElement","key","title","label","checked","onChange","registerBlockType","metadata","edit","save"],"sourceRoot":""}
--------------------------------------------------------------------------------
/blocks/build/pmpro_affiliates_report/index.js:
--------------------------------------------------------------------------------
1 | /******/ (() => { // webpackBootstrap
2 | /******/ "use strict";
3 | /******/ var __webpack_modules__ = ({
4 |
5 | /***/ "./blocks/src/pmpro_affiliates_report/block.json":
6 | /*!*******************************************************!*\
7 | !*** ./blocks/src/pmpro_affiliates_report/block.json ***!
8 | \*******************************************************/
9 | /***/ ((module) => {
10 |
11 | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"pmpro-affiliates/pmpro-affiliates-report","version":"1.0.0","title":"PMPro: Affiliates Report","icon":"editor-table","description":"Frontend affilaites report for PMPro.","supports":{"html":false},"category":"pmpro","textdomain":"pmpro-affiliates","attributes":{"back_link":{"type":"boolean","default":true},"export_csv":{"type":"boolean","default":true},"help":{"type":"boolean","default":true},"show_conversion_table":{"type":"boolean","default":false},"show_commissions_table":{"type":"boolean","default":false},"code":{"type":"boolean","default":false},"subid":{"type":"boolean","default":false},"name":{"type":"boolean","default":false},"user_login":{"type":"boolean","default":true},"date":{"type":"boolean","default":true},"membership_level":{"type":"boolean","default":true},"show_commission":{"type":"boolean","default":false},"total":{"type":"boolean","default":true}}}');
12 |
13 | /***/ }),
14 |
15 | /***/ "./blocks/src/pmpro_affiliates_report/edit.js":
16 | /*!****************************************************!*\
17 | !*** ./blocks/src/pmpro_affiliates_report/edit.js ***!
18 | \****************************************************/
19 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20 |
21 | __webpack_require__.r(__webpack_exports__);
22 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
24 | /* harmony export */ });
25 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
26 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
27 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
28 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
29 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
30 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
31 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
32 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
33 |
34 |
35 |
36 |
37 | function Edit({
38 | attributes,
39 | setAttributes
40 | }) {
41 | const {
42 | back_link,
43 | export_csv,
44 | help,
45 | show_commissions_table,
46 | show_conversion_table,
47 | code,
48 | subid,
49 | name,
50 | user_login,
51 | date,
52 | membership_level,
53 | show_commission,
54 | total
55 | } = attributes;
56 | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
57 | className: "pmpro-block-element"
58 | });
59 | return [(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
60 | key: 'controls'
61 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
62 | key: 'settings',
63 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Settings', 'pmpro-affiliates')
64 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
65 | key: 'back_link',
66 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Back Link', 'pmpro-affiliates'),
67 | checked: back_link,
68 | onChange: back_link => {
69 | setAttributes({
70 | back_link
71 | });
72 | },
73 | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show a back link?', 'pmpro-affiliates')
74 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
75 | key: 'export_csv',
76 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Export CSV', 'pmpro-affiliates'),
77 | checked: export_csv,
78 | onChange: export_csv => {
79 | setAttributes({
80 | export_csv
81 | });
82 | },
83 | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show Export CSV link', 'pmpro-affiliates')
84 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
85 | key: 'help',
86 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help', 'pmpro-affiliates'),
87 | checked: help,
88 | onChange: help => {
89 | setAttributes({
90 | help
91 | });
92 | },
93 | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show a help table', 'pmpro-affiliates')
94 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
95 | key: 'show_conversion_table',
96 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show Conversion Table', 'pmpro-affiliates'),
97 | checked: show_conversion_table,
98 | onChange: show_conversion_table => {
99 | setAttributes({
100 | show_conversion_table
101 | });
102 | },
103 | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show the conversion table', 'pmpro-affiliates')
104 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
105 | key: 'show_commissions_table',
106 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show Commissions Table', 'pmpro-affiliates'),
107 | checked: show_commissions_table,
108 | onChange: show_commissions_table => {
109 | setAttributes({
110 | show_commissions_table
111 | });
112 | },
113 | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show the commission table', 'pmpro-affiliates')
114 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
115 | key: 'table-fields',
116 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Table Fields', 'pmpro-affiliates')
117 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
118 | key: 'code',
119 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Code', 'pmpro-affiliates'),
120 | checked: code,
121 | onChange: code => {
122 | setAttributes({
123 | code
124 | });
125 | }
126 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
127 | key: 'sub_id',
128 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sub-ID', 'pmpro-affiliates'),
129 | checked: subid,
130 | onChange: subid => {
131 | setAttributes({
132 | subid
133 | });
134 | }
135 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
136 | key: 'name',
137 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Name', 'pmpro-affiliates'),
138 | checked: name,
139 | onChange: name => {
140 | setAttributes({
141 | name
142 | });
143 | }
144 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
145 | key: 'user_login',
146 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('User Login', 'pmpro-affiliates'),
147 | checked: user_login,
148 | onChange: user_login => {
149 | setAttributes({
150 | user_login
151 | });
152 | }
153 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
154 | key: 'date',
155 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Date', 'pmpro-affiliates'),
156 | checked: date,
157 | onChange: date => {
158 | setAttributes({
159 | date
160 | });
161 | }
162 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
163 | key: 'membership_level',
164 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Membership Level', 'pmpro-affiliates'),
165 | checked: membership_level,
166 | onChange: membership_level => {
167 | setAttributes({
168 | membership_level
169 | });
170 | }
171 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
172 | key: 'commision',
173 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Commission', 'pmpro-affiliates'),
174 | checked: show_commission,
175 | onChange: show_commission => {
176 | setAttributes({
177 | show_commission
178 | });
179 | }
180 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToggleControl, {
181 | key: 'total',
182 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Total', 'pmpro-affiliates'),
183 | checked: total,
184 | onChange: total => {
185 | setAttributes({
186 | total
187 | });
188 | }
189 | }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
190 | key: 'main',
191 | ...blockProps
192 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
193 | key: 'title',
194 | className: "pmpro-block-title"
195 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Paid Memberships Pro Affiliates', 'pmpro-affiliates')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
196 | key: 'subtitle',
197 | className: "pmpro-block-subtitle"
198 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Report', 'pmpro-affiliates')))];
199 | }
200 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit);
201 |
202 | /***/ }),
203 |
204 | /***/ "@wordpress/block-editor":
205 | /*!*************************************!*\
206 | !*** external ["wp","blockEditor"] ***!
207 | \*************************************/
208 | /***/ ((module) => {
209 |
210 | module.exports = window["wp"]["blockEditor"];
211 |
212 | /***/ }),
213 |
214 | /***/ "@wordpress/blocks":
215 | /*!********************************!*\
216 | !*** external ["wp","blocks"] ***!
217 | \********************************/
218 | /***/ ((module) => {
219 |
220 | module.exports = window["wp"]["blocks"];
221 |
222 | /***/ }),
223 |
224 | /***/ "@wordpress/components":
225 | /*!************************************!*\
226 | !*** external ["wp","components"] ***!
227 | \************************************/
228 | /***/ ((module) => {
229 |
230 | module.exports = window["wp"]["components"];
231 |
232 | /***/ }),
233 |
234 | /***/ "@wordpress/i18n":
235 | /*!******************************!*\
236 | !*** external ["wp","i18n"] ***!
237 | \******************************/
238 | /***/ ((module) => {
239 |
240 | module.exports = window["wp"]["i18n"];
241 |
242 | /***/ }),
243 |
244 | /***/ "react":
245 | /*!************************!*\
246 | !*** external "React" ***!
247 | \************************/
248 | /***/ ((module) => {
249 |
250 | module.exports = window["React"];
251 |
252 | /***/ })
253 |
254 | /******/ });
255 | /************************************************************************/
256 | /******/ // The module cache
257 | /******/ var __webpack_module_cache__ = {};
258 | /******/
259 | /******/ // The require function
260 | /******/ function __webpack_require__(moduleId) {
261 | /******/ // Check if module is in cache
262 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
263 | /******/ if (cachedModule !== undefined) {
264 | /******/ return cachedModule.exports;
265 | /******/ }
266 | /******/ // Create a new module (and put it into the cache)
267 | /******/ var module = __webpack_module_cache__[moduleId] = {
268 | /******/ // no module.id needed
269 | /******/ // no module.loaded needed
270 | /******/ exports: {}
271 | /******/ };
272 | /******/
273 | /******/ // Execute the module function
274 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
275 | /******/
276 | /******/ // Return the exports of the module
277 | /******/ return module.exports;
278 | /******/ }
279 | /******/
280 | /************************************************************************/
281 | /******/ /* webpack/runtime/compat get default export */
282 | /******/ (() => {
283 | /******/ // getDefaultExport function for compatibility with non-harmony modules
284 | /******/ __webpack_require__.n = (module) => {
285 | /******/ var getter = module && module.__esModule ?
286 | /******/ () => (module['default']) :
287 | /******/ () => (module);
288 | /******/ __webpack_require__.d(getter, { a: getter });
289 | /******/ return getter;
290 | /******/ };
291 | /******/ })();
292 | /******/
293 | /******/ /* webpack/runtime/define property getters */
294 | /******/ (() => {
295 | /******/ // define getter functions for harmony exports
296 | /******/ __webpack_require__.d = (exports, definition) => {
297 | /******/ for(var key in definition) {
298 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
299 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
300 | /******/ }
301 | /******/ }
302 | /******/ };
303 | /******/ })();
304 | /******/
305 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
306 | /******/ (() => {
307 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
308 | /******/ })();
309 | /******/
310 | /******/ /* webpack/runtime/make namespace object */
311 | /******/ (() => {
312 | /******/ // define __esModule on exports
313 | /******/ __webpack_require__.r = (exports) => {
314 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
315 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
316 | /******/ }
317 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
318 | /******/ };
319 | /******/ })();
320 | /******/
321 | /************************************************************************/
322 | var __webpack_exports__ = {};
323 | // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
324 | (() => {
325 | /*!*****************************************************!*\
326 | !*** ./blocks/src/pmpro_affiliates_report/index.js ***!
327 | \*****************************************************/
328 | __webpack_require__.r(__webpack_exports__);
329 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
330 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
331 | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./block.json */ "./blocks/src/pmpro_affiliates_report/block.json");
332 | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./blocks/src/pmpro_affiliates_report/edit.js");
333 |
334 |
335 |
336 | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_1__.name, {
337 | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
338 | save: () => null
339 | });
340 | })();
341 |
342 | /******/ })()
343 | ;
344 | //# sourceMappingURL=index.js.map
--------------------------------------------------------------------------------
/languages/pmpro-affiliates.pot:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 Paid Memberships Pro
2 | # This file is distributed under the same license as the Paid Memberships Pro - Affiliates Add On plugin.
3 | msgid ""
4 | msgstr ""
5 | "Project-Id-Version: Paid Memberships Pro - Affiliates Add On 0.7\n"
6 | "Report-Msgid-Bugs-To: info@paidmembershipspro.com\n"
7 | "Last-Translator: Paid Memberships Pro \n"
8 | "Language-Team: Paid Memberships Pro \n"
9 | "MIME-Version: 1.0\n"
10 | "Content-Type: text/plain; charset=UTF-8\n"
11 | "Content-Transfer-Encoding: 8bit\n"
12 | "POT-Creation-Date: 2025-04-09T10:04:19+00:00\n"
13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14 | "X-Generator: WP-CLI 2.11.0\n"
15 | "X-Domain: pmpro-affiliates\n"
16 |
17 | #. Plugin Name of the plugin
18 | #: pmpro-affiliates.php
19 | msgid "Paid Memberships Pro - Affiliates Add On"
20 | msgstr ""
21 |
22 | #. Plugin URI of the plugin
23 | #: pmpro-affiliates.php
24 | msgid "https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/"
25 | msgstr ""
26 |
27 | #. Description of the plugin
28 | #: pmpro-affiliates.php
29 | msgid "Create affiliate accounts with unique referrer URLs to track membership checkouts."
30 | msgstr ""
31 |
32 | #. Author of the plugin
33 | #: pmpro-affiliates.php
34 | msgid "Paid Memberships Pro"
35 | msgstr ""
36 |
37 | #. Author URI of the plugin
38 | #: pmpro-affiliates.php
39 | msgid "https://www.paidmembershipspro.com"
40 | msgstr ""
41 |
42 | #: adminpages/affiliates.php:138
43 | msgid "Affiliate saved successfully."
44 | msgstr ""
45 |
46 | #: adminpages/affiliates.php:144
47 | msgid "There was an error saving the affiliate."
48 | msgstr ""
49 |
50 | #: adminpages/affiliates.php:155
51 | msgid "Affiliate added successfully."
52 | msgstr ""
53 |
54 | #: adminpages/affiliates.php:161
55 | msgid "There was an error adding the affiliate."
56 | msgstr ""
57 |
58 | #: adminpages/affiliates.php:176
59 | msgid "Affiliate deleted successfully."
60 | msgstr ""
61 |
62 | #: adminpages/affiliates.php:182
63 | msgid "There was an error deleting the affiliate."
64 | msgstr ""
65 |
66 | #: adminpages/affiliates.php:196
67 | msgid "%s Add On: Lightweight %s Tracking"
68 | msgstr ""
69 |
70 | #: adminpages/affiliates.php:200
71 | msgid "Manage"
72 | msgstr ""
73 |
74 | #: adminpages/affiliates.php:201
75 | msgid "Reports"
76 | msgstr ""
77 |
78 | #: adminpages/affiliates.php:202
79 | #: blocks/build/pmpro_affiliates_report/index.js:63
80 | #: blocks/src/pmpro_affiliates_report/edit.js:11
81 | #: blocks/build/pmpro_affiliates_report/index.js:11
82 | msgid "Settings"
83 | msgstr ""
84 |
85 | #: adminpages/affiliates.php:213
86 | msgid "Edit %s"
87 | msgstr ""
88 |
89 | #: adminpages/affiliates.php:215
90 | msgid "Add New %s"
91 | msgstr ""
92 |
93 | #: adminpages/affiliates.php:230
94 | msgid "ID:"
95 | msgstr ""
96 |
97 | #: adminpages/affiliates.php:231
98 | msgid "This will be generated when you save."
99 | msgstr ""
100 |
101 | #: adminpages/affiliates.php:235
102 | msgid "Code:"
103 | msgstr ""
104 |
105 | #: adminpages/affiliates.php:238
106 | msgid "Value added to the site URL to designate the %s link. (e.g. \"&pa=CODE\" or \"?pa=CODE\")"
107 | msgstr ""
108 |
109 | #: adminpages/affiliates.php:243
110 | msgid "Business/Contact Name:"
111 | msgstr ""
112 |
113 | #: adminpages/affiliates.php:250
114 | msgid "%s User:"
115 | msgstr ""
116 |
117 | #: adminpages/affiliates.php:253
118 | msgid "The username of a WordPress user in your site who should have access to %s reports."
119 | msgstr ""
120 |
121 | #: adminpages/affiliates.php:258
122 | msgid "Commission Rate (%)"
123 | msgstr ""
124 |
125 | #: adminpages/affiliates.php:261
126 | msgid "Enter the percentage value of the commission to be earned."
127 | msgstr ""
128 |
129 | #: adminpages/affiliates.php:266
130 | msgid "Tracking Code:"
131 | msgstr ""
132 |
133 | #: adminpages/affiliates.php:269
134 | msgid "(Optional) If you are tracking this %s through another system, you can add HTML/JS code here to run on the confirmation page after checkout. Variables:"
135 | msgstr ""
136 |
137 | #: adminpages/affiliates.php:274
138 | msgid "Cookie Length:"
139 | msgstr ""
140 |
141 | #: adminpages/affiliates.php:277
142 | msgid "In days."
143 | msgstr ""
144 |
145 | #: adminpages/affiliates.php:282
146 | msgid "Enabled:"
147 | msgstr ""
148 |
149 | #: adminpages/affiliates.php:284
150 | #: pmpro-affiliates.php:389
151 | msgid "Yes"
152 | msgstr ""
153 |
154 | #: adminpages/affiliates.php:286
155 | #: pmpro-affiliates.php:391
156 | msgid "No"
157 | msgstr ""
158 |
159 | #: adminpages/affiliates.php:305
160 | msgid "Commission Earned (All time):"
161 | msgstr ""
162 |
163 | #: adminpages/affiliates.php:312
164 | msgid "Commission Paid (All time):"
165 | msgstr ""
166 |
167 | #: adminpages/affiliates.php:319
168 | msgid "Commission Due:"
169 | msgstr ""
170 |
171 | #: adminpages/affiliates.php:324
172 | msgid "view report"
173 | msgstr ""
174 |
175 | #: adminpages/affiliates.php:343
176 | msgid "Save %s"
177 | msgstr ""
178 |
179 | #: adminpages/affiliates.php:362
180 | msgid "Add New"
181 | msgstr ""
182 |
183 | #: adminpages/affiliates.php:364
184 | msgid "View"
185 | msgstr ""
186 |
187 | #: adminpages/affiliates.php:364
188 | #: adminpages/affiliates.php:426
189 | #: blocks/build/pmpro_affiliates_report/index.js:198
190 | #: blocks/src/pmpro_affiliates_report/edit.js:101
191 | #: blocks/build/pmpro_affiliates_report/index.js:101
192 | msgid "Report"
193 | msgstr ""
194 |
195 | #: adminpages/affiliates.php:373
196 | msgid "Use %s to track orders coming in from different sales campaigns and partners."
197 | msgstr ""
198 |
199 | #: adminpages/affiliates.php:373
200 | msgid "Create your first %s now"
201 | msgstr ""
202 |
203 | #: adminpages/affiliates.php:376
204 | msgid "Search %s:"
205 | msgstr ""
206 |
207 | #: adminpages/affiliates.php:389
208 | #: adminpages/report.php:91
209 | #: pages/report.php:194
210 | #: pages/report.php:226
211 | #: blocks/build/pmpro_affiliates_report/index.js:119
212 | #: blocks/src/pmpro_affiliates_report/edit.js:51
213 | #: blocks/build/pmpro_affiliates_report/index.js:51
214 | msgid "Code"
215 | msgstr ""
216 |
217 | #: adminpages/affiliates.php:390
218 | #: adminpages/report.php:93
219 | #: pages/report.php:200
220 | #: pages/report.php:232
221 | #: blocks/build/pmpro_affiliates_report/index.js:137
222 | #: blocks/src/pmpro_affiliates_report/edit.js:63
223 | #: blocks/build/pmpro_affiliates_report/index.js:63
224 | msgid "Name"
225 | msgstr ""
226 |
227 | #: adminpages/affiliates.php:391
228 | msgid "User"
229 | msgstr ""
230 |
231 | #: adminpages/affiliates.php:392
232 | msgid "Cookie"
233 | msgstr ""
234 |
235 | #: adminpages/affiliates.php:393
236 | msgid "Enabled"
237 | msgstr ""
238 |
239 | #: adminpages/affiliates.php:394
240 | msgid "Visits"
241 | msgstr ""
242 |
243 | #: adminpages/affiliates.php:395
244 | msgid "Commission %"
245 | msgstr ""
246 |
247 | #: adminpages/affiliates.php:396
248 | msgid "Conversion %"
249 | msgstr ""
250 |
251 | #: adminpages/affiliates.php:398
252 | msgid "Revenue Contributed"
253 | msgstr ""
254 |
255 | #: adminpages/affiliates.php:413
256 | msgid "No affiliates found."
257 | msgstr ""
258 |
259 | #: adminpages/affiliates.php:423
260 | msgid "ID: %s"
261 | msgstr ""
262 |
263 | #: adminpages/affiliates.php:429
264 | msgid "Edit"
265 | msgstr ""
266 |
267 | #: adminpages/affiliates.php:432
268 | msgid "Copy"
269 | msgstr ""
270 |
271 | #: adminpages/affiliates.php:435
272 | msgid "Link"
273 | msgstr ""
274 |
275 | #: adminpages/affiliates.php:438
276 | msgid "Deleting affiliates is permanent and can affect active users. Are you sure you want to delete affiliate %s?"
277 | msgstr ""
278 |
279 | #: adminpages/affiliates.php:438
280 | msgid "Delete"
281 | msgstr ""
282 |
283 | #: adminpages/affiliates.php:498
284 | msgid "Documentation"
285 | msgstr ""
286 |
287 | #: adminpages/affiliates.php:498
288 | #: pmpro-affiliates.php:901
289 | msgid "Support"
290 | msgstr ""
291 |
292 | #: adminpages/report-csv.php:28
293 | msgid "You do not have permissions to perform this action."
294 | msgstr ""
295 |
296 | #: adminpages/report.php:31
297 | msgid "for All %s"
298 | msgstr ""
299 |
300 | #: adminpages/report.php:33
301 | msgid "for Code %s"
302 | msgstr ""
303 |
304 | #: adminpages/report.php:35
305 | msgid "Export to CSV"
306 | msgstr ""
307 |
308 | #: adminpages/report.php:40
309 | msgid "View All %s Report"
310 | msgstr ""
311 |
312 | #: adminpages/report.php:54
313 | msgid "Business/Contact Name: %s"
314 | msgstr ""
315 |
316 | #: adminpages/report.php:59
317 | msgid "User:"
318 | msgstr ""
319 |
320 | #: adminpages/report.php:86
321 | #: pages/report.php:286
322 | msgid "No %s signups have been tracked yet."
323 | msgstr ""
324 |
325 | #: adminpages/report.php:92
326 | msgid "Order"
327 | msgstr ""
328 |
329 | #: adminpages/report.php:94
330 | #: pages/report.php:203
331 | #: pages/report.php:235
332 | msgid "Member"
333 | msgstr ""
334 |
335 | #: adminpages/report.php:95
336 | #: blocks/build/pmpro_affiliates_report/index.js:164
337 | #: blocks/src/pmpro_affiliates_report/edit.js:81
338 | #: blocks/build/pmpro_affiliates_report/index.js:81
339 | msgid "Membership Level"
340 | msgstr ""
341 |
342 | #: adminpages/report.php:96
343 | #: pages/report.php:206
344 | #: pages/report.php:246
345 | #: blocks/build/pmpro_affiliates_report/index.js:155
346 | #: blocks/src/pmpro_affiliates_report/edit.js:75
347 | #: blocks/build/pmpro_affiliates_report/index.js:75
348 | msgid "Date"
349 | msgstr ""
350 |
351 | #: adminpages/report.php:97
352 | msgid "Comission %"
353 | msgstr ""
354 |
355 | #: adminpages/report.php:98
356 | msgid "Commission Earned"
357 | msgstr ""
358 |
359 | #: adminpages/report.php:99
360 | #: pages/report.php:215
361 | #: pages/report.php:265
362 | msgid "Order Total"
363 | msgstr ""
364 |
365 | #: adminpages/report.php:100
366 | msgid "Status"
367 | msgstr ""
368 |
369 | #: adminpages/report.php:118
370 | #: pmpro-affiliates.php:649
371 | msgid "Paid"
372 | msgstr ""
373 |
374 | #: adminpages/report.php:119
375 | msgid "Reset Payment Status"
376 | msgstr ""
377 |
378 | #: adminpages/report.php:122
379 | msgid "Mark as Paid"
380 | msgstr ""
381 |
382 | #: adminpages/report.php:129
383 | #: pages/report.php:197
384 | #: pages/report.php:229
385 | #: blocks/build/pmpro_affiliates_report/index.js:128
386 | #: blocks/src/pmpro_affiliates_report/edit.js:57
387 | #: blocks/build/pmpro_affiliates_report/index.js:57
388 | msgid "Sub-ID"
389 | msgstr ""
390 |
391 | #: adminpages/report.php:146
392 | #: adminpages/report.php:155
393 | #: pages/report.php:240
394 | #: pages/report.php:254
395 | msgid "deleted"
396 | msgstr ""
397 |
398 | #: adminpages/report.php:157
399 | #: pages/report.php:256
400 | msgid "—"
401 | msgstr ""
402 |
403 | #: adminpages/settings.php:56
404 | msgid "Singular Name"
405 | msgstr ""
406 |
407 | #: adminpages/settings.php:59
408 | msgid "i.e. affiliate, referral, invitation"
409 | msgstr ""
410 |
411 | #: adminpages/settings.php:63
412 | msgid "Plural Name"
413 | msgstr ""
414 |
415 | #: adminpages/settings.php:66
416 | msgid "i.e. affiliates, referrals, invitations"
417 | msgstr ""
418 |
419 | #: adminpages/settings.php:70
420 | msgid "Credit for Recurring Orders"
421 | msgstr ""
422 |
423 | #: adminpages/settings.php:73
424 | msgid "No - only credit affiliate for initial payment."
425 | msgstr ""
426 |
427 | #: adminpages/settings.php:74
428 | msgid "Yes - credit affiliate for initial payment and recurring orders."
429 | msgstr ""
430 |
431 | #: adminpages/settings.php:83
432 | msgid "Save Settings"
433 | msgstr ""
434 |
435 | #: pages/report.php:120
436 | msgid "Report for Code:"
437 | msgstr ""
438 |
439 | #: pages/report.php:141
440 | #: pages/report.php:148
441 | msgid "Commission Rate"
442 | msgstr ""
443 |
444 | #: pages/report.php:142
445 | #: pages/report.php:149
446 | msgid "Visits (All Time)"
447 | msgstr ""
448 |
449 | #: pages/report.php:143
450 | #: pages/report.php:150
451 | msgid "Conversion Rating (All Time)"
452 | msgstr ""
453 |
454 | #: pages/report.php:168
455 | #: pages/report.php:175
456 | msgid "Commission Earned (All Time)"
457 | msgstr ""
458 |
459 | #: pages/report.php:169
460 | #: pages/report.php:176
461 | msgid "Commission Paid (All Time)"
462 | msgstr ""
463 |
464 | #: pages/report.php:170
465 | #: pages/report.php:177
466 | msgid "Commission Due"
467 | msgstr ""
468 |
469 | #: pages/report.php:209
470 | #: pages/report.php:249
471 | msgid "Level"
472 | msgstr ""
473 |
474 | #: pages/report.php:212
475 | #: pages/report.php:262
476 | #: blocks/build/pmpro_affiliates_report/index.js:173
477 | #: blocks/src/pmpro_affiliates_report/edit.js:87
478 | #: blocks/build/pmpro_affiliates_report/index.js:87
479 | msgid "Commission"
480 | msgstr ""
481 |
482 | #: pages/report.php:276
483 | #: blocks/build/pmpro_affiliates_report/index.js:76
484 | #: blocks/src/pmpro_affiliates_report/edit.js:21
485 | #: blocks/build/pmpro_affiliates_report/index.js:21
486 | msgid "Export CSV"
487 | msgstr ""
488 |
489 | #: pages/report.php:296
490 | msgid "How to Create Links for this Code"
491 | msgstr ""
492 |
493 | #: pages/report.php:304
494 | msgid "Add the string %1$1s (first parameter) or %2$2s (second or later parameter) to any link to this site. If you would like to track against specific campaigns, you can add the parameter %3$3s or %4$4s to your URL. Some example links are included below."
495 | msgstr ""
496 |
497 | #: pages/report.php:313
498 | msgid "Homepage"
499 | msgstr ""
500 |
501 | #: pages/report.php:317
502 | msgid "Membership Levels"
503 | msgstr ""
504 |
505 | #: pages/report.php:321
506 | msgid "Homepage with Campaign Tracking"
507 | msgstr ""
508 |
509 | #: pages/report.php:333
510 | msgid "Select a Code"
511 | msgstr ""
512 |
513 | #: pages/report.php:351
514 | msgid "View Your Membership Account →"
515 | msgstr ""
516 |
517 | #: pages/report.php:353
518 | msgid "← View All"
519 | msgstr ""
520 |
521 | #: pmpro-affiliates.php:57
522 | msgid "affiliate"
523 | msgstr ""
524 |
525 | #: pmpro-affiliates.php:58
526 | msgid "affiliates"
527 | msgstr ""
528 |
529 | #: pmpro-affiliates.php:71
530 | msgid "%s Report"
531 | msgstr ""
532 |
533 | #: pmpro-affiliates.php:73
534 | msgid "Include the shortcode %s or Affiliate Report block."
535 | msgstr ""
536 |
537 | #: pmpro-affiliates.php:339
538 | #: pmpro-affiliates.php:341
539 | #: pmpro-affiliates.php:361
540 | msgid "Affiliates"
541 | msgstr ""
542 |
543 | #: pmpro-affiliates.php:595
544 | msgid "%s Settings"
545 | msgstr ""
546 |
547 | #: pmpro-affiliates.php:599
548 | msgid "Automatically create %s code?"
549 | msgstr ""
550 |
551 | #: pmpro-affiliates.php:602
552 | msgid "Check this if you want to automatically create the %s code for members of this level."
553 | msgstr ""
554 |
555 | #: pmpro-affiliates.php:651
556 | msgid "Payment status reset."
557 | msgstr ""
558 |
559 | #: pmpro-affiliates.php:823
560 | msgid "Affiliate Information"
561 | msgstr ""
562 |
563 | #: pmpro-affiliates.php:836
564 | msgid "Create Affiliate"
565 | msgstr ""
566 |
567 | #: pmpro-affiliates.php:838
568 | msgid "View Report"
569 | msgstr ""
570 |
571 | #: pmpro-affiliates.php:839
572 | msgid "Edit Affiliate"
573 | msgstr ""
574 |
575 | #: pmpro-affiliates.php:847
576 | msgid "Affiliate Status"
577 | msgstr ""
578 |
579 | #: pmpro-affiliates.php:888
580 | msgid "Manage Affiliates"
581 | msgstr ""
582 |
583 | #: pmpro-affiliates.php:900
584 | msgid "View Documentation"
585 | msgstr ""
586 |
587 | #: pmpro-affiliates.php:900
588 | msgid "Docs"
589 | msgstr ""
590 |
591 | #: pmpro-affiliates.php:901
592 | msgid "Visit Customer Support Forum"
593 | msgstr ""
594 |
595 | #: blocks/build/pmpro_affiliates_report/index.js:66
596 | #: blocks/src/pmpro_affiliates_report/edit.js:14
597 | #: blocks/build/pmpro_affiliates_report/index.js:14
598 | msgid "Back Link"
599 | msgstr ""
600 |
601 | #: blocks/build/pmpro_affiliates_report/index.js:73
602 | #: blocks/src/pmpro_affiliates_report/edit.js:17
603 | #: blocks/build/pmpro_affiliates_report/index.js:17
604 | msgid "Show a back link?"
605 | msgstr ""
606 |
607 | #: blocks/build/pmpro_affiliates_report/index.js:83
608 | #: blocks/src/pmpro_affiliates_report/edit.js:24
609 | #: blocks/build/pmpro_affiliates_report/index.js:24
610 | msgid "Show Export CSV link"
611 | msgstr ""
612 |
613 | #: blocks/build/pmpro_affiliates_report/index.js:86
614 | #: blocks/src/pmpro_affiliates_report/edit.js:28
615 | #: blocks/build/pmpro_affiliates_report/index.js:28
616 | msgid "Help"
617 | msgstr ""
618 |
619 | #: blocks/build/pmpro_affiliates_report/index.js:93
620 | #: blocks/src/pmpro_affiliates_report/edit.js:31
621 | #: blocks/build/pmpro_affiliates_report/index.js:31
622 | msgid "Show a help table"
623 | msgstr ""
624 |
625 | #: blocks/build/pmpro_affiliates_report/index.js:96
626 | #: blocks/src/pmpro_affiliates_report/edit.js:35
627 | #: blocks/build/pmpro_affiliates_report/index.js:35
628 | msgid "Show Conversion Table"
629 | msgstr ""
630 |
631 | #: blocks/build/pmpro_affiliates_report/index.js:103
632 | #: blocks/src/pmpro_affiliates_report/edit.js:38
633 | #: blocks/build/pmpro_affiliates_report/index.js:38
634 | msgid "Show the conversion table"
635 | msgstr ""
636 |
637 | #: blocks/build/pmpro_affiliates_report/index.js:106
638 | #: blocks/src/pmpro_affiliates_report/edit.js:42
639 | #: blocks/build/pmpro_affiliates_report/index.js:42
640 | msgid "Show Commissions Table"
641 | msgstr ""
642 |
643 | #: blocks/build/pmpro_affiliates_report/index.js:113
644 | #: blocks/src/pmpro_affiliates_report/edit.js:45
645 | #: blocks/build/pmpro_affiliates_report/index.js:45
646 | msgid "Show the commission table"
647 | msgstr ""
648 |
649 | #: blocks/build/pmpro_affiliates_report/index.js:116
650 | #: blocks/src/pmpro_affiliates_report/edit.js:48
651 | #: blocks/build/pmpro_affiliates_report/index.js:48
652 | msgid "Table Fields"
653 | msgstr ""
654 |
655 | #: blocks/build/pmpro_affiliates_report/index.js:146
656 | #: blocks/src/pmpro_affiliates_report/edit.js:69
657 | #: blocks/build/pmpro_affiliates_report/index.js:69
658 | msgid "User Login"
659 | msgstr ""
660 |
661 | #: blocks/build/pmpro_affiliates_report/index.js:182
662 | #: blocks/src/pmpro_affiliates_report/edit.js:93
663 | #: blocks/build/pmpro_affiliates_report/index.js:93
664 | msgid "Total"
665 | msgstr ""
666 |
667 | #: blocks/build/pmpro_affiliates_report/index.js:195
668 | #: blocks/src/pmpro_affiliates_report/edit.js:100
669 | #: blocks/build/pmpro_affiliates_report/index.js:100
670 | msgid "Paid Memberships Pro Affiliates"
671 | msgstr ""
672 |
673 | #: blocks/build/pmpro_affiliates_report/block.json
674 | #: blocks/src/pmpro_affiliates_report/block.json
675 | msgctxt "block title"
676 | msgid "PMPro: Affiliates Report"
677 | msgstr ""
678 |
679 | #: blocks/build/pmpro_affiliates_report/block.json
680 | #: blocks/src/pmpro_affiliates_report/block.json
681 | msgctxt "block description"
682 | msgid "Frontend affilaites report for PMPro."
683 | msgstr ""
684 |
--------------------------------------------------------------------------------
/pages/report.php:
--------------------------------------------------------------------------------
1 | post_content ) && strpos( $post->post_content, '[pmpro_affiliates_report]' ) !== false )
9 | || ( ! empty( $post->post_content_filtered ) && strpos( $post->post_content_filtered, '[pmpro_affiliates_report]' ) !== false ) ) {
10 | /*
11 | Preheader operations here.
12 | */
13 | // get affiliates
14 | global $pmpro_affiliates;
15 | $pmpro_affiliates = pmpro_affiliates_getAffiliatesForUser();
16 |
17 | // no affiliates, get out of here
18 | if ( empty( $pmpro_affiliates ) ) {
19 | wp_redirect( pmpro_url( 'account' ) );
20 | exit;
21 | }
22 | }
23 | }
24 | }
25 | add_action( 'wp', 'pmpro_affiliates_report_preheader', 1 );
26 |
27 | /*
28 | Shortcode Wrapper
29 | */
30 | function pmpro_affiliates_report_shortcode( $atts, $content = null, $code = '' ) {
31 | global $post, $wpdb, $current_user, $pmpro_pages;
32 |
33 | $pmpro_affiliates = pmpro_affiliates_getAffiliatesForUser();
34 | $pmpro_affiliates_settings = pmpro_affiliates_get_settings();
35 |
36 | // Default values from shortcode attribute. Block defaults are set in the block's register_block_type() function.
37 | extract(
38 | shortcode_atts(
39 | array(
40 | 'back_link' => '1',
41 | 'export' => '1',
42 | 'export_csv' => '1',
43 | 'help' => '1',
44 | 'fields' => 'user_login,date,membership_level,total',
45 | 'show_conversion_table' => '0',
46 | 'show_commissions_table' => '0'
47 | ),
48 | $atts
49 | )
50 | );
51 |
52 | // Check if the fields values are coming from the shortcode instead.
53 | if ( ! is_array( $fields ) ) {
54 | $fields = explode( ',', $fields );
55 | }
56 |
57 | // Set the fields to values from the Block.
58 | if ( ! empty( $atts ) && is_array( $atts ) && has_block( 'pmpro-affiliates/pmpro-affiliates-report' ) ) {
59 | $fields = array_keys( array_filter( $atts ) );
60 | }
61 |
62 | // Check if the block attribute export_csv value is false and set it to "export" to override the shortcode value.
63 | if ( ! $export_csv ) {
64 | $export = $export_csv;
65 | }
66 |
67 | // Convert to a boolean value based on attribute input.
68 | $back_link = filter_var( $back_link, FILTER_VALIDATE_BOOLEAN );
69 | $export = filter_var( $export, FILTER_VALIDATE_BOOLEAN );
70 | $help = filter_var( $help, FILTER_VALIDATE_BOOLEAN );
71 | $show_conversion_table = filter_var( $show_conversion_table, FILTER_VALIDATE_BOOLEAN );
72 | $show_commissions_table = filter_var( $show_commissions_table, FILTER_VALIDATE_BOOLEAN );
73 |
74 |
75 | ob_start();
76 | /*
77 | Page Template HTML/ETC
78 | */
79 |
80 | $pmpro_affiliates_singular_name = $pmpro_affiliates_settings['pmpro_affiliates_singular_name'];
81 | $pmpro_affiliates_plural_name = $pmpro_affiliates_settings['pmpro_affiliates_plural_name'];
82 |
83 | if ( ! empty( $_REQUEST['report'] ) ) {
84 | $report = intval( $_REQUEST['report'] );
85 | } else {
86 | $report = null;
87 | }
88 |
89 | if ( count( $pmpro_affiliates ) == 1 ) {
90 | $report = $pmpro_affiliates[0]->id;
91 | }
92 |
93 | if ( $report ) {
94 | // show report
95 | $affiliate = $wpdb->get_row( "SELECT * FROM $wpdb->pmpro_affiliates WHERE id = '" . $report . "' LIMIT 1" );
96 |
97 | // no affiliate found?
98 | if ( empty( $affiliate ) ) {
99 | wp_redirect( pmpro_url( 'account' ) );
100 | exit;
101 | }
102 |
103 | // make sure admin or affiliate user
104 | if ( ! current_user_can( 'manage_options' ) && $current_user->user_login != $affiliate->affiliateuser ) {
105 | wp_redirect( pmpro_url( 'account' ) );
106 | exit;
107 | }
108 | }
109 | ?>
110 |
111 | code, 'paid' );
115 | $unpaid_commissions = pmpro_affiliates_get_commissions( $affiliate->code, 'unpaid' );
116 | $total_commissions = $paid_commissions + $unpaid_commissions;
117 | ?>
118 |
119 |
120 | code ); ?>
121 |
122 |
123 | pmpro_membership_orders o LEFT JOIN $wpdb->pmpro_affiliates a ON o.affiliate_id = a.id LEFT JOIN $wpdb->users u ON o.user_id = u.ID WHERE o.affiliate_id <> '' AND o.status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review') ";
125 | if ( $report != 'all' ) {
126 | $sqlQuery .= " AND a.id = '" . esc_sql( $report ) . "' ";
127 | }
128 | $affiliate_orders = $wpdb->get_results( $sqlQuery );
129 |
130 | if ( ! empty( $affiliate_orders ) ) {
131 |
132 | // Attribute to show/hide conversion table.
133 | if ( $show_conversion_table ) {
134 | ?>
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | commissionrate * 100 . "%" ); ?>
149 | visits ); ?>
150 |
151 |
152 |
153 |
154 |
155 |
156 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 | membership_id );
223 | ?>
224 |
225 |
226 | code ); ?>
227 |
228 |
229 | subid ); ?>
230 |
231 |
232 | name ) ); ?>
233 |
234 |
235 |
236 | user_login ) ) {
238 | echo esc_html( $order->user_login );
239 | } else { ?>
240 | []
241 |
243 |
244 |
245 |
246 | timestamp ) ); ?>
247 |
248 |
249 |
250 | name );
253 | } elseif ( $order->membership_id > 0 ) { ?>
254 | []
255 |
259 |
260 |
261 |
262 | total * $affiliate->commissionrate ) ); ?>
263 |
264 |
265 | total ) ); ?>
266 |
267 |
268 |
271 |
272 |
273 |
274 |
275 |
278 |
279 |
280 |
284 |
289 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
326 |
327 |
328 |
329 |
330 |
331 |
345 |
346 |
347 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 | 100 ) {
60 | $rate = 100;
61 | } else {
62 | $rate = intval( $_REQUEST['commissionrate'] );
63 | }
64 |
65 | $commissionrate = $rate / 100; //convert to decimal
66 | }
67 |
68 | if ( isset( $_REQUEST['cookiedays'] ) ) {
69 | $cookiedays = sanitize_text_field( preg_replace( "[^0-9]", "", $_REQUEST['cookiedays'] ) );
70 | }
71 |
72 | if ( isset( $_REQUEST['enabled'] ) ) {
73 | $enabled = sanitize_text_field( $_REQUEST['enabled'] );
74 | }
75 |
76 | } elseif ( $edit > 0 || ($report && $report != "all" ) || $copy ) {
77 | //get values from DB
78 | if($edit > 0)
79 | $affiliate_id = $edit;
80 | elseif($report)
81 | $affiliate_id = $report;
82 | elseif($copy)
83 | $affiliate_id = $copy;
84 | $affiliate = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_affiliates WHERE id = '" . intval($affiliate_id) . "' LIMIT 1");
85 | if(!empty($affiliate->id))
86 | {
87 | $code = $affiliate->code;
88 | $name = $affiliate->name;
89 | $affiliateuser = $affiliate->affiliateuser;
90 | $trackingcode = $affiliate->trackingcode;
91 | $cookiedays = $affiliate->cookiedays;
92 | $enabled = $affiliate->enabled;
93 | $commissionrate = $affiliate->commissionrate * 100; //Stored as decimal, but we want to show as percent.
94 | }
95 | }
96 | else
97 | {
98 | //defaults
99 | $code = pmpro_affiliates_getNewCode();
100 | $name = '';
101 | $affiliateuser = '';
102 | $trackingcode = '';
103 | $cookiedays = 30;
104 |
105 | /**
106 | * Filter the default placeholder for the commission rate when creating a new affiliate.
107 | * This is a percentage value, so 5% would be 5.
108 | *
109 | * @since 0.7
110 | *
111 | * @param integer $rate The default commission rate.
112 | */
113 | $commissionrate = apply_filters( 'pmpro_affiliate_default_commission_rate', 5 ); //default to 5%
114 |
115 | /**
116 | * Filter to adjust the number of days a cookie is valid for by default.
117 | * This can also be set and modified for each individual cookie.
118 | *
119 | * @param mixed $cookiedays - number of days cookie should last, accepts numerical string or integer
120 | *
121 | * @return mixed number of days cookie should last
122 | */
123 | $cookiedays = apply_filters( 'pmpro_affiliate_default_cookie_duration' , $cookiedays );
124 | $cookiedays = intval( $cookiedays );
125 | $enabled = true;
126 | }
127 |
128 | if($edit && $save)
129 | {
130 | //updating or new?
131 | if($edit > 0)
132 | {
133 | $sqlQuery = "UPDATE $wpdb->pmpro_affiliates SET code = '" . esc_sql($code) . "', name = '" . esc_sql($name) . "', affiliateuser = '" . esc_sql($affiliateuser) . "', trackingcode = '" . esc_sql($trackingcode) . "', commissionrate = '" . esc_sql( $commissionrate ) . "', cookiedays = '" . esc_sql($cookiedays) . "', enabled = '" . esc_sql($enabled) . "' WHERE id = '" . esc_sql( $edit ) . "' LIMIT 1";
134 | if($wpdb->query($sqlQuery) !== false)
135 | {
136 | //all good
137 | $edit = false;
138 | $pmpro_msg = __( 'Affiliate saved successfully.', 'pmpro-affiliates');
139 | $pmpro_msgt = "success";
140 | }
141 | else
142 | {
143 | //error
144 | $pmpro_msg = __( 'There was an error saving the affiliate.', 'pmpro-affiliates' );
145 | $pmpro_msgt = "error";
146 | }
147 | }
148 | else
149 | {
150 | $sqlQuery = "INSERT INTO $wpdb->pmpro_affiliates (code, name, affiliateuser, trackingcode, cookiedays, enabled, commissionrate) VALUES('" . esc_sql($code) . "', '" . esc_sql($name) . "', '" . esc_sql($affiliateuser) . "', '" . esc_sql($trackingcode) . "', '" . esc_sql($cookiedays) . "', '" . esc_sql($enabled) . "', '" . esc_sql( $commissionrate ) . "')";
151 | if($wpdb->query($sqlQuery) !== false)
152 | {
153 | //all good
154 | $edit = false;
155 | $pmpro_msg = __( 'Affiliate added successfully.', 'pmpro-affiliates' );
156 | $pmpro_msgt = "success";
157 | }
158 | else
159 | {
160 | //error
161 | $pmpro_msg = __( 'There was an error adding the affiliate.', 'pmpro-affiliates' );
162 | $pmpro_msgt = "error";
163 | }
164 | }
165 |
166 | }
167 |
168 | //are we deleting?
169 | if(!empty($delete))
170 | {
171 | $sqlQuery = "DELETE FROM $wpdb->pmpro_affiliates WHERE id=" . esc_sql($delete) . " LIMIT 1";
172 | if($wpdb->query($sqlQuery) !== false)
173 | {
174 | //all good
175 | $delete = false;
176 | $pmpro_msg = __( 'Affiliate deleted successfully.', 'pmpro-affiliates' );
177 | $pmpro_msgt = "success";
178 | }
179 | else
180 | {
181 | //error
182 | $pmpro_msg = __( 'There was an error deleting the affiliate.', 'pmpro-affiliates' );
183 | $pmpro_msgt = "error";
184 | }
185 | }
186 |
187 | //get settings for default term names
188 | $pmpro_affiliates_settings = pmpro_affiliates_get_settings();
189 | $pmpro_affiliates_singular_name = $pmpro_affiliates_settings['pmpro_affiliates_singular_name'];
190 | $pmpro_affiliates_plural_name = $pmpro_affiliates_settings['pmpro_affiliates_plural_name'];
191 | ?>
192 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
210 |
211 | 0)
213 | echo esc_html( sprintf( esc_html__( 'Edit %s', 'pmpro-affiliates' ), ucwords( $pmpro_affiliates_singular_name ) ) );
214 | else
215 | echo esc_html( sprintf( esc_html__('Add New %s', 'pmpro-affiliates'), ucwords($pmpro_affiliates_singular_name) ) );
216 | ?>
217 |
218 |
219 |
220 |
221 |
222 |
223 |
348 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 | get_results("SELECT * FROM $wpdb->pmpro_affiliates");
372 | if ( empty( $affiliates ) ) { ?>
373 | .
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
405 |
406 |
407 |
408 | get_results("SELECT * FROM $wpdb->pmpro_affiliates WHERE code LIKE '%" . esc_sql( $s ) . "%' OR name LIKE '%" . esc_sql( $s ) . "%' OR affiliateuser LIKE '%" . esc_sql( $s ) . "%'");
412 | if ( empty( $affiliates ) ) {
413 | echo '' . esc_html__( 'No affiliates found.', 'pmpro-affiliates' ) . ' ';
414 | }
415 | }
416 | foreach ( $affiliates as $affiliate ) { ?>
417 |
418 |
419 | code ); ?>
420 |
421 |
441 |
442 |
443 | affiliateuser );
445 | if ( $user ) {
446 | $affiliate_user_name = '' . esc_html( stripslashes( $affiliate->affiliateuser ) ) . ' ';
447 | } else {
448 | $affiliate_user_name = esc_html( stripslashes( $affiliate->affiliateuser ) );
449 | }
450 | ?>
451 |
452 |
453 | name) ); ?>
454 |
455 | cookiedays . " days" ); ?>
456 | enabled) ); ?>
457 | visits);?>
458 |
459 | commissionrate * 100 . "%" );
461 | ?>
462 |
463 |
464 |
465 |
466 | get_var("SELECT SUM(" . esc_sql( pmpro_affiliates_get_commission_calculation_source() ) . ") FROM $wpdb->pmpro_membership_orders WHERE affiliate_id = '" . esc_sql($affiliate->id) . "' AND status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')");
469 |
470 | ?>
471 |
472 |
473 | commissionrate ) );
475 | ?>
476 |
477 |
478 |
479 |
480 |
489 |
490 |
491 |
492 |
493 |
496 |
497 |
498 | |
499 | \n"
8 | "Language-Team: Paid Memberships Pro \n"
9 | "MIME-Version: 1.0\n"
10 | "Content-Type: text/plain; charset=UTF-8\n"
11 | "Content-Transfer-Encoding: 8bit\n"
12 | "POT-Creation-Date: 2025-04-09T10:04:19+00:00\n"
13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14 | "X-Generator: WP-CLI 2.11.0\n"
15 | "X-Domain: pmpro-affiliates\n"
16 |
17 | #. Plugin Name of the plugin
18 | #: pmpro-affiliates.php
19 | msgid "Paid Memberships Pro - Affiliates Add On"
20 | msgstr ""
21 |
22 | #. Plugin URI of the plugin
23 | #: pmpro-affiliates.php
24 | msgid "https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/"
25 | msgstr ""
26 |
27 | #. Description of the plugin
28 | #: pmpro-affiliates.php
29 | msgid "Create affiliate accounts with unique referrer URLs to track membership checkouts."
30 | msgstr ""
31 |
32 | #. Author of the plugin
33 | #: pmpro-affiliates.php
34 | msgid "Paid Memberships Pro"
35 | msgstr ""
36 |
37 | #. Author URI of the plugin
38 | #: pmpro-affiliates.php
39 | msgid "https://www.paidmembershipspro.com"
40 | msgstr ""
41 |
42 | #: adminpages/affiliates.php:107
43 | #: adminpages/affiliates.php:128
44 | #: adminpages/affiliates.php:138
45 | msgid "Affiliate saved successfully."
46 | msgstr ""
47 |
48 | #: adminpages/affiliates.php:113
49 | #: adminpages/affiliates.php:134
50 | #: adminpages/affiliates.php:144
51 | msgid "There was an error saving the affiliate."
52 | msgstr ""
53 |
54 | #: adminpages/affiliates.php:124
55 | #: adminpages/affiliates.php:145
56 | #: adminpages/affiliates.php:155
57 | msgid "Affiliate added successfully."
58 | msgstr ""
59 |
60 | #: adminpages/affiliates.php:130
61 | #: adminpages/affiliates.php:151
62 | #: adminpages/affiliates.php:161
63 | msgid "There was an error adding the affiliate."
64 | msgstr ""
65 |
66 | #: adminpages/affiliates.php:145
67 | #: adminpages/affiliates.php:166
68 | #: adminpages/affiliates.php:176
69 | msgid "Affiliate deleted successfully."
70 | msgstr ""
71 |
72 | #: adminpages/affiliates.php:151
73 | #: adminpages/affiliates.php:172
74 | #: adminpages/affiliates.php:182
75 | msgid "There was an error deleting the affiliate."
76 | msgstr ""
77 |
78 | #: adminpages/affiliates.php:165
79 | #: adminpages/affiliates.php:186
80 | #: adminpages/affiliates.php:196
81 | msgid "%s Add On: Lightweight %s Tracking"
82 | msgstr ""
83 |
84 | #: adminpages/affiliates.php:169
85 | #: adminpages/affiliates.php:190
86 | #: adminpages/affiliates.php:200
87 | msgid "Manage"
88 | msgstr ""
89 |
90 | #: adminpages/affiliates.php:170
91 | #: adminpages/affiliates.php:191
92 | #: adminpages/affiliates.php:201
93 | msgid "Reports"
94 | msgstr ""
95 |
96 | #: adminpages/affiliates.php:171
97 | #: adminpages/affiliates.php:192
98 | #: blocks/build/pmpro_affiliates_report/index.js:1
99 | #: blocks/src/pmpro_affiliates_report/edit.js:11
100 | #: adminpages/affiliates.php:202
101 | #: blocks/build/pmpro_affiliates_report/index.js:63
102 | #: blocks/build/pmpro_affiliates_report/index.js:11
103 | msgid "Settings"
104 | msgstr ""
105 |
106 | #: adminpages/affiliates.php:182
107 | #: adminpages/affiliates.php:326
108 | #: adminpages/affiliates.php:409
109 | #: adminpages/affiliates.php:419
110 | #: adminpages/affiliates.php:429
111 | msgid "Edit"
112 | msgstr ""
113 |
114 | #: adminpages/affiliates.php:184
115 | #: adminpages/affiliates.php:274
116 | #: adminpages/affiliates.php:347
117 | #: adminpages/affiliates.php:352
118 | #: adminpages/affiliates.php:362
119 | msgid "Add New"
120 | msgstr ""
121 |
122 | #: adminpages/affiliates.php:199
123 | #: adminpages/affiliates.php:220
124 | #: adminpages/affiliates.php:230
125 | msgid "ID:"
126 | msgstr ""
127 |
128 | #: adminpages/affiliates.php:200
129 | #: adminpages/affiliates.php:221
130 | #: adminpages/affiliates.php:231
131 | msgid "This will be generated when you save."
132 | msgstr ""
133 |
134 | #: adminpages/affiliates.php:204
135 | #: adminpages/affiliates.php:225
136 | #: adminpages/affiliates.php:235
137 | msgid "Code:"
138 | msgstr ""
139 |
140 | #: adminpages/affiliates.php:207
141 | #: adminpages/affiliates.php:228
142 | #: adminpages/affiliates.php:238
143 | msgid "Value added to the site URL to designate the %s link. (e.g. \"&pa=CODE\" or \"?pa=CODE\")"
144 | msgstr ""
145 |
146 | #: adminpages/affiliates.php:212
147 | #: adminpages/report.php:53
148 | #: adminpages/affiliates.php:233
149 | #: adminpages/affiliates.php:243
150 | msgid "Business/Contact Name:"
151 | msgstr ""
152 |
153 | #: adminpages/affiliates.php:222
154 | #: adminpages/affiliates.php:243
155 | #: adminpages/affiliates.php:253
156 | msgid "The username of a WordPress user in your site who should have access to %s reports."
157 | msgstr ""
158 |
159 | #: adminpages/affiliates.php:227
160 | #: adminpages/affiliates.php:256
161 | #: adminpages/affiliates.php:266
162 | msgid "Tracking Code:"
163 | msgstr ""
164 |
165 | #: adminpages/affiliates.php:230
166 | #: adminpages/affiliates.php:259
167 | #: adminpages/affiliates.php:269
168 | msgid "(Optional) If you are tracking this %s through another system, you can add HTML/JS code here to run on the confirmation page after checkout. Variables:"
169 | msgstr ""
170 |
171 | #: adminpages/affiliates.php:235
172 | #: adminpages/affiliates.php:264
173 | #: adminpages/affiliates.php:274
174 | msgid "Cookie Length:"
175 | msgstr ""
176 |
177 | #: adminpages/affiliates.php:238
178 | #: adminpages/affiliates.php:267
179 | #: adminpages/affiliates.php:277
180 | msgid "In days."
181 | msgstr ""
182 |
183 | #: adminpages/affiliates.php:243
184 | #: adminpages/affiliates.php:272
185 | #: adminpages/affiliates.php:282
186 | msgid "Enabled:"
187 | msgstr ""
188 |
189 | #: adminpages/affiliates.php:245
190 | #: pmpro-affiliates.php:396
191 | #: adminpages/affiliates.php:274
192 | #: pmpro-affiliates.php:388
193 | #: adminpages/affiliates.php:284
194 | #: pmpro-affiliates.php:389
195 | msgid "Yes"
196 | msgstr ""
197 |
198 | #: adminpages/affiliates.php:247
199 | #: pmpro-affiliates.php:398
200 | #: adminpages/affiliates.php:276
201 | #: pmpro-affiliates.php:390
202 | #: adminpages/affiliates.php:286
203 | #: pmpro-affiliates.php:391
204 | msgid "No"
205 | msgstr ""
206 |
207 | #: adminpages/affiliates.php:259
208 | #: adminpages/affiliates.php:328
209 | #: adminpages/affiliates.php:333
210 | #: adminpages/affiliates.php:343
211 | msgid "Save %s"
212 | msgstr ""
213 |
214 | #: adminpages/affiliates.php:275
215 | #: adminpages/affiliates.php:349
216 | #: adminpages/affiliates.php:354
217 | #: adminpages/affiliates.php:364
218 | msgid "View"
219 | msgstr ""
220 |
221 | #: adminpages/affiliates.php:275
222 | #: adminpages/affiliates.php:323
223 | #: pmpro-affiliates.php:67
224 | #: adminpages/affiliates.php:349
225 | #: adminpages/affiliates.php:406
226 | #: blocks/build/pmpro_affiliates_report/index.js:1
227 | #: blocks/src/pmpro_affiliates_report/edit.js:94
228 | #: adminpages/affiliates.php:354
229 | #: adminpages/affiliates.php:416
230 | #: adminpages/affiliates.php:364
231 | #: adminpages/affiliates.php:426
232 | #: blocks/build/pmpro_affiliates_report/index.js:198
233 | #: blocks/src/pmpro_affiliates_report/edit.js:101
234 | #: blocks/build/pmpro_affiliates_report/index.js:101
235 | msgid "Report"
236 | msgstr ""
237 |
238 | #: adminpages/affiliates.php:285
239 | #: adminpages/affiliates.php:358
240 | #: adminpages/affiliates.php:363
241 | #: adminpages/affiliates.php:373
242 | msgid "Use %s to track orders coming in from different sales campaigns and partners."
243 | msgstr ""
244 |
245 | #: adminpages/affiliates.php:285
246 | #: adminpages/affiliates.php:358
247 | #: adminpages/affiliates.php:363
248 | #: adminpages/affiliates.php:373
249 | msgid "Create your first %s now"
250 | msgstr ""
251 |
252 | #: adminpages/affiliates.php:301
253 | #: adminpages/report.php:72
254 | #: pages/report.php:118
255 | #: adminpages/affiliates.php:374
256 | #: adminpages/report.php:89
257 | #: pages/report.php:165
258 | #: blocks/build/pmpro_affiliates_report/index.js:1
259 | #: blocks/src/pmpro_affiliates_report/edit.js:44
260 | #: adminpages/affiliates.php:379
261 | #: adminpages/report.php:91
262 | #: adminpages/affiliates.php:389
263 | #: pages/report.php:194
264 | #: pages/report.php:226
265 | #: blocks/build/pmpro_affiliates_report/index.js:119
266 | #: blocks/src/pmpro_affiliates_report/edit.js:51
267 | #: blocks/build/pmpro_affiliates_report/index.js:51
268 | msgid "Code"
269 | msgstr ""
270 |
271 | #: adminpages/affiliates.php:302
272 | #: adminpages/report.php:74
273 | #: pages/report.php:124
274 | #: adminpages/affiliates.php:375
275 | #: adminpages/report.php:91
276 | #: pages/report.php:171
277 | #: blocks/build/pmpro_affiliates_report/index.js:1
278 | #: blocks/src/pmpro_affiliates_report/edit.js:56
279 | #: adminpages/affiliates.php:380
280 | #: adminpages/report.php:93
281 | #: adminpages/affiliates.php:390
282 | #: pages/report.php:200
283 | #: pages/report.php:232
284 | #: blocks/build/pmpro_affiliates_report/index.js:137
285 | #: blocks/src/pmpro_affiliates_report/edit.js:63
286 | #: blocks/build/pmpro_affiliates_report/index.js:63
287 | msgid "Name"
288 | msgstr ""
289 |
290 | #: adminpages/affiliates.php:303
291 | #: adminpages/affiliates.php:376
292 | #: adminpages/affiliates.php:381
293 | #: adminpages/affiliates.php:391
294 | msgid "User"
295 | msgstr ""
296 |
297 | #: adminpages/affiliates.php:304
298 | #: adminpages/affiliates.php:377
299 | #: adminpages/affiliates.php:382
300 | #: adminpages/affiliates.php:392
301 | msgid "Cookie"
302 | msgstr ""
303 |
304 | #: adminpages/affiliates.php:305
305 | #: adminpages/affiliates.php:378
306 | #: adminpages/affiliates.php:383
307 | #: adminpages/affiliates.php:393
308 | msgid "Enabled"
309 | msgstr ""
310 |
311 | #: adminpages/affiliates.php:306
312 | #: adminpages/affiliates.php:379
313 | #: adminpages/affiliates.php:384
314 | #: adminpages/affiliates.php:394
315 | msgid "Visits"
316 | msgstr ""
317 |
318 | #: adminpages/affiliates.php:307
319 | #: adminpages/affiliates.php:381
320 | #: adminpages/affiliates.php:386
321 | #: adminpages/affiliates.php:396
322 | msgid "Conversion %"
323 | msgstr ""
324 |
325 | #: adminpages/affiliates.php:308
326 | msgid "Earnings"
327 | msgstr ""
328 |
329 | #: adminpages/affiliates.php:320
330 | #: adminpages/affiliates.php:403
331 | #: adminpages/affiliates.php:413
332 | #: adminpages/affiliates.php:423
333 | msgid "ID: %s"
334 | msgstr ""
335 |
336 | #: adminpages/affiliates.php:329
337 | #: adminpages/affiliates.php:412
338 | #: adminpages/affiliates.php:422
339 | #: adminpages/affiliates.php:432
340 | msgid "Copy"
341 | msgstr ""
342 |
343 | #: adminpages/affiliates.php:332
344 | #: adminpages/affiliates.php:415
345 | #: adminpages/affiliates.php:425
346 | #: adminpages/affiliates.php:435
347 | msgid "Link"
348 | msgstr ""
349 |
350 | #: adminpages/affiliates.php:335
351 | #: adminpages/affiliates.php:418
352 | #: adminpages/affiliates.php:428
353 | #: adminpages/affiliates.php:438
354 | msgid "Deleting affiliates is permanent and can affect active users. Are you sure you want to delete affiliate %s?"
355 | msgstr ""
356 |
357 | #: adminpages/affiliates.php:335
358 | #: adminpages/affiliates.php:418
359 | #: adminpages/affiliates.php:428
360 | #: adminpages/affiliates.php:438
361 | msgid "Delete"
362 | msgstr ""
363 |
364 | #: adminpages/affiliates.php:369
365 | #: adminpages/affiliates.php:476
366 | #: adminpages/affiliates.php:494
367 | #: adminpages/affiliates.php:498
368 | msgid "Documentation"
369 | msgstr ""
370 |
371 | #: adminpages/affiliates.php:369
372 | #: pmpro-affiliates.php:541
373 | #: adminpages/affiliates.php:476
374 | #: pmpro-affiliates.php:753
375 | #: pmpro-affiliates.php:840
376 | #: adminpages/affiliates.php:494
377 | #: pmpro-affiliates.php:873
378 | #: adminpages/affiliates.php:498
379 | #: pmpro-affiliates.php:901
380 | msgid "Support"
381 | msgstr ""
382 |
383 | #: adminpages/report-csv.php:30
384 | #: adminpages/report-csv.php:28
385 | msgid "You do not have permissions to perform this action."
386 | msgstr ""
387 |
388 | #: adminpages/report.php:31
389 | msgid "for All"
390 | msgstr ""
391 |
392 | #: adminpages/report.php:33
393 | msgid "for Code"
394 | msgstr ""
395 |
396 | #: adminpages/report.php:35
397 | msgid "Export to CSV"
398 | msgstr ""
399 |
400 | #: adminpages/report.php:40
401 | msgid "View All %s Report"
402 | msgstr ""
403 |
404 | #: adminpages/report.php:55
405 | #: adminpages/report.php:59
406 | msgid "User:"
407 | msgstr ""
408 |
409 | #: adminpages/report.php:67
410 | #: adminpages/report.php:84
411 | #: adminpages/report.php:86
412 | #: pages/report.php:246
413 | #: pages/report.php:286
414 | msgid "No %s signups have been tracked yet."
415 | msgstr ""
416 |
417 | #: adminpages/report.php:73
418 | #: pages/report.php:121
419 | #: adminpages/report.php:122
420 | #: pages/report.php:168
421 | #: blocks/build/pmpro_affiliates_report/index.js:1
422 | #: blocks/src/pmpro_affiliates_report/edit.js:50
423 | #: adminpages/report.php:129
424 | #: pages/report.php:197
425 | #: pages/report.php:229
426 | #: blocks/build/pmpro_affiliates_report/index.js:128
427 | #: blocks/src/pmpro_affiliates_report/edit.js:57
428 | #: blocks/build/pmpro_affiliates_report/index.js:57
429 | msgid "Sub-ID"
430 | msgstr ""
431 |
432 | #: adminpages/report.php:75
433 | #: pages/report.php:127
434 | #: adminpages/report.php:92
435 | #: pages/report.php:174
436 | #: adminpages/report.php:94
437 | #: pages/report.php:203
438 | #: pages/report.php:235
439 | msgid "Member"
440 | msgstr ""
441 |
442 | #: adminpages/report.php:76
443 | #: pages/report.php:133
444 | #: adminpages/report.php:93
445 | #: blocks/build/pmpro_affiliates_report/index.js:1
446 | #: blocks/src/pmpro_affiliates_report/edit.js:74
447 | #: adminpages/report.php:95
448 | #: blocks/build/pmpro_affiliates_report/index.js:164
449 | #: blocks/src/pmpro_affiliates_report/edit.js:81
450 | #: blocks/build/pmpro_affiliates_report/index.js:81
451 | msgid "Membership Level"
452 | msgstr ""
453 |
454 | #: adminpages/report.php:77
455 | #: pages/report.php:130
456 | #: adminpages/report.php:94
457 | #: pages/report.php:177
458 | #: blocks/build/pmpro_affiliates_report/index.js:1
459 | #: blocks/src/pmpro_affiliates_report/edit.js:68
460 | #: adminpages/report.php:96
461 | #: pages/report.php:206
462 | #: pages/report.php:246
463 | #: blocks/build/pmpro_affiliates_report/index.js:155
464 | #: blocks/src/pmpro_affiliates_report/edit.js:75
465 | #: blocks/build/pmpro_affiliates_report/index.js:75
466 | msgid "Date"
467 | msgstr ""
468 |
469 | #: adminpages/report.php:78
470 | #: pages/report.php:136
471 | #: adminpages/report.php:97
472 | #: pages/report.php:186
473 | #: adminpages/report.php:99
474 | #: pages/report.php:215
475 | #: pages/report.php:265
476 | msgid "Order Total"
477 | msgstr ""
478 |
479 | #: adminpages/settings.php:50
480 | #: adminpages/settings.php:56
481 | msgid "Singular Name"
482 | msgstr ""
483 |
484 | #: adminpages/settings.php:53
485 | #: adminpages/settings.php:59
486 | msgid "i.e. affiliate, referral, invitation"
487 | msgstr ""
488 |
489 | #: adminpages/settings.php:57
490 | #: adminpages/settings.php:63
491 | msgid "Plural Name"
492 | msgstr ""
493 |
494 | #: adminpages/settings.php:60
495 | #: adminpages/settings.php:66
496 | msgid "i.e. affiliates, referrals, invitations"
497 | msgstr ""
498 |
499 | #: adminpages/settings.php:64
500 | #: adminpages/settings.php:70
501 | msgid "Credit for Recurring Orders"
502 | msgstr ""
503 |
504 | #: adminpages/settings.php:67
505 | #: adminpages/settings.php:73
506 | msgid "No - only credit affiliate for initial payment."
507 | msgstr ""
508 |
509 | #: adminpages/settings.php:68
510 | #: adminpages/settings.php:74
511 | msgid "Yes - credit affiliate for initial payment and recurring orders."
512 | msgstr ""
513 |
514 | #: adminpages/settings.php:77
515 | #: adminpages/settings.php:83
516 | msgid "Save Settings"
517 | msgstr ""
518 |
519 | #: pages/report.php:103
520 | #: pages/report.php:131
521 | #: blocks/build/pmpro_affiliates_report/index.js:1
522 | #: blocks/src/pmpro_affiliates_report/edit.js:21
523 | #: pages/report.php:276
524 | #: blocks/build/pmpro_affiliates_report/index.js:76
525 | #: blocks/build/pmpro_affiliates_report/index.js:21
526 | msgid "Export CSV"
527 | msgstr ""
528 |
529 | #: pages/report.php:105
530 | #: pages/report.php:133
531 | #: pages/report.php:120
532 | msgid "Report for Code:"
533 | msgstr ""
534 |
535 | #: pages/report.php:187
536 | #: pages/report.php:252
537 | #: pages/report.php:296
538 | msgid "How to Create Links for this Code"
539 | msgstr ""
540 |
541 | #. translators: variables for affiliate codes
542 | #: pages/report.php:192
543 | msgid "Add the string %1s (first parameter) or %2s (second or later parameter) to any link to this site. If you would like to track against specific campaigns, you can add the parameter %3s or %4s to your URL. Some example links are included below."
544 | msgstr ""
545 |
546 | #: pages/report.php:199
547 | #: pages/report.php:266
548 | #: pages/report.php:313
549 | msgid "Homepage"
550 | msgstr ""
551 |
552 | #: pages/report.php:200
553 | #: pages/report.php:267
554 | #: pages/report.php:317
555 | msgid "Membership Levels"
556 | msgstr ""
557 |
558 | #: pages/report.php:201
559 | #: pages/report.php:268
560 | #: pages/report.php:321
561 | msgid "Homepage with Campaign Tracking"
562 | msgstr ""
563 |
564 | #: pages/report.php:210
565 | #: pages/report.php:275
566 | #: pages/report.php:333
567 | msgid "Select a Code"
568 | msgstr ""
569 |
570 | #: pages/report.php:226
571 | #: pages/report.php:288
572 | #: pages/report.php:351
573 | msgid "View Your Membership Account →"
574 | msgstr ""
575 |
576 | #: pages/report.php:230
577 | #: pages/report.php:290
578 | #: pages/report.php:353
579 | msgid "← View All"
580 | msgstr ""
581 |
582 | #: pmpro-affiliates.php:55
583 | #: pmpro-affiliates.php:57
584 | msgid "affiliate"
585 | msgstr ""
586 |
587 | #: pmpro-affiliates.php:56
588 | #: pmpro-affiliates.php:58
589 | msgid "affiliates"
590 | msgstr ""
591 |
592 | #: pmpro-affiliates.php:67
593 | msgid "Include the shortcode %s"
594 | msgstr ""
595 |
596 | #: pmpro-affiliates.php:351
597 | #: pmpro-affiliates.php:353
598 | #: pmpro-affiliates.php:372
599 | #: pmpro-affiliates.php:338
600 | #: pmpro-affiliates.php:340
601 | #: pmpro-affiliates.php:360
602 | #: pmpro-affiliates.php:346
603 | #: pmpro-affiliates.php:348
604 | #: pmpro-affiliates.php:368
605 | #: pmpro-affiliates.php:339
606 | #: pmpro-affiliates.php:341
607 | #: pmpro-affiliates.php:361
608 | msgid "Affiliates"
609 | msgstr ""
610 |
611 | #: pmpro-affiliates.php:503
612 | #: pmpro-affiliates.php:514
613 | #: pmpro-affiliates.php:601
614 | #: pmpro-affiliates.php:609
615 | #: pmpro-affiliates.php:602
616 | msgid "Check this if you want to automatically create the %s code for members of this level."
617 | msgstr ""
618 |
619 | #: pmpro-affiliates.php:527
620 | #: pmpro-affiliates.php:740
621 | #: pmpro-affiliates.php:827
622 | #: pmpro-affiliates.php:860
623 | #: pmpro-affiliates.php:888
624 | msgid "Manage Affiliates"
625 | msgstr ""
626 |
627 | #: pmpro-affiliates.php:540
628 | #: pmpro-affiliates.php:752
629 | #: pmpro-affiliates.php:839
630 | #: pmpro-affiliates.php:872
631 | #: pmpro-affiliates.php:900
632 | msgid "View Documentation"
633 | msgstr ""
634 |
635 | #: pmpro-affiliates.php:540
636 | #: pmpro-affiliates.php:752
637 | #: pmpro-affiliates.php:839
638 | #: pmpro-affiliates.php:872
639 | #: pmpro-affiliates.php:900
640 | msgid "Docs"
641 | msgstr ""
642 |
643 | #: pmpro-affiliates.php:541
644 | #: pmpro-affiliates.php:753
645 | #: pmpro-affiliates.php:840
646 | #: pmpro-affiliates.php:873
647 | #: pmpro-affiliates.php:901
648 | msgid "Visit Customer Support Forum"
649 | msgstr ""
650 |
651 | #: adminpages/affiliates.php:203
652 | #: adminpages/affiliates.php:213
653 | msgid "Edit %s"
654 | msgstr ""
655 |
656 | #: adminpages/affiliates.php:205
657 | #: adminpages/affiliates.php:215
658 | msgid "Add New %s"
659 | msgstr ""
660 |
661 | #: adminpages/affiliates.php:248
662 | #: adminpages/affiliates.php:258
663 | msgid "Commission Rate (%)"
664 | msgstr ""
665 |
666 | #: adminpages/affiliates.php:251
667 | #: adminpages/affiliates.php:261
668 | msgid "Enter the percentage value of the commission to be earned."
669 | msgstr ""
670 |
671 | #: adminpages/affiliates.php:295
672 | #: adminpages/affiliates.php:305
673 | msgid "Commission Earned (All time):"
674 | msgstr ""
675 |
676 | #: adminpages/affiliates.php:302
677 | #: adminpages/affiliates.php:312
678 | msgid "Commission Paid (All time):"
679 | msgstr ""
680 |
681 | #: adminpages/affiliates.php:309
682 | #: adminpages/affiliates.php:319
683 | msgid "Commission Due:"
684 | msgstr ""
685 |
686 | #: adminpages/affiliates.php:314
687 | #: adminpages/affiliates.php:324
688 | msgid "view report"
689 | msgstr ""
690 |
691 | #: adminpages/affiliates.php:361
692 | #: adminpages/affiliates.php:366
693 | #: adminpages/affiliates.php:376
694 | msgid "Search %s:"
695 | msgstr ""
696 |
697 | #: adminpages/affiliates.php:380
698 | #: adminpages/affiliates.php:385
699 | #: adminpages/affiliates.php:395
700 | msgid "Commission %"
701 | msgstr ""
702 |
703 | #: adminpages/affiliates.php:383
704 | #: adminpages/affiliates.php:388
705 | #: adminpages/affiliates.php:398
706 | msgid "Revenue Contributed"
707 | msgstr ""
708 |
709 | #: adminpages/affiliates.php:393
710 | #: adminpages/affiliates.php:403
711 | #: adminpages/affiliates.php:413
712 | msgid "No affiliates found."
713 | msgstr ""
714 |
715 | #: adminpages/report.php:31
716 | msgid "for All %s"
717 | msgstr ""
718 |
719 | #: adminpages/report.php:33
720 | msgid "for Code %s"
721 | msgstr ""
722 |
723 | #: adminpages/report.php:54
724 | msgid "Business/Contact Name: %s"
725 | msgstr ""
726 |
727 | #: adminpages/report.php:90
728 | #: adminpages/report.php:92
729 | msgid "Order"
730 | msgstr ""
731 |
732 | #: adminpages/report.php:95
733 | #: adminpages/report.php:97
734 | msgid "Comission %"
735 | msgstr ""
736 |
737 | #: adminpages/report.php:96
738 | #: adminpages/report.php:98
739 | msgid "Commission Earned"
740 | msgstr ""
741 |
742 | #: adminpages/report.php:98
743 | #: adminpages/report.php:100
744 | msgid "Status"
745 | msgstr ""
746 |
747 | #: adminpages/report.php:111
748 | #: pmpro-affiliates.php:561
749 | #: pmpro-affiliates.php:648
750 | #: adminpages/report.php:118
751 | #: pmpro-affiliates.php:656
752 | #: pmpro-affiliates.php:649
753 | msgid "Paid"
754 | msgstr ""
755 |
756 | #: adminpages/report.php:112
757 | #: adminpages/report.php:119
758 | msgid "Reset Payment Status"
759 | msgstr ""
760 |
761 | #: adminpages/report.php:115
762 | #: adminpages/report.php:122
763 | msgid "Mark as Paid"
764 | msgstr ""
765 |
766 | #: adminpages/report.php:139
767 | #: adminpages/report.php:148
768 | #: pages/report.php:210
769 | #: pages/report.php:224
770 | #: adminpages/report.php:146
771 | #: adminpages/report.php:155
772 | #: pages/report.php:240
773 | #: pages/report.php:254
774 | msgid "deleted"
775 | msgstr ""
776 |
777 | #: adminpages/report.php:150
778 | #: pages/report.php:226
779 | #: adminpages/report.php:157
780 | #: pages/report.php:256
781 | msgid "—"
782 | msgstr ""
783 |
784 | #: pages/report.php:149
785 | #: pages/report.php:168
786 | #: pages/report.php:175
787 | msgid "Commission Earned (All Time)"
788 | msgstr ""
789 |
790 | #: pages/report.php:150
791 | #: pages/report.php:169
792 | #: pages/report.php:176
793 | msgid "Commission Paid (All Time)"
794 | msgstr ""
795 |
796 | #: pages/report.php:151
797 | #: pages/report.php:170
798 | #: pages/report.php:177
799 | msgid "Commission Due"
800 | msgstr ""
801 |
802 | #: pages/report.php:180
803 | #: pages/report.php:209
804 | #: pages/report.php:249
805 | msgid "Level"
806 | msgstr ""
807 |
808 | #: pages/report.php:183
809 | #: blocks/build/pmpro_affiliates_report/index.js:1
810 | #: blocks/src/pmpro_affiliates_report/edit.js:80
811 | #: pages/report.php:212
812 | #: pages/report.php:262
813 | #: blocks/build/pmpro_affiliates_report/index.js:173
814 | #: blocks/src/pmpro_affiliates_report/edit.js:87
815 | #: blocks/build/pmpro_affiliates_report/index.js:87
816 | msgid "Commission"
817 | msgstr ""
818 |
819 | #: pages/report.php:257
820 | #: pages/report.php:304
821 | msgid "Add the string %1$1s (first parameter) or %2$2s (second or later parameter) to any link to this site. If you would like to track against specific campaigns, you can add the parameter %3$3s or %4$4s to your URL. Some example links are included below."
822 | msgstr ""
823 |
824 | #: pmpro-affiliates.php:71
825 | msgid "%s Report"
826 | msgstr ""
827 |
828 | #: pmpro-affiliates.php:73
829 | msgid "Include the shortcode %s or Affiliate Report block."
830 | msgstr ""
831 |
832 | #: pmpro-affiliates.php:507
833 | #: pmpro-affiliates.php:594
834 | #: pmpro-affiliates.php:602
835 | #: pmpro-affiliates.php:595
836 | msgid "%s Settings"
837 | msgstr ""
838 |
839 | #: pmpro-affiliates.php:511
840 | #: pmpro-affiliates.php:598
841 | #: pmpro-affiliates.php:606
842 | #: pmpro-affiliates.php:599
843 | msgid "Automatically create %s code?"
844 | msgstr ""
845 |
846 | #: pmpro-affiliates.php:563
847 | #: pmpro-affiliates.php:650
848 | #: pmpro-affiliates.php:658
849 | #: pmpro-affiliates.php:651
850 | msgid "Payment status reset."
851 | msgstr ""
852 |
853 | #: pmpro-affiliates.php:700
854 | #: pmpro-affiliates.php:787
855 | #: pmpro-affiliates.php:795
856 | #: pmpro-affiliates.php:823
857 | msgid "Affiliate Information"
858 | msgstr ""
859 |
860 | #: pmpro-affiliates.php:713
861 | #: pmpro-affiliates.php:800
862 | #: pmpro-affiliates.php:808
863 | #: pmpro-affiliates.php:836
864 | msgid "Create Affiliate"
865 | msgstr ""
866 |
867 | #: pmpro-affiliates.php:715
868 | #: pmpro-affiliates.php:802
869 | #: pmpro-affiliates.php:810
870 | #: pmpro-affiliates.php:838
871 | msgid "View Report"
872 | msgstr ""
873 |
874 | #: pmpro-affiliates.php:716
875 | #: pmpro-affiliates.php:803
876 | #: pmpro-affiliates.php:811
877 | #: pmpro-affiliates.php:839
878 | msgid "Edit Affiliate"
879 | msgstr ""
880 |
881 | #: pmpro-affiliates.php:724
882 | #: pmpro-affiliates.php:811
883 | #: pmpro-affiliates.php:819
884 | #: pmpro-affiliates.php:847
885 | msgid "Affiliate Status"
886 | msgstr ""
887 |
888 | #: blocks/build/pmpro_affiliates_report/index.js:1
889 | #: blocks/src/pmpro_affiliates_report/edit.js:14
890 | #: blocks/build/pmpro_affiliates_report/index.js:66
891 | #: blocks/build/pmpro_affiliates_report/index.js:14
892 | msgid "Back Link"
893 | msgstr ""
894 |
895 | #: blocks/build/pmpro_affiliates_report/index.js:1
896 | #: blocks/src/pmpro_affiliates_report/edit.js:17
897 | #: blocks/build/pmpro_affiliates_report/index.js:73
898 | #: blocks/build/pmpro_affiliates_report/index.js:17
899 | msgid "Show a back link?"
900 | msgstr ""
901 |
902 | #: blocks/build/pmpro_affiliates_report/index.js:1
903 | #: blocks/src/pmpro_affiliates_report/edit.js:24
904 | #: blocks/build/pmpro_affiliates_report/index.js:83
905 | #: blocks/build/pmpro_affiliates_report/index.js:24
906 | msgid "Show Export CSV link"
907 | msgstr ""
908 |
909 | #: blocks/build/pmpro_affiliates_report/index.js:1
910 | #: blocks/src/pmpro_affiliates_report/edit.js:28
911 | #: blocks/build/pmpro_affiliates_report/index.js:86
912 | #: blocks/build/pmpro_affiliates_report/index.js:28
913 | msgid "Help"
914 | msgstr ""
915 |
916 | #: blocks/build/pmpro_affiliates_report/index.js:1
917 | #: blocks/src/pmpro_affiliates_report/edit.js:31
918 | #: blocks/build/pmpro_affiliates_report/index.js:93
919 | #: blocks/build/pmpro_affiliates_report/index.js:31
920 | msgid "Show a help table"
921 | msgstr ""
922 |
923 | #: blocks/build/pmpro_affiliates_report/index.js:1
924 | #: blocks/src/pmpro_affiliates_report/edit.js:35
925 | #: blocks/build/pmpro_affiliates_report/index.js:106
926 | #: blocks/src/pmpro_affiliates_report/edit.js:42
927 | #: blocks/build/pmpro_affiliates_report/index.js:42
928 | msgid "Show Commissions Table"
929 | msgstr ""
930 |
931 | #: blocks/build/pmpro_affiliates_report/index.js:1
932 | #: blocks/src/pmpro_affiliates_report/edit.js:38
933 | #: blocks/build/pmpro_affiliates_report/index.js:113
934 | #: blocks/src/pmpro_affiliates_report/edit.js:45
935 | #: blocks/build/pmpro_affiliates_report/index.js:45
936 | msgid "Show the commission table"
937 | msgstr ""
938 |
939 | #: blocks/build/pmpro_affiliates_report/index.js:1
940 | #: blocks/src/pmpro_affiliates_report/edit.js:41
941 | #: blocks/build/pmpro_affiliates_report/index.js:116
942 | #: blocks/src/pmpro_affiliates_report/edit.js:48
943 | #: blocks/build/pmpro_affiliates_report/index.js:48
944 | msgid "Table Fields"
945 | msgstr ""
946 |
947 | #: blocks/build/pmpro_affiliates_report/index.js:1
948 | #: blocks/src/pmpro_affiliates_report/edit.js:62
949 | #: blocks/build/pmpro_affiliates_report/index.js:146
950 | #: blocks/src/pmpro_affiliates_report/edit.js:69
951 | #: blocks/build/pmpro_affiliates_report/index.js:69
952 | msgid "User Login"
953 | msgstr ""
954 |
955 | #: blocks/build/pmpro_affiliates_report/index.js:1
956 | #: blocks/src/pmpro_affiliates_report/edit.js:86
957 | #: blocks/build/pmpro_affiliates_report/index.js:182
958 | #: blocks/src/pmpro_affiliates_report/edit.js:93
959 | #: blocks/build/pmpro_affiliates_report/index.js:93
960 | msgid "Total"
961 | msgstr ""
962 |
963 | #: blocks/build/pmpro_affiliates_report/index.js:1
964 | #: blocks/src/pmpro_affiliates_report/edit.js:93
965 | #: blocks/build/pmpro_affiliates_report/index.js:195
966 | #: blocks/src/pmpro_affiliates_report/edit.js:100
967 | #: blocks/build/pmpro_affiliates_report/index.js:100
968 | msgid "Paid Memberships Pro Affiliates"
969 | msgstr ""
970 |
971 | #: blocks/build/pmpro_affiliates_report/block.json
972 | #: blocks/src/pmpro_affiliates_report/block.json
973 | msgctxt "block title"
974 | msgid "PMPro: Affiliates Report"
975 | msgstr ""
976 |
977 | #: blocks/build/pmpro_affiliates_report/block.json
978 | #: blocks/src/pmpro_affiliates_report/block.json
979 | msgctxt "block description"
980 | msgid "Frontend affilaites report for PMPro."
981 | msgstr ""
982 |
983 | #: adminpages/affiliates.php:240
984 | #: adminpages/affiliates.php:250
985 | msgid "%s User:"
986 | msgstr ""
987 |
988 | #: pages/report.php:141
989 | #: pages/report.php:148
990 | msgid "Commission Rate"
991 | msgstr ""
992 |
993 | #: pages/report.php:142
994 | #: pages/report.php:149
995 | msgid "Visits (All Time)"
996 | msgstr ""
997 |
998 | #: pages/report.php:143
999 | #: pages/report.php:150
1000 | msgid "Conversion Rating (All Time)"
1001 | msgstr ""
1002 |
1003 | #: blocks/build/pmpro_affiliates_report/index.js:96
1004 | #: blocks/src/pmpro_affiliates_report/edit.js:35
1005 | #: blocks/build/pmpro_affiliates_report/index.js:35
1006 | msgid "Show Conversion Table"
1007 | msgstr ""
1008 |
1009 | #: blocks/build/pmpro_affiliates_report/index.js:103
1010 | #: blocks/src/pmpro_affiliates_report/edit.js:38
1011 | #: blocks/build/pmpro_affiliates_report/index.js:38
1012 | msgid "Show the conversion table"
1013 | msgstr ""
1014 |
--------------------------------------------------------------------------------
/languages/pmpro-affiliates-de_DE.po:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 Paid Memberships Pro
2 | # This file is distributed under the same license as the Paid Memberships Pro - Affiliates Add On plugin.
3 | msgid ""
4 | msgstr ""
5 | "Project-Id-Version: Paid Memberships Pro - Affiliates Add On 0.7\n"
6 | "Report-Msgid-Bugs-To: info@paidmembershipspro.com\n"
7 | "Last-Translator: Paid Memberships Pro \n"
8 | "Language-Team: Paid Memberships Pro \n"
9 | "MIME-Version: 1.0\n"
10 | "Content-Type: text/plain; charset=UTF-8\n"
11 | "Content-Transfer-Encoding: 8bit\n"
12 | "POT-Creation-Date: 2025-04-09T10:04:19+00:00\n"
13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14 | "X-Generator: WP-CLI 2.11.0\n"
15 | "X-Domain: pmpro-affiliates\n"
16 |
17 | #. Plugin Name of the plugin
18 | #: pmpro-affiliates.php
19 | msgid "Paid Memberships Pro - Affiliates Add On"
20 | msgstr "Paid Memberships Pro - Affiliates Add On"
21 |
22 | #. Plugin URI of the plugin
23 | #: pmpro-affiliates.php
24 | msgid "https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/"
25 | msgstr "https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/"
26 |
27 | #. Description of the plugin
28 | #: pmpro-affiliates.php
29 | msgid "Create affiliate accounts with unique referrer URLs to track membership checkouts."
30 | msgstr "Erstellen Sie Affiliate-Konten mit eindeutigen Referrer-URLs, um Mitgliedschaftsauszahlungen zu verfolgen."
31 |
32 | #. Author of the plugin
33 | #: pmpro-affiliates.php
34 | msgid "Paid Memberships Pro"
35 | msgstr "Paid Memberships Pro"
36 |
37 | #. Author URI of the plugin
38 | #: pmpro-affiliates.php
39 | msgid "https://www.paidmembershipspro.com"
40 | msgstr "https://www.paidmembershipspro.com"
41 |
42 | #: adminpages/settings.php:50
43 | #: adminpages/settings.php:56
44 | msgid "Singular Name"
45 | msgstr ""
46 |
47 | #: adminpages/settings.php:53
48 | #: adminpages/settings.php:59
49 | msgid "i.e. affiliate, referral, invitation"
50 | msgstr ""
51 |
52 | #: adminpages/settings.php:57
53 | #: adminpages/settings.php:63
54 | msgid "Plural Name"
55 | msgstr ""
56 |
57 | #: adminpages/settings.php:60
58 | #: adminpages/settings.php:66
59 | msgid "i.e. affiliates, referrals, invitations"
60 | msgstr ""
61 |
62 | #: adminpages/settings.php:64
63 | #: adminpages/settings.php:70
64 | msgid "Credit for Recurring Orders"
65 | msgstr ""
66 |
67 | #: adminpages/settings.php:67
68 | #: adminpages/settings.php:73
69 | msgid "No - only credit affiliate for initial payment."
70 | msgstr ""
71 |
72 | #: adminpages/settings.php:68
73 | #: adminpages/settings.php:74
74 | msgid "Yes - credit affiliate for initial payment and recurring orders."
75 | msgstr ""
76 |
77 | #: adminpages/settings.php:77
78 | #: adminpages/settings.php:83
79 | msgid "Save Settings"
80 | msgstr ""
81 |
82 | #: pages/report.php:103
83 | #: pages/report.php:131
84 | #: blocks/build/pmpro_affiliates_report/index.js:1
85 | #: blocks/src/pmpro_affiliates_report/edit.js:21
86 | #: pages/report.php:276
87 | #: blocks/build/pmpro_affiliates_report/index.js:76
88 | #: blocks/build/pmpro_affiliates_report/index.js:21
89 | msgid "Export CSV"
90 | msgstr ""
91 |
92 | #: pages/report.php:105
93 | #: pages/report.php:133
94 | #: pages/report.php:120
95 | msgid "Report for Code:"
96 | msgstr ""
97 |
98 | #: pages/report.php:118
99 | #: adminpages/affiliates.php:301
100 | #: adminpages/report.php:72
101 | #: adminpages/affiliates.php:374
102 | #: adminpages/report.php:89
103 | #: pages/report.php:165
104 | #: blocks/build/pmpro_affiliates_report/index.js:1
105 | #: blocks/src/pmpro_affiliates_report/edit.js:44
106 | #: adminpages/affiliates.php:379
107 | #: adminpages/report.php:91
108 | #: adminpages/affiliates.php:389
109 | #: pages/report.php:194
110 | #: pages/report.php:226
111 | #: blocks/build/pmpro_affiliates_report/index.js:119
112 | #: blocks/src/pmpro_affiliates_report/edit.js:51
113 | #: blocks/build/pmpro_affiliates_report/index.js:51
114 | msgid "Code"
115 | msgstr ""
116 |
117 | #: pages/report.php:121
118 | #: adminpages/report.php:73
119 | #: adminpages/report.php:122
120 | #: pages/report.php:168
121 | #: blocks/build/pmpro_affiliates_report/index.js:1
122 | #: blocks/src/pmpro_affiliates_report/edit.js:50
123 | #: adminpages/report.php:129
124 | #: pages/report.php:197
125 | #: pages/report.php:229
126 | #: blocks/build/pmpro_affiliates_report/index.js:128
127 | #: blocks/src/pmpro_affiliates_report/edit.js:57
128 | #: blocks/build/pmpro_affiliates_report/index.js:57
129 | msgid "Sub-ID"
130 | msgstr ""
131 |
132 | #: pages/report.php:124
133 | #: adminpages/affiliates.php:302
134 | #: adminpages/report.php:74
135 | #: adminpages/affiliates.php:375
136 | #: adminpages/report.php:91
137 | #: pages/report.php:171
138 | #: blocks/build/pmpro_affiliates_report/index.js:1
139 | #: blocks/src/pmpro_affiliates_report/edit.js:56
140 | #: adminpages/affiliates.php:380
141 | #: adminpages/report.php:93
142 | #: adminpages/affiliates.php:390
143 | #: pages/report.php:200
144 | #: pages/report.php:232
145 | #: blocks/build/pmpro_affiliates_report/index.js:137
146 | #: blocks/src/pmpro_affiliates_report/edit.js:63
147 | #: blocks/build/pmpro_affiliates_report/index.js:63
148 | msgid "Name"
149 | msgstr ""
150 |
151 | #: pages/report.php:127
152 | #: adminpages/report.php:75
153 | #: adminpages/report.php:92
154 | #: pages/report.php:174
155 | #: adminpages/report.php:94
156 | #: pages/report.php:203
157 | #: pages/report.php:235
158 | msgid "Member"
159 | msgstr ""
160 |
161 | #: pages/report.php:130
162 | #: adminpages/report.php:77
163 | #: adminpages/report.php:94
164 | #: pages/report.php:177
165 | #: blocks/build/pmpro_affiliates_report/index.js:1
166 | #: blocks/src/pmpro_affiliates_report/edit.js:68
167 | #: adminpages/report.php:96
168 | #: pages/report.php:206
169 | #: pages/report.php:246
170 | #: blocks/build/pmpro_affiliates_report/index.js:155
171 | #: blocks/src/pmpro_affiliates_report/edit.js:75
172 | #: blocks/build/pmpro_affiliates_report/index.js:75
173 | msgid "Date"
174 | msgstr ""
175 |
176 | #: pages/report.php:133
177 | #: adminpages/report.php:76
178 | #: adminpages/report.php:93
179 | #: blocks/build/pmpro_affiliates_report/index.js:1
180 | #: blocks/src/pmpro_affiliates_report/edit.js:74
181 | #: adminpages/report.php:95
182 | #: blocks/build/pmpro_affiliates_report/index.js:164
183 | #: blocks/src/pmpro_affiliates_report/edit.js:81
184 | #: blocks/build/pmpro_affiliates_report/index.js:81
185 | msgid "Membership Level"
186 | msgstr ""
187 |
188 | #: pages/report.php:136
189 | #: adminpages/report.php:78
190 | #: adminpages/report.php:97
191 | #: pages/report.php:186
192 | #: adminpages/report.php:99
193 | #: pages/report.php:215
194 | #: pages/report.php:265
195 | msgid "Order Total"
196 | msgstr ""
197 |
198 | #: pages/report.php:187
199 | #: pages/report.php:252
200 | #: pages/report.php:296
201 | msgid "How to Create Links for this Code"
202 | msgstr "Wie Sie Affiliate Links erstellen können"
203 |
204 | #. translators: variables for affiliate codes
205 | #: pages/report.php:192
206 | msgid "Add the string %s or %s to any link to this site. If you would like to track against specific campaigns, you can add the parameter %s or to your URL. Some example links are included below."
207 | msgstr ""
208 |
209 | #: pages/report.php:199
210 | #: pages/report.php:266
211 | #: pages/report.php:313
212 | msgid "Homepage"
213 | msgstr "Startseite"
214 |
215 | #: pages/report.php:200
216 | #: pages/report.php:267
217 | #: pages/report.php:317
218 | msgid "Membership Levels"
219 | msgstr "Produkte"
220 |
221 | #: pages/report.php:201
222 | #: pages/report.php:268
223 | #: pages/report.php:321
224 | msgid "Homepage with Campaign Tracking"
225 | msgstr ""
226 |
227 | #: pages/report.php:210
228 | #: pages/report.php:275
229 | #: pages/report.php:333
230 | msgid "Select a Code"
231 | msgstr ""
232 |
233 | #: pages/report.php:225
234 | #: pages/report.php:226
235 | #: pages/report.php:288
236 | #: pages/report.php:351
237 | msgid "View Your Membership Account →"
238 | msgstr "Meinen Account ansehen"
239 |
240 | #: pages/report.php:229
241 | msgid "← View All Affiliate Codes"
242 | msgstr "Alle Affiliate Codes ansehen"
243 |
244 | #: pmpro-affiliates.php:56
245 | #: pmpro-affiliates.php:55
246 | #: pmpro-affiliates.php:57
247 | msgid "affiliate"
248 | msgstr ""
249 |
250 | #: pmpro-affiliates.php:57
251 | #: pmpro-affiliates.php:56
252 | #: pmpro-affiliates.php:58
253 | msgid "affiliates"
254 | msgstr ""
255 |
256 | #: pmpro-affiliates.php:68
257 | #: adminpages/affiliates.php:275
258 | #: adminpages/affiliates.php:323
259 | #: pmpro-affiliates.php:67
260 | #: adminpages/affiliates.php:349
261 | #: adminpages/affiliates.php:406
262 | #: blocks/build/pmpro_affiliates_report/index.js:1
263 | #: blocks/src/pmpro_affiliates_report/edit.js:94
264 | #: adminpages/affiliates.php:354
265 | #: adminpages/affiliates.php:416
266 | #: adminpages/affiliates.php:364
267 | #: adminpages/affiliates.php:426
268 | #: blocks/build/pmpro_affiliates_report/index.js:198
269 | #: blocks/src/pmpro_affiliates_report/edit.js:101
270 | #: blocks/build/pmpro_affiliates_report/index.js:101
271 | msgid "Report"
272 | msgstr ""
273 |
274 | #: pmpro-affiliates.php:68
275 | #: pmpro-affiliates.php:67
276 | msgid "Include the shortcode %s"
277 | msgstr ""
278 |
279 | #: pmpro-affiliates.php:352
280 | #: pmpro-affiliates.php:354
281 | #: pmpro-affiliates.php:373
282 | #: pmpro-affiliates.php:351
283 | #: pmpro-affiliates.php:353
284 | #: pmpro-affiliates.php:372
285 | #: pmpro-affiliates.php:338
286 | #: pmpro-affiliates.php:340
287 | #: pmpro-affiliates.php:360
288 | #: pmpro-affiliates.php:346
289 | #: pmpro-affiliates.php:348
290 | #: pmpro-affiliates.php:368
291 | #: pmpro-affiliates.php:339
292 | #: pmpro-affiliates.php:341
293 | #: pmpro-affiliates.php:361
294 | msgid "Affiliates"
295 | msgstr "Affiliates"
296 |
297 | #: pmpro-affiliates.php:505
298 | #: pmpro-affiliates.php:503
299 | #: pmpro-affiliates.php:514
300 | #: pmpro-affiliates.php:601
301 | #: pmpro-affiliates.php:609
302 | #: pmpro-affiliates.php:602
303 | msgid "Check this if you want to automatically create the %s code for members of this level."
304 | msgstr ""
305 |
306 | #: pmpro-affiliates.php:529
307 | #: pmpro-affiliates.php:527
308 | #: pmpro-affiliates.php:740
309 | #: pmpro-affiliates.php:827
310 | #: pmpro-affiliates.php:860
311 | #: pmpro-affiliates.php:888
312 | msgid "Manage Affiliates"
313 | msgstr ""
314 |
315 | #: pmpro-affiliates.php:542
316 | #: pmpro-affiliates.php:540
317 | #: pmpro-affiliates.php:752
318 | #: pmpro-affiliates.php:839
319 | #: pmpro-affiliates.php:872
320 | #: pmpro-affiliates.php:900
321 | msgid "View Documentation"
322 | msgstr ""
323 |
324 | #: pmpro-affiliates.php:542
325 | #: pmpro-affiliates.php:540
326 | #: pmpro-affiliates.php:752
327 | #: pmpro-affiliates.php:839
328 | #: pmpro-affiliates.php:872
329 | #: pmpro-affiliates.php:900
330 | msgid "Docs"
331 | msgstr ""
332 |
333 | #: pmpro-affiliates.php:543
334 | #: pmpro-affiliates.php:541
335 | #: pmpro-affiliates.php:753
336 | #: pmpro-affiliates.php:840
337 | #: pmpro-affiliates.php:873
338 | #: pmpro-affiliates.php:901
339 | msgid "Visit Customer Support Forum"
340 | msgstr ""
341 |
342 | #: pmpro-affiliates.php:543
343 | #: adminpages/affiliates.php:369
344 | #: pmpro-affiliates.php:541
345 | #: adminpages/affiliates.php:476
346 | #: pmpro-affiliates.php:753
347 | #: pmpro-affiliates.php:840
348 | #: adminpages/affiliates.php:494
349 | #: pmpro-affiliates.php:873
350 | #: adminpages/affiliates.php:498
351 | #: pmpro-affiliates.php:901
352 | msgid "Support"
353 | msgstr ""
354 |
355 | #: adminpages/affiliates.php:107
356 | #: adminpages/affiliates.php:128
357 | #: adminpages/affiliates.php:138
358 | msgid "Affiliate saved successfully."
359 | msgstr ""
360 |
361 | #: adminpages/affiliates.php:113
362 | #: adminpages/affiliates.php:134
363 | #: adminpages/affiliates.php:144
364 | msgid "There was an error saving the affiliate."
365 | msgstr ""
366 |
367 | #: adminpages/affiliates.php:124
368 | #: adminpages/affiliates.php:145
369 | #: adminpages/affiliates.php:155
370 | msgid "Affiliate added successfully."
371 | msgstr ""
372 |
373 | #: adminpages/affiliates.php:130
374 | #: adminpages/affiliates.php:151
375 | #: adminpages/affiliates.php:161
376 | msgid "There was an error adding the affiliate."
377 | msgstr ""
378 |
379 | #: adminpages/affiliates.php:145
380 | #: adminpages/affiliates.php:166
381 | #: adminpages/affiliates.php:176
382 | msgid "Affiliate deleted successfully."
383 | msgstr ""
384 |
385 | #: adminpages/affiliates.php:151
386 | #: adminpages/affiliates.php:172
387 | #: adminpages/affiliates.php:182
388 | msgid "There was an error deleting the affiliate."
389 | msgstr ""
390 |
391 | #: adminpages/affiliates.php:165
392 | #: adminpages/affiliates.php:186
393 | #: adminpages/affiliates.php:196
394 | msgid "%s Add On: Lightweight %s Tracking"
395 | msgstr ""
396 |
397 | #: adminpages/affiliates.php:169
398 | #: adminpages/affiliates.php:190
399 | #: adminpages/affiliates.php:200
400 | msgid "Manage"
401 | msgstr ""
402 |
403 | #: adminpages/affiliates.php:170
404 | #: adminpages/affiliates.php:191
405 | #: adminpages/affiliates.php:201
406 | msgid "Reports"
407 | msgstr ""
408 |
409 | #: adminpages/affiliates.php:171
410 | #: adminpages/affiliates.php:192
411 | #: blocks/build/pmpro_affiliates_report/index.js:1
412 | #: blocks/src/pmpro_affiliates_report/edit.js:11
413 | #: adminpages/affiliates.php:202
414 | #: blocks/build/pmpro_affiliates_report/index.js:63
415 | #: blocks/build/pmpro_affiliates_report/index.js:11
416 | msgid "Settings"
417 | msgstr ""
418 |
419 | #: adminpages/affiliates.php:182
420 | #: adminpages/affiliates.php:326
421 | #: adminpages/affiliates.php:409
422 | #: adminpages/affiliates.php:419
423 | #: adminpages/affiliates.php:429
424 | msgid "Edit"
425 | msgstr ""
426 |
427 | #: adminpages/affiliates.php:184
428 | #: adminpages/affiliates.php:274
429 | #: adminpages/affiliates.php:347
430 | #: adminpages/affiliates.php:352
431 | #: adminpages/affiliates.php:362
432 | msgid "Add New"
433 | msgstr ""
434 |
435 | #: adminpages/affiliates.php:199
436 | #: adminpages/affiliates.php:220
437 | #: adminpages/affiliates.php:230
438 | msgid "ID:"
439 | msgstr ""
440 |
441 | #: adminpages/affiliates.php:200
442 | #: adminpages/affiliates.php:221
443 | #: adminpages/affiliates.php:231
444 | msgid "This will be generated when you save."
445 | msgstr ""
446 |
447 | #: adminpages/affiliates.php:204
448 | #: adminpages/affiliates.php:225
449 | #: adminpages/affiliates.php:235
450 | msgid "Code:"
451 | msgstr ""
452 |
453 | #: adminpages/affiliates.php:207
454 | #: adminpages/affiliates.php:228
455 | #: adminpages/affiliates.php:238
456 | msgid "Value added to the site URL to designate the %s link. (e.g. \"&pa=CODE\" or \"?pa=CODE\")"
457 | msgstr ""
458 |
459 | #: adminpages/affiliates.php:212
460 | #: adminpages/report.php:53
461 | #: adminpages/affiliates.php:233
462 | #: adminpages/affiliates.php:243
463 | msgid "Business/Contact Name:"
464 | msgstr ""
465 |
466 | #: adminpages/affiliates.php:222
467 | #: adminpages/affiliates.php:243
468 | #: adminpages/affiliates.php:253
469 | msgid "The username of a WordPress user in your site who should have access to %s reports."
470 | msgstr ""
471 |
472 | #: adminpages/affiliates.php:227
473 | #: adminpages/affiliates.php:256
474 | #: adminpages/affiliates.php:266
475 | msgid "Tracking Code:"
476 | msgstr ""
477 |
478 | #: adminpages/affiliates.php:230
479 | #: adminpages/affiliates.php:259
480 | #: adminpages/affiliates.php:269
481 | msgid "(Optional) If you are tracking this %s through another system, you can add HTML/JS code here to run on the confirmation page after checkout. Variables:"
482 | msgstr ""
483 |
484 | #: adminpages/affiliates.php:235
485 | #: adminpages/affiliates.php:264
486 | #: adminpages/affiliates.php:274
487 | msgid "Cookie Length:"
488 | msgstr ""
489 |
490 | #: adminpages/affiliates.php:238
491 | #: adminpages/affiliates.php:267
492 | #: adminpages/affiliates.php:277
493 | msgid "In days."
494 | msgstr ""
495 |
496 | #: adminpages/affiliates.php:243
497 | #: adminpages/affiliates.php:272
498 | #: adminpages/affiliates.php:282
499 | msgid "Enabled:"
500 | msgstr ""
501 |
502 | #: adminpages/affiliates.php:245
503 | #: pmpro-affiliates.php:396
504 | #: adminpages/affiliates.php:274
505 | #: pmpro-affiliates.php:388
506 | #: adminpages/affiliates.php:284
507 | #: pmpro-affiliates.php:389
508 | msgid "Yes"
509 | msgstr ""
510 |
511 | #: adminpages/affiliates.php:247
512 | #: pmpro-affiliates.php:398
513 | #: adminpages/affiliates.php:276
514 | #: pmpro-affiliates.php:390
515 | #: adminpages/affiliates.php:286
516 | #: pmpro-affiliates.php:391
517 | msgid "No"
518 | msgstr ""
519 |
520 | #: adminpages/affiliates.php:259
521 | #: adminpages/affiliates.php:328
522 | #: adminpages/affiliates.php:333
523 | #: adminpages/affiliates.php:343
524 | msgid "Save %s"
525 | msgstr ""
526 |
527 | #: adminpages/affiliates.php:275
528 | #: adminpages/affiliates.php:349
529 | #: adminpages/affiliates.php:354
530 | #: adminpages/affiliates.php:364
531 | msgid "View"
532 | msgstr ""
533 |
534 | #: adminpages/affiliates.php:285
535 | #: adminpages/affiliates.php:358
536 | #: adminpages/affiliates.php:363
537 | #: adminpages/affiliates.php:373
538 | msgid "Use %s to track orders coming in from different sales campaigns and partners."
539 | msgstr ""
540 |
541 | #: adminpages/affiliates.php:285
542 | #: adminpages/affiliates.php:358
543 | #: adminpages/affiliates.php:363
544 | #: adminpages/affiliates.php:373
545 | msgid "Create your first %s now"
546 | msgstr ""
547 |
548 | #: adminpages/affiliates.php:303
549 | #: adminpages/affiliates.php:376
550 | #: adminpages/affiliates.php:381
551 | #: adminpages/affiliates.php:391
552 | msgid "User"
553 | msgstr ""
554 |
555 | #: adminpages/affiliates.php:304
556 | #: adminpages/affiliates.php:377
557 | #: adminpages/affiliates.php:382
558 | #: adminpages/affiliates.php:392
559 | msgid "Cookie"
560 | msgstr ""
561 |
562 | #: adminpages/affiliates.php:305
563 | #: adminpages/affiliates.php:378
564 | #: adminpages/affiliates.php:383
565 | #: adminpages/affiliates.php:393
566 | msgid "Enabled"
567 | msgstr ""
568 |
569 | #: adminpages/affiliates.php:306
570 | #: adminpages/affiliates.php:379
571 | #: adminpages/affiliates.php:384
572 | #: adminpages/affiliates.php:394
573 | msgid "Visits"
574 | msgstr ""
575 |
576 | #: adminpages/affiliates.php:307
577 | #: adminpages/affiliates.php:381
578 | #: adminpages/affiliates.php:386
579 | #: adminpages/affiliates.php:396
580 | msgid "Conversion %"
581 | msgstr ""
582 |
583 | #: adminpages/affiliates.php:308
584 | msgid "Earnings"
585 | msgstr ""
586 |
587 | #: adminpages/affiliates.php:320
588 | #: adminpages/affiliates.php:403
589 | #: adminpages/affiliates.php:413
590 | #: adminpages/affiliates.php:423
591 | msgid "ID: %s"
592 | msgstr ""
593 |
594 | #: adminpages/affiliates.php:329
595 | #: adminpages/affiliates.php:412
596 | #: adminpages/affiliates.php:422
597 | #: adminpages/affiliates.php:432
598 | msgid "Copy"
599 | msgstr ""
600 |
601 | #: adminpages/affiliates.php:332
602 | #: adminpages/affiliates.php:415
603 | #: adminpages/affiliates.php:425
604 | #: adminpages/affiliates.php:435
605 | msgid "Link"
606 | msgstr ""
607 |
608 | #: adminpages/affiliates.php:335
609 | #: adminpages/affiliates.php:418
610 | #: adminpages/affiliates.php:428
611 | #: adminpages/affiliates.php:438
612 | msgid "Deleting affiliates is permanent and can affect active users. Are you sure you want to delete affiliate %s?"
613 | msgstr ""
614 |
615 | #: adminpages/affiliates.php:335
616 | #: adminpages/affiliates.php:418
617 | #: adminpages/affiliates.php:428
618 | #: adminpages/affiliates.php:438
619 | msgid "Delete"
620 | msgstr ""
621 |
622 | #: adminpages/affiliates.php:369
623 | #: adminpages/affiliates.php:476
624 | #: adminpages/affiliates.php:494
625 | #: adminpages/affiliates.php:498
626 | msgid "Documentation"
627 | msgstr ""
628 |
629 | #: adminpages/report-csv.php:30
630 | #: adminpages/report-csv.php:28
631 | msgid "You do not have permissions to perform this action."
632 | msgstr ""
633 |
634 | #: adminpages/report.php:31
635 | msgid "for All"
636 | msgstr ""
637 |
638 | #: adminpages/report.php:33
639 | msgid "for Code"
640 | msgstr ""
641 |
642 | #: adminpages/report.php:35
643 | msgid "Export to CSV"
644 | msgstr ""
645 |
646 | #: adminpages/report.php:40
647 | msgid "View All %s Report"
648 | msgstr ""
649 |
650 | #: adminpages/report.php:55
651 | #: adminpages/report.php:59
652 | msgid "User:"
653 | msgstr ""
654 |
655 | #: adminpages/report.php:67
656 | #: adminpages/report.php:84
657 | #: adminpages/report.php:86
658 | #: pages/report.php:246
659 | #: pages/report.php:286
660 | msgid "No %s signups have been tracked yet."
661 | msgstr ""
662 |
663 | #. translators: variables for affiliate codes
664 | #: pages/report.php:192
665 | msgid "Add the string %1s (first parameter) or %2s (second or later parameter) to any link to this site. If you would like to track against specific campaigns, you can add the parameter %3s or %4s to your URL. Some example links are included below."
666 | msgstr ""
667 |
668 | #: pages/report.php:230
669 | #: pages/report.php:290
670 | #: pages/report.php:353
671 | msgid "← View All"
672 | msgstr ""
673 |
674 | #: adminpages/affiliates.php:203
675 | #: adminpages/affiliates.php:213
676 | msgid "Edit %s"
677 | msgstr ""
678 |
679 | #: adminpages/affiliates.php:205
680 | #: adminpages/affiliates.php:215
681 | msgid "Add New %s"
682 | msgstr ""
683 |
684 | #: adminpages/affiliates.php:248
685 | #: adminpages/affiliates.php:258
686 | msgid "Commission Rate (%)"
687 | msgstr ""
688 |
689 | #: adminpages/affiliates.php:251
690 | #: adminpages/affiliates.php:261
691 | msgid "Enter the percentage value of the commission to be earned."
692 | msgstr ""
693 |
694 | #: adminpages/affiliates.php:295
695 | #: adminpages/affiliates.php:305
696 | msgid "Commission Earned (All time):"
697 | msgstr ""
698 |
699 | #: adminpages/affiliates.php:302
700 | #: adminpages/affiliates.php:312
701 | msgid "Commission Paid (All time):"
702 | msgstr ""
703 |
704 | #: adminpages/affiliates.php:309
705 | #: adminpages/affiliates.php:319
706 | msgid "Commission Due:"
707 | msgstr ""
708 |
709 | #: adminpages/affiliates.php:314
710 | #: adminpages/affiliates.php:324
711 | msgid "view report"
712 | msgstr ""
713 |
714 | #: adminpages/affiliates.php:361
715 | #: adminpages/affiliates.php:366
716 | #: adminpages/affiliates.php:376
717 | msgid "Search %s:"
718 | msgstr ""
719 |
720 | #: adminpages/affiliates.php:380
721 | #: adminpages/affiliates.php:385
722 | #: adminpages/affiliates.php:395
723 | msgid "Commission %"
724 | msgstr ""
725 |
726 | #: adminpages/affiliates.php:383
727 | #: adminpages/affiliates.php:388
728 | #: adminpages/affiliates.php:398
729 | msgid "Revenue Contributed"
730 | msgstr ""
731 |
732 | #: adminpages/affiliates.php:393
733 | #: adminpages/affiliates.php:403
734 | #: adminpages/affiliates.php:413
735 | msgid "No affiliates found."
736 | msgstr ""
737 |
738 | #: adminpages/report.php:31
739 | msgid "for All %s"
740 | msgstr ""
741 |
742 | #: adminpages/report.php:33
743 | msgid "for Code %s"
744 | msgstr ""
745 |
746 | #: adminpages/report.php:54
747 | msgid "Business/Contact Name: %s"
748 | msgstr ""
749 |
750 | #: adminpages/report.php:90
751 | #: adminpages/report.php:92
752 | msgid "Order"
753 | msgstr ""
754 |
755 | #: adminpages/report.php:95
756 | #: adminpages/report.php:97
757 | msgid "Comission %"
758 | msgstr ""
759 |
760 | #: adminpages/report.php:96
761 | #: adminpages/report.php:98
762 | msgid "Commission Earned"
763 | msgstr ""
764 |
765 | #: adminpages/report.php:98
766 | #: adminpages/report.php:100
767 | msgid "Status"
768 | msgstr ""
769 |
770 | #: adminpages/report.php:111
771 | #: pmpro-affiliates.php:561
772 | #: pmpro-affiliates.php:648
773 | #: adminpages/report.php:118
774 | #: pmpro-affiliates.php:656
775 | #: pmpro-affiliates.php:649
776 | msgid "Paid"
777 | msgstr ""
778 |
779 | #: adminpages/report.php:112
780 | #: adminpages/report.php:119
781 | msgid "Reset Payment Status"
782 | msgstr ""
783 |
784 | #: adminpages/report.php:115
785 | #: adminpages/report.php:122
786 | msgid "Mark as Paid"
787 | msgstr ""
788 |
789 | #: adminpages/report.php:139
790 | #: adminpages/report.php:148
791 | #: pages/report.php:210
792 | #: pages/report.php:224
793 | #: adminpages/report.php:146
794 | #: adminpages/report.php:155
795 | #: pages/report.php:240
796 | #: pages/report.php:254
797 | msgid "deleted"
798 | msgstr ""
799 |
800 | #: adminpages/report.php:150
801 | #: pages/report.php:226
802 | #: adminpages/report.php:157
803 | #: pages/report.php:256
804 | msgid "—"
805 | msgstr ""
806 |
807 | #: pages/report.php:149
808 | #: pages/report.php:168
809 | #: pages/report.php:175
810 | msgid "Commission Earned (All Time)"
811 | msgstr ""
812 |
813 | #: pages/report.php:150
814 | #: pages/report.php:169
815 | #: pages/report.php:176
816 | msgid "Commission Paid (All Time)"
817 | msgstr ""
818 |
819 | #: pages/report.php:151
820 | #: pages/report.php:170
821 | #: pages/report.php:177
822 | msgid "Commission Due"
823 | msgstr ""
824 |
825 | #: pages/report.php:180
826 | #: pages/report.php:209
827 | #: pages/report.php:249
828 | msgid "Level"
829 | msgstr ""
830 |
831 | #: pages/report.php:183
832 | #: blocks/build/pmpro_affiliates_report/index.js:1
833 | #: blocks/src/pmpro_affiliates_report/edit.js:80
834 | #: pages/report.php:212
835 | #: pages/report.php:262
836 | #: blocks/build/pmpro_affiliates_report/index.js:173
837 | #: blocks/src/pmpro_affiliates_report/edit.js:87
838 | #: blocks/build/pmpro_affiliates_report/index.js:87
839 | msgid "Commission"
840 | msgstr ""
841 |
842 | #: pages/report.php:257
843 | #: pages/report.php:304
844 | msgid "Add the string %1$1s (first parameter) or %2$2s (second or later parameter) to any link to this site. If you would like to track against specific campaigns, you can add the parameter %3$3s or %4$4s to your URL. Some example links are included below."
845 | msgstr ""
846 |
847 | #: pmpro-affiliates.php:71
848 | msgid "%s Report"
849 | msgstr ""
850 |
851 | #: pmpro-affiliates.php:73
852 | msgid "Include the shortcode %s or Affiliate Report block."
853 | msgstr ""
854 |
855 | #: pmpro-affiliates.php:507
856 | #: pmpro-affiliates.php:594
857 | #: pmpro-affiliates.php:602
858 | #: pmpro-affiliates.php:595
859 | msgid "%s Settings"
860 | msgstr ""
861 |
862 | #: pmpro-affiliates.php:511
863 | #: pmpro-affiliates.php:598
864 | #: pmpro-affiliates.php:606
865 | #: pmpro-affiliates.php:599
866 | msgid "Automatically create %s code?"
867 | msgstr ""
868 |
869 | #: pmpro-affiliates.php:563
870 | #: pmpro-affiliates.php:650
871 | #: pmpro-affiliates.php:658
872 | #: pmpro-affiliates.php:651
873 | msgid "Payment status reset."
874 | msgstr ""
875 |
876 | #: pmpro-affiliates.php:700
877 | #: pmpro-affiliates.php:787
878 | #: pmpro-affiliates.php:795
879 | #: pmpro-affiliates.php:823
880 | msgid "Affiliate Information"
881 | msgstr ""
882 |
883 | #: pmpro-affiliates.php:713
884 | #: pmpro-affiliates.php:800
885 | #: pmpro-affiliates.php:808
886 | #: pmpro-affiliates.php:836
887 | msgid "Create Affiliate"
888 | msgstr ""
889 |
890 | #: pmpro-affiliates.php:715
891 | #: pmpro-affiliates.php:802
892 | #: pmpro-affiliates.php:810
893 | #: pmpro-affiliates.php:838
894 | msgid "View Report"
895 | msgstr ""
896 |
897 | #: pmpro-affiliates.php:716
898 | #: pmpro-affiliates.php:803
899 | #: pmpro-affiliates.php:811
900 | #: pmpro-affiliates.php:839
901 | msgid "Edit Affiliate"
902 | msgstr ""
903 |
904 | #: pmpro-affiliates.php:724
905 | #: pmpro-affiliates.php:811
906 | #: pmpro-affiliates.php:819
907 | #: pmpro-affiliates.php:847
908 | msgid "Affiliate Status"
909 | msgstr ""
910 |
911 | #: blocks/build/pmpro_affiliates_report/index.js:1
912 | #: blocks/src/pmpro_affiliates_report/edit.js:14
913 | #: blocks/build/pmpro_affiliates_report/index.js:66
914 | #: blocks/build/pmpro_affiliates_report/index.js:14
915 | msgid "Back Link"
916 | msgstr ""
917 |
918 | #: blocks/build/pmpro_affiliates_report/index.js:1
919 | #: blocks/src/pmpro_affiliates_report/edit.js:17
920 | #: blocks/build/pmpro_affiliates_report/index.js:73
921 | #: blocks/build/pmpro_affiliates_report/index.js:17
922 | msgid "Show a back link?"
923 | msgstr ""
924 |
925 | #: blocks/build/pmpro_affiliates_report/index.js:1
926 | #: blocks/src/pmpro_affiliates_report/edit.js:24
927 | #: blocks/build/pmpro_affiliates_report/index.js:83
928 | #: blocks/build/pmpro_affiliates_report/index.js:24
929 | msgid "Show Export CSV link"
930 | msgstr ""
931 |
932 | #: blocks/build/pmpro_affiliates_report/index.js:1
933 | #: blocks/src/pmpro_affiliates_report/edit.js:28
934 | #: blocks/build/pmpro_affiliates_report/index.js:86
935 | #: blocks/build/pmpro_affiliates_report/index.js:28
936 | msgid "Help"
937 | msgstr ""
938 |
939 | #: blocks/build/pmpro_affiliates_report/index.js:1
940 | #: blocks/src/pmpro_affiliates_report/edit.js:31
941 | #: blocks/build/pmpro_affiliates_report/index.js:93
942 | #: blocks/build/pmpro_affiliates_report/index.js:31
943 | msgid "Show a help table"
944 | msgstr ""
945 |
946 | #: blocks/build/pmpro_affiliates_report/index.js:1
947 | #: blocks/src/pmpro_affiliates_report/edit.js:35
948 | #: blocks/build/pmpro_affiliates_report/index.js:106
949 | #: blocks/src/pmpro_affiliates_report/edit.js:42
950 | #: blocks/build/pmpro_affiliates_report/index.js:42
951 | msgid "Show Commissions Table"
952 | msgstr ""
953 |
954 | #: blocks/build/pmpro_affiliates_report/index.js:1
955 | #: blocks/src/pmpro_affiliates_report/edit.js:38
956 | #: blocks/build/pmpro_affiliates_report/index.js:113
957 | #: blocks/src/pmpro_affiliates_report/edit.js:45
958 | #: blocks/build/pmpro_affiliates_report/index.js:45
959 | msgid "Show the commission table"
960 | msgstr ""
961 |
962 | #: blocks/build/pmpro_affiliates_report/index.js:1
963 | #: blocks/src/pmpro_affiliates_report/edit.js:41
964 | #: blocks/build/pmpro_affiliates_report/index.js:116
965 | #: blocks/src/pmpro_affiliates_report/edit.js:48
966 | #: blocks/build/pmpro_affiliates_report/index.js:48
967 | msgid "Table Fields"
968 | msgstr ""
969 |
970 | #: blocks/build/pmpro_affiliates_report/index.js:1
971 | #: blocks/src/pmpro_affiliates_report/edit.js:62
972 | #: blocks/build/pmpro_affiliates_report/index.js:146
973 | #: blocks/src/pmpro_affiliates_report/edit.js:69
974 | #: blocks/build/pmpro_affiliates_report/index.js:69
975 | msgid "User Login"
976 | msgstr ""
977 |
978 | #: blocks/build/pmpro_affiliates_report/index.js:1
979 | #: blocks/src/pmpro_affiliates_report/edit.js:86
980 | #: blocks/build/pmpro_affiliates_report/index.js:182
981 | #: blocks/src/pmpro_affiliates_report/edit.js:93
982 | #: blocks/build/pmpro_affiliates_report/index.js:93
983 | msgid "Total"
984 | msgstr ""
985 |
986 | #: blocks/build/pmpro_affiliates_report/index.js:1
987 | #: blocks/src/pmpro_affiliates_report/edit.js:93
988 | #: blocks/build/pmpro_affiliates_report/index.js:195
989 | #: blocks/src/pmpro_affiliates_report/edit.js:100
990 | #: blocks/build/pmpro_affiliates_report/index.js:100
991 | msgid "Paid Memberships Pro Affiliates"
992 | msgstr ""
993 |
994 | #: blocks/build/pmpro_affiliates_report/block.json
995 | #: blocks/src/pmpro_affiliates_report/block.json
996 | msgctxt "block title"
997 | msgid "PMPro: Affiliates Report"
998 | msgstr ""
999 |
1000 | #: blocks/build/pmpro_affiliates_report/block.json
1001 | #: blocks/src/pmpro_affiliates_report/block.json
1002 | msgctxt "block description"
1003 | msgid "Frontend affilaites report for PMPro."
1004 | msgstr ""
1005 |
1006 | #: adminpages/affiliates.php:240
1007 | #: adminpages/affiliates.php:250
1008 | msgid "%s User:"
1009 | msgstr ""
1010 |
1011 | #: pages/report.php:141
1012 | #: pages/report.php:148
1013 | msgid "Commission Rate"
1014 | msgstr ""
1015 |
1016 | #: pages/report.php:142
1017 | #: pages/report.php:149
1018 | msgid "Visits (All Time)"
1019 | msgstr ""
1020 |
1021 | #: pages/report.php:143
1022 | #: pages/report.php:150
1023 | msgid "Conversion Rating (All Time)"
1024 | msgstr ""
1025 |
1026 | #: blocks/build/pmpro_affiliates_report/index.js:96
1027 | #: blocks/src/pmpro_affiliates_report/edit.js:35
1028 | #: blocks/build/pmpro_affiliates_report/index.js:35
1029 | msgid "Show Conversion Table"
1030 | msgstr ""
1031 |
1032 | #: blocks/build/pmpro_affiliates_report/index.js:103
1033 | #: blocks/src/pmpro_affiliates_report/edit.js:38
1034 | #: blocks/build/pmpro_affiliates_report/index.js:38
1035 | msgid "Show the conversion table"
1036 | msgstr ""
1037 |
--------------------------------------------------------------------------------
/pmpro-affiliates.php:
--------------------------------------------------------------------------------
1 | pmpro_affiliates = $table_prefix . 'pmpro_affiliates';
44 | }
45 | add_action( 'init', 'pmpro_affiliates_set_wpdb', 5 );
46 |
47 | // Get options
48 | function pmpro_affiliates_get_options() {
49 | $default_options = array( 'db_version' => 0 );
50 |
51 | return get_option( 'pmpro_affiliates_options', $default_options );
52 | }
53 |
54 | // Get settings
55 | function pmpro_affiliates_get_settings() {
56 | $default_settings = array(
57 | 'pmpro_affiliates_singular_name' => esc_html__( 'affiliate', 'pmpro-affiliates' ),
58 | 'pmpro_affiliates_plural_name' => esc_html__( 'affiliates', 'pmpro-affiliates' ),
59 | 'pmpro_affiliates_recurring' => '0',
60 | );
61 |
62 | return get_option( 'pmpro_affiliates_settings', $default_settings );
63 | }
64 |
65 | // Add page setting for the frontend Affiliate Report page
66 | function pmpro_affiliates_extra_page_settings( $pages ) {
67 | $pmpro_affiliates_settings = pmpro_affiliates_get_settings();
68 | $pmpro_affiliates_singular_name = $pmpro_affiliates_settings['pmpro_affiliates_singular_name'];
69 |
70 | $pages['affiliate_report'] = array(
71 | 'title' => sprintf( esc_html__( '%s Report', 'pmpro-affiliates' ), ucwords( $pmpro_affiliates_singular_name ) ),
72 | 'content' => '[pmpro_affiliates_report]',
73 | 'hint' => sprintf( esc_html__( 'Include the shortcode %s or Affiliate Report block.', 'pmpro-affiliates' ), '[pmpro_affiliates_report]' ),
74 | );
75 | return $pages;
76 | }
77 | add_action( 'pmpro_extra_page_settings', 'pmpro_affiliates_extra_page_settings' );
78 |
79 | // Add links to the bottom of the list
80 | function pmpro_affiliates_member_links_bottom() {
81 | // Check if the user has affiliate codes
82 | global $pmpro_affiliates, $pmpro_pages;
83 | $pmpro_affiliates = pmpro_affiliates_getAffiliatesForUser();
84 | $pmpro_pages_affiliate_report = $pmpro_pages['affiliate_report'];
85 |
86 | // If the user has affiliates codes, add the link
87 | if ( ! empty( $pmpro_affiliates ) && ! empty( $pmpro_pages_affiliate_report ) ) {
88 | ?>
89 |
90 | hide_errors();
106 | $wpdb->pmpro_affiliates = $table_prefix . 'pmpro_affiliates';
107 | $table_exists = $wpdb->query( "SHOW TABLES LIKE '" . $wpdb->pmpro_affiliates . "'" );
108 | if ( ! $table_exists ) {
109 | $db_version = 0;
110 | }
111 |
112 | // SQL for the affiliates table
113 | $sqlQuery = '
114 | CREATE TABLE `' . $wpdb->pmpro_affiliates . "` (
115 | id int(11) unsigned NOT NULL AUTO_INCREMENT,
116 | code varchar(32) NOT NULL,
117 | name varchar(255) NOT NULL,
118 | affiliateuser varchar(255) NOT NULL,
119 | trackingcode mediumtext NOT NULL,
120 | cookiedays int(11) NOT NULL DEFAULT '30',
121 | enabled tinyint(4) NOT NULL DEFAULT '1',
122 | commissionrate decimal(10,2) NOT NULL DEFAULT '0.00',
123 | visits int(11) unsigned NOT NULL DEFAULT '0',
124 | PRIMARY KEY (id),
125 | KEY affiliateid (code),
126 | KEY affiliateuser (affiliateuser),
127 | KEY enabled (enabled)
128 | );
129 | ";
130 |
131 | // Create the database table.
132 | if ( $db_version == 0 ) {
133 | require_once ABSPATH . 'wp-admin/includes/upgrade.php';
134 | dbDelta( $sqlQuery );
135 |
136 | // save the db version
137 | $db_version = 0.6;
138 | $pmpro_affiliates_options['db_version'] = $db_version;
139 | update_option( 'pmpro_affiliates_options', $pmpro_affiliates_options );
140 | } elseif ( $db_version > 0 && $db_version < 0.6 ) {
141 | // update the db version
142 | require_once dirname( __FILE__ ) . '/includes/updates/upgrade_0_6.php';
143 | pmpro_affiliates_upgrade_0_6();
144 | }
145 | }
146 | add_action( 'admin_init', 'pmpro_affiliates_checkDB', 20 );
147 |
148 | // check for affiliate code
149 | function pmpro_affiliates_wp_head() {
150 | global $pmpro_affiliate_code, $pmpro_affiliate_subid;
151 | if ( ! empty( $_REQUEST['pa'] ) ) {
152 | $pmpro_affiliate_code = preg_replace( '[^a-zA-Z0-9]', '', $_REQUEST['pa'] );
153 | }
154 | if ( ! empty( $_REQUEST['subid'] ) ) {
155 | $pmpro_affiliate_subid = preg_replace( '[^a-zA-Z0-9]', '', $_REQUEST['subid'] );
156 | }
157 |
158 | if ( ! empty( $pmpro_affiliate_code ) ) {
159 | global $wpdb;
160 |
161 | // check that the code is enabled
162 | $affiliate_enabled = $wpdb->get_var( "SELECT enabled FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $pmpro_affiliate_code ) . "' LIMIT 1" );
163 | if ( ! empty( $affiliate_enabled ) ) {
164 | // build cookie string
165 | $cookiestring = $pmpro_affiliate_code;
166 | if ( ! empty( $pmpro_affiliate_subid ) ) {
167 | $cookiestring .= ',' . $pmpro_affiliate_subid;
168 | }
169 |
170 | // track the visit
171 | if ( empty( $_COOKIE['pmpro_affiliate'] ) ) {
172 | $wpdb->query( "UPDATE $wpdb->pmpro_affiliates SET visits = visits + 1 WHERE code = '" . esc_sql( $pmpro_affiliate_code ) . "' LIMIT 1" );
173 | }
174 |
175 | // how long?
176 | $cookielength = $wpdb->get_var( "SELECT cookiedays FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $pmpro_affiliate_code ) . "' LIMIT 1" );
177 | ?>
178 |
185 | user_id;
199 | // check for an affiliate id in the first order for this subscription
200 | if ( ! empty( $order->subscription_transaction_id ) && ! empty( $pmpro_affiliates_recurring ) ) {
201 | $first_order = $order->get_original_subscription_order();
202 | if ( ! empty( $first_order ) ) {
203 | $affiliate_id = $first_order->affiliate_id;
204 | $affiliate_subid = $first_order->affiliate_subid;
205 |
206 | $affiliate_code = $wpdb->get_var( "SELECT code FROM $wpdb->pmpro_affiliates WHERE id = '" . esc_sql( $affiliate_id ) . "' LIMIT 1" );
207 | }
208 | }
209 |
210 | // check for cookie
211 | if ( empty( $affiliate_code ) && ! empty( $_COOKIE['pmpro_affiliate'] ) ) {
212 | $parts = explode( ',', $_COOKIE['pmpro_affiliate'] );
213 | $affiliate_code = sanitize_text_field( $parts[0] );
214 | if ( isset( $parts[1] ) ) {
215 | $affiliate_subid = sanitize_text_field( $parts[1] );
216 | } else {
217 | $affiliate_subid = '';
218 | }
219 | $affiliate_id = $wpdb->get_var( "SELECT id FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
220 | }
221 |
222 | if ( ! empty( $affiliate_code ) ) {
223 | // check that it is enabled
224 | $affiliate_enabled = $wpdb->get_var( "SELECT enabled FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
225 | if ( ! $affiliate_enabled ) {
226 | return; // don't do anything
227 | } else {
228 | // save first?
229 | if ( $savefirst ) {
230 | $order->saveOrder();
231 | }
232 |
233 | // update order in the database
234 | if ( ! empty( $order->id ) ) {
235 | $sqlQuery = "UPDATE $wpdb->pmpro_membership_orders SET affiliate_id = '" . esc_sql( $affiliate_id ) . "', affiliate_subid = '" . esc_sql( $affiliate_subid ) . "' WHERE id = " . esc_sql( $order->id ) . ' LIMIT 1';
236 | $wpdb->query( $sqlQuery );
237 | }
238 | }
239 | }
240 | }
241 | add_action( 'pmpro_added_order', 'pmpro_affiliates_pmpro_added_order' );
242 |
243 | /*
244 | If we get to the after_checkout hook without $pmpro_affiliates_saved_order set, let's pass the order directly.
245 | */
246 |
247 | function pmpro_affiliates_no_order_checkout( $user_id, $morder ) {
248 |
249 | global $pmpro_affiliates_saved_order;
250 |
251 | // if an order was added, we're good already
252 | if ( $pmpro_affiliates_saved_order ) {
253 | return;
254 | }
255 |
256 | //now pass through the function above
257 | return pmpro_affiliates_pmpro_added_order($morder, true); //will create an order if there is an affiliate id
258 |
259 | }
260 | add_action( 'pmpro_after_checkout', 'pmpro_affiliates_no_order_checkout', 10, 2 );
261 |
262 | /*
263 | If the level is set to create an affiliate, let's create it.
264 | */
265 | function pmpro_affiliates_generate_affiliate_after_checkout( $user_id, $morder ) {
266 | global $wpdb;
267 |
268 | //get some info
269 | $user = get_userdata($user_id);
270 | $pmpro_level = pmpro_getSpecificMembershipLevelForUser( $user_id, $morder->membership_id );
271 |
272 | //generate the affiliate after membership checkout
273 | $pmpro_create_affiliate_level = get_option( 'pmpro_create_affiliate_level_' . $pmpro_level->id );
274 | $code = pmpro_affiliates_getNewCode();
275 | if ( ! empty( $pmpro_create_affiliate_level ) ) {
276 | /**
277 | * Filter the number of days to set the cookie for the affiliate.
278 | *
279 | * @param int $days The number of days to set the cookie for the affiliate.
280 | * @param int $user_id The user ID.
281 | * @param object $pmpro_level The membership level object.
282 | * @return int The number of days to set the cookie for the affiliate.
283 | */
284 | $days = intval( apply_filters( 'pmproaf_default_cookie_duration', 30, $user_id, $pmpro_level ) );
285 | $sqlQuery = "INSERT INTO $wpdb->pmpro_affiliates (code, name, affiliateuser, trackingcode, cookiedays, enabled) VALUES('" . esc_sql( $code ) . "', '" . esc_sql( $user->display_name ) . "', '" . esc_sql( $user->user_login ) . "', '', $days, '1')";
286 | $wpdb->query( $sqlQuery );
287 | }
288 | }
289 | add_action( 'pmpro_after_checkout', 'pmpro_affiliates_generate_affiliate_after_checkout', 10, 2 );
290 |
291 | // add tracking code to confirmation page
292 | function pmpro_affiliates_pmpro_confirmation_message( $message ) {
293 | global $current_user, $wpdb, $pmpro_affiliates, $pmpro_pages;
294 | if ( ! empty( $_COOKIE['pmpro_affiliate'] ) ) {
295 | $parts = explode( ',', $_COOKIE['pmpro_affiliate'] );
296 | $affiliate_code = sanitize_text_field( $parts[0] );
297 |
298 | if ( ! empty( $affiliate_code ) ) {
299 | global $current_user, $wpdb;
300 |
301 | $affiliate_enabled = $wpdb->get_var( "SELECT enabled FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
302 | if ( $affiliate_enabled ) {
303 | $tracking_code = $wpdb->get_var( "SELECT trackingcode FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
304 | if ( ! empty( $tracking_code ) ) {
305 | // filter
306 | $order = new MemberOrder();
307 | $order->getLastMemberOrder();
308 | $tracking_code = str_replace( '!!ORDER_AMOUNT!!', $order->total, $tracking_code );
309 | $tracking_code = str_replace( '!!ORDER_ID!!', $order->code, $tracking_code );
310 | $tracking_code = str_replace( '!!LEVEL_NAME!!', $current_user->membership_level->name, $tracking_code );
311 |
312 | // add to message
313 | $message .= "\n" . stripslashes( $tracking_code );
314 | }
315 | }
316 | }
317 | }
318 |
319 | $pmpro_affiliates = pmpro_affiliates_getAffiliatesForUser( $current_user->ID );
320 | $pmpro_pages_affiliate_report = $pmpro_pages['affiliate_report'];
321 |
322 | // If the user has affiliates codes, add the link
323 | if ( ! empty( $pmpro_affiliates ) && ! empty( $pmpro_pages_affiliate_report ) ) {
324 | $message .= '' . get_the_title( $pmpro_pages_affiliate_report ) . '
';
325 | }
326 | return $message;
327 | }
328 | add_filter( 'pmpro_confirmation_message', 'pmpro_affiliates_pmpro_confirmation_message' );
329 |
330 | /*
331 | * Add Menu Item for "Affiliates".
332 | */
333 | function pmpro_affiliates_add_pages() {
334 | if ( ! defined( 'PMPRO_VERSION' ) ) {
335 | return;
336 | }
337 |
338 | if ( version_compare( PMPRO_VERSION, '2.0' ) >= 0 ) {
339 | add_submenu_page( 'pmpro-dashboard', __( 'Affiliates', 'pmpro-affiliates' ), __( 'Affiliates', 'pmpro-affiliates' ), 'manage_options', 'pmpro-affiliates', 'pmpro_affiliates_adminpage' );
340 | } else {
341 | add_submenu_page( 'pmpro-membershiplevels', __( 'Affiliates', 'pmpro-affiliates' ), __( 'Affiliates', 'pmpro-affiliates' ), 'manage_options', 'pmpro-affiliates', 'pmpro_affiliates_adminpage' );
342 | }
343 | }
344 | add_action( 'admin_menu', 'pmpro_affiliates_add_pages', 20 );
345 |
346 | // affiliates page (add new)
347 | function pmpro_affiliates_adminpage() {
348 | require_once dirname( __FILE__ ) . '/adminpages/affiliates.php';
349 | }
350 |
351 | // add page to admin bar
352 | function pmpro_affiliates_admin_bar_menu() {
353 | global $wp_admin_bar;
354 | if ( ! is_super_admin() || ! is_admin_bar_showing() ) {
355 | return;
356 | }
357 | $wp_admin_bar->add_menu(
358 | array(
359 | 'id' => 'pmpro-affiliates',
360 | 'parent' => 'paid-memberships-pro',
361 | 'title' => __( 'Affiliates', 'pmpro-affiliates' ),
362 | 'href' => get_admin_url(
363 | null,
364 | '/admin.php?page=pmpro-affiliates'
365 | ),
366 | )
367 | );
368 | }
369 | add_action( 'admin_bar_menu', 'pmpro_affiliates_admin_bar_menu', 1000 );
370 |
371 | // Get a new random code for affiliate codes.
372 | function pmpro_affiliates_getNewCode() {
373 | $code = pmpro_getDiscountCode();
374 |
375 | /**
376 | * Filter to allow customization of the code generated for Affiliate
377 | *
378 | * @param string $code The generated code for the Affiliate.
379 | *
380 | * @return string The string for the affiliate code.
381 | */
382 | $code = apply_filters( 'pmpro_affiliates_new_code', $code );
383 |
384 | return $code;
385 | }
386 |
387 | function pmpro_affiliates_yesorno( $var ) {
388 | if ( ! empty( $var ) ) {
389 | return __( 'Yes', 'pmpro-affiliates' );
390 | } else {
391 | return __( 'No', 'pmpro-affiliates' );
392 | }
393 | }
394 |
395 | /*
396 | This next function connects affiliate codes to discount codes with the same code. If one is set, the other will be set.
397 |
398 | If an affiliate code was passed or is already saved in a cookie and a discount code is used, the previous affiliate takes precedence.
399 |
400 | Legacy function for PMPro < 3.0.
401 | */
402 | function pmpro_affiliates_set_discount_code() {
403 | global $wpdb, $pmpro_level;
404 |
405 | // Is PMPro active?
406 | if ( ! function_exists( 'pmpro_is_checkout' ) ) {
407 | return;
408 | }
409 |
410 | // Only run the rest of this function if PMPro is not yet updated to 3.0.
411 | if ( version_compare( PMPRO_VERSION, '3.0' ) >= 0 ) {
412 | return;
413 | }
414 |
415 | // Make sure we're on the checkout page.
416 | if ( ! pmpro_is_checkout() ) {
417 | return;
418 | }
419 |
420 | //checkout page
421 | if( !isset( $_REQUEST['discount_code'] ) && ( ! empty( $_COOKIE['pmpro_affiliate'] ) || ! empty( $_REQUEST['pa'] ) ) ) {
422 | if( ! empty( $_COOKIE['pmpro_affiliate'] ) ) {
423 | $affiliate_code = sanitize_text_field( $_COOKIE['pmpro_affiliate'] );
424 | } else {
425 | $affiliate_code = sanitize_text_field( $_REQUEST['pa'] );
426 | }
427 |
428 | //set the discount code if there is an affiliate cookie
429 | $exists = $wpdb->get_var( "SELECT id FROM $wpdb->pmpro_discount_codes WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
430 | if( ! empty( $exists ) ) {
431 | //check that the code is applicable for this level
432 | if( ! empty( $pmpro_level ) ) {
433 | $level_id = $pmpro_level->id;
434 | } elseif ( ! empty( $_REQUEST['level'] ) ) {
435 | $level_id = intval( $_REQUEST['level'] );
436 | } else {
437 | $level_id = null;
438 | }
439 | $codecheck = pmpro_checkDiscountCode( $affiliate_code, $level_id );
440 | if( $codecheck ) {
441 | $_REQUEST['discount_code'] = $affiliate_code;
442 |
443 | //prevent caching of this page load
444 | add_action( 'send_headers', 'nocache_headers' );
445 | }
446 | }
447 | } elseif( ! empty( $_REQUEST['discount_code'] ) && empty( $_REQUEST['pa'] ) && empty( $_COOKIE['pmpro_affiliate'] ) ) {
448 | //set the affiliate id to the discount code
449 | $exists = $wpdb->get_var( "SELECT id FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $_REQUEST['discount_code'] ) . "' LIMIT 1" );
450 | if( ! empty( $exists ) ) {
451 | //set the affiliate id passed in to the discount code
452 | $_REQUEST['pa'] = sanitize_text_field( $_REQUEST['discount_code'] );
453 |
454 | // set the cookie to the discount code
455 | $_COOKIE['pmpro_affiliate'] = sanitize_text_field( $_REQUEST['discount_code'] );
456 |
457 | //prevent caching of this page load
458 | add_action( 'send_headers', 'nocache_headers' );
459 | }
460 | }
461 | }
462 | add_action( 'init', 'pmpro_affiliates_set_discount_code', 30 );
463 |
464 | /**
465 | * Set the default discount code to the affiliates code for sites updated to PMPro v3.0.
466 | *
467 | * @since 0.6.2
468 | *
469 | * @param string|null $code The default discount code.
470 | * @param int $level_id The level ID.
471 | * @return string The default discount code.
472 | */
473 | function pmpro_affiliates_default_discount_code( $code, $level_id ) {
474 | global $wpdb;
475 |
476 | // Get the affiliate code.
477 | if( ! empty( $_COOKIE['pmpro_affiliate'] ) ) {
478 | $affiliate_code = sanitize_text_field( $_COOKIE['pmpro_affiliate'] );
479 | } elseif ( ! empty( $_REQUEST['pa'] ) ) {
480 | $affiliate_code = sanitize_text_field( $_REQUEST['pa'] );
481 | } else {
482 | // No affiliate set. Return the code that was passed.
483 | return $code;
484 | }
485 |
486 | // Check if the affiliate code exists.
487 | $exists = $wpdb->get_var( "SELECT id FROM $wpdb->pmpro_discount_codes WHERE code = '" . esc_sql( $affiliate_code ) . "' LIMIT 1" );
488 | if ( empty( $exists ) ) {
489 | // The discount code for this affiliate does not exist. Return the code that was passed.
490 | return $code;
491 | }
492 |
493 | // Check that the code is applicable for this level.
494 | $codecheck = pmpro_checkDiscountCode( $affiliate_code, $level_id );
495 | if ( ! $codecheck ) {
496 | // The discount code for this affiliate is not applicable for this level. Return the code that was passed.
497 | return $code;
498 | }
499 |
500 | // Prevent caching of this page load.
501 | add_action( 'send_headers', 'nocache_headers' );
502 |
503 | // Set the default discount code to the affiliate code.
504 | return $affiliate_code;
505 | }
506 | add_filter( 'pmpro_default_discount_code', 'pmpro_affiliates_default_discount_code', 10, 2 );
507 |
508 | /**
509 | * If a discount code is used, check if it is an affiliate code.
510 | * If so, set the affiliate cookie and 'pa' parameter.
511 | *
512 | * @since 0.6.2
513 | *
514 | * @param object $level The checkout level object.
515 | * @return object The checkout level object.
516 | */
517 | function pmpro_affiliates_discount_code_level( $level ) {
518 | global $wpdb;
519 |
520 | if ( empty( $level->discount_code ) ) {
521 | // The 'discount_code' parameter will only be set for PMPro v3.0+.
522 | // For previous versions, the pmpro_affiliates_set_discount_code() function will handle this behavior.
523 | return $level;
524 | }
525 |
526 | // Check if the affiliate exists.
527 | $exists = $wpdb->get_var( "SELECT id FROM $wpdb->pmpro_affiliates WHERE code = '" . esc_sql( $level->discount_code ) . "' LIMIT 1" );
528 | if ( empty( $exists ) ) {
529 | // The discount code for this affiliate does not exist. Return the level object.
530 | return $level;
531 | }
532 |
533 | // Set the affiliate cookie and 'pa' parameter.
534 | $_COOKIE['pmpro_affiliate'] = sanitize_text_field( $level->discount_code );
535 | $_REQUEST['pa'] = sanitize_text_field( $level->discount_code );
536 |
537 | // Prevent caching of this page load.
538 | add_action( 'send_headers', 'nocache_headers' );
539 |
540 | return $level;
541 | }
542 | add_filter( 'pmpro_discount_code_level', 'pmpro_affiliates_discount_code_level' );
543 |
544 | // service for csv export
545 | function pmpro_wp_ajax_affiliates_report_csv() {
546 | require_once dirname( __FILE__ ) . '/adminpages/report-csv.php';
547 | exit;
548 | }
549 | add_action( 'wp_ajax_affiliates_report_csv', 'pmpro_wp_ajax_affiliates_report_csv' );
550 |
551 | // check if a user is an affiliate
552 | function pmpro_affiliates_getAffiliatesForUser( $user_id = null ) {
553 | if ( empty( $user_id ) ) {
554 | if ( ! is_user_logged_in() ) {
555 | return array();
556 | }
557 |
558 | global $current_user;
559 | $user_id = $current_user->ID;
560 | $user_login = $current_user->user_login;
561 | } else {
562 | $user = get_userdata( $user_id );
563 | $user_login = $user->user_login;
564 | }
565 |
566 | if ( empty( $user_login ) ) {
567 | return array();
568 | }
569 |
570 | global $wpdb;
571 | $affiliates = $wpdb->get_results( "SELECT * FROM $wpdb->pmpro_affiliates WHERE affiliateuser = '" . esc_sql( $user_login ) . "' and enabled = '1' " );
572 |
573 | if ( ! empty( $affiliates ) ) {
574 | return $affiliates;
575 | } else {
576 | return array();
577 | }
578 | }
579 |
580 | /*
581 | Add checkbox to automatically create an affiliate code for members of this level.
582 | */
583 | // show the checkbox on the edit level page
584 | function pmpro_affiliates_pmpro_membership_level_after_other_settings() {
585 | $pmpro_affiliates_settings = pmpro_affiliates_get_settings();
586 | $pmpro_affiliates_singular_name = $pmpro_affiliates_settings['pmpro_affiliates_singular_name'];
587 |
588 | $level_id = intval( $_REQUEST['edit'] );
589 | if ( $level_id > 0 ) {
590 | $pmpro_create_affiliate_level = get_option( 'pmpro_create_affiliate_level_' . $level_id );
591 | } else {
592 | $pmpro_create_affiliate_level = false;
593 | }
594 | ?>
595 |
596 |
607 | post_content, 'pmpro_affiliates_report' ) || has_block( 'pmpro-affiliates/pmpro-affiliates-report' ) ) ) {
631 | wp_enqueue_style( 'pmpro_affiliates', plugins_url( 'includes/css/frontend.css', __FILE__ ), array(), PMPRO_AFFILIATES_VERSION );
632 | }
633 | }
634 | add_action( 'wp_enqueue_scripts', 'pmpro_affiliates_enqueue_scripts' );
635 | /**
636 | * Register scripts needed for admin area.
637 | */
638 | function pmpro_affiliates_register_scripts_styles() {
639 | // Only load script on PMPro affiliates pages.
640 | if ( ! isset( $_REQUEST['page'] ) || $_REQUEST['page'] != 'pmpro-affiliates' ) {
641 | return;
642 | }
643 |
644 | // Register scripts.
645 | wp_register_script( 'pmpro_affiliates_admin', plugins_url( 'includes/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete' ), PMPRO_AFFILIATES_VERSION, true );
646 |
647 | $localize_data = array(
648 | 'ajaxurl' => admin_url( 'admin-ajax.php' ),
649 | 'paid_status' => esc_html__( 'Paid', 'pmpro-affiliates' ),
650 | 'search_nonce' => wp_create_nonce( 'pmpro_affiliates_search_nonce' ),
651 | 'reset_status' => esc_html__( 'Payment status reset.', 'pmpro-affiliates' ),
652 | );
653 |
654 | // Localize scripts with data from PHP.
655 | wp_localize_script( 'pmpro_affiliates_admin', 'pmpro_affiliates_admin', $localize_data );
656 | wp_enqueue_script( 'pmpro_affiliates_admin' );
657 | }
658 | add_action( 'admin_enqueue_scripts', 'pmpro_affiliates_register_scripts_styles' );
659 |
660 | /**
661 | * Ajax handler for saving affiliate paid order setting.
662 | *
663 | * @since 0.6.2
664 | */
665 | function pmpro_affiliates_mark_as_paid() {
666 |
667 | // check the nonce, if it's not valid bail.
668 | $nonce = $_REQUEST['_wpnonce'];
669 | if ( ! wp_verify_nonce( $nonce, 'pmpro_affiliates_mark_as_paid') ) {
670 | return;
671 | }
672 |
673 | $order_id = (int) $_REQUEST['order_id'];
674 | update_pmpro_membership_order_meta( $order_id, 'pmpro_affiliate_paid', true );
675 | exit;
676 | }
677 | add_action( 'wp_ajax_pmpro_affiliates_mark_as_paid', 'pmpro_affiliates_mark_as_paid' );
678 |
679 |
680 | /**
681 | * Ajax handler for resetting affiliate paid order to unpaid.
682 | *
683 | * @since 0.6.2
684 | */
685 | function pmpro_affiliates_reset_paid_status() {
686 |
687 | // check the nonce, if it's not valid bail.
688 | $nonce = $_REQUEST['_wpnonce'];
689 | if ( ! wp_verify_nonce( $nonce, 'pmpro_affiliates_reset_paid_status' ) ) {
690 | return;
691 | }
692 |
693 | $order_id = (int) $_REQUEST['order_id'];
694 | delete_pmpro_membership_order_meta( $order_id, 'pmpro_affiliate_paid', NULL );
695 | exit;
696 | }
697 | add_action( 'wp_ajax_pmpro_affiliates_reset_paid_status', 'pmpro_affiliates_reset_paid_status' );
698 |
699 |
700 | /**
701 | * AJAX handler for searching for affiliates and autocomplete.
702 | *
703 | * @since 0.6.2
704 | */
705 | function pmpro_affiliates_autocomplete_user_search() {
706 |
707 | // Verify the nonce for this action.
708 | wp_verify_nonce( $_REQUEST['search_nonce'], 'pmpro_affiliates_search_nonce' );
709 |
710 | $search = sanitize_text_field( $_REQUEST['search'] );
711 | $search_limit = apply_filters( 'pmpro_affiliates_autocomplete_user_search_limit', 25 );
712 |
713 | $user_query = new WP_User_Query(
714 | array(
715 | 'search' => '*' . $search . '*',
716 | 'search_columns' => array( 'user_login', 'user_nicename' ),
717 | 'number' => (int) $search_limit
718 | )
719 | );
720 |
721 | $results = array();
722 | if ( ! empty( $user_query->get_results() ) ) {
723 | foreach ( $user_query->get_results() as $user ) {
724 | $results[] = $user->user_login;
725 | }
726 | }
727 |
728 | wp_send_json_success( $results );
729 | }
730 | add_action( 'wp_ajax_pmpro_affiliates_autocomplete_user_search', 'pmpro_affiliates_autocomplete_user_search' );
731 |
732 | /**
733 | * Function to get all paid commission and the amount.
734 | *
735 | * @param string $affiliate_code The affiliate code to get the paid commissions for.
736 | * @return float $commission The total amount of commission paid to date.
737 | */
738 | function pmpro_affiliates_get_commissions( $affiliate_code, $state = 'paid' ) {
739 | global $wpdb;
740 |
741 | // No affiliate ID passed through, let's bail.
742 | if ( empty( $affiliate_code ) ) {
743 | return;
744 | }
745 |
746 | $paid_commission = 0;
747 |
748 | $sql_query = "SELECT SUM(" . esc_sql( 'o.' . pmpro_affiliates_get_commission_calculation_source() ) . ") as total, a.commissionrate
749 | FROM $wpdb->pmpro_membership_orders o
750 | LEFT JOIN $wpdb->pmpro_membership_ordermeta om
751 | ON o.id = om.pmpro_membership_order_id
752 | AND om.meta_key = 'pmpro_affiliate_paid'
753 | JOIN $wpdb->pmpro_affiliates a
754 | ON o.affiliate_id = a.id
755 | AND a.code = '" . esc_sql( $affiliate_code ) . "'";
756 |
757 | // Get paid or unpaid commissions.
758 | if ( 'paid' === $state ) {
759 | $sql_query .= " AND om.meta_value IS NOT NULL";
760 | } else {
761 | $sql_query .= " AND om.meta_value IS NULL";
762 | }
763 |
764 | $sql_query .= " GROUP BY o.code";
765 |
766 | $commission_data = $wpdb->get_results( $sql_query );
767 |
768 | // Loop through commission data and calculate the total paid commissions.
769 | if ( ! empty( $commission_data ) ) {
770 | foreach( $commission_data as $commission ) {
771 | $paid_commission += $commission->total * $commission->commissionrate;
772 | }
773 | }
774 |
775 | return $paid_commission;
776 | }
777 |
778 | /**
779 | * Get the conversion rate (percentage) for a specific affiliate code.
780 | *
781 | * @since 0.7
782 | *
783 | * @param object $affiliate The affiliate object from the custom table to get the conversion rate for.
784 | * @return string $conversion_rate The conversion rate as a percentage (i.e. "10%")
785 | */
786 | function pmpro_affiliates_get_conversion_rate( $affiliate ) {
787 | global $wpdb;
788 |
789 | // No affiliate ID passed through, let's bail.
790 | if ( empty( $affiliate->id ) ) {
791 | return;
792 | }
793 |
794 | // Calculate the number of orders for this affiliate.
795 | $norders = $wpdb->get_var(
796 | $wpdb->prepare(
797 | "SELECT COUNT(%s) FROM $wpdb->pmpro_membership_orders WHERE affiliate_id = %d AND status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')",
798 | pmpro_affiliates_get_commission_calculation_source(),
799 | $affiliate->id
800 | )
801 | );
802 |
803 | // Get the number of visits and calculate the conversion rate.
804 | if ( empty( $affiliate->visits ) ) {
805 | $conversion_rate = "0%";
806 | } else {
807 | $conversion_rate = esc_html( round( $norders / $affiliate->visits * 100, 2 ) . "%" );
808 | }
809 |
810 | return $conversion_rate;
811 | }
812 |
813 | /**
814 | * Show affiliate information when editing a user in WordPress.
815 | *
816 | * @since 0.6.2
817 | */
818 | function pmpro_affiliates_edit_user_profile( $user ) {
819 | if ( ! current_user_can( 'edit_users' ) ) {
820 | return;
821 | }
822 |
823 | echo '' . esc_html__( 'Affiliate Information', 'pmpro-affiliates' ) . ' ';
824 | // Show Affiliate information for this particular user.
825 | $affiliates = pmpro_affiliates_getAffiliatesForUser( $user->ID );
826 |
827 | // Get values if the user is an affiliate or not.
828 | if ( ! empty( $affiliates ) ) {
829 | $is_affiliate = true;
830 | $affiliate_code = $affiliates[0]->code;
831 | } else {
832 | $is_affiliate = false;
833 | }
834 |
835 | if ( ! $is_affiliate ) {
836 | $affiliate_actions = '+ ' . esc_html__( 'Create Affiliate', 'pmpro-affiliates' ) . ' ';
837 | } else {
838 | $affiliate_actions = '' . esc_html__( 'View Report', 'pmpro-affiliates' ) . ' ';
839 | $affiliate_actions .= ' ' . esc_html__( 'Edit Affiliate', 'pmpro-affiliates' ) . ' ';
840 | }
841 |
842 |
843 | ?>
844 |
852 | ' . esc_html__( 'Manage Affiliates', 'pmpro-affiliates' ) . '',
889 | );
890 | return array_merge( $new_links, $links );
891 | }
892 | add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'pmpro_affiliates_add_action_links' );
893 |
894 | /*
895 | Function to add links to the plugin row meta
896 | */
897 | function pmpro_affiliates_plugin_row_meta( $links, $file ) {
898 | if ( strpos( $file, 'pmpro-affiliates.php' ) !== false ) {
899 | $new_links = array(
900 | '' . __( 'Docs', 'pmpro-affiliates' ) . ' ',
901 | '' . __( 'Support', 'pmpro-affiliates' ) . ' ',
902 | );
903 | $links = array_merge( $links, $new_links );
904 | }
905 | return $links;
906 | }
907 | add_filter( 'plugin_row_meta', 'pmpro_affiliates_plugin_row_meta', 10, 2 );
908 |
--------------------------------------------------------------------------------