Skip to content

Commit

Permalink
3.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed Jun 16, 2024
1 parent e2b5d75 commit cb56efb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions affiliate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/*
Plugin Name: PS Affiliate
Plugin URI: https://cp-psource.github.io/affiliate/
Description: Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in PSeCommerce, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.
Description: Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in MarketPress, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.
Author: DerN3rd (PSOURCE)
Version: 3.2.8
Version: 3.2.9
Author URI: https://github.com/cp-psource
Domain Path: /affiliateincludes/languages
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
/*
Plugin Name: PSeCommerce
Description: Partnerprogramm-System-Plugin für das PSeCommerce-Plugin. Wird verwendet, um Einkäufe von Partnerempfehlungen zu verfolgen.
Author URI: https://n3rds.work/piestingtal-source-project/psecommerce-plugin/
Plugin Name: MarketPress
Description: Partnerprogramm-System-Plugin für das MarketPress-Plugin. Wird verwendet, um Einkäufe von Partnerempfehlungen zu verfolgen.
Author URI: https://n3rds.work/piestingtal-source-project/marketpress-plugin/
Network: false
Depends: psecommerce/psecommerce.php
Class: PSeCommerce
Depends: marketpress/marketpress.php
Class: MarketPress
*/

// Register actions only if MarketPress is active.
if ( affiliate_is_plugin_active( 'psecommerce/psecommerce.php' ) || affiliate_is_plugin_active_for_network( 'psecommerce/psecommerce.php' ) ) {
if ( affiliate_is_plugin_active( 'marketpress/marketpress.php' ) || affiliate_is_plugin_active_for_network( 'marketpress/marketpress.php' ) ) {

add_action( 'mp_shipping_process', 'affiliate_marketpress_record_order' );
add_action( 'mp_order_paid', 'affiliate_marketpress_paid_order' );
Expand Down Expand Up @@ -60,7 +60,7 @@ function aff_mp3_show_metabox( $post ) {

if ( ( isset( $_GET['order_id'] ) ) && ( ! empty( $_GET['order_id'] ) ) ) {
global $affadmin;
$affadmin->show_complete_records_table( $aff_user_id, false, array( 'paid:psecommerce' ), intval( $_GET['order_id'] ) );
$affadmin->show_complete_records_table( $aff_user_id, false, array( 'paid:marketpress' ), intval( $_GET['order_id'] ) );
}
}
}
Expand All @@ -74,7 +74,7 @@ function aff_mp3_paid_order( MP_Order $order ) {
return;
}

$sql = $wpdb->prepare( "SELECT count(id) FROM " . $affiliate->affiliaterecords . " WHERE user_id=%d AND affiliatearea=%s AND area_id=%d", $user_id, "paid:psecommerce", $order->ID );
$sql = $wpdb->prepare( "SELECT count(id) FROM " . $affiliate->affiliaterecords . " WHERE user_id=%d AND affiliatearea=%s AND area_id=%d", $user_id, "paid:marketpress", $order->ID );
$result = $wpdb->get_var( $sql );
if ( $result > 0 ) {
//duplicate
Expand Down Expand Up @@ -107,8 +107,8 @@ function aff_mp3_paid_order( MP_Order $order ) {
);

// run the standard affiliate action to do the recording and assigning
$note = __( 'Partnerprogramm Zahlung für PSeCommerce Bestellung.', 'affiliate)' );
do_action( 'affiliate_purchase', $user_id, $amount, 'paid:psecommerce', $order->ID, $note, $meta );
$note = __( 'Partnerprogramm Zahlung für MarketPress Bestellung.', 'affiliate)' );
do_action( 'affiliate_purchase', $user_id, $amount, 'paid:marketpress', $order->ID, $note, $meta );

// record the amount paid / assigned in the meta for the order
add_post_meta( $order->ID, 'affiliate_marketpress_order_paid', $amount, true );
Expand Down Expand Up @@ -153,7 +153,7 @@ function affiliate_marketpress_order_to_trash($order) {
if ((isset($order->mp_shipping_info['affiliate_referrer'])) && (!empty($order->mp_shipping_info['affiliate_referrer']))) {
global $affadmin;
$compete_records = $affadmin->get_complete_records($order->mp_shipping_info['affiliate_referrer'], false, 'paid:psecommerce', $order->ID);
$compete_records = $affadmin->get_complete_records($order->mp_shipping_info['affiliate_referrer'], false, 'paid:marketpress', $order->ID);
echo "compete_records<pre>"; print_r($compete_records); echo "</pre>";
}
die();
Expand Down Expand Up @@ -244,8 +244,8 @@ function affiliate_marketpress_paid_order( $order ) {
);

// run the standard affiliate action to do the recording and assigning
$note = __( 'Partnerprogramm Zahlung für PSeCommerce Bestellung.', 'affiliate)' );
do_action( 'affiliate_purchase', $affiliate_user_id, $amount, 'paid:psecommerce', $order->ID, $note, $meta );
$note = __( 'Partnerprogramm Zahlung für MarketPress Bestellung.', 'affiliate)' );
do_action( 'affiliate_purchase', $affiliate_user_id, $amount, 'paid:marketpress', $order->ID, $note, $meta );

// record the amount paid / assigned in the meta for the order
add_post_meta( $order->ID, 'affiliate_marketpress_order_paid', $amount, true );
Expand Down Expand Up @@ -295,7 +295,7 @@ class="description"><?php _e( 'Diese Bestellung wurde über einen Partnerprogram

if ( ( isset( $_GET['order_id'] ) ) && ( ! empty( $_GET['order_id'] ) ) ) {
global $affadmin;
$affadmin->show_complete_records_table( $order->mp_shipping_info['affiliate_referrer'], false, array( 'paid:psecommerce' ), intval( $_GET['order_id'] ) );
$affadmin->show_complete_records_table( $order->mp_shipping_info['affiliate_referrer'], false, array( 'paid:marketpress' ), intval( $_GET['order_id'] ) );
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions affiliateincludes/classes/affiliateadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@ function edit_user_profile( $user = '' ) {
if ( isset( $_GET['type'] ) ) {
$type = esc_attr( $_GET['type'] );
if ( $type == 'paid' ) {
$area[] = 'psecommerce';
$area[] = 'marketpress';
} else if ( $type == 'uniques' ) {
$area[] = 'click';
} else if ( $type == 'signups' ) {
Expand Down Expand Up @@ -2630,12 +2630,12 @@ function show_complete_records_table( $user_id, $period = false, $area = false,
<td class="affiliate-period"><?php echo $compete_record->period; ?></td>
<td class="affiliate-type"><?php
$order_label = __( 'Bestellung#', 'affiliate' ) . ' ' . $compete_record->area_id;
if ( ( $compete_record->affiliatearea == 'paid:psecommerce' ) && ( ! empty( $compete_record->area_id ) ) ) {
if ( ( ! isset( $_GET['page'] ) ) || ( $_GET['page'] != 'psecommerce-orders' ) ) {
if ( ( $compete_record->affiliatearea == 'paid:marketpress' ) && ( ! empty( $compete_record->area_id ) ) ) {
if ( ( ! isset( $_GET['page'] ) ) || ( $_GET['page'] != 'marketpress-orders' ) ) {
global $mp;
if ( isset( $mp ) ) {
echo '<a title="' . __( 'Bestell Details ansehen', 'affiliate' ) . '" href="' .
admin_url( 'edit.php?post_type=product&page=psecommerce-orders&order_id=' . $compete_record->area_id ) . '">' . $order_label . ' ' . $compete_record->area_id . '</a>';
admin_url( 'edit.php?post_type=product&page=marketpress-orders&order_id=' . $compete_record->area_id ) . '">' . $order_label . ' ' . $compete_record->area_id . '</a>';
} else {
echo $order_label;
}
Expand Down Expand Up @@ -2665,7 +2665,7 @@ function show_complete_records_table( $user_id, $period = false, $area = false,
echo ' -> ' . $compete_record->meta['LOCAL_URL'];
}
}
} else if ( $compete_record->affiliatearea == 'paid:psecommerce' ) {
} else if ( $compete_record->affiliatearea == 'paid:marketpress' ) {
echo $compete_record->affiliatenote;
//echo "compete_record->meta<pre>"; print_r($compete_record->meta); echo "</pre>";
if ( ( isset( $compete_record->meta['order_amount'] ) ) && ( ! empty( $compete_record->meta['order_amount'] ) ) ) {
Expand All @@ -2683,7 +2683,7 @@ function show_complete_records_table( $user_id, $period = false, $area = false,
}
?></td>
<td class="affiliate-amount"><?php
if ( $compete_record->affiliatearea == 'paid:psecommerce' ) {
if ( $compete_record->affiliatearea == 'paid:marketpress' ) {
echo number_format( $compete_record->amount, 2 );
} else {
echo '&nbsp;';
Expand Down Expand Up @@ -2984,7 +2984,7 @@ function show_users_period_details_table( $user_id, $period ) {
case 'type':
echo '<td>';

if ( ( $record->affiliatearea == 'paid:psecommerce' ) && ( ! empty( $record->area_id ) ) ) {
if ( ( $record->affiliatearea == 'paid:marketpress' ) && ( ! empty( $record->area_id ) ) ) {
_e( 'Paid', 'affiliate' );
} else if ( substr( $record->affiliatearea, 0, strlen( 'paid:' ) ) == 'paid:' ) {
_e( 'Paid', 'affiliate' );
Expand All @@ -3008,15 +3008,15 @@ function show_users_period_details_table( $user_id, $period ) {
echo '<td>';

if ( ! empty( $record->affiliatenote ) ) {
if ( ( ( $record->affiliatearea == 'paid:psecommerce' ) || ( $record->affiliatearea == 'psecommerce' ) ) && ( ! empty( $record->area_id ) ) ) {
_e( 'PSeCommerce', 'affiliate' );
if ( ( ( $record->affiliatearea == 'paid:marketpress' ) || ( $record->affiliatearea == 'marketpress' ) ) && ( ! empty( $record->area_id ) ) ) {
_e( 'MarketPress', 'affiliate' );
//echo "meta<pre>"; print_r(unserialize($record->meta)); echo "</pre>";
global $mp;
if ( ( isset( $mp ) ) && ( current_user_can( 'edit_others_posts' ) ) ) {
if ( isset( $record->meta['blog_id'] ) ) {
$order_href = get_admin_url( $record->meta['blog_id'], 'edit.php?post_type=product&page=psecommerce-orders&order_id=' . $record->area_id );
$order_href = get_admin_url( $record->meta['blog_id'], 'edit.php?post_type=product&page=marketpress-orders&order_id=' . $record->area_id );
} else {
$order_href = admin_url( 'edit.php?post_type=product&page=psecommerce-orders&order_id=' . $record->area_id );
$order_href = admin_url( 'edit.php?post_type=product&page=marketpress-orders&order_id=' . $record->area_id );
}
echo ' <a title="' . __( 'Bestell Details ansehen', 'affiliate' ) . '" href="' . $order_href . '">' . __( 'Bestellung#', 'affiliate' ) . ' ' . $record->area_id . '</a>';
} else {
Expand Down
2 changes: 1 addition & 1 deletion affiliateincludes/classes/affiliateshortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ function do_affiliateforcepayment_shortcode($atts, $content = null, $code = "")

$html .= $prefix;

do_action('affiliate_purchase', 1, 21.75, 'psecommerce', 1, 'Partnerprogramm-Zahlung für PSeCommerce-Bestellung.');
do_action('affiliate_purchase', 1, 21.75, 'marketpress', 1, 'Partnerprogramm-Zahlung für MarketPress-Bestellung.');

$html .= $postfix;

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Affiliates

**Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in PSeCommerce, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.**
**Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in MarketPress, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.**


## Affiliates boosts business by making all your users a part of your marketing team.
Expand Down
10 changes: 7 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ Contributors: DerN3rd (PSOURCE)
Tags: multisite, affiliate, provision, marketing
Requires at least: 4.9
Tested up to: 5.6
Stable tag: 3.2.8
Stable tag: 3.2.9
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in PSeCommerce, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.
Dieses Plugin fügt Deiner Seite ein einfaches Affiliate-System hinzu. Verfolge eingehende Klicks von Affiliate-Referer-Links, die Integration der Auftragsverfolgung in MarketPress, bezahlte Bloghosting-Anmeldungen und bezahlte Mitgliedschaftsanmeldungen.

== Description ==

Affiliates fördern das Geschäft, indem Du alle Deine Benutzer zu einem Teil Deines Marketingteams machst.

Integriert oder eigenständig
PS Affiliate lässt sich perfekt in unsere PS Bloghosting, PSeCommerce- und PS Mitgliedschaften-Plugins integrieren und ermöglicht es Dir,
PS Affiliate lässt sich perfekt in unsere PS Bloghosting, MarketPress- und PS Mitgliedschaften-Plugins integrieren und ermöglicht es Dir,
Deinen Besuchern einen Anteil am Gewinn zu bieten, indem sie für Deine Webseite werben.

[POWERED BY PSOURCE](https://github.com/cp-psource)
Expand All @@ -25,6 +25,10 @@ Deinen Besuchern einen Anteil am Gewinn zu bieten, indem sie für Deine Webseite

== ChangeLog ==

= 3.2.9 =

Add: MarketPress

= 3.2.8 =

* PhP8.3 Fixes
Expand Down

0 comments on commit cb56efb

Please sign in to comment.