Wp-Insert - Version 2.4.2

Version Description

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

includes/modules/core/units/adunit.php CHANGED
@@ -222,6 +222,14 @@ function wp_insert_get_ad_status($rules) {
222
  if(!wp_validate_boolean($rules['status'])) {
223
  return false;
224
  }
 
 
 
 
 
 
 
 
225
 
226
  if(isset($rules['rules_exclude_loggedin']) && wp_validate_boolean($rules['rules_exclude_loggedin']) && is_user_logged_in()) {
227
  return false;
222
  if(!wp_validate_boolean($rules['status'])) {
223
  return false;
224
  }
225
+
226
+ if(function_exists('is_amp_endpoint') && is_amp_endpoint()) {
227
+ return false;
228
+ }
229
+
230
+ if(function_exists('is_woocommerce') && is_woocommerce()) {
231
+ return false;
232
+ }
233
 
234
  if(isset($rules['rules_exclude_loggedin']) && wp_validate_boolean($rules['rules_exclude_loggedin']) && is_user_logged_in()) {
235
  return false;
includes/modules/general/inpost/module.php CHANGED
@@ -111,9 +111,7 @@ function wp_insert_inpostads_form_accordion_tabs_positioning($control, $identifi
111
  /* Begin In-Post Ads Ad Insertion */
112
  add_filter('the_content', 'wp_insert_inpostads_the_content', 100);
113
  function wp_insert_inpostads_the_content($content) {
114
- if(function_exists('is_amp_endpoint') && is_amp_endpoint()) {
115
- return $content;
116
- } else if(!is_feed() && is_main_query()) {
117
  $inpostads = get_option('wp_insert_inpostads');
118
  if(isset($inpostads) && is_array($inpostads)) {
119
  $paragraphCount = wp_insert_inpostads_get_paragraph_count($content);
111
  /* Begin In-Post Ads Ad Insertion */
112
  add_filter('the_content', 'wp_insert_inpostads_the_content', 100);
113
  function wp_insert_inpostads_the_content($content) {
114
+ if(!is_feed() && is_main_query()) {
 
 
115
  $inpostads = get_option('wp_insert_inpostads');
116
  if(isset($inpostads) && is_array($inpostads)) {
117
  $paragraphCount = wp_insert_inpostads_get_paragraph_count($content);
includes/modules/general/legalpages/functions.php CHANGED
@@ -11,6 +11,16 @@ function wp_insert_legalpages_privacy_policy_form_get_content() {
11
  }
12
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[privacy_policy]', 'values' => $legalPages['privacy_policy']));
13
  echo '<div id="wp_insert_legalpages_privacy_policy_accordion">';
 
 
 
 
 
 
 
 
 
 
14
  echo '<h3>Content</h3>';
15
  echo '<div style="max-height: 320px;">';
16
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
@@ -82,6 +92,16 @@ function wp_insert_legalpages_terms_conditions_form_get_content() {
82
  }
83
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[terms_conditions]', 'values' => $legalPages['terms_conditions']));
84
  echo '<div id="wp_insert_legalpages_terms_conditions_accordion">';
 
 
 
 
 
 
 
 
 
 
85
  echo '<h3>Content</h3>';
86
  echo '<div style="max-height: 320px;">';
87
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
@@ -153,6 +173,16 @@ function wp_insert_legalpages_disclaimer_form_get_content() {
153
  }
154
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[disclaimer]', 'values' => $legalPages['disclaimer']));
155
  echo '<div id="wp_insert_legalpages_disclaimer_accordion">';
 
 
 
 
 
 
 
 
 
 
156
  echo '<h3>Content</h3>';
157
  echo '<div style="max-height: 320px;">';
158
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
@@ -224,6 +254,16 @@ function wp_insert_legalpages_copyright_form_get_content() {
224
  }
225
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[copyright]', 'values' => $legalPages['copyright']));
226
  echo '<div id="wp_insert_legalpages_copyright_accordion">';
 
 
 
 
 
 
 
 
 
 
227
  echo '<h3>Content</h3>';
228
  echo '<div style="max-height: 320px;">';
229
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
11
  }
12
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[privacy_policy]', 'values' => $legalPages['privacy_policy']));
13
  echo '<div id="wp_insert_legalpages_privacy_policy_accordion">';
14
+ echo '<h3>Disclaimer</h3>';
15
+ echo '<div>';
16
+ echo '<p><b>By using this feature, you agree to this disclaimer.</b></p>';
17
+ echo '<p>These templates are provided to you to understand your obligations better, but they are NOT meant to constitute client-attorney relationship or personalized legal advice.</p>';
18
+ echo '<p>The developer is not eligible for any claim or action based on any information or functionality provided by this plugin.</p>';
19
+ echo '<p>We expressly disclaim all liability in respect of usage of this plugin or its features.</p>';
20
+ echo '<p>This plugin gives you general information and tools, but is NOT meant to serve as complete compliance package.</p>';
21
+ echo '<p>As each business and situation is unique, you might need to modify, add or delete information in these templates.</p>';
22
+ echo '<p>This information is provided just to get you started.</p>';
23
+ echo '</div>';
24
  echo '<h3>Content</h3>';
25
  echo '<div style="max-height: 320px;">';
26
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
92
  }
93
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[terms_conditions]', 'values' => $legalPages['terms_conditions']));
94
  echo '<div id="wp_insert_legalpages_terms_conditions_accordion">';
95
+ echo '<h3>Disclaimer</h3>';
96
+ echo '<div>';
97
+ echo '<p><b>By using this feature, you agree to this disclaimer.</b></p>';
98
+ echo '<p>These templates are provided to you to understand your obligations better, but they are NOT meant to constitute client-attorney relationship or personalized legal advice.</p>';
99
+ echo '<p>The developer is not eligible for any claim or action based on any information or functionality provided by this plugin.</p>';
100
+ echo '<p>We expressly disclaim all liability in respect of usage of this plugin or its features.</p>';
101
+ echo '<p>This plugin gives you general information and tools, but is NOT meant to serve as complete compliance package.</p>';
102
+ echo '<p>As each business and situation is unique, you might need to modify, add or delete information in these templates.</p>';
103
+ echo '<p>This information is provided just to get you started.</p>';
104
+ echo '</div>';
105
  echo '<h3>Content</h3>';
106
  echo '<div style="max-height: 320px;">';
107
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
173
  }
174
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[disclaimer]', 'values' => $legalPages['disclaimer']));
175
  echo '<div id="wp_insert_legalpages_disclaimer_accordion">';
176
+ echo '<h3>Disclaimer</h3>';
177
+ echo '<div>';
178
+ echo '<p><b>By using this feature, you agree to this disclaimer.</b></p>';
179
+ echo '<p>These templates are provided to you to understand your obligations better, but they are NOT meant to constitute client-attorney relationship or personalized legal advice.</p>';
180
+ echo '<p>The developer is not eligible for any claim or action based on any information or functionality provided by this plugin.</p>';
181
+ echo '<p>We expressly disclaim all liability in respect of usage of this plugin or its features.</p>';
182
+ echo '<p>This plugin gives you general information and tools, but is NOT meant to serve as complete compliance package.</p>';
183
+ echo '<p>As each business and situation is unique, you might need to modify, add or delete information in these templates.</p>';
184
+ echo '<p>This information is provided just to get you started.</p>';
185
+ echo '</div>';
186
  echo '<h3>Content</h3>';
187
  echo '<div style="max-height: 320px;">';
188
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
254
  }
255
  $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[copyright]', 'values' => $legalPages['copyright']));
256
  echo '<div id="wp_insert_legalpages_copyright_accordion">';
257
+ echo '<h3>Disclaimer</h3>';
258
+ echo '<div>';
259
+ echo '<p><b>By using this feature, you agree to this disclaimer.</b></p>';
260
+ echo '<p>These templates are provided to you to understand your obligations better, but they are NOT meant to constitute client-attorney relationship or personalized legal advice.</p>';
261
+ echo '<p>The developer is not eligible for any claim or action based on any information or functionality provided by this plugin.</p>';
262
+ echo '<p>We expressly disclaim all liability in respect of usage of this plugin or its features.</p>';
263
+ echo '<p>This plugin gives you general information and tools, but is NOT meant to serve as complete compliance package.</p>';
264
+ echo '<p>As each business and situation is unique, you might need to modify, add or delete information in these templates.</p>';
265
+ echo '<p>This information is provided just to get you started.</p>';
266
+ echo '</div>';
267
  echo '<h3>Content</h3>';
268
  echo '<div style="max-height: 320px;">';
269
  $control->add_control(array('type' => 'textarea-wysiwyg', 'style' => 'height: 220px;', 'optionName' => 'content'));
includes/modules/general/videointelligence/api/vi.php CHANGED
@@ -6,6 +6,7 @@ function wp_insert_vi_api_get_settings() {
6
  $response = wp_remote_get('https://dashboard-api.vidint.net/v1/api/widget/settings', array('timeout' => 15));
7
  if(!is_wp_error($response) && (200 == wp_remote_retrieve_response_code($response))) {
8
  $responseBody = json_decode($response['body']);
 
9
  if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) {
10
  $viSettings = array(
11
  'signupURL' => $responseBody->data->signupURL,
@@ -17,7 +18,11 @@ function wp_insert_vi_api_get_settings() {
17
  'revenueAPI' => $responseBody->data->revenueAPI,
18
  'adsTxtAPI' => $responseBody->data->adsTxtAPI,
19
  'languages' => $responseBody->data->languages,
20
- 'jsTagAPI' => $responseBody->data->jsTagAPI,
 
 
 
 
21
  );
22
  delete_transient('wp_insert_vi_api_settings');
23
  set_transient('wp_insert_vi_api_settings', $viSettings, WEEK_IN_SECONDS);
@@ -32,6 +37,10 @@ function wp_insert_vi_api_get_settings() {
32
  return $viSettings;
33
  }
34
 
 
 
 
 
35
  function wp_insert_vi_api_get_signupurl() {
36
  $viSettings = wp_insert_vi_api_get_settings();
37
  if(($viSettings != false) && is_array($viSettings)) {
@@ -74,6 +83,22 @@ function wp_insert_vi_api_get_languages() {
74
  return false;
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  function wp_insert_vi_api_get_adstxt_content() {
78
  $viSettings = wp_insert_vi_api_get_settings();
79
  if(($viSettings != false) && is_array($viSettings)) {
@@ -314,16 +339,6 @@ function wp_insert_vi_api_set_vi_code($args = null) {
314
  if(isset($args['native_bg_color']) && ($args['native_bg_color'] != '') && ($args['native_bg_color'] != 'undefined')) {
315
  $selectedArgs['backgroundColor'] = $args['native_bg_color'];
316
  }
317
-
318
- if(isset($args['optional_1']) && ($args['optional_1'] != '') && ($args['optional_1'] != 'undefined')) {
319
- $selectedArgs['vioptional1'] = $args['optional_1'];
320
- }
321
- if(isset($args['optional_2']) && ($args['optional_2'] != '') && ($args['optional_2'] != 'undefined')) {
322
- $selectedArgs['vioptional2'] = $args['optional_2'];
323
- }
324
- if(isset($args['optional_3']) && ($args['optional_3'] != '') && ($args['optional_3'] != 'undefined')) {
325
- $selectedArgs['vioptional3'] = $args['optional_3'];
326
- }
327
  }
328
 
329
  $viSettings = wp_insert_vi_api_get_settings();
@@ -418,4 +433,55 @@ function wp_insert_vi_api_get_vi_code($settingsKey = '') {
418
  }
419
  return '<script type="text/javascript">'.$jsTag.'</script>';
420
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  ?>
6
  $response = wp_remote_get('https://dashboard-api.vidint.net/v1/api/widget/settings', array('timeout' => 15));
7
  if(!is_wp_error($response) && (200 == wp_remote_retrieve_response_code($response))) {
8
  $responseBody = json_decode($response['body']);
9
+ //echo '<pre>'; print_r($responseBody->data); echo '</pre>';
10
  if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) {
11
  $viSettings = array(
12
  'signupURL' => $responseBody->data->signupURL,
18
  'revenueAPI' => $responseBody->data->revenueAPI,
19
  'adsTxtAPI' => $responseBody->data->adsTxtAPI,
20
  'languages' => $responseBody->data->languages,
21
+ 'jsTagAPI' => $responseBody->data->jsTagAPI,
22
+ 'vendorListURL' => $responseBody->data->vendorListURL,
23
+ 'vendorListVersion' => $responseBody->data->vendorListVersion,
24
+ 'consentPopupContent' => $responseBody->data->consentPopupContent,
25
+ 'purposes' => $responseBody->data->purposes,
26
  );
27
  delete_transient('wp_insert_vi_api_settings');
28
  set_transient('wp_insert_vi_api_settings', $viSettings, WEEK_IN_SECONDS);
37
  return $viSettings;
38
  }
39
 
40
+ function wp_insert_vi_api_reset_settings() {
41
+ delete_transient('wp_insert_vi_api_settings');
42
+ }
43
+
44
  function wp_insert_vi_api_get_signupurl() {
45
  $viSettings = wp_insert_vi_api_get_settings();
46
  if(($viSettings != false) && is_array($viSettings)) {
83
  return false;
84
  }
85
 
86
+ function wp_insert_vi_api_get_consent_popup_content() {
87
+ $viSettings = wp_insert_vi_api_get_settings();
88
+ if(($viSettings != false) && is_array($viSettings)) {
89
+ return $viSettings['consentPopupContent'];
90
+ }
91
+ return false;
92
+ }
93
+
94
+ function wp_insert_vi_api_get_consent_purposes() {
95
+ $viSettings = wp_insert_vi_api_get_settings();
96
+ if(($viSettings != false) && is_array($viSettings)) {
97
+ return $viSettings['purposes'];
98
+ }
99
+ return false;
100
+ }
101
+
102
  function wp_insert_vi_api_get_adstxt_content() {
103
  $viSettings = wp_insert_vi_api_get_settings();
104
  if(($viSettings != false) && is_array($viSettings)) {
339
  if(isset($args['native_bg_color']) && ($args['native_bg_color'] != '') && ($args['native_bg_color'] != 'undefined')) {
340
  $selectedArgs['backgroundColor'] = $args['native_bg_color'];
341
  }
 
 
 
 
 
 
 
 
 
 
342
  }
343
 
344
  $viSettings = wp_insert_vi_api_get_settings();
433
  }
434
  return '<script type="text/javascript">'.$jsTag.'</script>';
435
  }
436
+
437
+ function wp_insert_vi_api_is_eu() {
438
+ $userIp = $_SERVER["REMOTE_ADDR"];
439
+ //$userIp = '185.216.33.82';
440
+ $isEU = get_transient('wp_insert_vi_api_is_eu_'.$userIp);
441
+ if($isEU === false) {
442
+ try{
443
+ $response = wp_remote_get(
444
+ 'http://gdpr-check.net/gdpr/is-eu?ip='.$userIp,
445
+ array('timeout' => 15)
446
+ );
447
+ if(!is_wp_error($response)) {
448
+ if(200 == wp_remote_retrieve_response_code($response)) {
449
+ $responseBody = json_decode($response['body']);
450
+ if((json_last_error() == JSON_ERROR_NONE)) {
451
+ if((isset($responseBody->is_eu)) && ($responseBody->is_eu == '1')) {
452
+ delete_transient('wp_insert_vi_api_is_eu_'.$userIp);
453
+ set_transient('wp_insert_vi_api_is_eu_'.$userIp, '1', WEEK_IN_SECONDS);
454
+ return true;
455
+ } else {
456
+ delete_transient('wp_insert_vi_api_is_eu_'.$userIp);
457
+ set_transient('wp_insert_vi_api_is_eu_'.$userIp, '0', WEEK_IN_SECONDS);
458
+ return false;
459
+ }
460
+ } else {
461
+ return false;
462
+ }
463
+ } else {
464
+ return false;
465
+ }
466
+ }
467
+ } catch(Exception $ex) {
468
+ return false;
469
+ }
470
+ } else {
471
+ if($isEU == '1') {
472
+ return true;
473
+ } else {
474
+ return false;
475
+ }
476
+
477
+ }
478
+ }
479
+
480
+ function wp_insert_vi_api_get_vendor_list_version() {
481
+ $viSettings = wp_insert_vi_api_get_settings();
482
+ if(($viSettings != false) && is_array($viSettings)) {
483
+ return $viSettings['vendorListVersion'];
484
+ }
485
+ return false;
486
+ }
487
  ?>
includes/modules/general/videointelligence/css/gdpr.css ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp_insert_vi_consent_popup_overlay {
2
+ position: fixed;
3
+ left: 0;
4
+ right: 0;
5
+ top: 0;
6
+ bottom: 0;
7
+ background: rgba(0,0,0,0.5);
8
+ z-index: 10000;
9
+ }
10
+
11
+ #wp_insert_vi_consent_popup_wrapper {
12
+ max-width: 480px;
13
+ background: rgba(255,255,255,0.9);
14
+ padding: 30px 30px 30px;
15
+ position: fixed;
16
+ right: 0;
17
+ bottom: 0;
18
+ color: #000;
19
+ z-index: 10001;
20
+ }
21
+
22
+ #wp_insert_vi_consent_popup_wrapper h1 {
23
+ line-height: 42px;
24
+ font-weight: 400;
25
+ font-family: sans-serif,Helvetica,Arial;
26
+ font-size: 36px;
27
+ text-align: center;
28
+ margin: 0;
29
+ padding: 0;
30
+ border: none;
31
+ background: none;
32
+ color: #000;
33
+ }
34
+
35
+ #wp_insert_vi_consent_popup_wrapper p {
36
+ font-size: 14px;
37
+ font-family: sans-serif,Helvetica,Arial;
38
+ line-height: 20px;
39
+ margin: 10px 0 30px;
40
+ padding: 0;
41
+ border: none;
42
+ background: none;
43
+ color: #000;
44
+ text-align: justify;
45
+ font-weight: 400;
46
+ }
47
+
48
+ #wp_insert_vi_consent_popup_wrapper p a,
49
+ #wp_insert_vi_consent_popup_wrapper p a:hover {
50
+ font-size: 14px;
51
+ font-family: sans-serif,Helvetica,Arial;
52
+ line-height: 20px;
53
+ margin: 0;
54
+ padding: 0;
55
+ border: none;
56
+ background: none;
57
+ color: #000;
58
+ text-decoration: underline;
59
+ }
60
+
61
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_actions_wrapper {
62
+ text-align: center;
63
+ margin: 0 0 30px;
64
+ }
65
+
66
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_actions_wrapper #wp_insert_vi_consent_popup_disagree_btn,
67
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_actions_wrapper #wp_insert_vi_consent_popup_disagree_btn:hover {
68
+ cursor: pointer;
69
+ color: #000;
70
+ background: none;
71
+ border: none;
72
+ padding: 10px 30px;
73
+ text-align: center;
74
+ font-weight: 600;
75
+ font-size: 15px;
76
+ font-family: sans-serif,Helvetica,Arial;
77
+ margin: 0;
78
+ }
79
+
80
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_actions_wrapper #wp_insert_vi_consent_popup_agree_btn,
81
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_actions_wrapper #wp_insert_vi_consent_popup_agree_btn:hover {
82
+ cursor: pointer;
83
+ color: #000;
84
+ background: rgba(255, 242, 0, 1);
85
+ border: 2px solid rgba(255, 242, 0, 1);
86
+ padding: 10px 60px;
87
+ text-align: center;
88
+ font-weight: 600;
89
+ font-size: 15px;
90
+ font-family: sans-serif,Helvetica,Arial;
91
+ border-radius: 18px;
92
+ margin: 0;
93
+ }
94
+
95
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_links_wrapper {
96
+ text-align: center;
97
+ }
98
+
99
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_links_wrapper a,
100
+ #wp_insert_vi_consent_popup_wrapper #wp_insert_vi_consent_popup_links_wrapper a:hover {
101
+ color: #000;
102
+ background: none;
103
+ border: none;
104
+ padding: 10px;
105
+ text-align: center;
106
+ font-weight: 400;
107
+ font-size: 12px;
108
+ font-family: sans-serif,Helvetica,Arial;
109
+ margin: 0;
110
+ text-decoration: underline;
111
+ line-height: 24px;
112
+ }
113
+
114
+ #wp_insert_vi_consent_popup_settings_button {
115
+ font-size: 13px;
116
+ color: rgba(146, 135, 131, 1);
117
+ background: url(../images/privacy.png) no-repeat left center;
118
+ padding: 0 0 0 32px;
119
+ position: fixed;
120
+ bottom: 10px;
121
+ right: 10px;
122
+ cursor: pointer;
123
+ z-index: 10002;
124
+ font-family: sans-serif,Helvetica,Arial;
125
+ -webkit-touch-callout: none; /* iOS Safari */
126
+ -webkit-user-select: none; /* Safari */
127
+ -khtml-user-select: none; /* Konqueror HTML */
128
+ -moz-user-select: none; /* Firefox */
129
+ -ms-user-select: none; /* Internet Explorer/Edge */
130
+ user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
131
+ }
includes/modules/general/videointelligence/css/module.css CHANGED
@@ -316,4 +316,20 @@ p.viError {
316
  font-size: 13px;
317
  font-family: Arial;
318
  color: #444444;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  }
316
  font-size: 13px;
317
  font-family: Arial;
318
  color: #444444;
319
+ }
320
+
321
+ #wp_insert_vi_customize_adcode_dialog .ui-button {
322
+ background: #C8161B !important;
323
+ border: 2px solid #000 !important;
324
+ color: #fff !important;
325
+ display: block;
326
+ font-weight: bold !important;
327
+ height: 30px;
328
+ margin: 15px auto 0;
329
+ text-shadow: 1px 1px 5px #000;
330
+ width: 80%;
331
+ }
332
+
333
+ #wp_insert_vi_customize_adcode_dialog .ui-button.ui-state-active {
334
+ background: #6ddc5f !important;
335
  }
includes/modules/general/videointelligence/functions.php CHANGED
@@ -14,7 +14,7 @@ function wp_insert_vi_signup_form_get_content() {
14
  echo '</div>';
15
  } else {
16
  echo '<div class="wp_insert_popup_content_wrapper">';
17
- echo '<p> There was an error processing your request. Please try again later. </p>';
18
  echo '</div>';
19
  }
20
  die();
@@ -175,15 +175,18 @@ function wp_insert_vi_customize_adcode_form_get_content() {
175
  $control->add_control(array('type' => 'minicolors', 'label' => 'Native Text color', 'optionName' => 'native_text_color', 'helpText' => '&nbsp;'));
176
  $control->add_control(array('type' => 'select', 'label' => ' Native Text Font Family', 'optionName' => 'font_family', 'helpText' => '&nbsp;', 'options' => wp_insert_vi_get_constant_fonts()));
177
  $control->add_control(array('type' => 'select', 'label' => 'Native Text Font Size', 'optionName' => 'font_size', 'helpText' => '&nbsp;', 'options' => wp_insert_vi_get_constant_font_sizes()));
178
- $control->add_control(array('type' => 'textarea', 'label' => 'Optional 1', 'optionName' => 'optional_1', 'helpText' => '&nbsp;'));
179
- $control->add_control(array('type' => 'textarea', 'label' => 'Optional 2', 'optionName' => 'optional_2', 'helpText' => '&nbsp;'));
180
- $control->add_control(array('type' => 'textarea', 'label' => 'Optional 3', 'optionName' => 'optional_3', 'helpText' => '&nbsp;'));
181
  $control->HTML .= '<p class="wp_insert_vi_delay_notice">vi Ad Changes might take some time to take into effect</p>';
182
  $control->HTML .= '</div>';
183
  $control->HTML .= '<div class="clear"></div>';
184
  $control->HTML .= '</div>';
185
  $control->create_section(' vi stories: customize your video player ');
186
  echo $control->HTML;
 
 
 
 
 
 
187
  echo '<script type="text/javascript">';
188
  echo $control->JS;
189
  echo 'wp_insert_vi_code_iab_category_parent_change();';
@@ -204,9 +207,8 @@ function wp_insert_vi_customize_adcode_form_save_action() {
204
  $vicodeSettings['native_text_color'] = ((isset($_POST['wp_insert_vi_code_settings_native_text_color']))?$_POST['wp_insert_vi_code_settings_native_text_color']:'');
205
  $vicodeSettings['font_family'] = ((isset($_POST['wp_insert_vi_code_settings_font_family']))?$_POST['wp_insert_vi_code_settings_font_family']:'');
206
  $vicodeSettings['font_size'] = ((isset($_POST['wp_insert_vi_code_settings_font_size']))?$_POST['wp_insert_vi_code_settings_font_size']:'');
207
- $vicodeSettings['optional_1'] = ((isset($_POST['wp_insert_vi_code_settings_optional_1']))?$_POST['wp_insert_vi_code_settings_optional_1']:'');
208
- $vicodeSettings['optional_2'] = ((isset($_POST['wp_insert_vi_code_settings_optional_2']))?$_POST['wp_insert_vi_code_settings_optional_2']:'');
209
- $vicodeSettings['optional_3'] = ((isset($_POST['wp_insert_vi_code_settings_optional_3']))?$_POST['wp_insert_vi_code_settings_optional_3']:'');
210
  update_option('wp_insert_vi_code_settings', $vicodeSettings);
211
  $viCodeStatus = wp_insert_vi_api_set_vi_code($vicodeSettings);
212
  if(is_array($viCodeStatus) && (isset($viCodeStatus['status'])) && ($viCodeStatus['status'] == 'error')) {
@@ -215,7 +217,7 @@ function wp_insert_vi_customize_adcode_form_save_action() {
215
  echo '<p class="viError">'.$viCodeStatus['message'].'</p>';
216
  } else {
217
  echo '###FAIL###';
218
- echo '<p class="viError">There was an error processing your request, our team was notified.<br />Please try again later.</p>';
219
  }
220
  } else {
221
  echo '###SUCCESS###';
@@ -282,16 +284,6 @@ function wp_insert_vi_customize_adcode_get_settings() {
282
  }
283
  }
284
  }
285
-
286
- if(isset($vicodeSettings['optional_1']) && ($vicodeSettings['optional_1'] != '')) {
287
- $output .= '<label>Optional 1:</label><b>'.$vicodeSettings['optional_1'].'</b>';
288
- }
289
- if(isset($vicodeSettings['optional_2']) && ($vicodeSettings['optional_2'] != '')) {
290
- $output .= '<label>Optional 2:</label><b>'.$vicodeSettings['optional_1'].'</b>';
291
- }
292
- if(isset($vicodeSettings['optional_3']) && ($vicodeSettings['optional_3'] != '')) {
293
- $output .= '<label>Optional 3:</label><b>'.$vicodeSettings['optional_1'].'</b>';
294
- }
295
  $output .= '</p>';
296
  }
297
  return $output;
14
  echo '</div>';
15
  } else {
16
  echo '<div class="wp_insert_popup_content_wrapper">';
17
+ echo '<p>There was an error processing your request, our team was notified. Try clearing your browser cache, log out and log in again.</p>';
18
  echo '</div>';
19
  }
20
  die();
175
  $control->add_control(array('type' => 'minicolors', 'label' => 'Native Text color', 'optionName' => 'native_text_color', 'helpText' => '&nbsp;'));
176
  $control->add_control(array('type' => 'select', 'label' => ' Native Text Font Family', 'optionName' => 'font_family', 'helpText' => '&nbsp;', 'options' => wp_insert_vi_get_constant_fonts()));
177
  $control->add_control(array('type' => 'select', 'label' => 'Native Text Font Size', 'optionName' => 'font_size', 'helpText' => '&nbsp;', 'options' => wp_insert_vi_get_constant_font_sizes()));
 
 
 
178
  $control->HTML .= '<p class="wp_insert_vi_delay_notice">vi Ad Changes might take some time to take into effect</p>';
179
  $control->HTML .= '</div>';
180
  $control->HTML .= '<div class="clear"></div>';
181
  $control->HTML .= '</div>';
182
  $control->create_section(' vi stories: customize your video player ');
183
  echo $control->HTML;
184
+ $control->clear_controls();
185
+
186
+ $control->HTML .= '<p>Enable GDPR Compliance confirmation notice on your site for visitors from EU.<br />If you disable this option make sure you are using a data usage authorization system on your website to remain GDPR complaint.</p>';
187
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Do not Show GDPR Authorization Popup', 'checkedLabel' => 'Status : Show GDPR Authorization Popup', 'uncheckedLabel' => 'Status : Do not Show GDPR Authorization Popup', 'optionName' => 'show_gdpr_authorization'));
188
+ $control->create_section(' vi stories: GDPR Compliance ');
189
+ echo $control->HTML;
190
  echo '<script type="text/javascript">';
191
  echo $control->JS;
192
  echo 'wp_insert_vi_code_iab_category_parent_change();';
207
  $vicodeSettings['native_text_color'] = ((isset($_POST['wp_insert_vi_code_settings_native_text_color']))?$_POST['wp_insert_vi_code_settings_native_text_color']:'');
208
  $vicodeSettings['font_family'] = ((isset($_POST['wp_insert_vi_code_settings_font_family']))?$_POST['wp_insert_vi_code_settings_font_family']:'');
209
  $vicodeSettings['font_size'] = ((isset($_POST['wp_insert_vi_code_settings_font_size']))?$_POST['wp_insert_vi_code_settings_font_size']:'');
210
+
211
+ $vicodeSettings['show_gdpr_authorization'] = ((isset($_POST['wp_insert_vi_code_settings_show_gdpr_authorization']))?$_POST['wp_insert_vi_code_settings_show_gdpr_authorization']:'');
 
212
  update_option('wp_insert_vi_code_settings', $vicodeSettings);
213
  $viCodeStatus = wp_insert_vi_api_set_vi_code($vicodeSettings);
214
  if(is_array($viCodeStatus) && (isset($viCodeStatus['status'])) && ($viCodeStatus['status'] == 'error')) {
217
  echo '<p class="viError">'.$viCodeStatus['message'].'</p>';
218
  } else {
219
  echo '###FAIL###';
220
+ echo '<p class="viError">There was an error processing your request, our team was notified. Try clearing your browser cache, log out and log in again.</p>';
221
  }
222
  } else {
223
  echo '###SUCCESS###';
284
  }
285
  }
286
  }
 
 
 
 
 
 
 
 
 
 
