Plugin Directory

Changeset 2688771


Ignore:
Timestamp:
03/04/2022 09:34:11 AM (4 years ago)
Author:
melkarim
Message:

fix the internal proxy

Location:
addefend-easy-integration
Files:
4 added
6 edited
10 copied

Legend:

Unmodified
Added
Removed
  • addefend-easy-integration/tags/1.11/Components/script_integration.php

    r2229158 r2688771  
    7676}
    7777
     78function 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
    7887// clean up the database from all addefend content
    7988register_deactivation_hook(ADDEFEND_PLUGIN_PHP_FILE, 'addefend_cleanup');
  • addefend-easy-integration/tags/1.11/Utils/misc.php

    r2685023 r2688771  
    122122        if (substr($key, 0, 5) == "HTTP_") {
    123123            $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", "", substr($key, 5)))));
     124            $out[$key] = $value;
    124125        }
    125         $out[$key] = $value;
    126126    }
    127127    return $out;
  • addefend-easy-integration/tags/1.11/View/options.php

    r2685023 r2688771  
    1919    }
    2020
     21    $contentProxy = get_option( 'addefend_content_proxy', 'apache');
    2122    $scriptUrl = get_option( 'addefend_script_URL' , '' );
    2223    $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 );
    2526
    2627    if (isset($_POST[ 'submitted' ]) && $_POST[ 'submitted' ] == 'config_form') {
     
    3031            exit; // Get out of here, the nonce is rotten!
    3132        }
    32         $contentProxyType = $_POST['selected_content_proxy'];
     33
     34        $contentProxy = $_POST['selected_content_proxy'];
    3335        $scriptUrl = esc_url($_POST['script_URL']);
    3436        $proxyUrl = esc_url($_POST['proxy_URL']);
     37        $testUrl = $_POST['test_URL'];
    3538        $imageDir = $_POST['image_dir'];
    36         $validScriptUrl = true;
    37         $validProxyUrl = true;
    3839
    3940        // always save the new input
     41        update_option("addefend_content_proxy", $contentProxy);
    4042        update_option('addefend_script_URL', $scriptUrl);
    4143        update_option('addefend_proxy_URL', $proxyUrl);
    42         if ($imageDir === '') {
    43             $imageDir = ADDEFEND_DEFAULT_IMAGE_DIRECTORY;
    44         }
     44        update_option('addefend_test_URL', $testUrl);
    4545        update_option('addefend_image_dir', $imageDir);
    4646
    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            }
    4957            echo '<div class="error"><p><strong>Script URL is invalid</strong></p></div>';
    5058        }
    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            }
    5377            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>';
    6078        }
    6179    }
    62     if (isset($_POST["selected_content_proxy"])) {
    63         $newContentProxy = $_POST["selected_content_proxy"];
    64         update_option("addefend_content_proxy", $newContentProxy);
    65         $contentProxy = $newContentProxy;
    66     }
    6780    ?>
    6881
    6982    <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 
    8083    <form method="post" action="">
    8184        <?= wp_nonce_field("submit_addefend_integration_parameters" ) ?>
     
    8891            .addefend_table li {list-style-type: none;}
    8992            .addefend_table td > div {height : 20px; width : 140px;}
     93            .addefend_table td > :not(:first-child) {margin-top: 10px !important;}
    9094            .addefend_table td > div > p {text-align: center; color: white; font-weight: bold;}
    9195            .addefend_table td > label {font-weight: bold;}
     
    9397        </style>
    9498        <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>
    95111            <!-- Script URL -->
    96112            <tr>
     
    110126                    <input type="text" id="proxy_URL_field_id" name="proxy_URL" value="<?= esc_attr($proxyUrl) ?>" size="70">
    111127                </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; ?>
    112183            </tr>
    113184            <!-- Image Directory -->
     
    246317                    <td>
    247318                        <?php
    248                         $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect');
     319                        $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') !== false;
    249320                        ?>
    250321                        <?php if ($isInternalRedirectActionRegistered): ?>
     
    270341                    </td>
    271342                    <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>
    273344                    </td>
    274345                </tr>
     
    278349                    </td>
    279350                    <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>
    281352                    </td>
    282353                </tr>
     
    284355        <?php endif; ?>
    285356        <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">
    287358        </p>
    288359    </form>
    289360    <script>
    290361        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");
    295369            var proxyUrlElement = document.querySelector("#proxy_URL_field_id");
    296370            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;
    303381        });
    304382    </script>
  • addefend-easy-integration/tags/1.11/addefend-easy-integration.php

    r2685023 r2688771  
    44Plugin URI: https://wordpress.org/plugins/addefend-easy-integration/
    55Description: The AdDefend Easy Intregration plug-in supports publishers in integrating the AdDefend anti-adblock solution.
    6 Version: 1.10
     6Version: 1.11
    77Author: AdDefend GmbH
    88Author URI: https://www.addefend.com/
  • addefend-easy-integration/tags/1.11/readme.txt

    r2685023 r2688771  
    44Requires at least: 4.2
    55Tested up to: 5.9
    6 Stable tag: 1.10
     6Stable tag: 1.11
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl.html
     
    5252== Changelog ==
    5353
     54= 1.11 =
     55* internal proxy bugfixes
     56* implemented a test request
     57
    5458= 1.10 =
    5559* content-proxy should now work on any server
  • addefend-easy-integration/trunk/Components/script_integration.php

    r2229158 r2688771  
    7676}
    7777
     78function 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
    7887// clean up the database from all addefend content
    7988register_deactivation_hook(ADDEFEND_PLUGIN_PHP_FILE, 'addefend_cleanup');
  • addefend-easy-integration/trunk/Utils/misc.php

    r2685023 r2688771  
    122122        if (substr($key, 0, 5) == "HTTP_") {
    123123            $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", "", substr($key, 5)))));
     124            $out[$key] = $value;
    124125        }
    125         $out[$key] = $value;
    126126    }
    127127    return $out;
  • addefend-easy-integration/trunk/View/options.php

    r2685023 r2688771  
    1919    }
    2020
     21    $contentProxy = get_option( 'addefend_content_proxy', 'apache');
    2122    $scriptUrl = get_option( 'addefend_script_URL' , '' );
    2223    $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 );
    2526
    2627    if (isset($_POST[ 'submitted' ]) && $_POST[ 'submitted' ] == 'config_form') {
     
    3031            exit; // Get out of here, the nonce is rotten!
    3132        }
    32         $contentProxyType = $_POST['selected_content_proxy'];
     33
     34        $contentProxy = $_POST['selected_content_proxy'];
    3335        $scriptUrl = esc_url($_POST['script_URL']);
    3436        $proxyUrl = esc_url($_POST['proxy_URL']);
     37        $testUrl = $_POST['test_URL'];
    3538        $imageDir = $_POST['image_dir'];
    36         $validScriptUrl = true;
    37         $validProxyUrl = true;
    3839
    3940        // always save the new input
     41        update_option("addefend_content_proxy", $contentProxy);
    4042        update_option('addefend_script_URL', $scriptUrl);
    4143        update_option('addefend_proxy_URL', $proxyUrl);
    42         if ($imageDir === '') {
    43             $imageDir = ADDEFEND_DEFAULT_IMAGE_DIRECTORY;
    44         }
     44        update_option('addefend_test_URL', $testUrl);
    4545        update_option('addefend_image_dir', $imageDir);
    4646
    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            }
    4957            echo '<div class="error"><p><strong>Script URL is invalid</strong></p></div>';
    5058        }
    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            }
    5377            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>';
    6078        }
    6179    }
    62     if (isset($_POST["selected_content_proxy"])) {
    63         $newContentProxy = $_POST["selected_content_proxy"];
    64         update_option("addefend_content_proxy", $newContentProxy);
    65         $contentProxy = $newContentProxy;
    66     }
    6780    ?>
    6881
    6982    <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 
    8083    <form method="post" action="">
    8184        <?= wp_nonce_field("submit_addefend_integration_parameters" ) ?>
     
    8891            .addefend_table li {list-style-type: none;}
    8992            .addefend_table td > div {height : 20px; width : 140px;}
     93            .addefend_table td > :not(:first-child) {margin-top: 10px !important;}
    9094            .addefend_table td > div > p {text-align: center; color: white; font-weight: bold;}
    9195            .addefend_table td > label {font-weight: bold;}
     
    9397        </style>
    9498        <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>
    95111            <!-- Script URL -->
    96112            <tr>
     
    110126                    <input type="text" id="proxy_URL_field_id" name="proxy_URL" value="<?= esc_attr($proxyUrl) ?>" size="70">
    111127                </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; ?>
    112183            </tr>
    113184            <!-- Image Directory -->
     
    246317                    <td>
    247318                        <?php
    248                         $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect');
     319                        $isInternalRedirectActionRegistered = has_action('template_redirect', 'addefend_internal_redirect') !== false;
    249320                        ?>
    250321                        <?php if ($isInternalRedirectActionRegistered): ?>
     
    270341                    </td>
    271342                    <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>
    273344                    </td>
    274345                </tr>
     
    278349                    </td>
    279350                    <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>
    281352                    </td>
    282353                </tr>
     
    284355        <?php endif; ?>
    285356        <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">
    287358        </p>
    288359    </form>
    289360    <script>
    290361        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");
    295369            var proxyUrlElement = document.querySelector("#proxy_URL_field_id");
    296370            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;
    303381        });
    304382    </script>
  • addefend-easy-integration/trunk/addefend-easy-integration.php

    r2685023 r2688771  
    44Plugin URI: https://wordpress.org/plugins/addefend-easy-integration/
    55Description: The AdDefend Easy Intregration plug-in supports publishers in integrating the AdDefend anti-adblock solution.
    6 Version: 1.10
     6Version: 1.11
    77Author: AdDefend GmbH
    88Author URI: https://www.addefend.com/
  • addefend-easy-integration/trunk/readme.txt

    r2685023 r2688771  
    44Requires at least: 4.2
    55Tested up to: 5.9
    6 Stable tag: 1.10
     6Stable tag: 1.11
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl.html
     
    5252== Changelog ==
    5353
     54= 1.11 =
     55* internal proxy bugfixes
     56* implemented a test request
     57
    5458= 1.10 =
    5559* content-proxy should now work on any server
Note: See TracChangeset for help on using the changeset viewer.