Plugin Directory

Changeset 3209648


Ignore:
Timestamp:
12/18/2024 06:28:52 AM (13 months ago)
Author:
nestechdokobit
Message:

Deploy version 2.3.0

Location:
nestech
Files:
15 added
2 edited

Legend:

Unmodified
Added
Removed
  • nestech/trunk/nestech.php

    r3207440 r3209648  
    44Plugin URI: https://nestech.lt/
    55Description: Smart-ID, Mobile ID and other authenticators for your website
    6 Version: 2.2.0
     6Version: 2.3.0
    77Author: Nestech
    88Requires at least: 5.0
     
    300300    public function add_nestech_content(): void
    301301    {
    302         if (get_option('nestech_placement', true))
     302        $placement = get_option('nestech_placement', true);
     303        if ($placement || $placement === '')
    303304            echo "<div id='nestech-dokobit-root'></div>";
    304305    }
     
    438439        $activateUrl = $this->get_host_with_schema() . "?nestech_activate=1&nestech_token=$token";
    439440        $headers = ['Content-Type: text/html; charset=UTF-8'];
    440         $defaultMessage = "<p>Verify your email by clicking <a href='{$activateUrl}'>here</a></p>";
    441         $defaultMessage .= "<p><small>Or paste this link in your browser: $activateUrl</small></p>";
    442         $defaultMessage .= "<p><small>The link is valid for 24 hours</small></p>";
     441        $translations = $this->get_translations();
     442        $defaultMessage = "<p>{$translations['verify_message']} <a href='{$activateUrl}'>{$translations['here']}</a></p>";
     443        $defaultMessage .= "<p><small>{$translations['paste_link_message']}: $activateUrl</small></p>";
     444        $defaultMessage .= "<p><small>{$translations['link_expiry_message']}.</small></p>";
    443445        $message = apply_filters('nestech_verification_email_body', $defaultMessage, $activateUrl);
    444         $subject = apply_filters('nestech_verification_email_subject', 'Verify your email');
     446        $subject = apply_filters('nestech_verification_email_subject', $translations['subject']);
    445447        $sent = wp_mail($email, $subject, $message, $headers);
    446448        if (!$sent)
     
    670672        $placement = $args['Placement'] ?? null;
    671673        if ($placement !== null)
    672             add_option('nestech_placement', $placement);
     674            update_option('nestech_placement', $placement);
    673675        $response = wp_remote_post($external_url, [
    674676            'headers' => ['Content-Type' => 'application/json'],
     
    836838    }
    837839
     840    private function get_translations()
     841    {
     842        $translations = [
     843            'en_US' => [
     844                'subject' => 'Verify your email',
     845                'verify_message' => 'Verify your email by clicking',
     846                'here' => 'here',
     847                'paste_link_message' => 'Or paste this link in your browser',
     848                'link_expiry_message' => 'The link is valid for 24 hours',
     849            ],
     850            'lt_LT' => [
     851                'subject' => 'Patvirtinkite savo el. paštą',
     852                'verify_message' => 'Patvirtinkite savo el. paštą paspaudę',
     853                'here' => 'čia',
     854                'paste_link_message' => 'Arba nukopijuokite šią nuorodą naršyklėje',
     855                'link_expiry_message' => 'Nuoroda galioja 24 valandas',
     856            ],
     857            'lv_LV' => [
     858                'subject' => 'Apstipriniet savu e-pastu',
     859                'verify_message' => 'Apstipriniet savu e-pastu, noklikšķinot',
     860                'here' => 'šeit',
     861                'paste_link_message' => 'Vai ielīmējiet šo saiti savā pārlūkprogrammā',
     862                'link_expiry_message' => 'Saite ir derīga 24 stundas',
     863            ],
     864            'et_EE' => [
     865                'subject' => 'Kinnitage oma e-post',
     866                'verify_message' => 'Kinnitage oma e-post, klõpsates',
     867                'here' => 'siin',
     868                'paste_link_message' => 'Või kleepige see link oma brauserisse',
     869                'link_expiry_message' => 'Link kehtib 24 tundi',
     870            ],
     871            'is_IS' => [
     872                'subject' => 'Staðfestu netfangið þitt',
     873                'verify_message' => 'Staðfestu netfangið þitt með því að smella',
     874                'here' => 'hér',
     875                'paste_link_message' => 'Eða límdu þennan hlekk í vafrann þinn',
     876                'link_expiry_message' => 'Hlekkurinn er gildur í 24 klukkustundir',
     877            ],
     878        ];
     879        $locale = determine_locale() ?? 'en_US';
     880
     881        return $translations[$locale];
     882    }
     883
    838884    public function nestech_shortcode($atts)
    839885    {
  • nestech/trunk/readme.txt

    r3207440 r3209648  
    55Tested up to: 6.7.1
    66Requires PHP: 8.0
    7 Stable tag: 2.2.0
     7Stable tag: 2.3.0
    88License: GPL V2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    42422.1.0 - Minor improvements for better support.
    43432.2.0 - Improved UX for settings and subscriptions.
     442.3.0 - Added email translations for Lithuanian, Latvian, Estonian and Icelandic languages.
    4445
    4546== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.