affilinet Performance Ads - Version 1.9.0

Version Description

  • Release Date: March 3, 2018
  • RTB Header bidding added => increased eCPM and better Publisher Monetization
Download this release

Release Info

Developer Affilinet
Plugin Icon 128x128 affilinet Performance Ads
Version 1.9.0
Comparing to
See all releases

Code changes from version 1.8.7 to 1.9.0

Files changed (5) hide show
  1. affilinet.php +2 -1
  2. classes/Api.php +4 -4
  3. classes/Helper.php +1 -1
  4. classes/Plugin.php +50 -7
  5. readme.txt +7 -2
affilinet.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: affilinet Performance Ads
5
  Description: Integrate our data driven and automated performance display plugin into your WordPress platform and serve your users targeted ads in real time.
6
- Version: 1.8.7
7
  Author: affilinet
8
  Author URI: https://www.affili.net/de/publisher/tools/performance-ads
9
  Text Domain: affilinet-performance-module
@@ -11,6 +11,7 @@ License: GPLv2 or later
11
  */
12
 
13
  define("AFFILINET_PLUGIN_DIR", dirname(__FILE__).DIRECTORY_SEPARATOR);
 
14
 
15
  foreach (glob(AFFILINET_PLUGIN_DIR . "classes/*.php") as $filename) {
16
  include $filename;
3
  /*
4
  Plugin Name: affilinet Performance Ads
5
  Description: Integrate our data driven and automated performance display plugin into your WordPress platform and serve your users targeted ads in real time.
6
+ Version: 1.9.0
7
  Author: affilinet
8
  Author URI: https://www.affili.net/de/publisher/tools/performance-ads
9
  Text Domain: affilinet-performance-module
11
  */
12
 
13
  define("AFFILINET_PLUGIN_DIR", dirname(__FILE__).DIRECTORY_SEPARATOR);
14
+ define("AFFILINET_PLUGIN_FILE", plugin_basename( __FILE__) );
15
 
16
  foreach (glob(AFFILINET_PLUGIN_DIR . "classes/*.php") as $filename) {
17
  include $filename;
classes/Api.php CHANGED
@@ -105,13 +105,13 @@ class Affilinet_Api
105
  $programs = $client->__soapCall('GetPrograms', array($params));
106
  if ($programs->TotalResults === 0 ) {
107
  update_option('affilinet_webservice_login_is_correct', 'false', true);
108
- Affilinet_Helper::displayHugeAdminMessage(__('Wrong platform selected.<br> It seems like your account is registered to another country\'s platform.', 'affilinet-performance-module'), 'error', 'fa-exclamation-triangle');
109
  }
110
 
111
 
112
  switch ($programs->ProgramCollection->Program->PartnershipStatus) {
113
  case 'Active':
114
- Affilinet_Helper::displayHugeAdminMessage(__('Great, it looks like you already have a partnership with PerformanceAds! <br> Feel free to start using the plugin right away!', 'affilinet-performance-module'), 'success', 'fa-check-circle');
115
  break;
116
  case 'Paused' :
117
  case 'Waiting' :
@@ -119,14 +119,14 @@ class Affilinet_Api
119
  Affilinet_Helper::displayHugeAdminMessage(
120
  __('Please be aware that in order to earn commission for delivering creatives, a partnership with the PerformanceAds program is required.<br>Please apply <a target="_blank" href="http://publisher.affili.net/Programs/ProgramInfo.aspx?pid=', 'affilinet-performance-module')
121
  . Affilinet_PerformanceAds::getProgramIdByPlatform(get_option('affilinet_platform')) .
122
- __('">here</a>. Your partnership will be automatically accepted.', 'affilinet-performance-module'), 'warning', 'fa-exclamation-triangle');
123
  break;
124
  case 'Refused' :
125
  case 'Cancelled' :
126
  $link = Affilinet_Helper::getQualityStandardsLink();
127
  Affilinet_Helper::displayHugeAdminMessage(__('Unfortunately your partnership with PerformanceAds has been cancelled, as your website does not meet our quality standards. <br> For more information please visit our <a target="_blank" href="', 'affilinet-performance-module')
128
  . $link .
129
- __('">quality standards page.</a>', 'affilinet-performance-module'), 'error', 'fa-ban');
130
  break;
131
  }
132
 
105
  $programs = $client->__soapCall('GetPrograms', array($params));
106
  if ($programs->TotalResults === 0 ) {
107
  update_option('affilinet_webservice_login_is_correct', 'false', true);
108
+ Affilinet_Helper::displayHugeAdminMessage(__('Wrong platform selected.<br> It seems like your account is registered to another country\'s platform.', 'affilinet-performance-module'), 'error', 'dashicons-warning');
109
  }
110
 
111
 
112
  switch ($programs->ProgramCollection->Program->PartnershipStatus) {
113
  case 'Active':
114
+ Affilinet_Helper::displayHugeAdminMessage(__('Great, it looks like you already have a partnership with PerformanceAds! <br> Feel free to start using the plugin right away!', 'affilinet-performance-module'), 'success', 'dashicons-yes');
115
  break;
116
  case 'Paused' :
117
  case 'Waiting' :
119
  Affilinet_Helper::displayHugeAdminMessage(
120
  __('Please be aware that in order to earn commission for delivering creatives, a partnership with the PerformanceAds program is required.<br>Please apply <a target="_blank" href="http://publisher.affili.net/Programs/ProgramInfo.aspx?pid=', 'affilinet-performance-module')
121
  . Affilinet_PerformanceAds::getProgramIdByPlatform(get_option('affilinet_platform')) .
122
+ __('">here</a>. Your partnership will be automatically accepted.', 'affilinet-performance-module'), 'warning', 'dashicons-warning');
123
  break;
124
  case 'Refused' :
125
  case 'Cancelled' :
126
  $link = Affilinet_Helper::getQualityStandardsLink();
127
  Affilinet_Helper::displayHugeAdminMessage(__('Unfortunately your partnership with PerformanceAds has been cancelled, as your website does not meet our quality standards. <br> For more information please visit our <a target="_blank" href="', 'affilinet-performance-module')
128
  . $link .
129
+ __('">quality standards page.</a>', 'affilinet-performance-module'), 'error', 'dashicons-no');
130
  break;
131
  }
132
 
classes/Helper.php CHANGED
@@ -115,7 +115,7 @@ class Affilinet_Helper
115
  }
116
  ?>
117
  <div style="width: 50px;padding: 10px 20px;display: inline-block;">
118
- <i class="fa <?php echo $icon; ?>" style="font-size: 40px; color: <?php echo $color;?>; position:absolute; margin-top:10px;"></i>
119
  </div>
120
  <?php
121
  }
