Skip to content

Commit

Permalink
Merge pull request #118 from itthinx/tested-4.20.0-6.6
Browse files Browse the repository at this point in the history
Tested 4.20.0 6.6
  • Loading branch information
itthinx authored Jul 25, 2024
2 parents 80833ed + da071f3 commit cc32dab
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

The Affiliates WordPress Plugin

Copyright 2010 - 2023 "kento" (Karim Rahimpur) www.itthinx.com
Copyright 2010 - 2024 "kento" (Karim Rahimpur) www.itthinx.com

The files COPYRIGHT.txt and LICENSE.txt as well as ALL NOTICES IN THE
HEADERS OF ALL FILES MUST BE KEPT INTACT.
Expand Down
8 changes: 5 additions & 3 deletions affiliates.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* affiliates.php
*
* Copyright (c) 2010-2023 "kento" Karim Rahimpur www.itthinx.com
* Copyright (c) 2010-2024 "kento" Karim Rahimpur www.itthinx.com
*
* This code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
Expand All @@ -21,7 +21,9 @@
* Plugin Name: Affiliates
* Plugin URI: https://www.itthinx.com/plugins/affiliates
* Description: The Affiliates plugin provides the right tools to maintain a partner referral program.
* Version: 4.19.0
* Version: 4.20.0
* Requires at least: 6.2
* Requires PHP: 7.4
* Author: itthinx
* Author URI: https://www.itthinx.com
* Donate-Link: https://www.itthinx.com/shop
Expand All @@ -35,7 +37,7 @@
}

if ( !defined( 'AFFILIATES_CORE_VERSION' ) ) {
define( 'AFFILIATES_CORE_VERSION', '4.19.0' );
define( 'AFFILIATES_CORE_VERSION', '4.20.0' );
define( 'AFFILIATES_PLUGIN_NAME', 'affiliates' );
define( 'AFFILIATES_FILE', __FILE__ );
define( 'AFFILIATES_PLUGIN_BASENAME', plugin_basename( AFFILIATES_FILE ) );
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
== Affiliates - Changelog ==

= 4.20.0 =
* WordPress 6.6 compatible.
* Requires at least WordPress 6.2.
* Requires at least PHP 7.4.
* Fixed deprecated notice passing null to do_shortcode() in several instances.

= 4.19.0 =
* WordPress 6.2 compatible.
* Requires at least WordPress 6.0.
Expand Down
36 changes: 24 additions & 12 deletions lib/core/class-affiliates-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,16 @@ public static function referrer( $atts, $content = null ) {
*
* @param array $atts attributes (none used)
* @param string $content this is rendered for affiliates
*
* @return string
*/
public static function affiliates_is_affiliate( $atts, $content = null ) {
public static function affiliates_is_affiliate( $atts, $content = '' ) {

remove_shortcode( 'affiliates_is_affiliate' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_is_affiliate', array( __CLASS__, 'affiliates_is_affiliate' ) );

$output = "";
$output = '';
if ( affiliates_user_is_affiliate( get_current_user_id() ) ) {
$output .= $content;
}
Expand All @@ -274,14 +276,16 @@ public static function affiliates_is_affiliate( $atts, $content = null ) {
*
* @param array $atts attributes
* @param string $content this is rendered for non-affiliates
*
* @return string
*/
public static function affiliates_is_not_affiliate( $atts, $content = null ) {
public static function affiliates_is_not_affiliate( $atts, $content = '' ) {

remove_shortcode( 'affiliates_is_not_affiliate' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_is_not_affiliate', array( __CLASS__, 'affiliates_is_not_affiliate' ) );

$output = "";
$output = '';
if ( !affiliates_user_is_affiliate( get_current_user_id() ) ) {
$output .= $content;
}
Expand All @@ -296,7 +300,7 @@ public static function affiliates_is_not_affiliate( $atts, $content = null ) {
*
* @return string $content is rendered if referred
*/
public static function affiliates_is_referred( $atts, $content = null ) {
public static function affiliates_is_referred( $atts, $content = '' ) {
remove_shortcode( 'affiliates_is_referred' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_is_referred', array( __CLASS__, 'affiliates_is_referred' ) );
Expand All @@ -321,7 +325,7 @@ public static function affiliates_is_referred( $atts, $content = null ) {
*
* @return string $content is rendered if not referred
*/
public static function affiliates_is_not_referred( $atts, $content = null ) {
public static function affiliates_is_not_referred( $atts, $content = '' ) {
remove_shortcode( 'affiliates_is_not_referred' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_is_not_referred', array( __CLASS__, 'affiliates_is_not_referred' ) );
Expand Down Expand Up @@ -386,8 +390,10 @@ private static function for_from_until( $for, &$from, &$until ) {
*
* @param array $atts attributes
* @param string $content not used
*
* @return string
*/
public static function affiliates_hits( $atts, $content = null ) {
public static function affiliates_hits( $atts, $content = '' ) {
global $wpdb;

require_once AFFILIATES_CORE_LIB . '/class-affiliates-date-helper.php';
Expand Down Expand Up @@ -427,16 +433,18 @@ public static function affiliates_hits( $atts, $content = null ) {
*
* @param array $atts attributes
* @param string $content not used
*
* @return string
*/
public static function affiliates_visits( $atts, $content = null ) {
public static function affiliates_visits( $atts, $content = '' ) {

global $wpdb;

remove_shortcode( 'affiliates_visits' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_visits', array( __CLASS__, 'affiliates_visits' ) );

$output = "";
$output = '';
$options = shortcode_atts(
array(
'from' => null,
Expand Down Expand Up @@ -466,15 +474,17 @@ public static function affiliates_visits( $atts, $content = null ) {
*
* @param array $atts attributes
* @param string $content not used
*
* @return string
*/
public static function affiliates_referrals( $atts, $content = null ) {
public static function affiliates_referrals( $atts, $content = '' ) {
global $wpdb;

remove_shortcode( 'affiliates_referrals' );
$content = do_shortcode( $content );
add_shortcode( 'affiliates_referrals', array( __CLASS__, 'affiliates_referrals' ) );

$output = "";
$output = '';
$options = shortcode_atts(
array(
'status' => null,
Expand Down Expand Up @@ -827,8 +837,10 @@ public static function get_total( $affiliate_id, $from_date = null , $thru_date
*
* @param array $atts attributes
* @param string $content (is not used)
*
* @return string
*/
public static function affiliates_url( $atts, $content = null ) {
public static function affiliates_url( $atts, $content = '' ) {
global $wpdb, $wp;

$options = shortcode_atts(
Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Contributors: itthinx, proaktion
Donate link: https://www.itthinx.com/shop/
Tags: affiliate, affiliates, affiliate marketing, referral, growth marketing, ads, AddToAny, AddThis, advertising, affiliate plugin, affiliate tool, contact form, contact form 7, downloads, e-commerce, Ecwid, Events Manager, Jigoshop, lead, link, marketing, money, partner, Pay per Click, PayPal, PPC, referral links, referrer, sales, shopping cart, track, transaction, WooCommerce
Requires at least: 6.0
Tested up to: 6.2
Requires PHP: 7.2
Stable tag: 4.19.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 4.20.0
License: GPLv3

The Affiliates system provides the most powerful growth-oriented tools to run a successful Affiliate Marketing Program.
Expand Down

0 comments on commit cc32dab

Please sign in to comment.