Changeset 2688771
- Timestamp:
- 03/04/2022 09:34:11 AM (4 years ago)
- Location:
- addefend-easy-integration
- Files:
-
- 4 added
- 6 edited
- 10 copied
-
tags/1.10/Components/proxy_internal_forwarding.php (added)
-
tags/1.11 (added)
-
tags/1.11/Components (copied) (copied from addefend-easy-integration/trunk/Components)
-
tags/1.11/Components/proxy_integration.php (copied) (copied from addefend-easy-integration/trunk/Components/proxy_integration.php)
-
tags/1.11/Components/proxy_internal_forwarding.php (added)
-
tags/1.11/Components/script_integration.php (modified) (1 diff)
-
tags/1.11/Utils (copied) (copied from addefend-easy-integration/trunk/Utils)
-
tags/1.11/Utils/misc.php (copied) (copied from addefend-easy-integration/trunk/Utils/misc.php) (1 diff)
-
tags/1.11/View (copied) (copied from addefend-easy-integration/trunk/View)
-
tags/1.11/View/options.php (copied) (copied from addefend-easy-integration/trunk/View/options.php) (9 diffs)
-
tags/1.11/addefend-easy-integration.php (copied) (copied from addefend-easy-integration/trunk/addefend-easy-integration.php) (1 diff)
-
tags/1.11/assets (copied) (copied from addefend-easy-integration/trunk/assets)
-
tags/1.11/license.txt (copied) (copied from addefend-easy-integration/trunk/license.txt)
-
tags/1.11/readme.txt (copied) (copied from addefend-easy-integration/trunk/readme.txt) (2 diffs)
-
trunk/Components/proxy_internal_forwarding.php (added)
-
trunk/Components/script_integration.php (modified) (1 diff)
-
trunk/Utils/misc.php (modified) (1 diff)
-
trunk/View/options.php (modified) (9 diffs)
-
trunk/addefend-easy-integration.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
addefend-easy-integration/tags/1.11/Components/script_integration.php
r2229158 r2688771 76 76 } 77 77 78 function addefend_script_is_cached() { 79 global $wpdb; 80 $addefend_script = $wpdb->get_var('SELECT script FROM '.ADDEFEND_TABLE_NAME.' WHERE (id = \'1\')'); 81 if ($addefend_script) { 82 return true; 83 } 84 return false; 85 } 86 78 87 // clean up the database from all addefend content 79 88 register_deactivation_hook(ADDEFEND_PLUGIN_PHP_FILE, 'addefend_cleanup'); -
addefend-easy-integration/tags/1.11/Utils/misc.php
r2685023 r2688771 122 122 if (substr($key, 0, 5) == "HTTP_") { 123 123 $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", "", substr($key, 5))))); 124 $out[$key] = $value; 124 125 } 125 $out[$key] = $value;126 126 } 127 127 return $out; -
addefend-easy-integration/tags/1.11/View/options.php
r2685023 r2688771 19 19 } 20 20 21 $contentProxy = get_option( 'addefend_content_proxy', 'apache'); 21 22 $scriptUrl = get_option( 'addefend_script_URL' , '' ); 22 23 $proxyUrl = get_option( 'addefend_proxy_URL' , '' ); 23 $ imageDir = get_option( 'addefend_image_dir' , '/wp-content' );24 $ contentProxy = get_option( 'addefend_content_proxy', 'apache');24 $testUrl = get_option( 'addefend_test_URL' , '' ); 25 $imageDir = get_option( 'addefend_image_dir' , ADDEFEND_DEFAULT_IMAGE_DIRECTORY ); 25 26 26 27 if (isset($_POST[ 'submitted' ]) && $_POST[ 'submitted' ] == 'config_form') { … … 30 31 exit; // Get out of here, the nonce is rotten! 31 32 } 32 $contentProxyType = $_POST['selected_content_proxy']; 33 34 $contentProxy = $_POST['selected_content_proxy']; 33 35 $scriptUrl = esc_url($_POST['script_URL']); 34 36 $proxyUrl = esc_url($_POST['proxy_URL']); 37 $testUrl = $_POST['test_URL']; 35 38 $imageDir = $_POST['image_dir']; 36 $validScriptUrl = true;37 $validProxyUrl = true;38 39 39 40 // always save the new input 41 update_option("addefend_content_proxy", $contentProxy); 40 42 update_option('addefend_script_URL', $scriptUrl); 41 43 update_option('addefend_proxy_URL', $proxyUrl); 42 if ($imageDir === '') { 43 $imageDir = ADDEFEND_DEFAULT_IMAGE_DIRECTORY; 44 } 44 update_option('addefend_test_URL', $testUrl); 45 45 update_option('addefend_image_dir', $imageDir); 46 46 47 if (wp_remote_retrieve_response_code(wp_remote_get($scriptUrl)) == 404) { 48 $validScriptUrl = False; 47 $addefend_script_is_cached = addefend_script_is_cached(); 48 $validScriptUrl = wp_remote_retrieve_response_code(wp_remote_get($scriptUrl)) == 200; 49 if ($validScriptUrl) { 50 if (!$addefend_script_is_cached) { 51 download_addefend_script(); 52 } 53 } else { 54 if ($addefend_script_is_cached) { 55 addefend_cleanup(); 56 } 49 57 echo '<div class="error"><p><strong>Script URL is invalid</strong></p></div>'; 50 58 } 51 if (!preg_match('/.*:\/\/.*\..*\/.*\/.*\/.*\/.*/', $proxyUrl)) { 52 $validProxyUrl = False; 59 60 $htaccess = ABSPATH . '.htaccess'; 61 $addefend_rules = addefend_extract_from_markers($htaccess, ADDEFEND_HTACCESS_MARKER ); 62 $addefend_rules_added = sizeof($addefend_rules) > 5; 63 $validProxyUrl = preg_match('/.*:\/\/.*\..*\/.*\/.*\/.*\/.*/', $proxyUrl); 64 if ($validProxyUrl) { 65 if ($contentProxy === 'apache') { 66 if (!$addefend_rules_added) { 67 addefend_insert_rules(); 68 } 69 } elseif ($addefend_rules_added) { 70 addefend_remove_rules(); 71 } 72 echo '<div class="updated"><p><strong>Settings saved for: ' . $contentProxy . '</strong></p></div>'; 73 } else { 74 if ($addefend_rules_added) { 75 addefend_remove_rules(); 76 } 53 77 echo '<div class="error"><p><strong>Proxy URL is invalid</strong></p></div>'; 54 addefend_remove_rules();55 }56 if ($validProxyUrl && $validScriptUrl) {57 download_addefend_script();58 addefend_insert_rules();59 echo '<div class="updated"><p><strong>Settings saved for: '.$contentProxyType.'</strong></p></div>';60 78 } 61 79 } 62 if (isset($_POST["selected_content_proxy"])) {63 $newContentProxy = $_POST["selected_content_proxy"];64 update_option("addefend_content_proxy", $newContentProxy);65 $contentProxy = $newContentProxy;66 }67 80 ?> 68 81 69 82 <h1>AdDefend Integration Parameters</h1> 70 <p>71 <form method="post" action="">72 <label for="select_content_proxy">Content-Proxy:</label>73 <select id="select_content_proxy" name="selected_content_proxy" onchange="this.form.submit()">74 <option value="apache" <?= $contentProxy == "apache" ? "selected": "" ?>>Apache</option>75 <option value="intern" <?= $contentProxy == "intern" ? "selected": "" ?>>Internal Proxy</option>76 </select>77 </form>78 </p>79 80 83 <form method="post" action=""> 81 84 <?= wp_nonce_field("submit_addefend_integration_parameters" ) ?> … … 88 91 .addefend_table li {list-style-type: none;} 89 92 .addefend_table td > div {height : 20px; width : 140px;} 93 .addefend_table td > :not(:first-child) {margin-top: 10px !important;} 90 94 .addefend_table td > div > p {text-align: center; color: white; font-weight: bold;} 91 95 .addefend_table td > label {font-weight: bold;} … … 93 97 </style> 94 98 <table class="addefend_table"> 99 <!-- Content-proxy type --> 100 <tr> 101 <td> 102 <label for="select_content_proxy">Content-Proxy:</label> 103 </td> 104 <td> 105 <select id="select_content_proxy" name="selected_content_proxy"> 106 <option value="apache" <?= $contentProxy == "apache" ? "selected": "" ?>>Apache</option> 107 <option value="intern" <?= $contentProxy == "intern" ? "selected": "" ?>>Internal Proxy</option> 108 </select> 109 </td> 110 </tr> 95 111 <!-- Script URL --> 96 112 <tr> … … 110 126 <input type="text" id="proxy_URL_field_id" name="proxy_URL" value="<?= esc_attr($proxyUrl) ?>" size="70"> 111 127 </td> 128 </tr> 129 <!-- Test URL --> 130 <tr> 131 <td> 132 <label for="test_URL_field_id">Test URL: </label> 133 </td> 134 <td> 135 <input type="text" id="test_URL_field_id" name="test_URL" value="<?= esc_attr($testUrl) ?>" size="70"> 136 <?php if (strlen($testUrl) > 0): ?> 137 <?php 138 $adDefendIsReached = false; 139 $opts = array( 140 'http' => array( 141 'timeout' => 5, 142 'ignore_errors' => true 143 ) 144 ); 145 $context = stream_context_create($opts); 146 $testUrlResponseBody = @file_get_contents($testUrl, false, $context); 147 foreach ($http_response_header as $header) { 148 if (strpos($header, 'AdDefend') !== false) { 149 $adDefendIsReached = true; 150 break; 151 } 152 } 153 ?> 154 <?php if ($adDefendIsReached): ?> 155 <div style="background-color: green;"> 156 <p>Working</p> 157 </div> 158 <?php else: ?> 159 <div style="background-color: red;"> 160 <p>Not working</p> 161 </div> 162 <?php endif; ?> 163 <?php else: ?> 164 <?php 165 $adDefendIsReached = false; 166 $testUrlResponseBody = ''; 167 ?> 168 <?php endif; ?> 169 </td> 170 <?php if ($adDefendIsReached && isset($testUrlResponseBody) && strlen($testUrlResponseBody) > 0): ?> 171 <td> 172 <script> 173 var testUrlResponseBody; 174 try { 175 testUrlResponseBody = `<?= $testUrlResponseBody ?>`; 176 } catch (err) { 177 testUrlResponseBody = ''; 178 } 179 </script> 180 <button type="button" class="button-secondary" onclick="navigator.clipboard.writeText(testUrlResponseBody)">Copy response</button> 181 </td> 182 <?php endif; ?> 112 183 </tr> 113 184 <!-- Image Directory --> … … 246 317 <td> 247 318 <?php 248 $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') ;319 $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') !== false; 249 320 ?> 250 321 <?php if ($isInternalRedirectActionRegistered): ?> … … 270 341 </td> 271 342 <td> 272 <input type="text" id="example_ url_publisher" value="" size="70" readonly>343 <input type="text" id="example_content-proxy_url" value="" size="70" readonly> 273 344 </td> 274 345 </tr> … … 278 349 </td> 279 350 <td> 280 <input type="text" id="example_ url_forwarded" value="" size="70" readonly>351 <input type="text" id="example_proxy_url" value="" size="70" readonly> 281 352 </td> 282 353 </tr> … … 284 355 <?php endif; ?> 285 356 <p class="submit"> 286 <input type="submit" name="Submit" class="button-primary" value=" Save Changes">357 <input type="submit" name="Submit" class="button-primary" value="Apply"> 287 358 </p> 288 359 </form> 289 360 <script> 290 361 window.addEventListener("DOMContentLoaded", function() { 291 if (document.querySelector("input[name=selected_content_proxy]").value !== "intern") return; 292 293 var exampleUrlPublisherElement = document.querySelector("#example_url_publisher"); 294 var exampleUrlProxiedElement = document.querySelector("#example_url_forwarded"); 362 var selectedContentProxy = document.querySelector("input[name=selected_content_proxy]"); 363 if (!selectedContentProxy || selectedContentProxy.value !== "intern") { 364 return; 365 } 366 367 var exampleContentProxyUrlElement = document.querySelector("#example_content-proxy_url"); 368 var exampleProxyUrlElement = document.querySelector("#example_proxy_url"); 295 369 var proxyUrlElement = document.querySelector("#proxy_URL_field_id"); 296 370 var imagesDirectoryElement = document.querySelector("#image_dir_id"); 297 298 var exampleUrlPublisher = "", exampleUrlProxied = ""; 299 exampleUrlPublisher = location.protocol + "//" + location.host + imagesDirectoryElement.value + "/example/file.jpg"; 300 301 exampleUrlPublisherElement.value = exampleUrlPublisher; 302 exampleUrlProxiedElement.value = proxyUrlElement.value + imagesDirectoryElement.value + "/example/file.jpg"; 371 if (!exampleContentProxyUrlElement || !exampleProxyUrlElement || !proxyUrlElement || !imagesDirectoryElement) { 372 return; 373 } 374 375 var relativeProxyPath = imagesDirectoryElement.value + "/example/file.jpg"; 376 var contentProxyURL = location.protocol + "//" + location.host + relativeProxyPath; 377 var proxyURL = proxyUrlElement.value + relativeProxyPath; 378 379 exampleContentProxyUrlElement.value = contentProxyURL; 380 exampleProxyUrlElement.value = proxyURL; 303 381 }); 304 382 </script> -
addefend-easy-integration/tags/1.11/addefend-easy-integration.php
r2685023 r2688771 4 4 Plugin URI: https://wordpress.org/plugins/addefend-easy-integration/ 5 5 Description: The AdDefend Easy Intregration plug-in supports publishers in integrating the AdDefend anti-adblock solution. 6 Version: 1.1 06 Version: 1.11 7 7 Author: AdDefend GmbH 8 8 Author URI: https://www.addefend.com/ -
addefend-easy-integration/tags/1.11/readme.txt
r2685023 r2688771 4 4 Requires at least: 4.2 5 5 Tested up to: 5.9 6 Stable tag: 1.1 06 Stable tag: 1.11 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl.html … … 52 52 == Changelog == 53 53 54 = 1.11 = 55 * internal proxy bugfixes 56 * implemented a test request 57 54 58 = 1.10 = 55 59 * content-proxy should now work on any server -
addefend-easy-integration/trunk/Components/script_integration.php
r2229158 r2688771 76 76 } 77 77 78 function addefend_script_is_cached() { 79 global $wpdb; 80 $addefend_script = $wpdb->get_var('SELECT script FROM '.ADDEFEND_TABLE_NAME.' WHERE (id = \'1\')'); 81 if ($addefend_script) { 82 return true; 83 } 84 return false; 85 } 86 78 87 // clean up the database from all addefend content 79 88 register_deactivation_hook(ADDEFEND_PLUGIN_PHP_FILE, 'addefend_cleanup'); -
addefend-easy-integration/trunk/Utils/misc.php
r2685023 r2688771 122 122 if (substr($key, 0, 5) == "HTTP_") { 123 123 $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", "", substr($key, 5))))); 124 $out[$key] = $value; 124 125 } 125 $out[$key] = $value;126 126 } 127 127 return $out; -
addefend-easy-integration/trunk/View/options.php
r2685023 r2688771 19 19 } 20 20 21 $contentProxy = get_option( 'addefend_content_proxy', 'apache'); 21 22 $scriptUrl = get_option( 'addefend_script_URL' , '' ); 22 23 $proxyUrl = get_option( 'addefend_proxy_URL' , '' ); 23 $ imageDir = get_option( 'addefend_image_dir' , '/wp-content' );24 $ contentProxy = get_option( 'addefend_content_proxy', 'apache');24 $testUrl = get_option( 'addefend_test_URL' , '' ); 25 $imageDir = get_option( 'addefend_image_dir' , ADDEFEND_DEFAULT_IMAGE_DIRECTORY ); 25 26 26 27 if (isset($_POST[ 'submitted' ]) && $_POST[ 'submitted' ] == 'config_form') { … … 30 31 exit; // Get out of here, the nonce is rotten! 31 32 } 32 $contentProxyType = $_POST['selected_content_proxy']; 33 34 $contentProxy = $_POST['selected_content_proxy']; 33 35 $scriptUrl = esc_url($_POST['script_URL']); 34 36 $proxyUrl = esc_url($_POST['proxy_URL']); 37 $testUrl = $_POST['test_URL']; 35 38 $imageDir = $_POST['image_dir']; 36 $validScriptUrl = true;37 $validProxyUrl = true;38 39 39 40 // always save the new input 41 update_option("addefend_content_proxy", $contentProxy); 40 42 update_option('addefend_script_URL', $scriptUrl); 41 43 update_option('addefend_proxy_URL', $proxyUrl); 42 if ($imageDir === '') { 43 $imageDir = ADDEFEND_DEFAULT_IMAGE_DIRECTORY; 44 } 44 update_option('addefend_test_URL', $testUrl); 45 45 update_option('addefend_image_dir', $imageDir); 46 46 47 if (wp_remote_retrieve_response_code(wp_remote_get($scriptUrl)) == 404) { 48 $validScriptUrl = False; 47 $addefend_script_is_cached = addefend_script_is_cached(); 48 $validScriptUrl = wp_remote_retrieve_response_code(wp_remote_get($scriptUrl)) == 200; 49 if ($validScriptUrl) { 50 if (!$addefend_script_is_cached) { 51 download_addefend_script(); 52 } 53 } else { 54 if ($addefend_script_is_cached) { 55 addefend_cleanup(); 56 } 49 57 echo '<div class="error"><p><strong>Script URL is invalid</strong></p></div>'; 50 58 } 51 if (!preg_match('/.*:\/\/.*\..*\/.*\/.*\/.*\/.*/', $proxyUrl)) { 52 $validProxyUrl = False; 59 60 $htaccess = ABSPATH . '.htaccess'; 61 $addefend_rules = addefend_extract_from_markers($htaccess, ADDEFEND_HTACCESS_MARKER ); 62 $addefend_rules_added = sizeof($addefend_rules) > 5; 63 $validProxyUrl = preg_match('/.*:\/\/.*\..*\/.*\/.*\/.*\/.*/', $proxyUrl); 64 if ($validProxyUrl) { 65 if ($contentProxy === 'apache') { 66 if (!$addefend_rules_added) { 67 addefend_insert_rules(); 68 } 69 } elseif ($addefend_rules_added) { 70 addefend_remove_rules(); 71 } 72 echo '<div class="updated"><p><strong>Settings saved for: ' . $contentProxy . '</strong></p></div>'; 73 } else { 74 if ($addefend_rules_added) { 75 addefend_remove_rules(); 76 } 53 77 echo '<div class="error"><p><strong>Proxy URL is invalid</strong></p></div>'; 54 addefend_remove_rules();55 }56 if ($validProxyUrl && $validScriptUrl) {57 download_addefend_script();58 addefend_insert_rules();59 echo '<div class="updated"><p><strong>Settings saved for: '.$contentProxyType.'</strong></p></div>';60 78 } 61 79 } 62 if (isset($_POST["selected_content_proxy"])) {63 $newContentProxy = $_POST["selected_content_proxy"];64 update_option("addefend_content_proxy", $newContentProxy);65 $contentProxy = $newContentProxy;66 }67 80 ?> 68 81 69 82 <h1>AdDefend Integration Parameters</h1> 70 <p>71 <form method="post" action="">72 <label for="select_content_proxy">Content-Proxy:</label>73 <select id="select_content_proxy" name="selected_content_proxy" onchange="this.form.submit()">74 <option value="apache" <?= $contentProxy == "apache" ? "selected": "" ?>>Apache</option>75 <option value="intern" <?= $contentProxy == "intern" ? "selected": "" ?>>Internal Proxy</option>76 </select>77 </form>78 </p>79 80 83 <form method="post" action=""> 81 84 <?= wp_nonce_field("submit_addefend_integration_parameters" ) ?> … … 88 91 .addefend_table li {list-style-type: none;} 89 92 .addefend_table td > div {height : 20px; width : 140px;} 93 .addefend_table td > :not(:first-child) {margin-top: 10px !important;} 90 94 .addefend_table td > div > p {text-align: center; color: white; font-weight: bold;} 91 95 .addefend_table td > label {font-weight: bold;} … … 93 97 </style> 94 98 <table class="addefend_table"> 99 <!-- Content-proxy type --> 100 <tr> 101 <td> 102 <label for="select_content_proxy">Content-Proxy:</label> 103 </td> 104 <td> 105 <select id="select_content_proxy" name="selected_content_proxy"> 106 <option value="apache" <?= $contentProxy == "apache" ? "selected": "" ?>>Apache</option> 107 <option value="intern" <?= $contentProxy == "intern" ? "selected": "" ?>>Internal Proxy</option> 108 </select> 109 </td> 110 </tr> 95 111 <!-- Script URL --> 96 112 <tr> … … 110 126 <input type="text" id="proxy_URL_field_id" name="proxy_URL" value="<?= esc_attr($proxyUrl) ?>" size="70"> 111 127 </td> 128 </tr> 129 <!-- Test URL --> 130 <tr> 131 <td> 132 <label for="test_URL_field_id">Test URL: </label> 133 </td> 134 <td> 135 <input type="text" id="test_URL_field_id" name="test_URL" value="<?= esc_attr($testUrl) ?>" size="70"> 136 <?php if (strlen($testUrl) > 0): ?> 137 <?php 138 $adDefendIsReached = false; 139 $opts = array( 140 'http' => array( 141 'timeout' => 5, 142 'ignore_errors' => true 143 ) 144 ); 145 $context = stream_context_create($opts); 146 $testUrlResponseBody = @file_get_contents($testUrl, false, $context); 147 foreach ($http_response_header as $header) { 148 if (strpos($header, 'AdDefend') !== false) { 149 $adDefendIsReached = true; 150 break; 151 } 152 } 153 ?> 154 <?php if ($adDefendIsReached): ?> 155 <div style="background-color: green;"> 156 <p>Working</p> 157 </div> 158 <?php else: ?> 159 <div style="background-color: red;"> 160 <p>Not working</p> 161 </div> 162 <?php endif; ?> 163 <?php else: ?> 164 <?php 165 $adDefendIsReached = false; 166 $testUrlResponseBody = ''; 167 ?> 168 <?php endif; ?> 169 </td> 170 <?php if ($adDefendIsReached && isset($testUrlResponseBody) && strlen($testUrlResponseBody) > 0): ?> 171 <td> 172 <script> 173 var testUrlResponseBody; 174 try { 175 testUrlResponseBody = `<?= $testUrlResponseBody ?>`; 176 } catch (err) { 177 testUrlResponseBody = ''; 178 } 179 </script> 180 <button type="button" class="button-secondary" onclick="navigator.clipboard.writeText(testUrlResponseBody)">Copy response</button> 181 </td> 182 <?php endif; ?> 112 183 </tr> 113 184 <!-- Image Directory --> … … 246 317 <td> 247 318 <?php 248 $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') ;319 $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') !== false; 249 320 ?> 250 321 <?php if ($isInternalRedirectActionRegistered): ?> … … 270 341 </td> 271 342 <td> 272 <input type="text" id="example_ url_publisher" value="" size="70" readonly>343 <input type="text" id="example_content-proxy_url" value="" size="70" readonly> 273 344 </td> 274 345 </tr> … … 278 349 </td> 279 350 <td> 280 <input type="text" id="example_ url_forwarded" value="" size="70" readonly>351 <input type="text" id="example_proxy_url" value="" size="70" readonly> 281 352 </td> 282 353 </tr> … … 284 355 <?php endif; ?> 285 356 <p class="submit"> 286 <input type="submit" name="Submit" class="button-primary" value=" Save Changes">357 <input type="submit" name="Submit" class="button-primary" value="Apply"> 287 358 </p> 288 359 </form> 289 360 <script> 290 361 window.addEventListener("DOMContentLoaded", function() { 291 if (document.querySelector("input[name=selected_content_proxy]").value !== "intern") return; 292 293 var exampleUrlPublisherElement = document.querySelector("#example_url_publisher"); 294 var exampleUrlProxiedElement = document.querySelector("#example_url_forwarded"); 362 var selectedContentProxy = document.querySelector("input[name=selected_content_proxy]"); 363 if (!selectedContentProxy || selectedContentProxy.value !== "intern") { 364 return; 365 } 366 367 var exampleContentProxyUrlElement = document.querySelector("#example_content-proxy_url"); 368 var exampleProxyUrlElement = document.querySelector("#example_proxy_url"); 295 369 var proxyUrlElement = document.querySelector("#proxy_URL_field_id"); 296 370 var imagesDirectoryElement = document.querySelector("#image_dir_id"); 297 298 var exampleUrlPublisher = "", exampleUrlProxied = ""; 299 exampleUrlPublisher = location.protocol + "//" + location.host + imagesDirectoryElement.value + "/example/file.jpg"; 300 301 exampleUrlPublisherElement.value = exampleUrlPublisher; 302 exampleUrlProxiedElement.value = proxyUrlElement.value + imagesDirectoryElement.value + "/example/file.jpg"; 371 if (!exampleContentProxyUrlElement || !exampleProxyUrlElement || !proxyUrlElement || !imagesDirectoryElement) { 372 return; 373 } 374 375 var relativeProxyPath = imagesDirectoryElement.value + "/example/file.jpg"; 376 var contentProxyURL = location.protocol + "//" + location.host + relativeProxyPath; 377 var proxyURL = proxyUrlElement.value + relativeProxyPath; 378 379 exampleContentProxyUrlElement.value = contentProxyURL; 380 exampleProxyUrlElement.value = proxyURL; 303 381 }); 304 382 </script> -
addefend-easy-integration/trunk/addefend-easy-integration.php
r2685023 r2688771 4 4 Plugin URI: https://wordpress.org/plugins/addefend-easy-integration/ 5 5 Description: The AdDefend Easy Intregration plug-in supports publishers in integrating the AdDefend anti-adblock solution. 6 Version: 1.1 06 Version: 1.11 7 7 Author: AdDefend GmbH 8 8 Author URI: https://www.addefend.com/ -
addefend-easy-integration/trunk/readme.txt
r2685023 r2688771 4 4 Requires at least: 4.2 5 5 Tested up to: 5.9 6 Stable tag: 1.1 06 Stable tag: 1.11 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl.html … … 52 52 == Changelog == 53 53 54 = 1.11 = 55 * internal proxy bugfixes 56 * implemented a test request 57 54 58 = 1.10 = 55 59 * content-proxy should now work on any server
Note: See TracChangeset
for help on using the changeset viewer.