/home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI
NameSizeModeActions
EasyDigitalDownloads/-0755rm
Elementor/-0755rm
Integrations/-0755rm
MemberPress/-0755rm
Plugins/-0755rm
Promos/-0755rm
Rules/-0755rm
Shortcodes/-0755rm
WooCommerce/-0755rm
WPForms/-0755rm
Actions.php79700666editdlrm
Ajax.php14940666editdlrm
Api.php145070666editdlrm
ApiAuth.php24630666editdlrm
ApiKey.php52030666editdlrm
AssetLoader.php54890666editdlrm
BaseRestApi.php68890666editdlrm
Blocks.php131050666editdlrm
ClassicEditor.php70840666editdlrm
ConstantContact.php75910666editdlrm
Debug.php45920666editdlrm
EasyDigitalDownloads.php95530666editdlrm
Elementor.php54930666editdlrm
Inserter.php115710666editdlrm
InstallSkin.php13860666editdlrm
InstallSkinCompat.php13950666editdlrm
MailPoet.php139740666editdlrm
MemberPress.php42160666editdlrm
Menu.php173010666editdlrm
Notifications.php189100666editdlrm
OmuApi.php41220666editdlrm
Output.php258480666editdlrm
Pages.php180190666editdlrm
Partners.php55570666editdlrm
Plugins.php249230666editdlrm
Promos.php11310666editdlrm
Refresh.php65530666editdlrm
RestApi.php441900666editdlrm
RevenueAttribution.php30370666editdlrm
Review.php14820666editdlrm
Rules.php240000666editdlrm
Save.php119990666editdlrm
Shortcode.php36670666editdlrm
Sites.php85530666editdlrm
Support.php91920666editdlrm
Type.php37220666editdlrm
Urls.php89510666editdlrm
Utils.php75890666editdlrm
Validate.php92660666editdlrm
Welcome.php49290666editdlrm
Widget.php66620666editdlrm
WooCommerce.php200450666editdlrm
WpErrorException.php7140666editdlrm
WPForms.php26650666editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI/RevenueAttribution.php (3037B)
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', ); } }