287
  $output .= '</p>';
288
  }
289
  return $output;
includes/modules/general/videointelligence/gdpr.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Consent Popup */
3
+ add_action('init', 'wp_insert_vi_gdpr_popup_init');
4
+ function wp_insert_vi_gdpr_popup_init() {
5
+ $vicodeSettings = get_option('wp_insert_vi_code_settings');
6
+ if(isset($vicodeSettings['show_gdpr_authorization']) && wp_validate_boolean($vicodeSettings['show_gdpr_authorization']) ) {
7
+ add_action('wp_enqueue_scripts', 'wp_insert_vi_gdpr_popup_wp_enqueue_style');
8
+ add_action('wp_enqueue_scripts', 'wp_insert_vi_gdpr_popup_wp_enqueue_scripts');
9
+ add_action('wp_footer', 'wp_insert_vi_gdpr_popup_wp_footer');
10
+ }
11
+ }
12
+
13
+ function wp_insert_vi_gdpr_popup_wp_enqueue_style() {
14
+ wp_enqueue_style('wp_insert_vi_gdpr', WP_INSERT_URL.'includes/modules/general/videointelligence/css/gdpr.css', array(), WP_INSERT_VERSION , 'all');
15
+ }
16
+
17
+
18
+ function wp_insert_vi_gdpr_popup_wp_enqueue_scripts() {
19
+ wp_enqueue_script('wp_insert_vi_gdpr', WP_INSERT_URL.'includes/modules/general/videointelligence/js/gdpr.js', array(), WP_INSERT_VERSION , true);
20
+ }
21
+
22
+ function wp_insert_vi_gdpr_popup_wp_footer() {
23
+ $showViConsent = true;
24
+ $isEU = wp_insert_vi_api_is_eu();
25
+ if(isset($_COOKIE['Viconsent'])) {
26
+ $showViConsent = false;
27
+ }
28
+ $vicodeSettings = get_option('wp_insert_vi_code_settings');
29
+ $labels = array();
30
+ $viConsentPopupContent = wp_insert_vi_api_get_consent_popup_content();
31
+ if($viConsentPopupContent != false) {
32
+ switch($vicodeSettings['language']) {
33
+ case 'de-de':
34
+ $labels['popupContent'] = $viConsentPopupContent->es;
35
+ $labels['accept'] = 'acepto';
36
+ $labels['donotaccept'] = 'no acepto';
37
+ $labels['showPurposes'] = 'Mostrar propósitos';
38
+ $labels['showVendors'] = 'Mostrar vendedores';
39
+
40
+ break;
41
+ case 'fr-fr':
42
+ $labels['popupContent'] = $viConsentPopupContent->fr;
43
+ $labels['accept'] = 'J’accepte';
44
+ $labels['donotaccept'] = 'Je n’accepte pas';
45
+ $labels['showPurposes'] = 'Plus de details';
46
+ $labels['showVendors'] = 'Montrez les vendeurs';
47
+ break;
48
+ case 'en-us':
49
+ default:
50
+ $labels['popupContent'] = $viConsentPopupContent->en;
51
+ $labels['accept'] = 'I accept';
52
+ $labels['donotaccept'] = 'I do not accept';
53
+ $labels['showPurposes'] = 'Show purposes';
54
+ $labels['showVendors'] = 'Show vendors';
55
+ break;
56
+ }
57
+ }
58
+
59
+ echo '<div id="wp_insert_vi_consent_popup_wrapper" style="display: none;">';
60
+ echo $labels['popupContent'];
61
+ echo '<div id="wp_insert_vi_consent_popup_actions_wrapper">';
62
+ echo '<input id="wp_insert_vi_consent_popup_disagree_btn" type="button" value="'.$labels['donotaccept'].'" onclick="wp_insert_vi_consent_popup_disagree()" />';
63
+ echo '<input id="wp_insert_vi_consent_popup_agree_btn" type="button" value="'.$labels['accept'].'" onclick="wp_insert_vi_consent_popup_agree()" />';
64
+ echo '</div>';
65
+ echo '<div id="wp_insert_vi_consent_popup_links_wrapper">';
66
+ echo '<a href="https://www.vi.ai/purposes" target="_blank">'.$labels['showPurposes'].'</a>';
67
+ echo '<a href="https://www.vi.ai/vendors" target="_blank">'.$labels['showVendors'].'</a>';
68
+ echo '</div>';
69
+ echo '<input id="wp_insert_vi_consent_popup_is_eu" type="hidden" value="'.$isEU.'" />';
70
+ echo '<input id="wp_insert_vi_consent_popup_url" type="hidden" value="'.get_bloginfo('url').'" />';
71
+ echo '<input id="wp_insert_vi_consent_popup_auth" type="hidden" value="'.wp_create_nonce('wp_insert_vi_consent').'" />';
72
+ echo '<input id="wp_insert_vi_consent_popup_vendor_list_version" type="hidden" value="'.wp_insert_vi_api_get_vendor_list_version().'" />';
73
+ $purposesBinary = '000000000000000000000000';
74
+ $purposes = wp_insert_vi_api_get_consent_purposes();
75
+ if(isset($purposes) && (count($purposes) > 0)) {
76
+ foreach($purposes as $purpose) {
77
+ $purposesBinary = substr_replace($purposesBinary, '1', ((24 - (int)$purpose->id) + 1), 1);
78
+ }
79
+ }
80
+ echo '<input id="wp_insert_vi_consent_popup_vendor_list_purposes" type="hidden" value="'.$purposesBinary.'" />';
81
+ echo '<input id="wp_insert_vi_consent_popup_vendor_list_vendors" type="hidden" value="999" />';
82
+ echo '</div>';
83
+ echo '<div id="wp_insert_vi_consent_popup_overlay" style="display: none;"></div>';
84
+ echo '<span id="wp_insert_vi_consent_popup_settings_button" onclick="wp_insert_vi_consent_popup_settings()" unselectable="on" style="display: none;">Privacy settings</span>';
85
+ }
86
+ /* End Consent Popup */
87
+
88
+ /* Begin Data Storage */
89
+ add_action('init', 'wp_insert_vi_gdpr_data_init');
90
+ function wp_insert_vi_gdpr_data_init() {
91
+ if(isset($_GET['wp_insert_vi_consent']) && ($_GET['wp_insert_vi_consent'] != '')) {
92
+ check_ajax_referer('wp_insert_vi_consent', 'wp_insert_vi_consent');
93
+ wp_insert_post(array(
94
+ 'post_title' => date('c'),
95
+ 'post_content' => ((isset($_COOKIE['Viconsent']))?$_COOKIE['Viconsent']:''),
96
+ 'post_status' => 'publish',
97
+ 'post_type' => 'viconsent',
98
+ ));
99
+ die();
100
+ }
101
+
102
+
103
+ $labels = array(
104
+ 'name' => 'VI Consent',
105
+ 'singular_name' => 'VI Consent',
106
+ 'add_new' => 'Add New',
107
+ 'add_new_item' => 'Add New VI Consent',
108
+ 'edit_item' => 'Edit VI Consent',
109
+ 'new_item' => 'New VI Consent',
110
+ 'view_item' => 'View VI Consent',
111
+ 'search_items' => 'Search VI Consent',
112
+ 'not_found' => 'No VI Consent found',
113
+ 'not_found_in_trash' => 'No VI Consent found in Trash',
114
+ 'parent_item_colon' => 'Parent VI Consent:',
115
+ 'menu_name' => 'VI Consent',
116
+ );
117
+
118
+ $args = array(
119
+ 'labels' => $labels,
120
+ 'hierarchical' => false,
121
+ 'description' => 'VI Consent',
122
+ 'supports' => array('title', 'editor'),
123
+ 'public' => false,
124
+ 'show_ui' => true,
125
+ 'show_in_menu' => false,
126
+ 'show_in_nav_menus' => false,
127
+ 'publicly_queryable' => false,
128
+ 'exclude_from_search' => true,
129
+ 'has_archive' => false,
130
+ 'query_var' => false,
131
+ 'can_export' => true,
132
+ 'rewrite' => false,
133
+ 'capability_type' => 'post'
134
+ );
135
+
136
+ register_post_type('viconsent', $args);
137
+ }
138
+
139
+ add_filter('user_can_richedit', 'wp_insert_vi_gdpr_data_user_can_richedit');
140
+ function wp_insert_vi_gdpr_data_user_can_richedit($default) {
141
+ if(get_post_type() === 'viconsent') {
142
+ return false;
143
+ }
144
+ return $default;
145
+ }
146
+ /* End Data Storage */
147
+ ?>
includes/modules/general/videointelligence/images/privacy.png ADDED
Binary file
includes/modules/general/videointelligence/js/gdpr.js ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Begin IAB API V 1.1 Implementation */
2
+ var __vicmp = (function () {
3
+ return typeof (__vicmp) == "function" ? __vicmp : function (c) {
4
+ var b = arguments;
5
+ if (!b.length) {
6
+ return __vicmp.a;
7
+ }
8
+ else if (c == '__vicmp') {
9
+ return false;
10
+ } else {
11
+ if (typeof __vicmp.a === 'undefined') {
12
+ __vicmp.a = [];
13
+ }
14
+ __vicmp.a.push([].slice.apply(b));
15
+ if(typeof __vicmp.execute != 'undefined') {
16
+ __vicmp.execute(b);
17
+ }
18
+ }
19
+ }
20
+ })();
21
+
22
+ function wp_insert_vi_consent_onload_cmp() {
23
+ if(typeof __vicmp.execute === 'undefined') {
24
+ __vicmp.execute = function(b) {
25
+ var data = {};
26
+ if(typeof b != 'undefined') {
27
+ if(b[0] == 'getUserConsentStatus') {
28
+ var ViconsentCookie = wp_insert_vi_consent_popup_get_cookie('Viconsent');
29
+ var gdprStatus = false;
30
+ if(document.getElementById('wp_insert_vi_consent_popup_is_eu').value == '1') {
31
+ gdprStatus = true;
32
+ }
33
+ if(ViconsentCookie != '') {
34
+ var ViconsentCookieData = wp_insert_vi_consent_popup_decode_cookie_content(ViconsentCookie);
35
+ data = {
36
+ gdprApplies: gdprStatus,
37
+ hasGlobalScope: false,
38
+ consent: ViconsentCookieData['PurposeAllowed'][1],
39
+ }
40
+ } else { // Cookie Missing / Corrupted
41
+ data = {
42
+ gdprApplies: gdprStatus,
43
+ hasGlobalScope: false,
44
+ consent: false,
45
+ }
46
+ }
47
+ }
48
+ b[2](data, true);
49
+ }
50
+ };
51
+
52
+ if(__vicmp.a && typeof func === 'undefined') {
53
+ for(var i=0; i<__vicmp.a.length;i++) {
54
+ __vicmp.execute(__vicmp.a[i]);
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ //setTimeout(wp_insert_vi_consent_onload_cmp, 500);
61
+ wp_insert_vi_consent_onload_cmp();
62
+ /* End IAB API V 1.1 Implementation */
63
+
64
+ /* Begin Consent Cookie Implementation */
65
+ function wp_insert_vi_consent_popup_disagree() {
66
+ var cookieData = wp_insert_vi_consent_popup_create_cookie_content('000000000000000000000000');
67
+ wp_insert_vi_consent_popup_set_cookie('Viconsent', cookieData);
68
+
69
+ var ajaxFrame = document.createElement('iframe');
70
+ ajaxFrame.src = document.getElementById('wp_insert_vi_consent_popup_url').value + '?wp_insert_vi_consent=' + document.getElementById('wp_insert_vi_consent_popup_auth').value;
71
+ ajaxFrame.style.display = 'none';
72
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').appendChild(ajaxFrame);
73
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'none';
74
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'none';
75
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'block';
76
+ }
77
+
78
+ function wp_insert_vi_consent_popup_agree() {
79
+ var wp_insert_vi_consent_popup_vendor_list_purposes = document.getElementById('wp_insert_vi_consent_popup_vendor_list_purposes').value;
80
+ var cookieData = wp_insert_vi_consent_popup_create_cookie_content(wp_insert_vi_consent_popup_vendor_list_purposes);
81
+ wp_insert_vi_consent_popup_set_cookie('Viconsent', cookieData);
82
+
83
+ var ajaxFrame = document.createElement('iframe');
84
+ ajaxFrame.src = document.getElementById('wp_insert_vi_consent_popup_url').value + '?wp_insert_vi_consent=' + document.getElementById('wp_insert_vi_consent_popup_auth').value;
85
+ ajaxFrame.style.display = 'none';
86
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').appendChild(ajaxFrame);
87
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'none';
88
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'none';
89
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'block';
90
+ }
91
+
92
+ function wp_insert_vi_consent_popup_create_cookie_content(purposeAllowed) {
93
+ cookieConsentTimeStamp = Math.round((new Date()).getTime()/100);
94
+ var cookieConsent = new Object();
95
+ cookieConsent['Version'] = wp_insert_vi_consent_popup_create_binary_string(1, 6);
96
+ cookieConsent['Created'] = wp_insert_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
97
+ cookieConsent['LastUpdated'] = wp_insert_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
98
+ cookieConsent['CMPId'] = wp_insert_vi_consent_popup_create_binary_string(999, 12);
99
+ cookieConsent['CMPVersion'] = wp_insert_vi_consent_popup_create_binary_string(0, 6);
100
+ cookieConsent['ConsentScreen'] = wp_insert_vi_consent_popup_create_binary_string(0, 6);
101
+ cookieConsent['ConsentLanguage'] = wp_insert_vi_consent_popup_create_binary_string(4, 6)+wp_insert_vi_consent_popup_create_binary_string(13, 6);
102
+ var wp_insert_vi_consent_popup_vendor_list_version = parseInt(document.getElementById('wp_insert_vi_consent_popup_vendor_list_version').value);
103
+ cookieConsent['VendorListVersion'] = wp_insert_vi_consent_popup_create_binary_string(wp_insert_vi_consent_popup_vendor_list_version, 12);
104
+ cookieConsent['PurposeAllowed'] = purposeAllowed;
105
+
106
+ return window.btoa(cookieConsent['Version'] + cookieConsent['Created'] + cookieConsent['LastUpdated'] + cookieConsent['CMPId'] + cookieConsent['CMPVersion'] + cookieConsent['ConsentScreen'] + cookieConsent['ConsentLanguage'] + cookieConsent['VendorListVersion'] + cookieConsent['PurposeAllowed']);
107
+ }
108
+
109
+ function wp_insert_vi_consent_popup_decode_cookie_content(cookieData) {
110
+ if(cookieData != '') {
111
+ var binaryCookieData = atob(cookieData);
112
+ var cookieConsent = new Object();
113
+ cookieConsent['Version'] = parseInt(binaryCookieData.substring(0, 6), 2);
114
+ cookieConsent['Created'] = parseInt(binaryCookieData.substring(6, 42), 2);
115
+ cookieConsent['LastUpdated'] = parseInt(binaryCookieData.substring(42, 78), 2);
116
+ cookieConsent['CMPId'] = parseInt(binaryCookieData.substring(78, 90), 2);
117
+ cookieConsent['CMPVersion'] = parseInt(binaryCookieData.substring(90, 96), 2);
118
+ cookieConsent['ConsentScreen'] = parseInt(binaryCookieData.substring(96, 102), 2);
119
+ cookieConsent['ConsentLanguage'] = parseInt(binaryCookieData.substring(102, 108), 2)+''+parseInt(binaryCookieData.substring(106, 114), 2);
120
+ cookieConsent['VendorListVersion'] = parseInt(binaryCookieData.substring(114,126), 2);
121
+ cookieConsent['PurposeAllowed'] = binaryCookieData.substring(126, 150);
122
+
123
+ var purposeConsents = new Object();
124
+ for(var i = 24; i > 0; i--) {
125
+ if(cookieConsent['PurposeAllowed'].substring(i - 1, i) == '1') {
126
+ purposeConsents[(24 - i) + 1] = true;
127
+ } else {
128
+ purposeConsents[(24 - i) + 1] = false;
129
+ }
130
+ }
131
+ cookieConsent['PurposeAllowed'] = purposeConsents;
132
+ return cookieConsent;
133
+ }
134
+ return false;
135
+ }
136
+
137
+ function wp_insert_vi_consent_popup_create_binary_string(dMask, dBitSize) {
138
+ var bMask = "";
139
+ if(dBitSize <= 32) {
140
+ while(dBitSize--) {
141
+ bMask += (dMask >> dBitSize) & 1;
142
+ }
143
+ } else {
144
+ bMask = dMask.toString(2);
145
+ while (bMask.length < dBitSize) {
146
+ bMask = "0" + bMask;
147
+ }
148
+ }
149
+ return bMask;
150
+ }
151
+
152
+ function wp_insert_vi_consent_popup_set_cookie(name, value) {
153
+ var date = new Date();
154
+ date.setTime(date.getTime() + (365*24*60*60*1000));
155
+ document.cookie = name + "=" + value + ";" + "expires=" + date.toUTCString() + ";path=/";
156
+ }
157
+
158
+ function wp_insert_vi_consent_popup_get_cookie(cookieName) {
159
+ var name = cookieName + "=";
160
+ var decodedCookie = decodeURIComponent(document.cookie);
161
+ var ca = decodedCookie.split(';');
162
+ for(var i = 0; i <ca.length; i++) {
163
+ var c = ca[i];
164
+ while (c.charAt(0) == ' ') {
165
+ c = c.substring(1);
166
+ }
167
+ if (c.indexOf(name) == 0) {
168
+ return c.substring(name.length, c.length);
169
+ }
170
+ }
171
+ return "";
172
+ }
173
+
174
+ function wp_insert_vi_consent_popup_settings() {
175
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'block';
176
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'block';
177
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'none';
178
+ }
179
+
180
+ function wp_insert_vi_consent_popup_load() {
181
+ if(document.getElementById('wp_insert_vi_consent_popup_is_eu').value == true) {
182
+ if(wp_insert_vi_consent_popup_get_cookie('Viconsent') == false) {
183
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'block';
184
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'block';
185
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'none';
186
+ } else {
187
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'none';
188
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'none';
189
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'block';
190
+ }
191
+ } else {
192
+ document.getElementById('wp_insert_vi_consent_popup_wrapper').style.display = 'none';
193
+ document.getElementById('wp_insert_vi_consent_popup_overlay').style.display = 'none';
194
+ document.getElementById('wp_insert_vi_consent_popup_settings_button').style.display = 'none';
195
+ }
196
+ }
197
+ setTimeout(wp_insert_vi_consent_popup_load, 500);
198
+ /* End Consent Cookie Implementation */
includes/modules/general/videointelligence/js/module.js CHANGED
@@ -140,9 +140,7 @@ function wp_insert_vi_customize_adcode() {
140
  var wp_insert_vi_code_settings_native_text_color = jQuery('#wp_insert_vi_code_settings_native_text_color').val();
141
  var wp_insert_vi_code_settings_font_family = jQuery('#wp_insert_vi_code_settings_font_family').val();
142
  var wp_insert_vi_code_settings_font_size = jQuery('#wp_insert_vi_code_settings_font_size').val();
143
- var wp_insert_vi_code_settings_optional_1 = jQuery('#wp_insert_vi_code_settings_optional_1').val();
144
- var wp_insert_vi_code_settings_optional_2 = jQuery('#wp_insert_vi_code_settings_optional_2').val();
145
- var wp_insert_vi_code_settings_optional_3 = jQuery('#wp_insert_vi_code_settings_optional_3').val();
146
  jQuery('.ui-dialog-content').html('<div class="wp_insert_ajaxloader"></div>');
147
  jQuery('.wp_insert_ajaxloader').show();
148
  jQuery.post(
@@ -158,9 +156,7 @@ function wp_insert_vi_customize_adcode() {
158
  'wp_insert_vi_code_settings_native_text_color': wp_insert_vi_code_settings_native_text_color,
159
  'wp_insert_vi_code_settings_font_family': wp_insert_vi_code_settings_font_family,
160
  'wp_insert_vi_code_settings_font_size': wp_insert_vi_code_settings_font_size,
161
- 'wp_insert_vi_code_settings_optional_1': wp_insert_vi_code_settings_optional_1,
162
- 'wp_insert_vi_code_settings_optional_2': wp_insert_vi_code_settings_optional_2,
163
- 'wp_insert_vi_code_settings_optional_3': wp_insert_vi_code_settings_optional_3,
164
  }, function(response) {
165
  if(response.indexOf('###SUCCESS###') !== -1) {
166
  jQuery('.ui-dialog-titlebar').find('button').last().button('enable').click();
140
  var wp_insert_vi_code_settings_native_text_color = jQuery('#wp_insert_vi_code_settings_native_text_color').val();
141
  var wp_insert_vi_code_settings_font_family = jQuery('#wp_insert_vi_code_settings_font_family').val();
142
  var wp_insert_vi_code_settings_font_size = jQuery('#wp_insert_vi_code_settings_font_size').val();
143
+ var wp_insert_vi_code_settings_show_gdpr_authorization = jQuery('#wp_insert_vi_code_settings_show_gdpr_authorization').prop('checked');
 
 
144
  jQuery('.ui-dialog-content').html('<div class="wp_insert_ajaxloader"></div>');
145
  jQuery('.wp_insert_ajaxloader').show();
146
  jQuery.post(
156
  'wp_insert_vi_code_settings_native_text_color': wp_insert_vi_code_settings_native_text_color,
157
  'wp_insert_vi_code_settings_font_family': wp_insert_vi_code_settings_font_family,
158
  'wp_insert_vi_code_settings_font_size': wp_insert_vi_code_settings_font_size,
159
+ 'wp_insert_vi_code_settings_show_gdpr_authorization': wp_insert_vi_code_settings_show_gdpr_authorization,
 
 
160
  }, function(response) {
161
  if(response.indexOf('###SUCCESS###') !== -1) {
162
  jQuery('.ui-dialog-titlebar').find('button').last().button('enable').click();
includes/modules/general/videointelligence/module.php CHANGED
@@ -2,6 +2,7 @@
2
  require_once(dirname(__FILE__).'/functions.php');
3
  require_once(dirname(__FILE__).'/api/vi.php');
4
  require_once(dirname(__FILE__).'/vi-constants.php');
 
5
 
6
  /* Begin Add Assets */
7
  add_action('wp_insert_modules_css', 'wp_insert_module_vi_css', 0);
@@ -103,7 +104,7 @@ function wp_insert_vi_get_chart() {
103
  echo '</div>';
104
  echo '<div class="clear"></div>';
105
  } else {
106
- echo '<p class="viError">There was an error processing your request, our team was notified.<br />Please try again later.</p>';
107
  echo '<div id="wp_insert_vi_earnings_wrapper">';
108
  echo '<div id="wp_insert_vi_earnings">';
109
  echo '<span id="wp_insert_vi_earnings_label">Total Earnings</span>';
2
  require_once(dirname(__FILE__).'/functions.php');
3
  require_once(dirname(__FILE__).'/api/vi.php');
4
  require_once(dirname(__FILE__).'/vi-constants.php');
5
+ require_once(dirname(__FILE__).'/gdpr.php');
6
 
7
  /* Begin Add Assets */
8
  add_action('wp_insert_modules_css', 'wp_insert_module_vi_css', 0);
104
  echo '</div>';
105
  echo '<div class="clear"></div>';
106
  } else {
107
+ echo '<p class="viError">There was an error processing your request, our team was notified. Try clearing your browser cache, log out and log in again.</p>';
108
  echo '<div id="wp_insert_vi_earnings_wrapper">';
109
  echo '<div id="wp_insert_vi_earnings">';
110
  echo '<span id="wp_insert_vi_earnings_label">Total Earnings</span>';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Namith Jawahar
3
  Tags: google adsense, adsense, google ads, google analytics, privacy policy, best adsense plugin, ad management, ad rotation, tracking codes
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
- Tested up to: 4.9.4
7
- Stable tag: 2.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,7 +19,7 @@ Wp-Insert is the most powerful yet easiest to use wordpress ad management / ad i
19
 
20
  * Adsense Optimized
21
  * Builtin support for Google Page-Level Ads
22
- * Builtin support for Google Adsense Auto Ads
23
  * Unlimited Adblocks (No restrictions placed on you)
24
  * Insert Ad Above, Below, To the Left and Right of Page or Post Content
25
  * Insert Ad in the Middle of Page/Post Content with intelligent midpoint detection algorithms
@@ -31,6 +31,7 @@ Wp-Insert is the most powerful yet easiest to use wordpress ad management / ad i
31
  * Hide ads for Loggedin users
32
  * Hide ads for Mobile users
33
  * Builtin support for AMP plugin by Automattic
 
34
  * Hide ads on specific pages
35
  * Insert Ads directly into the theme files with control over when and where to display Ads
36
  * Insert Google Analytics, Facebook trackng pixel or any other tracking Code easily
@@ -82,4 +83,24 @@ Wp-Insert is the most powerful yet easiest to use wordpress ad management / ad i
82
  == Frequently Asked Questions ==
83
  <a href="http://wp-insert.smartlogix.co.in/" title="The Ultimate Adsense / Ad-Management Plugin for Wordpress">Wp-Insert Tutorial and Support Website</a>
84
 
85
- <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">Wp-Insert Developers</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Tags: google adsense, adsense, google ads, google analytics, privacy policy, best adsense plugin, ad management, ad rotation, tracking codes
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
+ Tested up to: 4.9.6
7
+ Stable tag: 2.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
19
 
20
  * Adsense Optimized
21
  * Builtin support for Google Page-Level Ads
22
+ * Builtin support for Google Adsnese Auto Ads
23
  * Unlimited Adblocks (No restrictions placed on you)
24
  * Insert Ad Above, Below, To the Left and Right of Page or Post Content
25
  * Insert Ad in the Middle of Page/Post Content with intelligent midpoint detection algorithms
31
  * Hide ads for Loggedin users
32
  * Hide ads for Mobile users
33
  * Builtin support for AMP plugin by Automattic
34
+ * Woocommerce aware
35
  * Hide ads on specific pages
36
  * Insert Ads directly into the theme files with control over when and where to display Ads
37
  * Insert Google Analytics, Facebook trackng pixel or any other tracking Code easily
83
  == Frequently Asked Questions ==
84
  <a href="http://wp-insert.smartlogix.co.in/" title="The Ultimate Adsense / Ad-Management Plugin for Wordpress">Wp-Insert Tutorial and Support Website</a>
85
 
86
+ <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">Wp-Insert Developers</a>
87
+
88
+ == Privacy Policy ==
89
+
90
+ Users privacy is very important to us and we make extra effort not to collect data about the users to the maximum extend possible.
91
+ However to provide enhanced functionality we utilize the APIs from different third party services as listed below and the usage of those API are in accordance with their privacy policies.
92
+
93
+ = Geo Targeting =
94
+
95
+ To enable Geo Targeting functionality for Ads we have to send the visitor IP address to a third party service (http://freegeoip.net/ OR https://ipstack.com/) and the usage of thier API is in accordance to their privacy policy located at https://ipstack.com/privacy/.
96
+ This third party API is utilized only when you enable or use Geo Targetting features in the plugin admin.
97
+
98
+ = video intelligence =
99
+
100
+ The plugin provides deep integration with video intelligence to provide enhanced features and for easy integration with their services.
101
+ This third party API and features are utilized only when you enable or use video inteligence related features in the plugin admin and the usage of thier API and features are in accordance to their privacy policy.
102
+
103
+ video intelligence ("vi") as a third party, needs to process the user's technical data such as cookie ID, IP Address, Geo-Location and Device ID to personalize content and advertising and analyse our traffic.
104
+ You can find below a link vi's Legal webpage where there are transparently presented all GDPR relevant information.
105
+ Please access the link to check vi's Privacy Policy, Terms&Conditions pages, Opt Out Mechanism, Vendor and Purposes lists.
106
+ https://www.vi.ai/legals/
wp-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
6
- Version: 2.4.1
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
@@ -38,4 +38,6 @@ if(!defined('WP_INSERT_DEBUG'))
38
 
39
  require_once(dirname(__FILE__).'/includes/modules/core/modules.php');
40
  require_once(dirname(__FILE__).'/includes/modules/general/modules.php');
 
 
41
  ?>
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
6
+ Version: 2.4.2
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
38
 
39
  require_once(dirname(__FILE__).'/includes/modules/core/modules.php');
40
  require_once(dirname(__FILE__).'/includes/modules/general/modules.php');
41
+
42
+ register_activation_hook(__FILE__, 'wp_insert_vi_api_reset_settings');
43
  ?>