115
  }
116
  ?>
117
  <div style="width: 50px;padding: 10px 20px;display: inline-block;">
118
+ <i class="dashicons <?php echo $icon; ?>" style="font-size: 40px; color: <?php echo $color;?>; position:absolute; margin-top:10px;"></i>
119
  </div>
120
  <?php
121
  }
classes/Plugin.php CHANGED
@@ -10,12 +10,14 @@ class Affilinet_Plugin
10
  add_action('widgets_init', array($this, 'register_widget'));
11
 
12
  add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
 
13
 
14
  add_action('plugins_loaded', array($this, 'load_textdomain'));
15
  add_shortcode('affilinet_performance_ad', array($this, 'performance_ad_shortcode'));
16
 
17
  add_action( 'admin_notices', array( $this, 'admin_notice' ));
18
 
 
19
  }
20
 
21
  function admin_notice() {
@@ -56,6 +58,7 @@ class Affilinet_Plugin
56
 
57
  }
58
 
 
59
  /**
60
  * Create the admin Menu
61
  */
@@ -76,9 +79,18 @@ class Affilinet_Plugin
76
  add_submenu_page('affilinet', __('Reporting', 'affilinet-performance-module'), __('Reporting', 'affilinet-performance-module'), 'manage_options', 'affilinet_reporting', 'Affilinet_View::reporting');
77
 
78
  // options menu
79
- add_options_page('affilinet Settings', 'affilinet', 'manage_options', 'affilinet_options', 'Affilinet_View::settings');
80
  }
81
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * Register the widget
84
  */
@@ -106,14 +118,45 @@ class Affilinet_Plugin
106
  wp_enqueue_script('flot');
107
  wp_enqueue_script('flot.time');
108
  }
109
- // on settings page integrate font awesome
110
-
111
- if ($hook == 'affilinet_page_affilinet_settings') {
112
- wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
113
- }
114
-
115
 
 
 
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
 
