Changeset 3352529
- Timestamp:
- 08/29/2025 10:15:33 AM (7 months ago)
- Location:
- autoglot
- Files:
-
- 68 added
- 4 deleted
- 5 edited
-
assets/screenshot-1.jpg (added)
-
assets/screenshot-1.png (deleted)
-
assets/screenshot-10.jpg (added)
-
assets/screenshot-2.jpg (added)
-
assets/screenshot-2.png (deleted)
-
assets/screenshot-3.jpg (added)
-
assets/screenshot-3.png (deleted)
-
assets/screenshot-4.jpg (added)
-
assets/screenshot-4.png (deleted)
-
assets/screenshot-5.jpg (added)
-
assets/screenshot-6.jpg (added)
-
assets/screenshot-7.jpg (added)
-
assets/screenshot-8.jpg (added)
-
assets/screenshot-9.jpg (added)
-
tags/2.7.7 (added)
-
tags/2.7.7/admin (added)
-
tags/2.7.7/admin/autoglot_admin.php (added)
-
tags/2.7.7/admin/autoglot_editor.php (added)
-
tags/2.7.7/admin/css (added)
-
tags/2.7.7/admin/css/autoglot_flags.css (added)
-
tags/2.7.7/admin/css/autoglot_translation_admin.css (added)
-
tags/2.7.7/admin/index.php (added)
-
tags/2.7.7/admin/js (added)
-
tags/2.7.7/admin/js/autoglot_translation_admin.js (added)
-
tags/2.7.7/admin/js/autoglot_translation_admin_tabs.js (added)
-
tags/2.7.7/admin/js/autoglot_translation_editor.js (added)
-
tags/2.7.7/admin/partials (added)
-
tags/2.7.7/admin/partials/display_dashboard.php (added)
-
tags/2.7.7/admin/partials/display_editor.php (added)
-
tags/2.7.7/admin/partials/display_settings.php (added)
-
tags/2.7.7/admin/partials/display_setup.php (added)
-
tags/2.7.7/admin/partials/display_utilities.php (added)
-
tags/2.7.7/autoglot.php (added)
-
tags/2.7.7/front (added)
-
tags/2.7.7/front/css (added)
-
tags/2.7.7/front/css/autoglot.css (added)
-
tags/2.7.7/front/css/autoglot.min.css (added)
-
tags/2.7.7/front/img (added)
-
tags/2.7.7/front/img/flags_sprites.png (added)
-
tags/2.7.7/front/img/smallflags_sprites.png (added)
-
tags/2.7.7/front/index.php (added)
-
tags/2.7.7/front/js (added)
-
tags/2.7.7/front/js/autoglot.js (added)
-
tags/2.7.7/index.php (added)
-
tags/2.7.7/readme.txt (added)
-
tags/2.7.7/translation (added)
-
tags/2.7.7/translation/autoglot-de.mo (added)
-
tags/2.7.7/translation/autoglot-de.po (added)
-
tags/2.7.7/translation/autoglot-es_ES.mo (added)
-
tags/2.7.7/translation/autoglot-es_ES.po (added)
-
tags/2.7.7/translation/autoglot-fr_FR.mo (added)
-
tags/2.7.7/translation/autoglot-fr_FR.po (added)
-
tags/2.7.7/translation/autoglot-it.mo (added)
-
tags/2.7.7/translation/autoglot-it.po (added)
-
tags/2.7.7/translation/autoglot-pt.mo (added)
-
tags/2.7.7/translation/autoglot-pt.po (added)
-
tags/2.7.7/translation/autoglot-ru_RU.mo (added)
-
tags/2.7.7/translation/autoglot-ru_RU.po (added)
-
tags/2.7.7/translation/autoglot.pot (added)
-
tags/2.7.7/translation/index.php (added)
-
tags/2.7.7/translation/ru.mo (added)
-
tags/2.7.7/translation/ru.po (added)
-
tags/2.7.7/utils (added)
-
tags/2.7.7/utils/autoglot_3rdparty.php (added)
-
tags/2.7.7/utils/autoglot_constants.php (added)
-
tags/2.7.7/utils/autoglot_curl.php (added)
-
tags/2.7.7/utils/autoglot_db.php (added)
-
tags/2.7.7/utils/autoglot_dom.php (added)
-
tags/2.7.7/utils/autoglot_options.php (added)
-
tags/2.7.7/utils/autoglot_utils.php (added)
-
tags/2.7.7/utils/autoglot_widget.php (added)
-
tags/2.7.7/utils/index.php (added)
-
trunk/autoglot.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/utils/autoglot_constants.php (modified) (2 diffs)
-
trunk/utils/autoglot_dom.php (modified) (1 diff)
-
trunk/utils/autoglot_utils.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
autoglot/trunk/autoglot.php
r3352146 r3352529 4 4 Plugin URI: https://autoglot.com/download/ 5 5 Description: Fully automatic SEO-friendly plugin for multilingual WordPress translation. Translate your website and boost your traffic in minutes! No coding, no subscription, no recurring payments, no hurdles! 6 Version: 2.7. 66 Version: 2.7.7 7 7 Text Domain: autoglot 8 8 Author: Autoglot WordPress Team … … 78 78 private $flushed_buffer = false; 79 79 80 /** is it custom ajax/json request with fragments for woo? */ 81 public $json_custom_request = false; 82 83 /** is it custom ajax/html request like woo? */ 84 public $html_custom_request = false; 80 /** is it custom ajax request for woo? */ 81 public $custom_ajax_request = false; 85 82 86 83 /** content_type of generated response */ … … 103 100 $this->langURL = autoglot_utils::get_language_from_url($_SERVER['REQUEST_URI'], $this->homeURL); 104 101 105 if (autoglot_utils::is_custom_ json()) {//is custom ajax/json like woocommerce requests102 if (autoglot_utils::is_custom_ajax()) {//is custom ajax like woocommerce request 106 103 $this->langURL = autoglot_utils::get_language_from_url($_SERVER['HTTP_REFERER'], $this->homeURL); 107 $this-> json_custom_request = true;108 } elseif (autoglot_utils::is_custom_html()) {//is custom ajax/htmllike woocommerce requests104 $this->custom_ajax_request = true; 105 /* } elseif (autoglot_utils::is_custom_json()) {//is custom ajax/json like woocommerce requests 109 106 $this->langURL = autoglot_utils::get_language_from_url($_SERVER['HTTP_REFERER'], $this->homeURL); 110 $this-> html_custom_request = true;107 $this->custom_ajax_request = true;*/ 111 108 } elseif(wp_is_json_request()) {//not custom ajax/json but json, so check lang and try from referer 112 109 if(!strlen($this->langURL)) $this->langURL = autoglot_utils::get_language_from_url($_SERVER['HTTP_REFERER'], $this->homeURL); … … 703 700 } 704 701 705 if($this->response_content_type == "json" && !$this-> json_custom_request){//it's json, let's check if it contains [html] or other items like woo cart, return if not702 if($this->response_content_type == "json" && !$this->custom_ajax_request){//it's json, let's check if it contains [html] or other items like woo cart, return if not 706 703 if ($buffer[0] == '{') { 707 704 $tryjson = json_decode($buffer); … … 751 748 return json_encode($tryjson); // return translated json 752 749 753 /* if (isset($tryjson->html) && strlen($tryjson->html)) {754 $tryjson->html = $this->translate_json($tryjson->html);755 //$tryjson->translated_by = "Autoglot";756 return json_encode($tryjson); // return translated json757 }*/758 //$tryjson->not_translated_by = "Autoglot";759 //return json_encode($tryjson); // return not translated json760 750 } 761 751 } 762 752 return $buffer; 763 753 } 764 765 if($this-> json_custom_request) {754 755 if($this->response_content_type == "json" && $this->custom_ajax_request) { 766 756 if ($buffer[0] == '{') { 767 757 … … 775 765 } 776 766 } 777 //file_put_contents(__DIR__."/debug".time().".txt", print_r($tryjson->fragments, true), FILE_APPEND);778 /*if (isset($tryjson->fragments->{'.woocommerce-checkout-review-order-table'})) {779 $tryjson->fragments->{'.woocommerce-checkout-review-order-table'} = $this->translate_json($tryjson->fragments->{'.woocommerce-checkout-review-order-table'});780 }781 if (isset($tryjson->fragments->{'.woocommerce-checkout-payment'})) {782 $tryjson->fragments->{'.woocommerce-checkout-payment'} = $this->translate_json($tryjson->fragments->{'.woocommerce-checkout-payment'});783 }784 if (isset($tryjson->fragments->{'div.widget_shopping_cart_content'})) {785 $tryjson->fragments->{'div.widget_shopping_cart_content'} = $this->translate_json($tryjson->fragments->{'div.widget_shopping_cart_content'});786 }*/787 767 788 768 //file_put_contents(__DIR__."/debug".time().".txt", print_r($tryjson->fragments, true), FILE_APPEND); … … 794 774 } 795 775 796 if((is_admin() && wp_doing_ajax() && $this->response_content_type == "html") || $this->html_custom_request) {//custom ajax+html776 if((is_admin() && wp_doing_ajax() && $this->response_content_type == "html") || ($this->response_content_type == "html" && $this->custom_ajax_request)) {//custom ajax+html 797 777 if ($buffer[0] != '{') { 798 778 $buffer = $this->translate_json($buffer); … … 885 865 // Process the value using the appropriate callback 886 866 $callback_name = $process_callbacks[$key]; 887 if ($callback_name === 'translate_url') { 888 // translate_url needs language parameter 889 $tryjson[$key] = $this->$callback_name($value, $this->langURL); 867 if ($callback_name === 'update_url') { 868 // update_url needs a different approach 869 if($this->options->translate_urls) { 870 $tryjson[$key] = autoglot_utils::add_language_to_url($this->translate_url($tryjson[$key], $this->langURL), $this->homeURL, $this->langURL); 871 } else { 872 $tryjson[$key] = autoglot_utils::add_language_to_url($tryjson[$key], $this->homeURL, $this->langURL); 873 } 890 874 } else { 891 875 // Other callbacks like translate_json only need the value … … 906 890 // Process the value using the appropriate callback 907 891 $callback_name = $process_callbacks[$key]; 908 if ($callback_name === 'translate_url') { 909 // translate_url needs language parameter 910 $tryjson->$key = $this->$callback_name($value, $this->langURL); 892 if ($callback_name === 'update_url') { 893 // update_url needs a different approach 894 if($this->options->translate_urls) { 895 $tryjson->$key = autoglot_utils::add_language_to_url($this->translate_url($tryjson->$key, $this->langURL), $this->homeURL, $this->langURL); 896 } else { 897 $tryjson->$key = autoglot_utils::add_language_to_url($tryjson->$key, $this->homeURL, $this->langURL); 898 } 911 899 } else { 912 900 // Other callbacks like translate_json only need the value -
autoglot/trunk/readme.txt
r3352146 r3352529 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.0 7 Stable tag: 2.7. 67 Stable tag: 2.7.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 308 308 == Upgrade Notice == 309 309 310 = 2.7. 6=310 = 2.7.7 = 311 311 Improved WooCommerce integration 312 312 … … 343 343 == Screenshots == 344 344 345 1. Copy your API key from your Autoglot Control Panel and enable translation 346 2. Choose as many languages as you need for translation 347 3. Add a widget with language selector 348 4. Enjoy new visitors on your SEO optimized translated multilingual website 345 1. No coding required: simply find, install and activate Autoglot plugin. 346 2. Register in our Autoglot Control Panel - it's free, no credit card required! 347 3. Autoglot Control Panel is the place to track your balance and add new orders. 348 4. Complete Autoglot setup in 3 simple steps. 349 5. You can always change Autoglot settings later! 350 6. Choose any type of language switcher: widgets, shortcodes, or floating box! 351 7. Choose as many languages as you need for translation. 352 8. You can also change flags for the top popular languages like English or Spanish. 353 9. Autoglot supports MTPE with our convenient Translation editor. 354 10. Feel free to change links, videos or images in each language. 349 355 350 356 == Changelog == 357 358 = 2.7.7 (29/08/2025) = 359 * Improved WooCommerce integration 360 * Small fixes in translation of AJAX-generated JSON files 361 * Removed outdated code 362 * Added new screenshots to plugin description 351 363 352 364 = 2.7.6 (28/08/2025) = -
autoglot/trunk/utils/autoglot_constants.php
r3352146 r3352529 177 177 'html' => 'translate_json', 178 178 'content' => 'translate_json', 179 'url' => ' translate_url',179 'url' => 'update_url', 180 180 ); 181 181 … … 255 255 256 256 //Define for autoglot plugin version 257 define('AUTOGLOT_PLUGIN_VER', '2.7. 6');257 define('AUTOGLOT_PLUGIN_VER', '2.7.7'); 258 258 259 259 //Define for autoglot plugin name -
autoglot/trunk/utils/autoglot_dom.php
r3348279 r3352529 893 893 // Generate final output 894 894 $output = ""; 895 if($this->autoglot-> json_custom_request || $this->autoglot->html_custom_request || wp_is_json_request() || $this->autoglot->response_content_type == "json" || (is_admin() && wp_doing_ajax())){895 if($this->autoglot->custom_ajax_request || wp_is_json_request() || $this->autoglot->response_content_type == "json" || (is_admin() && wp_doing_ajax())){ 896 896 $body = $this->dom_translated->getElementsByTagName('body')->item(0); 897 897 if ($body) foreach ($body->childNodes as $child) { -
autoglot/trunk/utils/autoglot_utils.php
r3352146 r3352529 380 380 381 381 /** 382 * Is it custom ajax +jsonrequest with fragments for woo carts etc., that should be translated?383 */ 384 public static function is_custom_ json(){382 * Is it custom ajax request with fragments for woo carts etc., that should be translated? 383 */ 384 public static function is_custom_ajax(){ 385 385 386 386 if ((isset($_GET['wc-ajax'])) || … … 397 397 * Is it custom ajax+html request that should be translated? 398 398 */ 399 public static function is_custom_html(){399 /*public static function is_custom_html(){ 400 400 401 401 if ((isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'update_shipping_method')) { … … 403 403 } 404 404 return false; 405 } 405 }*/ 406 406 407 407 /**
Note: See TracChangeset
for help on using the changeset viewer.