| @@ -114,9 +114,9 @@ | ||
| 114 | 114 | <table> |
| 115 | 115 | <tr> |
| 116 | 116 | <td>Publisher ID</td> |
| 117 | 117 | <td> |
| 118 | - <input type="text" name="publisher_id" placeholder="publisher" value="<?php echo htmlspecialchars($settings->publisher_id) ?>"/> | |
| 118 | + <input type="text" name="publisher_id" placeholder="publisher" value="<?php echo !empty($settings->publisher_id) ? htmlspecialchars($settings->publisher_id) : '' ?>"/> | |
| 119 | 119 | </td> |
| 120 | 120 | <td class='tooltip'> |
| 121 | 121 | <img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 122 | 122 | <div>Please contact your Taboola representative to receive the Publisher ID </div> |
| @@ -124,9 +124,9 @@ | ||
| 124 | 124 | </tr> |
| 125 | 125 | <tr> |
| 126 | 126 | <td colspan='2' style='line-height: 26px; font-size: 13px;'> |
| 127 | 127 | Don't have a Publisher ID? |
| 128 | - <a style='float: inherit; margin-left:5px; class='request_link' href=' http://taboola.com/contact' target='_blank'>Contact Taboola here</a> | |
| 128 | + <a style='float: inherit; margin-left:5px;' class='request_link' href=' https://taboola.com/contact' target='_blank'>Contact Taboola</a> | |
| 129 | 129 | </td> |
| 130 | 130 | </tr> |
| 131 | 131 | </table> |
| 132 | 132 | |
| @@ -132,9 +132,9 @@ | ||
| 132 | 132 | |
| 133 | 133 | <hr style='margin-bottom: 25px; margin-top: 5px;'> |
| 134 | 134 | |
| 135 | 135 | <div class='checkbox'> |
| 136 | - <input id="first_bc_enabled" type="checkbox" <?php echo $settings->first_bc_enabled ? "checked='checked'" : "" ?> name="first_bc_enabled"/> | |
| 136 | + <input id="first_bc_enabled" type="checkbox" <?php echo !empty($settings->first_bc_enabled) ? "checked='checked'" : "" ?> name="first_bc_enabled"/> | |
| 137 | 137 | Below Article |
| 138 | 138 | </div> |
| 139 | 139 | <table> |
| 140 | 140 | <tr> |
| @@ -139,9 +139,9 @@ | ||
| 139 | 139 | <table> |
| 140 | 140 | <tr> |
| 141 | 141 | <td>Widget ID</td> |
| 142 | 142 | <td> |
| 143 | - <input type="text" value="<?php echo $settings->first_bc_widget_id ?>" name="first_bc_widget_id" placeholder="Widget ID" /> | |
| 143 | + <input type="text" value="<?php echo !empty($settings->first_bc_widget_id) ? htmlspecialchars($settings->first_bc_widget_id) : '' ?>" name="first_bc_widget_id" placeholder="Widget ID" /> | |
| 144 | 144 | </td> |
| 145 | 145 | <td class='tooltip'> |
| 146 | 146 | <img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 147 | 147 | <div>Please contact your Taboola representative to receive the Widget ID</div> |
| @@ -151,9 +151,9 @@ | ||
| 151 | 151 | </table> |
| 152 | 152 | <hr> |
| 153 | 153 | |
| 154 | 154 | <div class='checkbox'> |
| 155 | - <input id="second_bc_enabled" type="checkbox" <?php echo $settings->second_bc_enabled ? "checked='checked'" : "" ?> name="second_bc_enabled"/> | |
| 155 | + <input id="second_bc_enabled" type="checkbox" <?php echo !empty($settings->second_bc_enabled) ? "checked='checked'" : "" ?> name="second_bc_enabled"/> | |
| 156 | 156 | Below Article 2nd |
| 157 | 157 | </div> |
| 158 | 158 | |
| 159 | 159 | <table> |
| @@ -159,9 +159,9 @@ | ||
| 159 | 159 | <table> |
| 160 | 160 | <tr> |
| 161 | 161 | <td>Widget ID</td> |
| 162 | 162 | <td> |
| 163 | - <input type="text" value="<?php echo htmlspecialchars($settings->second_bc_widget_id) ?>" name="second_bc_widget_id" placeholder="Widget ID" /> | |
| 163 | + <input type="text" value="<?php echo !empty($settings->second_bc_widget_id) ? htmlspecialchars($settings->second_bc_widget_id) : '' ?>" name="second_bc_widget_id" placeholder="Widget ID" /> | |
| 164 | 164 | </td> |
| 165 | 165 | <td class='tooltip'> |
| 166 | 166 | <img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 167 | 167 | <div>Please contact your Taboola representative to receive the Widget ID</div> |
| @@ -170,9 +170,9 @@ | ||
| 170 | 170 | |
| 171 | 171 | </table> |
| 172 | 172 | <hr style='border-bottom: 1px solid #fafafa;'> |
| 173 | 173 | |
| 174 | - <?php $location_defined = (htmlspecialchars($settings->location_string) != ""); ?> | |
| 174 | + <?php $location_defined = !empty($settings->location_string); ?> | |
| 175 | 175 | |
| 176 | 176 | |
| 177 | 177 | <div class='toggle_intercept checkbox'> |
| 178 | 178 | <?php if ($location_defined): ?> |
| @@ -188,13 +188,12 @@ | ||
| 188 | 188 | <table class='location_section' style='display:none'> |
| 189 | 189 | |
| 190 | 190 | <?php endif; ?> |
| 191 | 191 | |
| 192 | - | |
| 193 | 192 | <tr> |
| 194 | 193 | <td>Location</td> |
| 195 | 194 | <td> |
| 196 | - <input type="text" value="<?php echo htmlspecialchars($settings->location_string) ?>" name="location_string" placeholder="" /> | |
| 195 | + <input type="text" value="<?php echo !empty($settings->location_string) ? htmlspecialchars($settings->location_string) : '' ?>" name="location_string" placeholder="" /> | |
| 197 | 196 | </td> |
| 198 | 197 | <td class='tooltip'> |
| 199 | 198 | <img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 200 | 199 | <div>This field controls the location of these widgets on the page. If you would like to move your widget from its default location directly below the article a Taboola representative will provide you with the necessary information.</div> |
| @@ -201,9 +200,9 @@ | ||
| 201 | 200 | </td> |
| 202 | 201 | </tr> |
| 203 | 202 | <tr> |
| 204 | 203 | <td colspan="2"> <div class='checkbox'> |
| 205 | - <input id="out_of_content_enabled" type="checkbox" <?php echo $settings->out_of_content_enabled ? "checked='checked'" : "" ?> name="out_of_content_enabled"/> | |
| 204 | + <input id="out_of_content_enabled" type="checkbox" <?php echo !empty($settings->out_of_content_enabled) ? "checked='checked'" : "" ?> name="out_of_content_enabled"/> | |
| 206 | 205 | Place widget after main content DOM element |
| 207 | 206 | </div></td> |
| 208 | 207 | <td class='tooltip'> |
| 209 | 208 | <img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| @@ -211,19 +210,25 @@ | ||
| 211 | 210 | </td> |
| 212 | 211 | |
| 213 | 212 | </tr> |
| 214 | 213 | |
| 215 | - | |
| 216 | 214 | </table> |
| 217 | 215 | <input class='button-secondary apply_button' type="submit" value="Apply Changes ✔"/> |
| 218 | - <!-- <a class='request_link' href=' http://taboola.com/contact' target='_blank'>Request Widget</a> --> | |
| 216 | + <!-- <a class='request_link' href=' https://taboola.com/contact' target='_blank'>Request Widget</a> --> | |
| 219 | 217 | </form> |
| 220 | 218 | <div style='clear:both'></div> |
| 221 | 219 | |
| 222 | - <form name="install_log" style="display:none;" method="post" action="http://trc.taboola.com/wordpressplugin/log/2/debug"> | |
| 220 | + <?php | |
| 221 | + $logPublisher = empty($settings->publisher_id) ? "wordpressplugin" : $settings->publisher_id; | |
| 222 | + $userDetails = wp_get_current_user(); | |
| 223 | + $detailsString = $userDetails->first_name." ".$userDetails->last_name; | |
| 224 | + ?> | |
| 225 | + <img src="https://logs-01.loggly.com/inputs/d14862f3-64ad-49ca-b28d-1b5d155414ec.gif?source=wp&type=settings&pub=<?=$logPublisher?>&user=<?=urlencode($detailsString)?>&email=<?=urlencode($userDetails->user_email)?>&url=<?=urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}")?>"/> | |
| 226 | + <!-- <form name="install_log" style="display:none;" method="post" action="http://logs-01.loggly.com/inputs/d14862f3-64ad-49ca-b28d-1b5d155414ec/tag/http/"> | |
| 223 | 227 | <input name="tim" type="hidden" value="<?=date("H:i:s.000")?>"> |
| 224 | - <input name="data" type="hideen" value="WORDPRESS_PLUGIN_INSTALL_URL|<?="//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"?>"> | |
| 225 | - </form> | |
| 228 | + <input name="pub" type="hidden" value="<?=$logPublisher?>"> | |
| 229 | + <input name="data" type="hideen" value="WORDPRESS_PLUGIN_INSTALL|<?="//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}|{$detailsString}"?>"> | |
| 230 | + </form> --> | |
| 226 | 231 | |
| 227 | 232 | <?php |
| 228 | 233 | if($_SERVER['REQUEST_METHOD'] == 'POST' && count($taboola_errors) == 0){ |
| 229 | 234 | echo "<span class='label-success'>Your changes have been made! You can now see them on your site</span>"; |
| @@ -262,5 +267,5 @@ | ||
| 262 | 267 | window.onload = function(){ |
| 263 | 268 | document.forms['install_log'].submit() |
| 264 | 269 | |
| 265 | 270 | } |
| 266 | -</script> | |
| 271 | +</script> | |