'.__('You entered a valid licence key but you did not download the premium version yet. Please go to the Update Page and update to the premium version. It can take up to 5 minutes until WordPress notifies you about the new version.', 'affiliate-power').'
If you have problems or ideas for new features I always appreciate a comment on the Plugin Page or a Message. As a Premium-User your requests have priority.
As a subscriber to the Affiliate Power Newsletter you get tips and news about Affiliate Marketing. Just check your data and click Subscribe.
You can always unsubscribe from the Newsletter and I will not give your Email to anyone else.', 'affiliate-power'), $first_name, $user->user_email );
?>
";
echo "[?]";
_e("
With the activated tracking, you can find out which articles/referer/keywords etc. led to which income. Sales, which occurred before the plugin installation can not be analyzed. This option makes sense for almost all plugin users.
", "affiliate-power");
}
static public function addSendMailTransactionsField() {
$options = get_option('affiliate-power-options');
if (!isset($options['send-mail-transactions'])) $options['send-mail-transactions'] = 0;
$checked = $options['send-mail-transactions'] ? ' checked' : '';
echo " ";
echo "[?]";
_e("
Receive a daily email with all new or changed sales. If there aren't any sales, no email will be send.
", "affiliate-power");
}
static public function addOverwriteSubidsField() {
$options = get_option('affiliate-power-options');
if (!isset($options['overwrite-subids'])) $options['overwrite-subids'] = 0;
$checked = $options['overwrite-subids'] ? ' checked' : '';
echo " ";
echo "[?]";
_e("
Should the plugin overwrite existing Subids in your affiliate links? If you don't know what that means, leave this field unchecked.
", "affiliate-power");
}
static public function addLicenceKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['licence-key'])) $options['licence-key'] = '';
echo " ";
echo "[?]";
_e("
There is also a premium version of Affiliate Power which requires a licence key. Find more information about the premium version on the Premium Page. For using the basic version, leave this field empty.
", "affiliate-power");
}
static public function addLandingParamsField() {
echo " ";
echo "[?]";
_e("
Here you can define URL-Parameters you want to track. You can separate several parameters with comma. If you are using Google Analytics campaign tracking, this values may be a good start: utm_campaign,utm_source,utm_medium,utm_term,utm_content.
", "affiliate-power");
}
//Network Settings
static public function optionsNetworksText() {
_e('
In order to download your sales, you have to enter your data of the affiliate networks you are using. Whats about data security?
', 'affiliate-power');
}
//Adcell
static public function addAdcellUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['adcell-username'])) $options['adcell-username'] = '';
echo " ";
echo "[?]";
_e("
The Adcell Username is the number, you are using to login on the adcell page.
", "affiliate-power");
}
static public function addAdcellPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['adcell-password'])) $options['adcell-password'] = '';
echo " ";
echo "[?]";
_e("
The Adcell API password is a special access to the Adcell API. Please do not enter your normal Adcell password here. The API password can be defined in the publisher area, menu item \"My Data\".
", "affiliate-power");
}
static public function addAdcellRefererFilterField() {
$options = get_option('affiliate-power-options');
if (!isset($options['adcell-referer-filter'])) $options['adcell-referer-filter'] = 0;
$checked = $options['adcell-referer-filter'] ? ' checked' : '';
echo " ";
echo "[?]";
_e("
Only save sales, which came from this domain. This option makes only sense if you are using your Adcell account for several pages", "affiliate-power");
}
//Affili.net
static public function addAffiliIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['affili-id'])) $options['affili-id'] = '';
echo " ";
echo "[?]";
_e("
The Affili.net UserId is the 6-digit number, you are using to login on affili.net.
", "affiliate-power");
}
static public function addAffiliPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['affili-password'])) $options['affili-password'] = '';
echo " ";
echo "[?]";
_e("
The affili.net Publisher Webservice Password is a special access the the affili.net API. Please do not enter your normal affili.net password here. You can find the Publisher Webservice Password in the publisher area of affili.net, menu item Solutions -> Webservices -> Access data. It may be necessary to request the password via the request button first.
", "affiliate-power");
}
static public function addAffiliPrefixField() {
$options = get_option('affiliate-power-options');
if (!isset($options['affili-prefix-filter'])) $options['affili-prefix-filter'] = 0;
$checked = $options['affili-prefix-filter'] ? ' checked' : '';
echo " ";
echo "[?]";
_e("
Only save sales, which came from this domain. This option makes only sense if you are using your Affili.net account for several pages", "affiliate-power");
}
//Belboon
static public function addBelboonUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['belboon-username'])) $options['belboon-username'] = '';
echo " ";
echo "[?]";
_e("
The Belboon username is the name you use to login on the Belboon page. This name is case-sensitive.
", "affiliate-power");
}
static public function addBelboonPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['belboon-password'])) $options['belboon-password'] = '';
echo " ";
echo "[?]";
_e("
The belboon WebService Password is a special access the the belboon API. Please do not enter your normal belboon password here. You can find the WebService Password in the publisher area, left-hand side, menu item Tools & Services -> Webservices. It may be necessary to request the password first.
", "affiliate-power");
}
//Awin
static public function addAwinIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['awin-id'])) $options['awin-id'] = '';
echo " ";
echo "[?]";
_e("
You can find the Awin Publisher ID at the top of the publisher area, next to your company name.
", "affiliate-power");
}
static public function addAwinTokenField() {
$options = get_option('affiliate-power-options');
if (!isset($options['awin-token'])) $options['awin-token'] = '';
echo " ";
echo "[?]";
_e("
You can find the Awin API Token at the top of the publisher area, where it says Hello... -> API Credentials.
", "affiliate-power");
}
static public function addAwinRefererField() {
$options = get_option('affiliate-power-options');
if (!isset($options['awin-referer'])) $options['awin-referer'] = '';
echo " ";
echo "[?]";
_e("
If you are using your awin account for several pages, you can enter the domain of this page here (without http and www). The plugin will only import sales from this domain. If you are using your awin account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
static public function addBelboonPlatformField() {
$options = get_option('affiliate-power-options');
if (!isset($options['belboon-platform'])) $options['belboon-platform'] = '';
echo " ";
echo "[?]";
_e("
If you are using your belboon account for several pages, you can enter the ad platform name for this page here. The plugin will only import sales from this ad platform. Please do not enter the ad platform id but the name. You can find the ad platform name in the publisher area, left-hand side, menu item Overview ad platforms. If you are using several ad platforms for this page you can separate the ad platform names with comma. If you are using your belboon account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
//Commission Junction
static public function addCjIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['cj-id'])) $options['cj-id'] = '';
echo " ";
echo "[?]";
_e("
The PID identifies your website at Commission Junction. You can find it in the publisher area of Commission Junction at the menu item Account -> Website Settings.
", "affiliate-power");
}
static public function addCjKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['cj-key'])) $options['cj-key'] = '';
echo " ";
echo "[?]";
_e("
The Commission Junction Developer Key is a special access to the Commission Junction API. Please do not enter your normal password here. In order to get the key, you have to go to the Webservice-Site of Commission Junction, and login with your normal account data.
", "affiliate-power");
}
//Daisycon
static public function addDaisyconUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['daisycon-username'])) $options['daisycon-username'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new user. You can do this via the top menu item Account -> Add new User. Put whatever you want into First name and last name. Enter 'Viewer' in the default access level and 'Accounts' in the Contact types box. Enter the username of the new user into this field.
", "affiliate-power");
}
static public function addDaisyconPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['daisycon-password'])) $options['daisycon-password'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new user. You can do this via the top menu item Account -> Add new User. Put whatever you want into First name and last name. Enter 'Viewer' in the default access level and 'Accounts' in the Contact types box. Enter the password of the new user into this field.
", "affiliate-power");
}
static public function addDaisyconPublisherField() {
$options = get_option('affiliate-power-options');
if (!isset($options['daisycon-publisher'])) $options['daisycon-publisher'] = '';
echo " ";
echo "[?]";
_e("
Enter the Publisher Id of your daisycon account into this field. You can find the publisher Id in the My Account area via the menu item My Account -> General -> Account Details. Make sure to use your Publisher Id.
", "affiliate-power");
}
static public function addDaisyconMediaField() {
$options = get_option('affiliate-power-options');
if (!isset($options['daisycon-media'])) $options['daisycon-media'] = '';
echo " ";
echo "[?]";
_e("
Enter the Media Id of your daisycon account into this field. This field is optional
", "affiliate-power");
}
//Digistore24
static public function addDigistore24KeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['digistore24-key'])) $options['digistore24-key'] = '';
echo " ";
echo "[?]";
_e("
The Digistore24 API key is a special access to the Digistore24 API. Please do not enter your normal password here. Follow these steps to get the key:
Make sure you are in the vendor view. You can change that in the top left corner
Click on Settings -> Account access -> Api keys
Create a new key with the name 'Affiliate Power' and Read access
Copy the created API key into this field. It should look something like 1234-XYZ123xyz...
", "affiliate-power");
}
//eBay
static public function addEbayEmailField() {
$options = get_option('affiliate-power-options');
if (!isset($options['ebay-email'])) $options['ebay-email'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new login. You can do that at the menu item Account->Users. Enter a secondary email and a password. Use 'Standard User' as the user role. Click on the confirmation link, which is sent to your secondary email.
", "affiliate-power");
}
static public function addEbayPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['ebay-password'])) $options['ebay-password'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new login. You can do that at the menu item Account->Users. Enter a secondary email and a password. Use 'Standard User' as the user role. Click on the confirmation link, which is sent to your secondary email.
", "affiliate-power");
}
static public function addEbayCampaignField() {
$options = get_option('affiliate-power-options');
if (!isset($options['ebay-campaign'])) $options['ebay-campaign'] = '';
echo " ";
echo "[?]";
_e("
If you are using your ebay partner network account for several pages, enter the campaign name you defined in the login area for this page. The plugin will only import sales from this campaign name. Please do not enter the campaign id but the name. You can find the campaign name in the publisher area, menu item Campaigns. If you are using several campaigns for this page you can separate the campaign names with comma. If you are using your account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
//financeAds
static public function addFAdsIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['fads-id'])) $options['fads-id'] = '';
echo " ";
echo "[?]";
_e("
The five digit Partner ID identifies your account at financeAds.
", "affiliate-power");
}
static public function addFAdsWFIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['fads-wfid'])) $options['fads-wfid'] = '';
echo " ";
echo "[?]";
_e("
If you are using your financeAds account for several pages, enter the Ad Space ID you defined in the login area for this page. The plugin will only import sales from this Ad Space. If you are using your account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
static public function addFAdsKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['fads-key'])) $options['fads-key'] = '';
echo " ";
echo "[?]";
_e("
The financeAds API Key is a special access to the financeAds API. Please do not enter your normal password here. In order to get the key, you have to go to the financeAds panel and login with your normal account data. Then you have to go to Auswertung -> Auswertungs API and click the link: API Key anzeigen. If you can't find the API Key, you might have to contact financeAds first and ask them to activate your access to the API.
", "affiliate-power");
}
//Superclix
static public function addSuperclixUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['superclix-username'])) $options['superclix-username'] = '';
echo " ";
echo "[?]";
_e("
The Superclix username is the name you use to login on the Superclix page. This name is case-sensitive.
", "affiliate-power");
}
static public function addSuperclixPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['superclix-password'])) $options['superclix-password'] = '';
echo " ";
echo "[?]";
_e("
The Superclix export password is a special access to the Superclix API. Please do not enter your normal password here. The export password can be defined in the publisher area, menu item \"Account -> Change password \".
", "affiliate-power");
}
static public function addSuperclixRefererFilterField() {
$options = get_option('affiliate-power-options');
if (!isset($options['superclix-referer-filter'])) $options['superclix-referer-filter'] = 0;
$checked = $options['superclix-referer-filter'] ? ' checked' : '';
echo " ";
echo "[?]";
_e("
Only save sales, which came from this domain. This option makes only sense if you are using your Superclix account for several pages", "affiliate-power");
}
//Tradedoubler
static public function addTradedoublerKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['tradedoubler-key'])) $options['tradedoubler-key'] = '';
echo " ";
echo "[?]";
_e("
The Tradedoubler Report Key is a special access to the Tradedoubler API. Please do not enter your normal Tradedoubler password here. In order to get the Tradedoubler Report Key, you have to wirte an email with your username to support.uk@tradedoubler.com (you can also change the country code if you are not in the UK) and ask for a Report Key. You will get an email with the key.
", "affiliate-power");
}
static public function addTradedoublerSitenameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['tradedoubler-sitename'])) $options['tradedoubler-sitename'] = '';
echo " ";
echo "[?]";
_e("
If you are using your Tradedoubler account for several pages, enter the site name you defined in the Tradedoubler login area for this page. The plugin will only import sales from this site name. Please do not enter the site id but the name. You can find the site name in the publisher area, menu item Sites -> Sites. If you are using several sites for this page you can separate the site names with comma. If you are using your account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
//Tradetracker
static public function addTradetrackerUserIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['tradetracker-userid'])) $options['tradetracker-userid'] = '';
echo " ";
echo "[?]";
_e("
Please do not use your normal username here. Log into your account and click on the menu item 'Web-Service'. You find your Customer ID on the right hand side. It may be necessary to request the ID via the request button first.
", "affiliate-power");
}
static public function addTradetrackerPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['tradetracker-password'])) $options['tradetracker-password'] = '';
echo " ";
echo "[?]";
_e("
Please do not use your normal password here. Log into your account and click on the menu item 'Tools' -> 'Web-Service'. You find your passphrase on the right hand side. It may be necessary to request the passphrase via the request button first.
", "affiliate-power");
}
static public function addTradetrackerSiteIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['tradetracker-siteid'])) $options['tradetracker-siteid'] = '';
echo " ";
echo "[?]";
_e("
To find your Site Id log into your account and click on Account -> My websites.
", "affiliate-power");
}
//Webgains
static public function addWebgainsUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['webgains-username'])) $options['webgains-username'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new user. You can do this via the top menu item Account -> Add new User. Put whatever you want into First name and last name. Enter 'Viewer' in the default access level and 'Accounts' in the Contact types box. Enter the username of the new user into this field.
", "affiliate-power");
}
static public function addWebgainsPasswordField() {
$options = get_option('affiliate-power-options');
if (!isset($options['webgains-password'])) $options['webgains-password'] = '';
echo " ";
echo "[?]";
_e("
For security reasons, you should not use your normal login here. Login into your account and create a new user. You can do this via the top menu item Account -> Add new User. Put whatever you want into First name and last name. Enter 'Viewer' in the default access level and 'Accounts' in the Contact types box. Enter the password of the new user into this field.
", "affiliate-power");
}
static public function addWebgainsCampaignField() {
$options = get_option('affiliate-power-options');
if (!isset($options['webgains-campaign'])) $options['webgains-campaign'] = '';
echo " ";
echo "[?]";
_e("
Enter the Campaign Id of your website into this field. You can find the campaign Id in the publisher area via the top menu item Account -> Manage my sites/campaigns. Make sure to use the numeric Campaign Id.
", "affiliate-power");
}
//Zanox
static public function addZanoxConnectIdField() {
$options = get_option('affiliate-power-options');
if (!isset($options['zanox-connect-id'])) $options['zanox-connect-id'] = '';
echo " ";
echo "[?]";
_e("
The Zanox ConnectId is required to import sales from zanox. It's not that simple to get it, but together we will work it out:
Go to http://apps.zanox.com, click on \"Connect with Zanox\" in the top-right corner and login with your normal Zanox account data
Go to the tab \"Developers\" -> \"My own Applications\", accept the terms and click on \"Become a developer\"
Click on the new button \"New application\" and then \"zanox keys\"
", "affiliate-power");
}
static public function addZanoxPublicKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['zanox-public-key'])) $options['zanox-public-key'] = '';
echo " ";
echo "[?]";
_e("
The Zanox PublicKey is required to import sales from zanox. It's not that simple to get it, but together we will work it out:
Go to http://apps.zanox.com, click on \"Connect with Zanox\" in the top-right corner and login with your normal Zanox account data
Go to the tab \"Developers\" -> \"My own Applications\", accept the terms and click on \"Become a developer\"
Click on the new button \"New application\" and then \"zanox keys\"
", "affiliate-power");
}
static public function addZanoxSecretKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['zanox-secret-key'])) $options['zanox-secret-key'] = '';
echo " ";
echo "[?]";
_e("
The Zanox SecretKey is required to import sales from zanox. It's not that simple to get it, but together we will work it out:
Go to http://apps.zanox.com, click on \"Connect with Zanox\" in the top-right corner and login with your normal Zanox account data
Go to the tab \"Developers\" -> \"My own Applications\", accept the terms and click on \"Become a developer\"
Click on the new button \"New application\" and then \"zanox keys\"
", "affiliate-power");
}
static public function addZanoxAdspaceField() {
$options = get_option('affiliate-power-options');
if (!isset($options['zanox-adspace'])) $options['zanox-adspace'] = '';
echo " ";
echo "[?]";
_e("
If you are using your Zanox account for several pages, enter the ad space name you defined in the login area for this page. The plugin will only import sales from this ad space name. Please do not enter the ad space id but the name. You can find the ad space name in the publisher area, menu item Profile -> My Ad Spaces. If you are using several ad spaces for this page you can separate the ad space names with comma. If you are using your account only for this page anyway, just leave the field empty. In this case, the plugin will download all sales.
", "affiliate-power");
}
//Validation
static public function optionsValidate($input) {
//Main Settings
$whitelist['add-sub-ids'] = $input['add-sub-ids'];
if ($whitelist['add-sub-ids'] != 1) $whitelist['add-sub-ids'] = 0;
//$whitelist['homepage-tracking'] = $input['homepage-tracking'];
//if ($whitelist['homepage-tracking'] != 1) $whitelist['homepage-tracking'] = 0;
$whitelist['send-mail-transactions'] = $input['send-mail-transactions'];
if ($whitelist['send-mail-transactions'] != 1) $whitelist['send-mail-transactions'] = 0;
$whitelist['overwrite-subids'] = $input['overwrite-subids'];
if ($whitelist['overwrite-subids'] != 1) $whitelist['overwrite-subids'] = 0;
if (isset($input['licence-key']) && ctype_alnum($input['licence-key'])) {
$check_result = Affiliate_Power_Apis::checkLicenceKey($input['licence-key']);
if ($check_result == false || $check_result == 'database_error' || $check_result == 'database_charset_error') add_settings_error('affiliate-power-options', 'affiliate-power-error-licence-key', __('The licence key could not be checked. Please try again later and let me know if it is still not working.', 'affiliate-power') );
elseif ($check_result == 'outdated_key') add_settings_error('affiliate-power-options', 'affiliate-power-error-licence-key', __('The licence key is outdated. Please renew your licence key.', 'affiliate-power') );
elseif ($check_result == 'invalid_key_format' || $check_result == 'invalid_key') add_settings_error('affiliate-power-options', 'affiliate-power-error-licence-key', __('The licence key is invalid. Please check again. If you are sure you entered the right key, let me know, and I will check it out.', 'affiliate-power') );
elseif ($check_result == 'ok') $whitelist['licence-key'] = $input['licence-key'];
}
elseif (!empty($input['licence-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-licence-key', __('Invalid licence key. The key should only contain numbers and letters.', 'affiliate-power'));
//if (is_numeric($input['download-method'])) $whitelist['download-method'] = (int)$input['download-method'];
//Adcell
if (is_numeric($input['adcell-username'])) $whitelist['adcell-username'] = $input['adcell-username'];
elseif (!empty($input['adcell-username'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-adcell-username', __('Invalid Adcell username. The username should only contain numbers and letters.', 'affiliate-power'), 'error');
if (!empty($input['adcell-password'])) $whitelist['adcell-password'] = esc_html($input['adcell-password']);
if ($input['adcell-referer-filter'] != 1) $input['adcell-referer-filter'] = 0;
$whitelist['adcell-referer-filter'] = $input['adcell-referer-filter'];
if (isset($whitelist['adcell-username']) && isset($whitelist['adcell-password'])) {
include_once('apis/adcell.php');
if (!Affiliate_Power_Api_Adcell::checkLogin($whitelist['adcell-username'], $whitelist['adcell-password'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-adcell-login', __('Adcell test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Affili.net
if (is_numeric($input['affili-id'])) $whitelist['affili-id'] = $input['affili-id'];
elseif (!empty($input['affili-id'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-affili-id', __('Invalid Affili.net Id. The Id should only contain numbers.', 'affiliate-power'), 'error');
if (ctype_alnum($input['affili-password']) && strlen($input['affili-password']) == 20) $whitelist['affili-password'] = $input['affili-password'];
elseif (!empty($input['affili-password'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-affili-password', __('Invalid Affili.net PublisherWebservice password. The password should be 20 characters long and only contain numbers and letters. Please do not enter your normal Affili.net password, but your PublisherWebservice password', 'affiliate-power'), 'error');
if ($input['affili-prefix-filter'] != 1) $input['affili-prefix-filter'] = 0;
$whitelist['affili-prefix-filter'] = $input['affili-prefix-filter'];
if (isset($whitelist['affili-id']) && isset($whitelist['affili-password'])) {
include_once('apis/affili.php');
if (!extension_loaded('soap')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-soap', __('In order to download the Affili.net sales the PHP-module SOAP is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Affili::checkLogin($whitelist['affili-id'], $whitelist['affili-password'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-affili-login', __('Affili.net test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Awin
if (ctype_digit($input['awin-id'])) $whitelist['awin-id'] = $input['awin-id'];
elseif (!empty($input['awin-id'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-awin-token', __('Invalid Awin Publisher ID. The Publisher ID should only contain numbers.', 'affiliate-power'), 'error');
if (ctype_alnum(str_replace('-','',$input['awin-token'])) && strlen($input['awin-token']) >= 20) $whitelist['awin-token'] = $input['awin-token'];
elseif (!empty($input['awin-token'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-awin-token', __('Invalid Awin API Token. The token should be more than 20 characters long and only contain numbers, letters and dashes. Please do not enter your normal Awin password, but your API Token.', 'affiliate-power'), 'error');
if (isset($whitelist['awin-id']) && isset($whitelist['awin-token'])) {
include_once('apis/awin.php');
if (!Affiliate_Power_Api_Awin::checkLogin($whitelist['awin-id'], $whitelist['awin-token'])) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-awin-login', __('Awin test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
if (!empty($input['awin-referer'])) $whitelist['awin-referer'] = esc_html($input['awin-referer']);
//Belboon
if (!empty($input['belboon-username'])) $whitelist['belboon-username'] = esc_html($input['belboon-username']);
if (ctype_alnum($input['belboon-password']) && strlen($input['belboon-password']) == 20) $whitelist['belboon-password'] = $input['belboon-password'];
elseif (!empty($input['belboon-password'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-belboon-password', __('Invalid Belboon WebService password. The password should be 20 characters long and only contain numbers and letters. Please do not enter your normal Belboon password, but your WebService password.', 'affiliate-power'), 'error');
if (isset($whitelist['belboon-username']) && isset($whitelist['belboon-password'])) {
include_once('apis/belboon.php');
if (!extension_loaded('soap')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-soap', __('In order to download the Belboon sales the PHP-module SOAP is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Belboon::checkLogin($whitelist['belboon-username'], $whitelist['belboon-password'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-belboon-login', __('Belboon test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
if (!empty($input['belboon-platform'])) $whitelist['belboon-platform'] = esc_html($input['belboon-platform']);
//Commission Junction
if (is_numeric($input['cj-id'])) $whitelist['cj-id'] = $input['cj-id'];
elseif (!empty($input['cj-id'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-cj-id', __('Invalid Commission Junction PID. The PID should only contain numbers.', 'affiliate-power'), 'error');
if (strlen($input['cj-key']) > 20) $whitelist['cj-key'] = esc_html($input['cj-key']);
elseif (!empty($input['cj-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-cj-key', __('Invalid cj developer key. The key should be longer than 20 characters Please do not enter your normal cj password, but your developer key.', 'affiliate-power'), 'error');
if (isset($whitelist['cj-id']) && isset($whitelist['cj-key'])) {
include_once('apis/cj.php');
if (!class_exists('DOMDocument')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-dom', __('In order to download the Commission Junction Sales, the PHP-Class DomDocument is required. This class semms to be not included on your server. Please include the class. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Cj::checkLogin($whitelist['cj-id'], $whitelist['cj-key'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-cj-login', __('Commission Junction test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Daisycon
if (!empty($input['daisycon-username'])) $whitelist['daisycon-username'] = esc_html($input['daisycon-username']);
if (!empty($input['daisycon-password'])) $whitelist['daisycon-password'] = esc_html($input['daisycon-password']);
if (!empty($input['daisycon-media'])) $whitelist['daisycon-media'] = esc_html($input['daisycon-media']);
if (!empty($input['daisycon-username']) && empty($input['daisycon-publisher'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-daisycon-publisher', __('Please enter your Daisycon Publisher ID', 'affiliate-power'), 'error');
elseif (!empty($input['daisycon-publisher']) && !is_numeric($input['daisycon-publisher'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-daisycon-publisher', __('Invalid Daisycon Publisher ID.', 'affiliate-power'), 'error');
elseif (is_numeric($input['daisycon-publisher'])) $whitelist['daisycon-publisher'] = esc_html($input['daisycon-publisher']);
if (isset($whitelist['daisycon-username']) && isset($whitelist['daisycon-password']) && isset($whitelist['daisycon-publisher'])) {
include_once('apis/daisycon.php');
$result = Affiliate_Power_Api_Daisycon::checkLogin($whitelist['daisycon-username'], $whitelist['daisycon-password'], (int)$whitelist['daisycon-publisher']);
if (true !== $result) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-daisycon-login', __('Daisycon test login failed. '.$result, 'affiliate-power'), 'error');
}
}
//Digistore24
if (strlen($input['digistore24-key']) > 20) $whitelist['digistore24-key'] = esc_html(trim($input['digistore24-key']));
elseif (!empty($input['digistore24-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-cj-key', __('Invalid digistore24 API key. The key should be longer than 20 characters. Please do not enter your normal password, but your API key.', 'affiliate-power'), 'error');
if (isset($whitelist['digistore24-key'])) {
include_once('apis/digistore24.php');
if (!extension_loaded('curl')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-curl', __('In order to download the Digistore24 sales the PHP-module curl is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Digistore24::checkLogin($whitelist['digistore24-key'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-digistore24-login', __('Digistore24 test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//eBay
if (is_email($input['ebay-email'])) $whitelist['ebay-email'] = $input['ebay-email'];
elseif (!empty($input['ebay-email'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-ebay-email', __('Invalid eBay email.', 'affiliate-power'), 'error');
if (!empty($input['ebay-password'])) $whitelist['ebay-password'] = esc_html($input['ebay-password']);
elseif (!empty($input['ebay-email'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-ebay-password', __('Please enter your eBay password', 'affiliate-power'), 'error');
if (isset($whitelist['ebay-email']) && isset($whitelist['ebay-password'])) {
include_once('apis/ebay.php');
if (!Affiliate_Power_Api_Ebay::checkLogin($whitelist['ebay-email'], $whitelist['ebay-password'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-ebay-email', __('eBay test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
if (!empty($input['ebay-campaign'])) $whitelist['ebay-campaign'] = esc_html($input['ebay-campaign']);
//financeAds
if (is_numeric($input['fads-id'])) $whitelist['fads-id'] = $input['fads-id'];
elseif (!empty($input['fads-id'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-fads-id', __('Invalid financeAds User ID. The User ID should only contain numbers.', 'affiliate-power'), 'error');
if (is_numeric($input['fads-wfid'])) $whitelist['fads-wfid'] = $input['fads-wfid'];
elseif (!empty($input['fads-wfid'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-fads-wfid', __('Invalid financeAds Ad Space ID. The Ad Space ID should only contain numbers.', 'affiliate-power'), 'error');
if (strlen($input['fads-key']) == 32) $whitelist['fads-key'] = esc_html($input['fads-key']);
elseif (!empty($input['fads-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-fads-key', __('Invalid financeAds auth key. The key should has 32 characters. Please do not enter your normal fAds password, but your API key.', 'affiliate-power'), 'error');
if (isset($whitelist['fads-id']) && isset($whitelist['fads-key'])) {
include_once('apis/financeads.php');
if (!class_exists('DOMDocument')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-dom', __('In order to download the financeAds Sales, the PHP-Class DomDocument is required. This class seems to be not included on your server. Please include the class. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Financeads::checkLogin($whitelist['fads-id'], $whitelist['fads-key'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-fads-login', __('financeAds test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Superclix
if (!empty($input['superclix-username'])) $whitelist['superclix-username'] = esc_html($input['superclix-username']);
if (!empty($input['superclix-password'])) $whitelist['superclix-password'] = esc_html($input['superclix-password']);
if ($input['superclix-referer-filter'] != 1) $input['superclix-referer-filter'] = 0;
$whitelist['superclix-referer-filter'] = $input['superclix-referer-filter'];
if (isset($whitelist['superclix-username']) && isset($whitelist['superclix-password'])) {
include_once('apis/superclix.php');
if (!Affiliate_Power_Api_Superclix::checkLogin($whitelist['superclix-username'], $whitelist['superclix-password'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-superclix-login', __('Superclix test login failed. Please check your data. Don\'t forget to specify your export password, not your normal password.', 'affiliate-power'), 'error');
}
}
//Tradedoubler
if (ctype_alnum($input['tradedoubler-key']) && strlen($input['tradedoubler-key']) >= 32) $whitelist['tradedoubler-key'] = $input['tradedoubler-key'];
elseif (!empty($input['tradedoubler-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-tradedoubler-key', __('Invalid tradedoubler report key. The key should be at least 32 characters long. Please do not enter your normal password, but your report key.', 'affiliate-power'), 'error');
if (isset($whitelist['tradedoubler-key'])) {
include_once('apis/tradedoubler.php');
if (!Affiliate_Power_Api_Tradedoubler::checkLogin($whitelist['tradedoubler-key'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-tradedoubler-login', __('Tradedoubler test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
if (!empty($input['tradedoubler-sitename'])) $whitelist['tradedoubler-sitename'] = esc_html($input['tradedoubler-sitename']);
//Tradetracker
if (ctype_digit($input['tradetracker-userid'])) $whitelist['tradetracker-userid'] = $input['tradetracker-userid'];
elseif (!empty($input['tradetracker-userid'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-tradetracker-userid', __('Invalid Tradetracker User Id. The User ID should only contain numbers. Please make sure to specify your User ID, not your username.', 'affiliate-power'), 'error');
if (ctype_alnum($input['tradetracker-password']) && strlen($input['tradetracker-password']) > 20) $whitelist['tradetracker-password'] = $input['tradetracker-password'];
elseif (!empty($input['tradetracker-password'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-tradetracker-password', __('Invalid Tradetracker passphrase. Please do not enter your normal password, but your passphrase.', 'affiliate-power'), 'error');
if (ctype_digit($input['tradetracker-siteid'])) $whitelist['tradetracker-siteid'] = $input['tradetracker-siteid'];
elseif (empty($input['tradetracker-siteid']) && !empty($input['tradetracker-userid'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-tradetracker-userid', __('Missing Tradetracker Site Id. Please specify your Site Id.', 'affiliate-power'), 'error');
elseif (!empty($input['tradetracker-siteid'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-tradetracker-userid', __('Invalid Tradetracker Site Id. The Site ID should only contain numbers. Please make sure to specify your Site ID, not your sitename.', 'affiliate-power'), 'error');
if (isset($whitelist['tradetracker-userid']) && isset($whitelist['tradetracker-password']) && isset($whitelist['tradetracker-siteid'])) {
include_once('apis/tradetracker.php');
if (!extension_loaded('soap')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-soap', __('In order to download the Tradetracker sales the PHP-module SOAP is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Tradetracker::checkLogin($whitelist['tradetracker-userid'], $whitelist['tradetracker-password'], $whitelist['tradetracker-siteid'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-tradetracker-login', __('Tradetracker test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Webgains
if (!empty($input['webgains-username'])) $whitelist['webgains-username'] = esc_html($input['webgains-username']);
if (!empty($input['webgains-password'])) $whitelist['webgains-password'] = esc_html($input['webgains-password']);
if (!empty($input['webgains-username']) && empty($input['webgains-campaign'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-webgains-campaign', __('Please enter your Webgains Campaign Id', 'affiliate-power'), 'error');
elseif (!empty($input['webgains-campaign']) && !is_numeric($input['webgains-campaign'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-webgains-campaign', __('Invalid Webgains Campaign Id. Make sure to use the numeric Campaign Id, not the Campaign name.', 'affiliate-power'), 'error');
elseif (is_numeric($input['webgains-campaign'])) $whitelist['webgains-campaign'] = esc_html($input['webgains-campaign']);
if (isset($whitelist['webgains-username']) && isset($whitelist['webgains-password']) && isset($whitelist['webgains-campaign'])) {
include_once('apis/webgains.php');
if (!extension_loaded('soap')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-soap', __('In order to download the Webgains sales the PHP-module SOAP is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Webgains::checkLogin($whitelist['webgains-username'], $whitelist['webgains-password'], $whitelist['webgains-campaign'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-webgains-login', __('Webgains test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//Zanox
if (ctype_alnum($input['zanox-connect-id']) && strlen($input['zanox-connect-id']) == 20) $whitelist['zanox-connect-id'] = $input['zanox-connect-id'];
elseif (!empty($input['zanox-connect-id'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-zanox-connect-id', __('Invalid Zanox Connect Id. The Id should contain 20 characters of numbers and letters only. Please do not specify your normal Zanox account, but your Connect Id.', 'affiliate-power'), 'error');
if (ctype_alnum($input['zanox-public-key']) && strlen($input['zanox-public-key']) == 20) $whitelist['zanox-public-key'] = $input['zanox-public-key'];
elseif (!empty($input['zanox-public-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-zanox-public-key', __('Invalid Zanox Public Key. The key should contain 20 characters of numbers and letters only. Please do not specify your normal Zanox account or password, but your Public Key.', 'affiliate-power'), 'error');
if (strlen($input['zanox-secret-key']) >= 20) $whitelist['zanox-secret-key'] = $input['zanox-secret-key'];
elseif (!empty($input['zanox-secret-key'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-zanox-secret-key', __('Invalid Zanox Secret Key. The key should contain at least 20 characters of numbers and letters only. Please do not specify your normal Zanox password, but your Secret Key.', 'affiliate-power'), 'error');
if (isset($whitelist['zanox-connect-id']) && isset($whitelist['zanox-public-key']) && isset($whitelist['zanox-secret-key'])) {
include_once('apis/zanox.php');
if (!extension_loaded('soap')) {
add_settings_error('affiliate-power-options', 'affiliate-power-error-soap', __('In order to download the Zanox sales the PHP-module SOAP is required. This seems to be not activated on your server. Please activate the module. If you don\'t know how to do this, your webhoster can assist you.', 'affiliate-power'), 'error');
}
elseif (!Affiliate_Power_Api_Zanox::checkLogin($whitelist['zanox-connect-id'], $whitelist['zanox-public-key'], $whitelist['zanox-secret-key'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-zanox-login', __('Zanox test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
if (!empty($input['zanox-adspace'])) $whitelist['zanox-adspace'] = esc_html($input['zanox-adspace']);
//settings_errors('affiliate-power-options');
return $whitelist;
}
}
?>