custom-body-data.php
4 years ago
custom-dropdown.php
4 years ago
custom-filter.php
4 years ago
custom-pagination.php
4 years ago
default-settings-modal.php
4 years ago
delete-confirmation-prompt.php
4 years ago
header-settings-paragraph.php
4 years ago
index.html
4 years ago
single-redirection.php
4 years ago
default-settings-modal.php
650 lines
| 1 | <?php |
| 2 | if (!defined("ABSPATH")) { |
| 3 | exit(); |
| 4 | } |
| 5 | // $settingsData initialized in ajax functions |
| 6 | ?> |
| 7 | <div id="ir-custom-modal"> |
| 8 | <div id="custom-modal" class="custom-modal"> |
| 9 | <div class="custom-modal__box settings-box"> |
| 10 | <form action="" class="ir-default-settings-form"> |
| 11 | <span role="button" tabindex="1" class="settings-box__close-btn ir-default-settings-close"> |
| 12 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/gray-close-icon.svg"); ?>" alt="<?php _e( "close modal's icon", "redirect-redirection" ); ?>"> |
| 13 | </span> |
| 14 | |
| 15 | <div class="settings-box__container"> |
| 16 | <h6 class="settings-box__heading sett-box-heading"> |
| 17 | <span class="sett-box-heading__icon"><img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/cogs-icon.svg"); ?>" alt="<?php _e( "cogs icon", "redirect-redirection" ); ?>"></span> |
| 18 | <span class="sett-box-heading__text"><?php _e( "Advanced options", "redirect-redirection" ); ?></span> |
| 19 | </h6> |
| 20 | |
| 21 | <div class="settings-box__checkboxes-container checkboxes-container"> |
| 22 | <div class="checkboxes-container__col"> |
| 23 | <span class="checkboxes-container__label"><?php _e( "Source URL", "redirect-redirection" ); ?></span> |
| 24 | </div> |
| 25 | <div class="checkboxes-container__col checkboxes-rows"> |
| 26 | <?php |
| 27 | $ignoreTrailingSlashes = (empty($settingsData["ignore_trailing_slashes"])) ? 0 : intval($settingsData["ignore_trailing_slashes"]); |
| 28 | $ignoreTrailingSlashesDisabled = ""; |
| 29 | $ignoreTrailingSlashesStyle = ""; |
| 30 | if (isset($id) && !empty($settingsData[IRRPConstants::META_KEY_CRITERIAS][$id]["criteria"]) && ($settingsData[IRRPConstants::META_KEY_CRITERIAS][$id]["criteria"] === "regex-match")) { |
| 31 | $ignoreTrailingSlashesDisabled = "disabled='disabled'"; |
| 32 | $ignoreTrailingSlashesStyle = "style='opacity:0.7;z-index:9999;'"; |
| 33 | } |
| 34 | ?> |
| 35 | <div class="checkboxes-rows__row" <?php echo esc_attr($ignoreTrailingSlashesStyle); ?>> |
| 36 | <input id="check-1" class="checkboxes-rows__input" type="checkbox" name="ignore_trailing_slashes" value="1" <?php echo checked($ignoreTrailingSlashes === 1); ?> <?php echo esc_attr($ignoreTrailingSlashesDisabled); ?>> |
| 37 | <label for="check-1" class="checkboxes-rows__text"><?php _e( "Ignore trailing slashes", "redirect-redirection" ); ?></label> |
| 38 | <span role="button" tabindex="1" class="ml-0 custom-modal__info-btn custom-modal-info-btn"> |
| 39 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 40 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--1"> |
| 41 | <?php _e( "If checked, URLs with “/” at the end and those without it will be redirected.", "redirect-redirection" ); ?> |
| 42 | </p> |
| 43 | </span> |
| 44 | </div> |
| 45 | <div class="checkboxes-rows__row"> |
| 46 | <?php $ignoreParameters = (empty($settingsData["ignore_parameters"])) ? 0 : intval($settingsData["ignore_parameters"]); ?> |
| 47 | <input id="check-2" class="checkboxes-rows__input" type="checkbox" name="ignore_parameters" value="1" <?php echo checked($ignoreParameters === 1); ?>> |
| 48 | <label for="check-2" class="checkboxes-rows__text"><?php _e( "Ignore parameters", "redirect-redirection" ); ?></label> |
| 49 | <span role="button" tabindex="1" class="ml-0 custom-modal__info-btn custom-modal-info-btn"> |
| 50 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 51 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--2"> |
| 52 | <?php _e( "If checked URLs with parameters will be redirected as well, e.g. if you selected /whatever to get redirected, then /whatever?param will be redirected too.", "redirect-redirection" ); ?> |
| 53 | </p> |
| 54 | </span> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="checkboxes-container__col checkboxes-rows"> |
| 58 | <div class="checkboxes-rows__row"> |
| 59 | <?php $ignoreCase = (empty($settingsData["ignore_case"])) ? 0 : intval($settingsData["ignore_case"]); ?> |
| 60 | <input id="check-3" class="checkboxes-rows__input" type="checkbox" name="ignore_case" value="1" <?php echo checked($ignoreCase === 1); ?>> |
| 61 | <label for="check-3" class="checkboxes-rows__text"><?php _e( "Ignore lower/upper case", "redirect-redirection" ); ?></label> |
| 62 | <span role="button" tabindex="1" class="ml-0 custom-modal__info-btn custom-modal-info-btn"> |
| 63 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 64 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--3"> |
| 65 | <?php _e( "If checked the cases of your source URL will be ignored, e.g. if you entered /whatever as URL, /WhAteVER will also be redirected.", "redirect-redirection" ); ?> |
| 66 | </p> |
| 67 | </span> |
| 68 | </div> |
| 69 | <div class="checkboxes-rows__row"> |
| 70 | <?php $passOnParameters = (empty($settingsData["pass_on_parameters"])) ? 0 : intval($settingsData["pass_on_parameters"]); ?> |
| 71 | <input id="check-4" class="checkboxes-rows__input" type="checkbox" name="pass_on_parameters" value="1" <?php echo checked($passOnParameters === 1); ?>> |
| 72 | <label for="check-4" class="checkboxes-rows__text"><?php _e( "Pass on parameters", "redirect-redirection" ); ?></label> |
| 73 | <span role="button" tabindex="1" class="ml-0 custom-modal__info-btn custom-modal-info-btn"> |
| 74 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 75 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--4"> |
| 76 | <?php _e( "If checked parameters will be passed on, e.g. if you selected to redirect /whatever to /whatever-new, then when a user enters /whatever?param he will be redirected to /whatever-new?param.", "redirect-redirection" ); ?> |
| 77 | </p> |
| 78 | </span> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |
| 82 | |
| 83 | <div class="settings-box__table settings-table settings-table--with-border"> |
| 84 | <div class="settings-table__col settings-table__col--first-child d-flex align-items-center"> |
| 85 | <span class="settings-table__label"><?php _e( "Redirect HTTP code:", "redirect-redirection" ); ?></span> |
| 86 | <span role="button" tabindex="1" class="mb-21 custom-modal__info-btn custom-modal__info-btn--small-devices ir-http-codes-show"> |
| 87 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 88 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--16"> |
| 89 | <?php _e( "Click to see an explanation of HTTP codes", "redirect-redirection" ); ?> |
| 90 | </p> |
| 91 | </span> |
| 92 | </div> |
| 93 | <div class="settings-table__col d-flex align-items-center"> |
| 94 | <?php |
| 95 | $redirectCode = (empty($settingsData["redirect_code"])) ? 0 : intval($settingsData["redirect_code"]); |
| 96 | $ddOptions = [ |
| 97 | [ |
| 98 | "option" => 301, |
| 99 | "text" => __( "301 - Moved Permanently", "redirect-redirection" ) |
| 100 | ], |
| 101 | [ |
| 102 | "option" => 302, |
| 103 | "text" => __( "302 – Found", "redirect-redirection" ) |
| 104 | ], |
| 105 | [ |
| 106 | "option" => 303, |
| 107 | "text" => __( "303 – See Other", "redirect-redirection" ) |
| 108 | ], |
| 109 | [ |
| 110 | "option" => 304, |
| 111 | "text" => __( "304 – Not Modified", "redirect-redirection" ) |
| 112 | ], |
| 113 | [ |
| 114 | "option" => 307, |
| 115 | "text" => __( "307 – Temporary Redirect", "redirect-redirection" ) |
| 116 | ], |
| 117 | [ |
| 118 | "option" => 308, |
| 119 | "text" => __( "308 – Permanent Redirect", "redirect-redirection" ) |
| 120 | ], |
| 121 | ]; |
| 122 | $selected = ($found = array_search($redirectCode, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 123 | IRRPHelper::customDropdown("redirect_code", $ddOptions, $selected); |
| 124 | ?> |
| 125 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices ir-http-codes-show"> |
| 126 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 127 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--5"> |
| 128 | <?php _e( "Click to see an explanation of HTTP codes", "redirect-redirection" ); ?> |
| 129 | </p> |
| 130 | </span> |
| 131 | </div> |
| 132 | </div> |
| 133 | |
| 134 | <?php |
| 135 | $inclusionExclusionRules = (empty($settingsData["inclusion_exclusion_rules"])) ? 0 : intval($settingsData["inclusion_exclusion_rules"]); |
| 136 | $rulesContainerClass = $inclusionExclusionRules ? "" : "ir-hidden"; |
| 137 | ?> |
| 138 | <div class="settings-box__table settings-table" style="<?php echo strpos($rulesContainerClass, "ir-hidden") !== false ? "margin-bottom: 50px" : "" ?>"> |
| 139 | <div class="settings-table__col settings-table__col--first-child"> |
| 140 | <span class="settings-table__label"><?php _e( "Inclusion & exclusion rules", "redirect-redirection" ); ?></span> |
| 141 | </div> |
| 142 | <div class="settings-table__col"> |
| 143 | <label for="cron-btn-toggle" class="custom-switch"> |
| 144 | <input type="checkbox" id="cron-btn-toggle" class="ir-rules-switcher" name="inclusion_exclusion_rules" value="1" <?php echo checked($inclusionExclusionRules === 1); ?>> |
| 145 | <div class="custom-switch-slider round"> |
| 146 | <span class="on"><?php _e( "On", "redirect-redirection" ); ?></span> |
| 147 | <span class="off"><?php _e( "Off", "redirect-redirection" ); ?></span> |
| 148 | </div> |
| 149 | </label> |
| 150 | </div> |
| 151 | </div> |
| 152 | |
| 153 | <div class="settings-box__rules-table rules-table ir-redirect-settings-container <?php echo esc_attr($rulesContainerClass); ?>"> |
| 154 | <div class="rules-table__row"> |
| 155 | <div class="rules-table__col rules-table__col--1"> |
| 156 | <span class="rules-table__row-label"><?php |
| 157 | printf( |
| 158 | __( 'Only redirect if %1$sall%2$s of the following criteria ', 'redirect-redirection' ), |
| 159 | '<a class="settings-box__link" href="#!">', |
| 160 | '</a>' |
| 161 | ); |
| 162 | ?></span> |
| 163 | </div> |
| 164 | <div class="rules-table__col rules-table__col--2"> |
| 165 | <?php |
| 166 | $redirectOptions = (empty($settingsData["redirect_options"])) ? "" : trim($settingsData["redirect_options"]); |
| 167 | $ddOptions = [ |
| 168 | [ |
| 169 | "option" => "are_case", |
| 170 | "text" => __( "are the case", "redirect-redirection" ) |
| 171 | ], |
| 172 | [ |
| 173 | "option" => "are_not_case", |
| 174 | "text" => __( "are not the case", "redirect-redirection" ) |
| 175 | ], |
| 176 | ]; |
| 177 | $selected = ($found = array_search($redirectOptions, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 178 | IRRPHelper::customDropdown("redirect_options", $ddOptions, $selected); |
| 179 | ?> |
| 180 | </div> |
| 181 | </div> |
| 182 | |
| 183 | <div class="rules-table__row"> |
| 184 | <?php |
| 185 | $rulesGroup1Enabled = (empty($settingsData["rules_group1"]["enabled"])) ? "" : intval($settingsData["rules_group1"]["enabled"]); |
| 186 | $rulesGroup1LoginInfo = (empty($settingsData["rules_group1"]["login_info"])) ? "" : trim($settingsData["rules_group1"]["login_info"]); |
| 187 | $ddOptions = [ |
| 188 | [ |
| 189 | "option" => "logged_in", |
| 190 | "text" => __( "logged in", "redirect-redirection" ) |
| 191 | ], |
| 192 | [ |
| 193 | "option" => "not_logged_in", |
| 194 | "text" => __( "not logged in", "redirect-redirection" ) |
| 195 | ], |
| 196 | ]; |
| 197 | $selected = ($found = array_search($rulesGroup1LoginInfo, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 198 | ?> |
| 199 | <div class="rules-table__col rules-table__col--1"> |
| 200 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 201 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group1[enabled]" value="1" <?php checked($rulesGroup1Enabled === 1); ?>> |
| 202 | <span><?php _e( "User who clicks on the link is", "redirect-redirection" ); ?></span> |
| 203 | </span> |
| 204 | </div> |
| 205 | <div class="rules-table__col rules-table__col--2"> |
| 206 | <?php IRRPHelper::customDropdown("rules_group1[login_info]", $ddOptions, $selected); ?> |
| 207 | </div> |
| 208 | </div> |
| 209 | |
| 210 | <div class="rules-table__row"> |
| 211 | <?php |
| 212 | $rulesGroup2Enabled = (empty($settingsData["rules_group2"]["enabled"])) ? 0 : intval($settingsData["rules_group2"]["enabled"]); |
| 213 | $rulesGroup2Role = (empty($settingsData["rules_group2"]["role"])) ? "" : trim($settingsData["rules_group2"]["role"]); |
| 214 | $ddOptions = [ |
| 215 | [ |
| 216 | "option" => "has", |
| 217 | "text" => __( "has", "redirect-redirection" ) |
| 218 | ], |
| 219 | [ |
| 220 | "option" => "does_not_have", |
| 221 | "text" => __( "doesn't have", "redirect-redirection" ) |
| 222 | ], |
| 223 | ]; |
| 224 | $selected = ($found = array_search($rulesGroup2Role, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 225 | ?> |
| 226 | <div class="rules-table__col rules-table__col--1"> |
| 227 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 228 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group2[enabled]" value="1" <?php echo checked($rulesGroup2Enabled === 1); ?>> |
| 229 | <span><?php _e( "User who clicks on the link", "redirect-redirection" ); ?></span> |
| 230 | </span> |
| 231 | </div> |
| 232 | <div class="rules-table__col rules-table__col--2"> |
| 233 | <?php IRRPHelper::customDropdown("rules_group2[role]", $ddOptions, $selected); ?> |
| 234 | </div> |
| 235 | <div class="rules-table__col rules-table__col--3 d-flex flex-col flex-1140-row align-items-start align-items-1140-center"> |
| 236 | <span class="me-15"><?php _e( "WordPress user role", "redirect-redirection" ); ?></span> |
| 237 | <?php |
| 238 | $roles = get_editable_roles(); |
| 239 | $rulesGroup2RoleName = (empty($settingsData["rules_group2"]["role_name"])) ? "" : trim($settingsData["rules_group2"]["role_name"]); |
| 240 | $ddOptions = []; |
| 241 | foreach ($roles as $role => $info) { |
| 242 | $ddOptions[] = ["option" => $role, "text" => $info["name"]]; |
| 243 | } |
| 244 | $selected = ($found = array_search($rulesGroup2RoleName, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 245 | IRRPHelper::customDropdown("rules_group2[role_name]", $ddOptions, $selected); |
| 246 | ?> |
| 247 | </div> |
| 248 | </div> |
| 249 | |
| 250 | <div class="rules-table__row rules-table__row--align-end"> |
| 251 | <?php |
| 252 | $rulesGroup3Enabled = (empty($settingsData["rules_group3"]["enabled"])) ? 0 : intval($settingsData["rules_group3"]["enabled"]); |
| 253 | $rulesGroup3Referrer = (empty($settingsData["rules_group3"]["referrer"])) ? "" : trim($settingsData["rules_group3"]["referrer"]); |
| 254 | $rulesGroup3ReferrerValue = (empty($settingsData["rules_group3"]["referrer_value"])) ? "" : trim($settingsData["rules_group3"]["referrer_value"]); |
| 255 | $ddOptions = [ |
| 256 | [ |
| 257 | "option" => "matches", |
| 258 | "text" => __( "matches", "redirect-redirection" ) |
| 259 | ], |
| 260 | [ |
| 261 | "option" => "does_not_match", |
| 262 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 263 | ], |
| 264 | ]; |
| 265 | $selected = ($found = array_search($rulesGroup3Referrer, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 266 | ?> |
| 267 | <div class="rules-table__col rules-table__col--1"> |
| 268 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 269 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group3[enabled]" value="1" <?php echo checked($rulesGroup3Enabled === 1); ?>> |
| 270 | <span><?php _e( "User’s referrer link", "redirect-redirection" ); ?></span> |
| 271 | </span> |
| 272 | </div> |
| 273 | <div class="rules-table__col rules-table__col--2"> |
| 274 | <?php IRRPHelper::customDropdown("rules_group3[referrer]", $ddOptions, $selected); ?> |
| 275 | </div> |
| 276 | <div class="rules-table__col rules-table__col--3 flex-grow-1"> |
| 277 | <div class="rules-table__input-group rules-table-input-group"> |
| 278 | <label class="rules-table-input-group__label d-flex align-items-center"> |
| 279 | <span><?php _e( "Referrer:", "redirect-redirection" ); ?></span> |
| 280 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 281 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 282 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--6"> |
| 283 | <?php _e( "Here you can set the user’s referrer URL (URL from which they are coming) that is used to determine the match, in addition to the source URL.", "redirect-redirection" ); ?> |
| 284 | </p> |
| 285 | </span> |
| 286 | </label> |
| 287 | <span class="d-flex align-items-center"> |
| 288 | <input name="rules_group3[referrer_value]" class="rules-table-input-group__input flex-grow-1" type="text" placeholder="https://www.example.com/blog/referrer-url" value="<?php echo esc_attr($rulesGroup3ReferrerValue); ?>"> |
| 289 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices"> |
| 290 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 291 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--7"> |
| 292 | <?php _e( "Here you can set the user’s referrer URL (URL from which they are coming) that is used to determine the match, in addition to the source URL.", "redirect-redirection" ); ?> |
| 293 | </p> |
| 294 | </span> |
| 295 | </span> |
| 296 | </div> |
| 297 | </div> |
| 298 | </div> |
| 299 | |
| 300 | <div class="rules-table__row rules-table__row--align-end"> |
| 301 | <?php |
| 302 | $rulesGroup4Enabled = (empty($settingsData["rules_group4"]["enabled"])) ? 0 : intval($settingsData["rules_group4"]["enabled"]); |
| 303 | $rulesGroup4Agent = (empty($settingsData["rules_group4"]["agent"])) ? "" : trim($settingsData["rules_group4"]["agent"]); |
| 304 | $rulesGroup4AgentValue = (empty($settingsData["rules_group4"]["agent_value"])) ? "" : trim($settingsData["rules_group4"]["agent_value"]); |
| 305 | $rulesGroup4AgentRegex = (empty($settingsData["rules_group4"]["agent_regex"])) ? 0 : intval($settingsData["rules_group4"]["agent_regex"]); |
| 306 | $ddOptions = [ |
| 307 | [ |
| 308 | "option" => "matches", |
| 309 | "text" => __( "matches", "redirect-redirection" ) |
| 310 | ], |
| 311 | [ |
| 312 | "option" => "does_not_match", |
| 313 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 314 | ], |
| 315 | ]; |
| 316 | $selected = ($found = array_search($rulesGroup4Agent, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 317 | ?> |
| 318 | <div class="rules-table__col rules-table__col--1"> |
| 319 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 320 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group4[enabled]" value="1" <?php echo checked($rulesGroup4Enabled === 1); ?>> |
| 321 | <span><?php _e( "User’s agent", "redirect-redirection" ); ?></span> |
| 322 | </span> |
| 323 | </div> |
| 324 | <div class="rules-table__col rules-table__col--2"> |
| 325 | <?php IRRPHelper::customDropdown("rules_group4[agent]", $ddOptions, $selected); ?> |
| 326 | </div> |
| 327 | <div class="rules-table__col rules-table__col--3 d-flex flex-col flex-1140-row align-items-start align-items-1140-end flex-grow-1"> |
| 328 | <div class="rules-table__input-group rules-table-input-group"> |
| 329 | <label class="rules-table-input-group__label"><?php _e( "User agent:", "redirect-redirection" ); ?></label> |
| 330 | <input class="rules-table-input-group__input w-1140-270px" type="text" placeholder="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36" name="rules_group4[agent_value]" value="<?php echo esc_attr($rulesGroup4AgentValue); ?>"> |
| 331 | </div> |
| 332 | <div class="mt-15 mt-1140-0 d-flex align-items-end justify-content-end flex-grow-1 pb-13"> |
| 333 | <span class="mr-15"><?php _e( "Regex:", "redirect-redirection" ); ?></span> |
| 334 | <input class="rules-table__checkbox" type="checkbox" name="rules_group4[agent_regex]" value="1" <?php echo checked($rulesGroup4AgentRegex === 1); ?>> |
| 335 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices"> |
| 336 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 337 | <p class="custom-modal-info-btn__tooltip"> |
| 338 | <?php _e( "Here you can set the user’s browser agent in addition to the source URL to determine the match. It can use browser type, OS, (mobile) platform, etc. If you want to apply RegEx, tick the checkbox.", "redirect-redirection" ); ?> |
| 339 | </p> |
| 340 | </span> |
| 341 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 342 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 343 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--8"> |
| 344 | <?php _e( "Here you can set the user’s browser agent in addition to the source URL to determine the match. It can use browser type, OS, (mobile) platform, etc. If you want to apply RegEx, tick the checkbox.", "redirect-redirection" ); ?> |
| 345 | </p> |
| 346 | </span> |
| 347 | </div> |
| 348 | </div> |
| 349 | </div> |
| 350 | |
| 351 | <div class="rules-table__row rules-table__row--align-end"> |
| 352 | <?php |
| 353 | $rulesGroup5Enabled = (empty($settingsData["rules_group5"]["enabled"])) ? 0 : intval($settingsData["rules_group5"]["enabled"]); |
| 354 | $rulesGroup5Cookie = (empty($settingsData["rules_group5"]["cookie"])) ? "" : trim($settingsData["rules_group5"]["cookie"]); |
| 355 | $rulesGroup5CookieName = (empty($settingsData["rules_group5"]["cookie_name"])) ? "" : trim($settingsData["rules_group5"]["cookie_name"]); |
| 356 | $rulesGroup5CookieValue = (empty($settingsData["rules_group5"]["cookie_value"])) ? "" : trim($settingsData["rules_group5"]["cookie_value"]); |
| 357 | $rulesGroup5CookieRegex = (empty($settingsData["rules_group5"]["cookie_regex"])) ? 0 : intval($settingsData["rules_group5"]["cookie_regex"]); |
| 358 | $ddOptions = [ |
| 359 | [ |
| 360 | "option" => "matches", |
| 361 | "text" => __( "matches", "redirect-redirection" ) |
| 362 | ], |
| 363 | [ |
| 364 | "option" => "does_not_match", |
| 365 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 366 | ], |
| 367 | ]; |
| 368 | $selected = ($found = array_search($rulesGroup5Cookie, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 369 | ?> |
| 370 | <div class="rules-table__col rules-table__col--1"> |
| 371 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 372 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group5[enabled]" value="1" <?php echo checked($rulesGroup5Enabled === 1); ?>> |
| 373 | <span><?php _e( "User’s cookie", "redirect-redirection" ); ?></span> |
| 374 | </span> |
| 375 | </div> |
| 376 | <div class="rules-table__col rules-table__col--2"> |
| 377 | <?php IRRPHelper::customDropdown("rules_group5[cookie]", $ddOptions, $selected); ?> |
| 378 | </div> |
| 379 | <div class="rules-table__col rules-table__col--3 d-flex flex-col flex-1140-row align-items-start align-items-1140-end flex-grow-1"> |
| 380 | <div class="rules-table__input-group rules-table-input-group mr-1140-30"> |
| 381 | <label class="rules-table-input-group__label"><?php _e( "Cookie name:", "redirect-redirection" ); ?></label> |
| 382 | <span class="d-flex align-items-center"> |
| 383 | <input class="rules-table-input-group__input w-1140-130px" type="text" placeholder="namecookie" name="rules_group5[cookie_name]" value="<?php echo esc_attr($rulesGroup5CookieName); ?>"> |
| 384 | </span> |
| 385 | </div> |
| 386 | <div class="mt-15 mt-1140-0 rules-table__input-group rules-table-input-group"> |
| 387 | <label class="rules-table-input-group__label"><?php _e( "Cookie value:", "redirect-redirection" ); ?></label> |
| 388 | <input class="rules-table-input-group__input w-1140-130px" type="text" placeholder="valuecookie" name="rules_group5[cookie_value]" value="<?php echo esc_attr($rulesGroup5CookieValue); ?>"> |
| 389 | </div> |
| 390 | <div class="mt-15 mt-1140-0 d-flex align-items-end justify-content-end flex-grow-1 pb-13"> |
| 391 | <span class="mr-15"><?php _e( "Regex:", "redirect-redirection" ); ?></span> |
| 392 | <input class="rules-table__checkbox" type="checkbox" name="rules_group5[cookie_regex]" value="1" <?php echo checked($rulesGroup5CookieRegex === 1); ?>> |
| 393 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices"> |
| 394 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 395 | <p class="custom-modal-info-btn__tooltip"> |
| 396 | <?php _e( "Here you can set the cookie name and value in addition to the source URL to determine the match. If you want to apply RegEx, tick the checkbox.", "redirect-redirection" ); ?> |
| 397 | </p> |
| 398 | </span> |
| 399 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 400 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 401 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--9"> |
| 402 | <?php _e( "Here you can set the cookie name and value in addition to the source URL to determine the match. If you want to apply RegEx, tick the checkbox.", "redirect-redirection" ); ?> |
| 403 | </p> |
| 404 | </span> |
| 405 | </div> |
| 406 | </div> |
| 407 | </div> |
| 408 | |
| 409 | <div class="rules-table__row rules-table__row--align-end"> |
| 410 | <?php |
| 411 | $rulesGroup6Enabled = (empty($settingsData["rules_group6"]["enabled"])) ? 0 : intval($settingsData["rules_group6"]["enabled"]); |
| 412 | $rulesGroup6Ip = (empty($settingsData["rules_group6"]["ip"])) ? "" : trim($settingsData["rules_group6"]["ip"]); |
| 413 | $rulesGroup6IpValue = (empty($settingsData["rules_group6"]["ip_value"])) ? "" : trim($settingsData["rules_group6"]["ip_value"]); |
| 414 | $ddOptions = [ |
| 415 | [ |
| 416 | "option" => "matches", |
| 417 | "text" => __( "matches", "redirect-redirection" ) |
| 418 | ], |
| 419 | [ |
| 420 | "option" => "does_not_match", |
| 421 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 422 | ], |
| 423 | ]; |
| 424 | $selected = ($found = array_search($rulesGroup6Ip, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 425 | ?> |
| 426 | <div class="rules-table__col rules-table__col--1"> |
| 427 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 428 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group6[enabled]" value="1" <?php echo checked($rulesGroup6Enabled === 1); ?>> |
| 429 | <span><?php _e( "User’s IP", "redirect-redirection" ); ?></span> |
| 430 | </span> |
| 431 | </div> |
| 432 | <div class="rules-table__col rules-table__col--2"> |
| 433 | <?php IRRPHelper::customDropdown("rules_group6[ip]", $ddOptions, $selected); ?> |
| 434 | </div> |
| 435 | <div class="rules-table__col rules-table__col--3 flex-grow-1"> |
| 436 | <div class="rules-table__input-group rules-table-input-group"> |
| 437 | <label class="rules-table-input-group__label d-flex align-items-center"> |
| 438 | <span><?php _e( "IP:", "redirect-redirection" ); ?></span> |
| 439 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 440 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 441 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--10"> |
| 442 | <?php _e( "Here you can set the user’s IP address that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 443 | </p> |
| 444 | </span> |
| 445 | </label> |
| 446 | <span class="d-flex align-items-center"> |
| 447 | <input class="rules-table-input-group__input w-1140-400px" type="text" placeholder="178.243.58.24,184.545.65.23" name="rules_group6[ip_value]" value="<?php echo esc_attr($rulesGroup6IpValue); ?>"> |
| 448 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices"> |
| 449 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 450 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--11"> |
| 451 | <?php _e( "Here you can set the user’s IP address that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 452 | </p> |
| 453 | </span> |
| 454 | </span> |
| 455 | </div> |
| 456 | </div> |
| 457 | </div> |
| 458 | |
| 459 | <div class="rules-table__row rules-table__row--align-end"> |
| 460 | <?php |
| 461 | $rulesGroup7Enabled = (empty($settingsData["rules_group7"]["enabled"])) ? 0 : intval($settingsData["rules_group7"]["enabled"]); |
| 462 | $rulesGroup7Server = (empty($settingsData["rules_group7"]["server"])) ? "" : trim($settingsData["rules_group7"]["server"]); |
| 463 | $rulesGroup7ServerValue = (empty($settingsData["rules_group7"]["server_value"])) ? "" : trim($settingsData["rules_group7"]["server_value"]); |
| 464 | $ddOptions = [ |
| 465 | [ |
| 466 | "option" => "matches", |
| 467 | "text" => __( "matches", "redirect-redirection" ) |
| 468 | ], |
| 469 | [ |
| 470 | "option" => "does_not_match", |
| 471 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 472 | ], |
| 473 | ]; |
| 474 | $selected = ($found = array_search($rulesGroup7Server, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 475 | ?> |
| 476 | <div class="rules-table__col rules-table__col--1"> |
| 477 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 478 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group7[enabled]" value="1" <?php echo checked($rulesGroup7Enabled === 1); ?>> |
| 479 | <span><?php _e( "Server", "redirect-redirection" ); ?></span> |
| 480 | </span> |
| 481 | </div> |
| 482 | <div class="rules-table__col rules-table__col--2"> |
| 483 | <?php IRRPHelper::customDropdown("rules_group7[server]", $ddOptions, $selected); ?> |
| 484 | </div> |
| 485 | <div class="rules-table__col rules-table__col--3 flex-grow-1"> |
| 486 | <div class="rules-table__input-group rules-table-input-group"> |
| 487 | <label class="rules-table-input-group__label d-flex align-items-center"> |
| 488 | <span><?php _e( "Server:", "redirect-redirection" ); ?></span> |
| 489 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 490 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 491 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--12"> |
| 492 | <?php _e( "Here you can set the server name that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 493 | </p> |
| 494 | </span> |
| 495 | </label> |
| 496 | <span class="d-flex align-items-center"> |
| 497 | <input class="rules-table-input-group__input w-1140-400px" type="text" placeholder="?" name="rules_group7[server_value]" value="<?php echo esc_attr($rulesGroup7ServerValue); ?>"> |
| 498 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices"> |
| 499 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 500 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--13"> |
| 501 | <?php _e( "Here you can set the server name that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 502 | </p> |
| 503 | </span> |
| 504 | </span> |
| 505 | </div> |
| 506 | </div> |
| 507 | </div> |
| 508 | |
| 509 | <div class="rules-table__row rules-table__row--align-end"> |
| 510 | <?php |
| 511 | $rulesGroup8Enabled = (empty($settingsData["rules_group8"]["enabled"])) ? 0 : intval($settingsData["rules_group8"]["enabled"]); |
| 512 | $rulesGroup8Language = (empty($settingsData["rules_group8"]["language"])) ? "" : trim($settingsData["rules_group8"]["language"]); |
| 513 | $rulesGroup8LanguageValue = (empty($settingsData["rules_group8"]["language_value"])) ? "" : trim($settingsData["rules_group8"]["language_value"]); |
| 514 | $ddOptions = [ |
| 515 | [ |
| 516 | "option" => "matches", |
| 517 | "text" => __( "matches", "redirect-redirection" ) |
| 518 | ], |
| 519 | [ |
| 520 | "option" => "does_not_match", |
| 521 | "text" => __( "doesn't match", "redirect-redirection" ) |
| 522 | ], |
| 523 | ]; |
| 524 | $selected = ($found = array_search($rulesGroup8Language, array_column($ddOptions, "option"))) !== false ? $found : "false"; |
| 525 | ?> |
| 526 | <div class="rules-table__col rules-table__col--1"> |
| 527 | <span class="rules-table__row-label rules-table__row-label--flex"> |
| 528 | <input class="rules-table__checkbox rules-table__checkbox--1" type="checkbox" name="rules_group8[enabled]" value="1" <?php echo checked($rulesGroup8Enabled === 1); ?>> |
| 529 | <span><?php _e( "Language", "redirect-redirection" ); ?></span> |
| 530 | </span> |
| 531 | </div> |
| 532 | <div class="rules-table__col rules-table__col--2"> |
| 533 | <?php IRRPHelper::customDropdown("rules_group8[language]", $ddOptions, $selected); ?> |
| 534 | </div> |
| 535 | <div class="rules-table__col rules-table__col--3 flex-grow-1"> |
| 536 | <div class="rules-table__input-group rules-table-input-group"> |
| 537 | <label class="rules-table-input-group__label d-flex align-items-center"> |
| 538 | <span><?php _e( "Language:", "redirect-redirection" ); ?></span> |
| 539 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--small-devices"> |
| 540 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 541 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--14"> |
| 542 | <?php _e( "Here you can set the browser language that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 543 | </p> |
| 544 | </span> |
| 545 | </label> |
| 546 | <span class="d-flex align-items-center"> |
| 547 | <input class="rules-table-input-group__input w-1140-400px" type="text" placeholder="en-GB,en-US," name="rules_group8[language_value]" value="<?php echo esc_attr($rulesGroup8LanguageValue); ?>"> |
| 548 | <span role="button" tabindex="1" class="custom-modal__info-btn custom-modal__info-btn--large-devices custom-modal-info-btn"> |
| 549 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/info-icon.svg"); ?>" alt="<?php _e( "info icon", "redirect-redirection" ); ?>"> |
| 550 | <p class="custom-modal-info-btn__tooltip cmib-tooltip--15"> |
| 551 | <?php _e( "Here you can set the browser language that is used to determine the match, in addition to the source URL", "redirect-redirection" ); ?> |
| 552 | </p> |
| 553 | </span> |
| 554 | </span> |
| 555 | </div> |
| 556 | </div> |
| 557 | </div> |
| 558 | </div> |
| 559 | </div> |
| 560 | |
| 561 | <div class="settings-box__footer settings-box-footer"> |
| 562 | <input type="hidden" value="" class="ir-redirect-settings"/> |
| 563 | <button class="settings-box-footer__btn ir-default-settings-close ir-default-settings-save"> |
| 564 | <?php _e( "Save", "redirect-redirection" ); ?> |
| 565 | </button> |
| 566 | <p></p> |
| 567 | <p class="settings-box-footer__paragraph" style="display: none;"><?php |
| 568 | printf( |
| 569 | __( 'You can change your default settings on the %1$sOptions tab%2$s', 'redirect-redirection' ), |
| 570 | '<a class="settings-box__link" href="#!">', |
| 571 | '</a>' |
| 572 | ); |
| 573 | ?></p> |
| 574 | <button class="settings-box-footer__close-btn ir-default-settings-close" type="button"> |
| 575 | <?php _e( "Close", "redirect-redirection" ); ?> |
| 576 | </button> |
| 577 | </div> |
| 578 | </form> |
| 579 | <textarea class="ir-hidden ir-default-settings" name="ir-default-settings"></textarea> |
| 580 | </div> |
| 581 | </div> |
| 582 | |
| 583 | <div id="http-codes-custom-modal" class="custom-modal"> |
| 584 | <div class="custom-modal__box settings-box" style="max-width: 700px"> |
| 585 | <div class="ir-http-codes"> |
| 586 | <span role="button" tabindex="1" class="settings-box__close-btn ir-http-codes-close"> |
| 587 | <img src="<?php echo plugins_url(IRRP_DIR_NAME . "/assets/css/assets/images/gray-close-icon.svg"); ?>" alt="<?php _e( "close modal's icon", "redirect-redirection" ); ?>"> |
| 588 | </span> |
| 589 | |
| 590 | <div class="settings-box__container"> |
| 591 | <h6 class="settings-box__heading sett-box-heading"> |
| 592 | <span class="sett-box-heading__text"><?php _e( "Explanation of HTTP codes", "redirect-redirection" ); ?></span> |
| 593 | </h6> |
| 594 | |
| 595 | <span class="custom-modal__text-heading d-block"> |
| 596 | <?php _e( "301 Moved Permanently", "redirect-redirection" ); ?> |
| 597 | </span> |
| 598 | <p class="custom-modal__text"> |
| 599 | <?php _e( "The URL of the requested resource has been changed permanently. The new URL is given in the response.", "redirect-redirection" ); ?> |
| 600 | </p> |
| 601 | |
| 602 | <br><br> |
| 603 | |
| 604 | <span class="custom-modal__text-heading d-block"> |
| 605 | <?php _e( "302 Found", "redirect-redirection" ); ?> |
| 606 | </span> |
| 607 | <p class="custom-modal__text"> |
| 608 | <?php _e( "This response code means that the URI of requested resource has been changed temporarily. Further changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.", "redirect-redirection" ); ?> |
| 609 | </p> |
| 610 | |
| 611 | <br><br> |
| 612 | |
| 613 | <span class="custom-modal__text-heading d-block"> |
| 614 | <?php _e( "303 See Other", "redirect-redirection" ); ?> |
| 615 | </span> |
| 616 | <p class="custom-modal__text"> |
| 617 | <?php _e( "The server sent this response to direct the client to get the requested resource at another URI with a GET request.", "redirect-redirection" ); ?> |
| 618 | </p> |
| 619 | |
| 620 | <br><br> |
| 621 | |
| 622 | <span class="custom-modal__text-heading d-block"> |
| 623 | <?php _e( "304 Not Modified", "redirect-redirection" ); ?> |
| 624 | </span> |
| 625 | <p class="custom-modal__text"> |
| 626 | <?php _e( "This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.", "redirect-redirection" ); ?> |
| 627 | </p> |
| 628 | |
| 629 | <br><br> |
| 630 | |
| 631 | <span class="custom-modal__text-heading d-block"> |
| 632 | <?php _e( "307 Temporary Redirect", "redirect-redirection" ); ?> |
| 633 | </span> |
| 634 | <p class="custom-modal__text"> |
| 635 | <?php _e( "The server sends this response to direct the client to get the requested resource at another URI with same method that was used in the prior request. This has the same semantics as the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: If a POST was used in the first request, a POST must be used in the second request.", "redirect-redirection" ); ?> |
| 636 | </p> |
| 637 | |
| 638 | <br><br> |
| 639 | |
| 640 | <span class="custom-modal__text-heading d-block"> |
| 641 | <?php _e( "308 Permanent Redirect", "redirect-redirection" ); ?> |
| 642 | </span> |
| 643 | <p class="custom-modal__text"> |
| 644 | <?php _e( "This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: If a POST was used in the first request, a POST must be used in the second request.", "redirect-redirection" ); ?> |
| 645 | </p> |
| 646 | </div> |
| 647 | </div> |
| 648 | </div> |
| 649 | </div> |
| 650 | </div> |