Changeset 3133814
- Timestamp:
- 08/11/2024 06:47:18 PM (18 months ago)
- Location:
- woocommerce-cestina
- Files:
-
- 35 added
- 1 deleted
- 3 edited
-
branches/2.7.zip (deleted)
-
tags/2.7.1 (added)
-
tags/2.7.1/admin (added)
-
tags/2.7.1/admin/css (added)
-
tags/2.7.1/admin/css/header-footer.css (added)
-
tags/2.7.1/admin/css/request-translation.css (added)
-
tags/2.7.1/admin/css/site-content.css (added)
-
tags/2.7.1/admin/css/stng-page.css (added)
-
tags/2.7.1/admin/css/style-wpt-menu.css (added)
-
tags/2.7.1/admin/css/wptt-changelog.css (added)
-
tags/2.7.1/admin/pages (added)
-
tags/2.7.1/admin/pages/download-request-plugin.php (added)
-
tags/2.7.1/admin/pages/main-page.php (added)
-
tags/2.7.1/admin/pages/plugin-statistics.php (added)
-
tags/2.7.1/admin/pages/plugin-translate-footer.php (added)
-
tags/2.7.1/admin/pages/plugin-translate-header.php (added)
-
tags/2.7.1/admin/pages/translated-plugins.php (added)
-
tags/2.7.1/admin/pages/translated-themes.php (added)
-
tags/2.7.1/assets (added)
-
tags/2.7.1/assets/icons (added)
-
tags/2.7.1/assets/icons/discord.png (added)
-
tags/2.7.1/assets/icons/facebook.png (added)
-
tags/2.7.1/assets/icons/instagram.png (added)
-
tags/2.7.1/assets/icons/wpt-translate.png (added)
-
tags/2.7.1/assets/icons/x.png (added)
-
tags/2.7.1/assets/icons/youtube.png (added)
-
tags/2.7.1/core (added)
-
tags/2.7.1/core/create-admin-menu.php (added)
-
tags/2.7.1/core/plugins (added)
-
tags/2.7.1/core/plugins/woocommerce.php (added)
-
tags/2.7.1/license.txt (added)
-
tags/2.7.1/readme.txt (added)
-
tags/2.7.1/translates (added)
-
tags/2.7.1/translates/plugins (added)
-
tags/2.7.1/translates/plugins/woocommerce-cs_CZ.mo (added)
-
tags/2.7.1/woocommerce-cestina.php (added)
-
trunk/admin/pages/download-request-plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-cestina.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-cestina/trunk/admin/pages/download-request-plugin.php
r3133780 r3133814 9 9 <?php include 'plugin-translate-header.php'; ?> 10 10 <div class="wptech_translate-wrap" style="text-align: center; padding: 50px;"> 11 <h2>Žádost o stažení WPTrans Plugin</h2>12 11 <?php 13 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 14 // Načtení aktuálního přihlášeného uživatele 15 $current_user = wp_get_current_user(); 16 $user_name = $current_user->display_name; 17 $user_email = $current_user->user_email; 18 19 // Informace o webu 20 $site_url = get_site_url(); 12 // Načtení URL aktuálního webu a odstranění www. a koncových lomítek pro konzistentní porovnání 13 $current_site_url = rtrim(preg_replace('/^www\./', '', get_site_url()), '/'); 21 14 22 // Nastavení e-mailu 23 $to = '[email protected]'; 24 $subject = 'Žádost o WPTrans Plugin'; 25 $message = "Uživatel \"$user_name\" žádá o stažení WPTrans Plugin pro webové stránky.\n\n"; 26 $message .= "Webová stránka: $site_url\n"; 27 $message .= "Email: $user_email"; 28 $headers = "From: $user_name <$user_email>"; 15 // Funkce pro kontrolu VIP statusu 16 function is_vip_site($site_url) { 17 $response = wp_remote_get('https://wpress.tech/wp-json/wp/v2/vip-sites?per_page=100&order=desc&orderby=date'); 29 18 30 // Odeslání e-mailu 31 if (wp_mail($to, $subject, $message, $headers)) { 32 echo '<p style="color: green;">Žádost byla úspěšně odeslána.</p>'; 33 } else { 34 echo '<p style="color: red;">Nastala chyba při odesílání e-mailu. Zkontrolujte prosím nastavení serveru a zkuste to znovu.</p>'; 19 if (is_wp_error($response)) { 20 return false; // Pokud dojde k chybě při volání API, považujeme web za ne VIP 35 21 } 22 23 $body = wp_remote_retrieve_body($response); 24 $vip_sites = json_decode($body); 25 26 if (json_last_error() !== JSON_ERROR_NONE) { 27 return false; // Pokud je chyba při dekódování JSON, považujeme web za ne VIP 28 } 29 30 // Kontrola, zda se URL aktuálního webu shoduje s URL v API 31 foreach ($vip_sites as $site) { 32 if (isset($site->acf->url_adresa)) { 33 // Odstranění www. a koncových lomítek z URL v API pro konzistentní porovnání 34 $api_site_url = rtrim(preg_replace('/^www\./', '', $site->acf->url_adresa), '/'); 35 if ($api_site_url === $site_url) { 36 return true; // Pokud je nalezena shoda, web je VIP 37 } 38 } 39 } 40 41 return false; // Pokud není nalezena shoda, web není VIP 42 } 43 44 // Kontrola, zda je web ve VIP seznamu 45 if (is_vip_site($current_site_url)) { 46 // Obsah pro VIP weby 47 echo '<h2>Stáhnout WPTrans Plugin</h2>'; 48 echo '<p>Pro váš web je dostupný WPTrans Plugin ke stažení.</p>'; 49 echo '<a href="#" style="padding: 15px 30px; background-color: #005a9c; color: white; text-decoration: none; font-size: 18px; border-radius: 5px; display: inline-block; margin-top: 20px;">Stáhnout Plugin</a>'; 50 } else { 51 // Původní obsah pro ne VIP weby 52 echo '<h2>Žádost o stažení WPTrans Plugin</h2>'; 53 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 54 // Načtení aktuálního přihlášeného uživatele 55 $current_user = wp_get_current_user(); 56 $user_name = $current_user->display_name; 57 $user_email = $current_user->user_email; 58 59 // Nastavení e-mailu 60 $to = '[email protected]'; 61 $subject = 'Žádost o WPTrans Plugin'; 62 $message = "Uživatel \"$user_name\" žádá o stažení WPTrans Plugin pro webové stránky.\n\n"; 63 $message .= "Webová stránka: $current_site_url\n"; 64 $message .= "Email: $user_email"; 65 $headers = "From: $user_name <$user_email>"; 66 67 // Odeslání e-mailu 68 if (wp_mail($to, $subject, $message, $headers)) { 69 echo '<p style="color: green;">Žádost byla úspěšně odeslána.</p>'; 70 } else { 71 echo '<p style="color: red;">Nastala chyba při odesílání e-mailu. Zkontrolujte prosím nastavení serveru a zkuste to znovu.</p>'; 72 } 73 } 74 75 echo '<form method="post" action="">'; 76 echo '<button type="submit" style="padding: 10px 20px; font-size: 16px; cursor: pointer;">Odeslat žádost</button>'; 77 echo '</form>'; 36 78 } 37 79 ?> 38 39 <form method="post" action="">40 <button type="submit" style="padding: 10px 20px; font-size: 16px; cursor: pointer;">Odeslat žádost</button>41 </form>42 80 </div> 43 81 <?php include 'plugin-translate-footer.php'; ?> -
woocommerce-cestina/trunk/readme.txt
r3133780 r3133814 6 6 Tested up to: 6.6.1 7 7 Requires PHP: 5.7 8 Stable tag: 2.7 8 Stable tag: 2.7.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 58 58 == Changelog == 59 60 = 2.7.1 = 61 * Aktualizace překladu 59 62 60 63 = 2.7 = -
woocommerce-cestina/trunk/woocommerce-cestina.php
r3133780 r3133814 5 5 Plugin URI: http://wpress.tech 6 6 Description: Přeloží WooCommerce a vybrané dodatkové pluginy do češtiny. 7 Version: 2.7 7 Version: 2.7.1 8 8 Author: WPressTech 9 9 Author URI: https://wpress.tech
Note: See TracChangeset
for help on using the changeset viewer.