/
home
/
techb158
/
primomovers.ca
/
wp-content
/
plugins
/
optinmonster
/
OMAPI
/
/home/techb158/primomovers.ca/wp-content/plugins/optinmonster/OMAPI
mkdir
upload
Name
Size
Mode
Actions
EasyDigitalDownloads/
-
0755
rm
Elementor/
-
0755
rm
Integrations/
-
0755
rm
MemberPress/
-
0755
rm
Plugins/
-
0755
rm
Promos/
-
0755
rm
Rules/
-
0755
rm
Shortcodes/
-
0755
rm
WooCommerce/
-
0755
rm
WPForms/
-
0755
rm
Actions.php
7126
0644
edit
dl
rm
Ajax.php
1494
0644
edit
dl
rm
Api.php
14508
0644
edit
dl
rm
ApiAuth.php
2463
0644
edit
dl
rm
ApiKey.php
5205
0644
edit
dl
rm
AssetLoader.php
5721
0644
edit
dl
rm
BaseRestApi.php
6807
0644
edit
dl
rm
Blocks.php
13118
0644
edit
dl
rm
ClassicEditor.php
7085
0644
edit
dl
rm
ConstantContact.php
7602
0644
edit
dl
rm
Debug.php
4453
0644
edit
dl
rm
EasyDigitalDownloads.php
9553
0644
edit
dl
rm
Elementor.php
5493
0644
edit
dl
rm
Inserter.php
11562
0644
edit
dl
rm
InstallSkin.php
1386
0644
edit
dl
rm
InstallSkinCompat.php
1395
0644
edit
dl
rm
MailPoet.php
13680
0644
edit
dl
rm
MemberPress.php
4216
0644
edit
dl
rm
Menu.php
17282
0644
edit
dl
rm
Notifications.php
18910
0644
edit
dl
rm
OmuApi.php
4122
0644
edit
dl
rm
Output.php
24860
0644
edit
dl
rm
Pages.php
18028
0644
edit
dl
rm
Partners.php
5557
0644
edit
dl
rm
Plugins.php
24923
0644
edit
dl
rm
Promos.php
1132
0644
edit
dl
rm
Refresh.php
5891
0644
edit
dl
rm
RestApi.php
39506
0644
edit
dl
rm
RevenueAttribution.php
3037
0644
edit
dl
rm
Review.php
1482
0644
edit
dl
rm
Rules.php
24003
0644
edit
dl
rm
Save.php
11193
0644
edit
dl
rm
Shortcode.php
3668
0644
edit
dl
rm
Sites.php
8554
0644
edit
dl
rm
Support.php
8446
0644
edit
dl
rm
Type.php
2496
0644
edit
dl
rm
Urls.php
8845
0644
edit
dl
rm
Utils.php
7590
0644
edit
dl
rm
Validate.php
9280
0644
edit
dl
rm
Welcome.php
4930
0644
edit
dl
rm
Widget.php
6652
0644
edit
dl
rm
WooCommerce.php
20046
0644
edit
dl
rm
WpErrorException.php
714
0644
edit
dl
rm
WPForms.php
2666
0644
edit
dl
rm
Edit:
/home/techb158/primomovers.ca/wp-content/plugins/optinmonster/OMAPI/RevenueAttribution.php
(3037B)
<?php /** * Revenue attribution class. * * @since 2.6.13 * * @package OMAPI * @author Thomas Griffin */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * The Revenue Attribution class. * * @since 2.6.13 */ class OMAPI_RevenueAttribution { /** * Holds the class object. * * @since 2.6.13 * * @var object */ public static $instance; /** * Path to the file. * * @since 2.6.13 * * @var string */ public $file = __FILE__; /** * Holds the base class object. * * @since 2.6.13 * * @var object */ public $base; /** * Primary class constructor. * * @since 2.6.13 */ public function __construct() { // Set our object. $this->set(); } /** * Sets our object instance and base class instance. * * @since 2.6.13 */ public function set() { self::$instance = $this; $this->base = OMAPI::get_instance(); } /** * Maybe stores revenue attribution data when a purchase is successful. * * @since 2.6.13 * * @param array $data An array of revenue attribution data to store. * * @return bool|WP_Error True if successful, WP_Error or false otherwise. */ public function store( $data = array() ) { // If revenue attribution is not turned on, return early. $ra = $this->base->get_revenue_attribution(); if ( empty( $ra['enabled'] ) || empty( $ra['currency'] ) ) { return false; } // If we can't find the account ID, return early. $accountId = $this->base->get_option( 'accountId' ); if ( empty( $accountId ) ) { return false; } // Build and send the request. $api = OMAPI_Api::build( 'v2', 'revenue/' . $accountId, 'POST' ); return $api->request( $data ); } /** * Returns revenue attribution data. * * @since 2.6.13 * * @return array An array of revenue attribution data. */ public function get_revenue_data() { // If we don't have any cookies set for OM campaigns, return early. if ( empty( $_COOKIE['_omra'] ) ) { return array(); } // If revenue attribution is not turned on, return early. $ra = $this->base->get_revenue_attribution(); if ( empty( $ra['enabled'] ) || empty( $ra['currency'] ) ) { return array(); } // Loop through and prepare the campaign data. If it is empty, return early. $campaign_data = json_decode( stripslashes( rawurldecode( $_COOKIE['_omra'] ) ), true ); if ( empty( $campaign_data ) ) { return array(); } // Sanitize the campaign data before sending it back. $sanitized_campaigns = array(); foreach ( $campaign_data as $campaign_id => $action ) { $sanitized_campaigns[ esc_html( $campaign_id ) ] = esc_html( $action ); } // Return the default revenue attribution data. Additional revenue // data should be returned from the integration itself (such as // the total, transaction ID, etc.). return array( 'campaigns' => $sanitized_campaigns, 'currency' => esc_html( $ra['currency'] ), 'device' => wp_is_mobile() ? 'mobile' : 'desktop', 'type' => 'sale', ); } }
Save
cmd:
run