'.__('You entered a valid licence key but you did not download the premium version yet. Please go to the a href="update-core.php">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.
', 'affiliate-power');
_e('
You like the plugin but you want to know more about your income? There is also a premium version of Affiliate Power where you can track the User Source, Keyword, Landing Page and URL-Parameters like utm_campaign. Find more information on the Premium Page.
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 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");
}
//Webworker Dashboard
static public function optionsWebworkerDashboardText() {
_e('With the Webworker Dashboard you can keep track of all your projects. If you have an account there, you can import your affiliate earnings automatically by entering your account details here. This is completely optional. If you do not enter your account details, no data will be send.', 'affiliate-power');
}
static public function addWebworkerDashboardUsernameField() {
$options = get_option('affiliate-power-options');
if (!isset($options['webworker-dashboard-username'])) $options['webworker-dashboard-username'] = '';
echo " ";
echo "[?]";
_e("
This is the normal Email address you use to login at the Webworker Dashboard.
", "affiliate-power");
}
static public function addWebworkerDashboardApiKeyField() {
$options = get_option('affiliate-power-options');
if (!isset($options['webworker-dashboard-apikey'])) $options['webworker-dashboard-apikey'] = '';
echo " ";
echo "[?]";
_e("
The API password is a special access to the Webworker Dashboard API. Please do not enter your normal Webworker Dashboard password here. The API Key can be created in the login area, menu item Settings -> APIs. Select \"Webworker Dashboard\" in the select box and click \"Add API\".
", "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 PublisherWebservice Password is a special access the the affili.net API. Please do not enter your normal affili.net password here. You can find the PublisherWebservice Password in the publisher area of affili.net, menu item Account -> Technical settings -> Webservices. It may be necessary to request the password via the request button first.
", "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");
}
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, click on \"Register for a Key\" and login with your normal account data.
", "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");
}
//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");
}
//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;
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'];
//Webworker Dashboard
if (is_email($input['webworker-dashboard-username'])) $whitelist['webworker-dashboard-username'] = $input['webworker-dashboard-username'];
elseif (!empty($input['webworker-dashboard-username'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-webworker-dashboard-username', __('Invalid Webworker Dashboard email address. This is not a valid email address.', 'affiliate-power'), 'error');
if (ctype_alnum($input['webworker-dashboard-apikey']) && strlen($input['webworker-dashboard-apikey']) == 32) $whitelist['webworker-dashboard-apikey'] = $input['webworker-dashboard-apikey'];
elseif (!empty($input['webworker-dashboard-apikey'])) add_settings_error('affiliate-power-options', 'affiliate-power-error-webworker-dashboard-apikey', __('Invalid Webworker Dashboard Apikey. The Apikey should be 32 characters long and only contain numbers and letters. Please do not enter your normal Webworker Dashboard password, but yourApikey', 'affiliate-power'), 'error');
if (isset($whitelist['webworker-dashboard-username']) && isset($whitelist['webworker-dashboard-apikey'])) {
include_once('apis/webworker-dashboard.php');
if (!Affiliate_Power_Api_Webworker_Dashboard::checkLogin($whitelist['webworker-dashboard-username'], $whitelist['webworker-dashboard-apikey'])){
add_settings_error('affiliate-power-options', 'affiliate-power-error-webworker-dashboard-login', __('Webworker Dashboard test login failed. Please check your data.', 'affiliate-power'), 'error');
}
}
//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']);
$whitelist['adcell-referer-filter'] = $input['adcell-referer-filter'];
if ($whitelist['adcell-referer-filter'] != 1) $whitelist['adcell-referer-filter'] = 0;
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 (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');
}
}
//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');
}
}
//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 (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']);
//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;
}
}
?>