119
  /**
10
  add_action('widgets_init', array($this, 'register_widget'));
11
 
12
  add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
13
+ add_action('wp_head', array($this, 'enqueue_bidding_script'));
14
 
15
  add_action('plugins_loaded', array($this, 'load_textdomain'));
16
  add_shortcode('affilinet_performance_ad', array($this, 'performance_ad_shortcode'));
17
 
18
  add_action( 'admin_notices', array( $this, 'admin_notice' ));
19
 
20
+ add_filter( 'plugin_action_links_' .plugin_basename(AFFILINET_PLUGIN_FILE ), array( $this, 'plugin_add_settings_link' ) );
21
  }
22
 
23
  function admin_notice() {
58
 
59
  }
60
 
61
+
62
  /**
63
  * Create the admin Menu
64
  */
79
  add_submenu_page('affilinet', __('Reporting', 'affilinet-performance-module'), __('Reporting', 'affilinet-performance-module'), 'manage_options', 'affilinet_reporting', 'Affilinet_View::reporting');
80
 
81
  // options menu
82
+ add_options_page('affilinet Settings', 'affilinet Perf. Ads', 'manage_options', 'affilinet_options', 'Affilinet_View::settings');
83
  }
84
 
85
+
86
+
87
+ public function plugin_add_settings_link( $links ) {
88
+
89
+ $settings_link = '<a href="' . admin_url( 'options-general.php?page=affilinet_options' ) . '">' . __( 'Settings', 'affilinet-performance-module' ) . '</a>';
90
+ array_push( $links, $settings_link );
91
+ return $links;
92
+ }
93
+
94
  /**
95
  * Register the widget
96
  */
118
  wp_enqueue_script('flot');
119
  wp_enqueue_script('flot.time');
120
  }
121
+ }
 
 
 
 
 
122
 
123
+ public function enqueue_bidding_script()
124
+ {
125
 
126
+ switch ($platformId = get_option('affilinet_platform')) {
127
+
128
+ case 7: // AT
129
+ $country = 'at';
130
+ break;
131
+ case 6: // CH
132
+ $country = 'ch';
133
+ break;
134
+ case 1: // DE
135
+ $country = 'de';
136
+ break;
137
+ case 3: // FR
138
+ $country = 'fr';
139
+ break;
140
+ case 2: // UK (prebidding not implemented)
141
+ case 4: // NL (prebidding not implemented)
142
+ default :
143
+ return;
144
+ }
145
+
146
+ $publisherId = get_option('affilinet_publisher_id');
147
+ if ($publisherId == null) return;
148
+
149
+
150
+ echo '<!-- affilinet prebidding script --><script language="javascript" type="text/javascript">'
151
+ . 'var affnetpbjsConfig = { "' . $country . '": { "publisherId" : "' . $publisherId . '" }};</script>';
152
+ $link = array(
153
+ 'de' => 'https://html-links.com/banners/9192/js/affnetpbjs_de.min.js',
154
+ 'at' => 'https://html-links.com/banners/12376/js/affnetpbjs_at.min.js',
155
+ 'ch' => 'https://html-links.com/banners/12252/js/affnetpbjs_ch.min.js',
156
+ 'fr' => 'https://html-links.com/banners/12751/js/affnetpbjs_fr.min.js',
157
+ );
158
+
159
+ echo '<script src="' . $link[ $country ] . '"></script>';
160
  }
161
 
162
  /**
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === affilinet Performance Ads ===
2
  Contributors: affilinet, teraone
3
- Tags: affilinet, affiliate marketing, online marketing, performance marketing, marketing, advertisement, advertising, advertise, Affiliate, performance, Display, earn money, monetization, monetize, Monetarisierung, performance, Vermarktung, Banner, Geld verdienen, werbeintegration, Werbung
4
  Requires at least: 3.0.1
5
- Tested up to: 4.8
6
  Stable tag: 1.8.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,11 @@ It may take up to 90 minutes for ads to show, additionally all publisher account
80
  == Changelog ==
81
 
82
 
 
 
 
 
 
83
  = 1.8.7 =
84
  * Release Date: July 5, 2017
85
  * SubId can be modified with the hook 'affilinet_subid_array'
1
  === affilinet Performance Ads ===
2
  Contributors: affilinet, teraone
3
+ Tags: Affiliate, affilinet, advertising, banner, performance marketing
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.9
6
  Stable tag: 1.8.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
80
  == Changelog ==
81
 
82
 
83
+ = 1.9.0 =
84
+ * Release Date: March 3, 2018
85
+ * RTB Header bidding added => increased eCPM and better Publisher Monetization
86
+
87
+
88
  = 1.8.7 =
89
  * Release Date: July 5, 2017
90
  * SubId can be modified with the hook 'affilinet_subid_array'