Plugin Directory

Changeset 3050498


Ignore:
Timestamp:
03/13/2024 12:43:55 PM (2 years ago)
Author:
solbeg
Message:

Update to version 1.2 from GitHub

Location:
geoflex
Files:
1 added
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • geoflex/tags/1.2/geoflex.php

    r3049631 r3050498  
    44 * Plugin Name:       Geoflex
    55 * Description:       Adds multiregional capability to WordPress
    6  * Version:           1.1
     6 * Version:           1.2
    77 * Requires at least: 5.8.3
    88 * Requires PHP:      7.4
  • geoflex/tags/1.2/languages/geoflex-ru_RU.po

    r3049631 r3050498  
    22msgstr ""
    33"Project-Id-Version: \n"
    4 "POT-Creation-Date: 2024-03-11 17:09+0300\n"
    5 "PO-Revision-Date: 2024-03-11 17:12+0300\n"
     4"POT-Creation-Date: 2024-03-13 15:03+0300\n"
     5"PO-Revision-Date: 2024-03-13 15:04+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    243243
    244244#: src/Admin/Support.php:43
     245msgid ""
     246"For correct work of the plugin do not use Permalink structure \"Plain"
     247"\" (Setting->Permalinks)."
     248msgstr ""
     249"Для правильной работы плагина не используйте структуру постоянных ссылок "
     250"\"Простые\" (Настройки->Постоянные ссылки)"
     251
     252#: src/Admin/Support.php:44
    245253msgid "Substitution options:"
    246254msgstr "Варианты замен:"
    247255
    248 #: src/Admin/Support.php:45
     256#: src/Admin/Support.php:46
    249257msgid "the name of the region. For example, <strong>«Warsaw»</strong>."
    250258msgstr "название региона. Например, <strong>«Варшава»</strong>."
    251259
    252 #: src/Admin/Support.php:46
    253 msgid ""
    254 "when talking about something that is in a region. For example, <strong>«In "
    255 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."
    256 msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."
    257 
    258260#: src/Admin/Support.php:47
     261msgid ""
     262"in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W "
     263"Warszawie»</strong>."
     264msgstr ""
     265"в регионе. Например, <strong>«В Варшеве»</strong>, <strong>«В Варшеве»</"
     266"strong>."
     267
     268#: src/Admin/Support.php:48
    259269msgid ""
    260270"by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</"
     
    262272msgstr "по региону. Например, <strong>«По Варшаве»</strong>."
    263273
    264 #: src/Admin/Support.php:48
     274#: src/Admin/Support.php:49
    265275msgid ""
    266276"from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z "
     
    268278msgstr "из региона. Например, <strong>«Из Варшавы»</strong>."
    269279
    270 #: src/Admin/Support.php:49
     280#: src/Admin/Support.php:50
    271281msgid "phone number for the region"
    272282msgstr "номер телефона для региона"
    273283
    274 #: src/Admin/Support.php:50
     284#: src/Admin/Support.php:51
    275285msgid "address for the region"
    276286msgstr "адрес в регионе"
    277287
    278 #: src/Admin/Support.php:51
     288#: src/Admin/Support.php:52
    279289msgid "email for the region"
    280290msgstr "email для региона"
    281291
    282 #: src/Admin/Support.php:52
     292#: src/Admin/Support.php:53
    283293msgid "link for the region"
    284294msgstr "ссылка для региона"
    285295
    286 #: src/Region.php:320
     296#: src/Region.php:324
    287297msgid "Select a region"
    288298msgstr "Выберите регион"
    289299
     300#, fuzzy
     301#~| msgid ""
     302#~| "when talking about something that is in a region. For example, "
     303#~| "<strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>."
     304#~ msgid ""
     305#~ "something that is in a region. For example, <strong>«In Warsaw»</strong>, "
     306#~ "<strong>«W Warszawie»</strong>."
     307#~ msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."
     308
    290309#~ msgid "Regions settings"
    291310#~ msgstr "Настройки регионов"
  • geoflex/tags/1.2/languages/geoflex.pot

    r3049631 r3050498  
    33msgstr ""
    44"Project-Id-Version: \n"
    5 "POT-Creation-Date: 2024-03-11 17:09+0300\n"
     5"POT-Creation-Date: 2024-03-13 15:03+0300\n"
    66"PO-Revision-Date: 2023-11-03 15:22+0400\n"
    77"Last-Translator: \n"
     
    240240
    241241#: src/Admin/Support.php:43
     242msgid ""
     243"For correct work of the plugin do not use Permalink structure \"Plain"
     244"\" (Setting->Permalinks)."
     245msgstr ""
     246
     247#: src/Admin/Support.php:44
    242248msgid "Substitution options:"
    243249msgstr ""
    244250
    245 #: src/Admin/Support.php:45
     251#: src/Admin/Support.php:46
    246252msgid "the name of the region. For example, <strong>«Warsaw»</strong>."
    247253msgstr ""
    248254
    249 #: src/Admin/Support.php:46
    250 msgid ""
    251 "when talking about something that is in a region. For example, <strong>«In "
    252 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."
    253 msgstr ""
    254 
    255255#: src/Admin/Support.php:47
     256msgid ""
     257"in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W "
     258"Warszawie»</strong>."
     259msgstr ""
     260
     261#: src/Admin/Support.php:48
    256262msgid ""
    257263"by region. For example, <strong>«By Warsaw»</strong>, <strong>«W "
     
    259265msgstr ""
    260266
    261 #: src/Admin/Support.php:48
     267#: src/Admin/Support.php:49
    262268msgid ""
    263269"from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z "
     
    265271msgstr ""
    266272
    267 #: src/Admin/Support.php:49
     273#: src/Admin/Support.php:50
    268274msgid "phone number for the region"
    269275msgstr ""
    270276
    271 #: src/Admin/Support.php:50
     277#: src/Admin/Support.php:51
    272278msgid "address for the region"
    273279msgstr ""
    274280
    275 #: src/Admin/Support.php:51
     281#: src/Admin/Support.php:52
    276282msgid "email for the region"
    277283msgstr ""
    278284
    279 #: src/Admin/Support.php:52
     285#: src/Admin/Support.php:53
    280286msgid "link for the region"
    281287msgstr ""
    282288
    283 #: src/Region.php:320
     289#: src/Region.php:324
    284290msgid "Select a region"
    285291msgstr ""
  • geoflex/tags/1.2/readme.txt

    r3049631 r3050498  
    55Tested up to: 6.4.2
    66Requires PHP: 7.4
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2626
    2727* `{region_name}` the name of the region. For example, **«Warsaw»**,
    28 * `{region_in}` when talking about something that is in a region. For example, **«In Warsaw»**, **«W Warszawie»**,
     28* `{region_in}` in a region. For example, **«In Warsaw»**, **«W Warszawie»**,
    2929* `{region_by}` by region. For example, **«By Warsaw»**, **«W Warszawie»**,
    3030* `{region_from}` from the region. For example, **«From Warsaw»**, **«Z Warszawy»**,
     
    42423. Edit Region
    43434. Support
    44 5. Options in the content
    45 6. Regions pop-up
     445. Options in the content (admin panel)
     456. Options in the content (result on the website)
     467. Regions pop-up
    4647
    4748== Installation ==
     
    6263== Changelog ==
    6364
     65= 1.2 =
     66Updated strings to translate
     67Updated instructions on the Support Page
     68
    6469= 1.1 =
    65 Update Support page
     70Updated Support page
    6671
    6772= 1.0 =
  • geoflex/tags/1.2/src/Admin/Metabox.php

    r3049132 r3050498  
    145145        <table class="form-table" role="presentation">
    146146            <tbody>
    147                 <?php foreach ($this->fields as $field): ?>
     147                <?php
     148                    foreach ($this->fields as $field):
     149                        if (empty($field["id"]) || empty($field["type"]) || empty($field["label"])) {
     150                            continue;
     151                        }
     152                ?>
    148153                    <tr>
    149154                        <th scope="row">
     
    154159                        </td>
    155160                    </tr>
    156                 <?php endforeach; ?>
     161                <?php
     162                    endforeach;
     163                ?>
    157164            </tbody>
    158165        </table>
     
    195202        }
    196203
    197         $id = $field["id"];
     204        $id = Helpers::get_meta_key($field["id"], false);
    198205        $type = $field["type"];
    199206        $default = isset($field["default"] )? $field["default"] : "";
     
    317324        foreach ($this->fields as $field) {
    318325            $id = $field["id"];
     326
     327            if (empty($id)) {
     328                continue;
     329            }
     330
     331            $key = Helpers::get_meta_key($id, false);
    319332            $type = $field["type"];
    320333
    321334            switch ($type) {
    322335                case "checkbox":
    323                     $value = !!array_key_exists($id, $_POST);
     336                    $value = !!array_key_exists($key, $_POST);
    324337                    break;
    325338                case "textarea":
    326                     $value = array_key_exists($id, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$id])) : false;
     339                    $value = array_key_exists($key, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$key])) : false;
    327340                    break;
    328341                case "code_css":
    329                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     342                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    330343                    break;
    331344                case "code_js":
    332                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     345                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    333346                    break;
    334347                case "code_html":
    335                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     348                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    336349                    break;
    337350                default:
    338                     $value = array_key_exists($id, $_POST) ? sanitize_text_field(wp_unslash($_POST[$id])) : false;
     351                    $value = array_key_exists($key, $_POST) ? sanitize_text_field(wp_unslash($_POST[$key])) : false;
    339352            }
    340353
  • geoflex/tags/1.2/src/Admin/Support.php

    r3049631 r3050498  
    4141            <h3><?php esc_html_e("General options:", "geoflex"); ?></h3>
    4242            <p><?php echo wp_kses(__('To enable opening the region selection window upon clicking the link, it is necessary to add the <code>rel="region"</code> attribute.', "geoflex"), ['code' => []]); ?></p>
     43            <p><?php esc_html_e("For correct work of the plugin do not use Permalink structure \"Plain\" (Setting->Permalinks).", "geoflex"); ?></p>
    4344            <h3><?php esc_html_e("Substitution options:", "geoflex"); ?></h3>
    4445            <ul>
    4546                <li><code>{region_name}</code> <?php echo wp_kses(__("the name of the region. For example, <strong>«Warsaw»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    46                 <li><code>{region_in}</code> <?php echo wp_kses(__("when talking about something that is in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
     47                <li><code>{region_in}</code> <?php echo wp_kses(__("in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    4748                <li><code>{region_by}</code> <?php echo wp_kses(__("by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    4849                <li><code>{region_from}</code> <?php echo wp_kses(__("from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z Warszawy»</strong>.", "geoflex"), ['strong' => []]); ?></li>
  • geoflex/tags/1.2/src/Plugin.php

    r3049132 r3050498  
    9696        $slug = preg_replace("/\./", "", str_replace($home, "", $domain));
    9797
    98         if ($slug) {
     98        if ($slug && function_exists("idn_to_utf8")) {
    9999            $slug = sanitize_title(idn_to_utf8($slug));
    100100        }
  • geoflex/tags/1.2/src/Region.php

    r3049132 r3050498  
    103103        // Fields replaces
    104104        foreach (Metabox::get_fields() as $field) {
    105             if ($field["type"] === "checkbox") {
     105            if (empty($field["id"]) || $field["type"] === "checkbox") {
    106106                continue;
    107107            }
     
    215215    public function redirect_canonical($redirect, $requested)
    216216    {
    217         $redirect_domain = idn_to_ascii(wp_parse_url($redirect, PHP_URL_HOST));
     217        $redirect_domain = wp_parse_url($redirect, PHP_URL_HOST);
    218218        $requested_domain = wp_parse_url($requested, PHP_URL_HOST);
     219
     220        if (function_exists("idn_to_ascii")) {
     221            $redirect_domain = idn_to_ascii($redirect_domain );
     222        }
    219223
    220224        if ($redirect_domain === $requested_domain) {
  • geoflex/tags/1.2/src/Utils/Helpers.php

    r3049132 r3050498  
    1111     *
    1212     * @param string $id
     13     * @param  mixed $underscore
    1314     * @return string
    1415     */
    15     public static function get_meta_key(string $id)
     16    public static function get_meta_key(string $id, bool $underscore = true)
    1617    {
    17         return "_geoflex_" . $id;
     18        if (empty($id)) {
     19            return false;
     20        }
     21       
     22        $prefix = $underscore ? "_" : "";
     23        return $prefix . "geoflex_" . $id;
    1824    }
    1925
  • geoflex/trunk/geoflex.php

    r3049631 r3050498  
    44 * Plugin Name:       Geoflex
    55 * Description:       Adds multiregional capability to WordPress
    6  * Version:           1.1
     6 * Version:           1.2
    77 * Requires at least: 5.8.3
    88 * Requires PHP:      7.4
  • geoflex/trunk/languages/geoflex-ru_RU.po

    r3049631 r3050498  
    22msgstr ""
    33"Project-Id-Version: \n"
    4 "POT-Creation-Date: 2024-03-11 17:09+0300\n"
    5 "PO-Revision-Date: 2024-03-11 17:12+0300\n"
     4"POT-Creation-Date: 2024-03-13 15:03+0300\n"
     5"PO-Revision-Date: 2024-03-13 15:04+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    243243
    244244#: src/Admin/Support.php:43
     245msgid ""
     246"For correct work of the plugin do not use Permalink structure \"Plain"
     247"\" (Setting->Permalinks)."
     248msgstr ""
     249"Для правильной работы плагина не используйте структуру постоянных ссылок "
     250"\"Простые\" (Настройки->Постоянные ссылки)"
     251
     252#: src/Admin/Support.php:44
    245253msgid "Substitution options:"
    246254msgstr "Варианты замен:"
    247255
    248 #: src/Admin/Support.php:45
     256#: src/Admin/Support.php:46
    249257msgid "the name of the region. For example, <strong>«Warsaw»</strong>."
    250258msgstr "название региона. Например, <strong>«Варшава»</strong>."
    251259
    252 #: src/Admin/Support.php:46
    253 msgid ""
    254 "when talking about something that is in a region. For example, <strong>«In "
    255 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."
    256 msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."
    257 
    258260#: src/Admin/Support.php:47
     261msgid ""
     262"in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W "
     263"Warszawie»</strong>."
     264msgstr ""
     265"в регионе. Например, <strong>«В Варшеве»</strong>, <strong>«В Варшеве»</"
     266"strong>."
     267
     268#: src/Admin/Support.php:48
    259269msgid ""
    260270"by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</"
     
    262272msgstr "по региону. Например, <strong>«По Варшаве»</strong>."
    263273
    264 #: src/Admin/Support.php:48
     274#: src/Admin/Support.php:49
    265275msgid ""
    266276"from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z "
     
    268278msgstr "из региона. Например, <strong>«Из Варшавы»</strong>."
    269279
    270 #: src/Admin/Support.php:49
     280#: src/Admin/Support.php:50
    271281msgid "phone number for the region"
    272282msgstr "номер телефона для региона"
    273283
    274 #: src/Admin/Support.php:50
     284#: src/Admin/Support.php:51
    275285msgid "address for the region"
    276286msgstr "адрес в регионе"
    277287
    278 #: src/Admin/Support.php:51
     288#: src/Admin/Support.php:52
    279289msgid "email for the region"
    280290msgstr "email для региона"
    281291
    282 #: src/Admin/Support.php:52
     292#: src/Admin/Support.php:53
    283293msgid "link for the region"
    284294msgstr "ссылка для региона"
    285295
    286 #: src/Region.php:320
     296#: src/Region.php:324
    287297msgid "Select a region"
    288298msgstr "Выберите регион"
    289299
     300#, fuzzy
     301#~| msgid ""
     302#~| "when talking about something that is in a region. For example, "
     303#~| "<strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>."
     304#~ msgid ""
     305#~ "something that is in a region. For example, <strong>«In Warsaw»</strong>, "
     306#~ "<strong>«W Warszawie»</strong>."
     307#~ msgstr "в регионе. Например, <strong>«В Варшаве»</strong>."
     308
    290309#~ msgid "Regions settings"
    291310#~ msgstr "Настройки регионов"
  • geoflex/trunk/languages/geoflex.pot

    r3049631 r3050498  
    33msgstr ""
    44"Project-Id-Version: \n"
    5 "POT-Creation-Date: 2024-03-11 17:09+0300\n"
     5"POT-Creation-Date: 2024-03-13 15:03+0300\n"
    66"PO-Revision-Date: 2023-11-03 15:22+0400\n"
    77"Last-Translator: \n"
     
    240240
    241241#: src/Admin/Support.php:43
     242msgid ""
     243"For correct work of the plugin do not use Permalink structure \"Plain"
     244"\" (Setting->Permalinks)."
     245msgstr ""
     246
     247#: src/Admin/Support.php:44
    242248msgid "Substitution options:"
    243249msgstr ""
    244250
    245 #: src/Admin/Support.php:45
     251#: src/Admin/Support.php:46
    246252msgid "the name of the region. For example, <strong>«Warsaw»</strong>."
    247253msgstr ""
    248254
    249 #: src/Admin/Support.php:46
    250 msgid ""
    251 "when talking about something that is in a region. For example, <strong>«In "
    252 "Warsaw»</strong>, <strong>«W Warszawie»</strong>."
    253 msgstr ""
    254 
    255255#: src/Admin/Support.php:47
     256msgid ""
     257"in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W "
     258"Warszawie»</strong>."
     259msgstr ""
     260
     261#: src/Admin/Support.php:48
    256262msgid ""
    257263"by region. For example, <strong>«By Warsaw»</strong>, <strong>«W "
     
    259265msgstr ""
    260266
    261 #: src/Admin/Support.php:48
     267#: src/Admin/Support.php:49
    262268msgid ""
    263269"from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z "
     
    265271msgstr ""
    266272
    267 #: src/Admin/Support.php:49
     273#: src/Admin/Support.php:50
    268274msgid "phone number for the region"
    269275msgstr ""
    270276
    271 #: src/Admin/Support.php:50
     277#: src/Admin/Support.php:51
    272278msgid "address for the region"
    273279msgstr ""
    274280
    275 #: src/Admin/Support.php:51
     281#: src/Admin/Support.php:52
    276282msgid "email for the region"
    277283msgstr ""
    278284
    279 #: src/Admin/Support.php:52
     285#: src/Admin/Support.php:53
    280286msgid "link for the region"
    281287msgstr ""
    282288
    283 #: src/Region.php:320
     289#: src/Region.php:324
    284290msgid "Select a region"
    285291msgstr ""
  • geoflex/trunk/readme.txt

    r3049631 r3050498  
    55Tested up to: 6.4.2
    66Requires PHP: 7.4
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2626
    2727* `{region_name}` the name of the region. For example, **«Warsaw»**,
    28 * `{region_in}` when talking about something that is in a region. For example, **«In Warsaw»**, **«W Warszawie»**,
     28* `{region_in}` in a region. For example, **«In Warsaw»**, **«W Warszawie»**,
    2929* `{region_by}` by region. For example, **«By Warsaw»**, **«W Warszawie»**,
    3030* `{region_from}` from the region. For example, **«From Warsaw»**, **«Z Warszawy»**,
     
    42423. Edit Region
    43434. Support
    44 5. Options in the content
    45 6. Regions pop-up
     445. Options in the content (admin panel)
     456. Options in the content (result on the website)
     467. Regions pop-up
    4647
    4748== Installation ==
     
    6263== Changelog ==
    6364
     65= 1.2 =
     66Updated strings to translate
     67Updated instructions on the Support Page
     68
    6469= 1.1 =
    65 Update Support page
     70Updated Support page
    6671
    6772= 1.0 =
  • geoflex/trunk/src/Admin/Metabox.php

    r3049132 r3050498  
    145145        <table class="form-table" role="presentation">
    146146            <tbody>
    147                 <?php foreach ($this->fields as $field): ?>
     147                <?php
     148                    foreach ($this->fields as $field):
     149                        if (empty($field["id"]) || empty($field["type"]) || empty($field["label"])) {
     150                            continue;
     151                        }
     152                ?>
    148153                    <tr>
    149154                        <th scope="row">
     
    154159                        </td>
    155160                    </tr>
    156                 <?php endforeach; ?>
     161                <?php
     162                    endforeach;
     163                ?>
    157164            </tbody>
    158165        </table>
     
    195202        }
    196203
    197         $id = $field["id"];
     204        $id = Helpers::get_meta_key($field["id"], false);
    198205        $type = $field["type"];
    199206        $default = isset($field["default"] )? $field["default"] : "";
     
    317324        foreach ($this->fields as $field) {
    318325            $id = $field["id"];
     326
     327            if (empty($id)) {
     328                continue;
     329            }
     330
     331            $key = Helpers::get_meta_key($id, false);
    319332            $type = $field["type"];
    320333
    321334            switch ($type) {
    322335                case "checkbox":
    323                     $value = !!array_key_exists($id, $_POST);
     336                    $value = !!array_key_exists($key, $_POST);
    324337                    break;
    325338                case "textarea":
    326                     $value = array_key_exists($id, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$id])) : false;
     339                    $value = array_key_exists($key, $_POST) ? sanitize_textarea_field(wp_unslash($_POST[$key])) : false;
    327340                    break;
    328341                case "code_css":
    329                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     342                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    330343                    break;
    331344                case "code_js":
    332                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     345                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    333346                    break;
    334347                case "code_html":
    335                     $value = array_key_exists($id, $_POST) ? wp_unslash($_POST[$id]) : false;
     348                    $value = array_key_exists($key, $_POST) ? wp_unslash($_POST[$key]) : false;
    336349                    break;
    337350                default:
    338                     $value = array_key_exists($id, $_POST) ? sanitize_text_field(wp_unslash($_POST[$id])) : false;
     351                    $value = array_key_exists($key, $_POST) ? sanitize_text_field(wp_unslash($_POST[$key])) : false;
    339352            }
    340353
  • geoflex/trunk/src/Admin/Support.php

    r3049631 r3050498  
    4141            <h3><?php esc_html_e("General options:", "geoflex"); ?></h3>
    4242            <p><?php echo wp_kses(__('To enable opening the region selection window upon clicking the link, it is necessary to add the <code>rel="region"</code> attribute.', "geoflex"), ['code' => []]); ?></p>
     43            <p><?php esc_html_e("For correct work of the plugin do not use Permalink structure \"Plain\" (Setting->Permalinks).", "geoflex"); ?></p>
    4344            <h3><?php esc_html_e("Substitution options:", "geoflex"); ?></h3>
    4445            <ul>
    4546                <li><code>{region_name}</code> <?php echo wp_kses(__("the name of the region. For example, <strong>«Warsaw»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    46                 <li><code>{region_in}</code> <?php echo wp_kses(__("when talking about something that is in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
     47                <li><code>{region_in}</code> <?php echo wp_kses(__("in a region. For example, <strong>«In Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    4748                <li><code>{region_by}</code> <?php echo wp_kses(__("by region. For example, <strong>«By Warsaw»</strong>, <strong>«W Warszawie»</strong>.", "geoflex"), ['strong' => []]); ?></li>
    4849                <li><code>{region_from}</code> <?php echo wp_kses(__("from the region. For example, <strong>«From Warsaw»</strong>, <strong>«Z Warszawy»</strong>.", "geoflex"), ['strong' => []]); ?></li>
  • geoflex/trunk/src/Plugin.php

    r3049132 r3050498  
    9696        $slug = preg_replace("/\./", "", str_replace($home, "", $domain));
    9797
    98         if ($slug) {
     98        if ($slug && function_exists("idn_to_utf8")) {
    9999            $slug = sanitize_title(idn_to_utf8($slug));
    100100        }
  • geoflex/trunk/src/Region.php

    r3049132 r3050498  
    103103        // Fields replaces
    104104        foreach (Metabox::get_fields() as $field) {
    105             if ($field["type"] === "checkbox") {
     105            if (empty($field["id"]) || $field["type"] === "checkbox") {
    106106                continue;
    107107            }
     
    215215    public function redirect_canonical($redirect, $requested)
    216216    {
    217         $redirect_domain = idn_to_ascii(wp_parse_url($redirect, PHP_URL_HOST));
     217        $redirect_domain = wp_parse_url($redirect, PHP_URL_HOST);
    218218        $requested_domain = wp_parse_url($requested, PHP_URL_HOST);
     219
     220        if (function_exists("idn_to_ascii")) {
     221            $redirect_domain = idn_to_ascii($redirect_domain );
     222        }
    219223
    220224        if ($redirect_domain === $requested_domain) {
  • geoflex/trunk/src/Utils/Helpers.php

    r3049132 r3050498  
    1111     *
    1212     * @param string $id
     13     * @param  mixed $underscore
    1314     * @return string
    1415     */
    15     public static function get_meta_key(string $id)
     16    public static function get_meta_key(string $id, bool $underscore = true)
    1617    {
    17         return "_geoflex_" . $id;
     18        if (empty($id)) {
     19            return false;
     20        }
     21       
     22        $prefix = $underscore ? "_" : "";
     23        return $prefix . "geoflex_" . $id;
    1824    }
    1925
Note: See TracChangeset for help on using the changeset viewer.