/home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI
Edit: /home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI/Partners.php (5557B)
$type,
'id' => $id,
)
);
}
/**
* Returns partner url, if it exists.
*
* Not used directly, but parsed for query args.
*
* @since 2.0.0
*
* @return string|boolean
*/
public static function has_partner_url() {
$url = self::get_partner_url();
return false === strpos( $url, 'optinmonster.com/wp' ) && false !== strpos( $url, 'ref=' )
? $url
: false;
}
/**
* Get the Partner ID.
*
* @since 2.0.0
* @since 2.15.0 Fallback to parsing the partner url for the ID.
*
* @return string
*/
public static function get_id() {
$id = self::get_trial_id();
if ( empty( $id ) ) {
$id = self::get_affwp_id();
}
if ( empty( $id ) ) {
$id = self::get_sas_id();
}
if ( empty( $id ) ) {
// Try to get the ID from the partner url.
$url = self::has_partner_url();
if ( $url ) {
$parsed = wp_parse_url( $url );
if (
! empty( $parsed['host'] )
// Only get the ID if it's a shareasale url.
&& false !== stripos( $parsed['host'], 'shareasale.com' )
&& ! empty( $parsed['query'] )
) {
$args = wp_parse_args( $parsed['query'] );
if ( ! empty( $args['u'] ) ) {
$id = $args['u'];
}
}
}
}
return $id;
}
/**
* Get the referrer, if stored.
*
* @since 2.10.0
*
* @return string Referrer
*/
public static function referred_by() {
return sanitize_text_field( get_option( 'optinmonster_referred_by', '' ) );
}
}