Changeset 3371920
- Timestamp:
- 10/02/2025 04:47:53 PM (6 months ago)
- Location:
- translate-websites-translentor/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
translentor.php (modified) (4 diffs)
-
translentor/website-translator/widget/tanslentor_widget.php (modified) (14 diffs)
-
widgets/index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
translate-websites-translentor/trunk/readme.txt
r3121856 r3371920 4 4 Donate link: https://translentor.com/contact/ 5 5 Tags: translate elementor, elementor translator, automatic translation, ai translation 6 Requires at least: 4.0 7 Tested up to: 6.4.3 8 Stable tag: 1.6.1 6 Tested up to: 6.8.3 7 Requires PHP: 7.4 8 Requires at least: 6.6 9 Requires Plugins: elementor 10 Stable tag: 1.6.2 9 11 Requires PHP: 7.4 10 12 License: GPLv2 or later … … 115 117 8. Elementor Reset Password Widget 116 118 119 == Changelog == 120 121 = 1.6.2 (2025-10-02) = 122 123 __Fixed__ 124 * Updated widget registration to use modern Elementor API 125 * Fixed widget asset dependency names to match registered CSS/JS handles (resolved loading issues) 126 * Removed buggy option check that prevented widget rendering in some cases 127 * Ensured widget renders consistently when added to pages via Elementor editor 128 * Improved widget compatibility with Elementor 3.x and newer WordPress versions 129 130 131 = 1.6.1 (2024-11-11) = 132 133 __Changed__ 134 * Ajax loading issue corrected 135 * Optimized code for faster on page translations 136 * Additional Elementor styling 137 * Improved Elementor styling 138 * Updated flag icons -
translate-websites-translentor/trunk/translentor.php
r3326440 r3371920 1 1 <?php 2 2 3 /** 3 4 * Plugin Name: Translentor 4 5 * Plugin URI: https://translentor.com 5 6 * Description: This plugin adds a language translator widget to the Elementor Page Builder. 6 * Version: 1.6. 17 * Author: Translentor7 * Version: 1.6.2 8 * Author: Code Snippets Pro 8 9 * Author URI: https://translentor.com 9 10 * Domain Path: translentor … … 13 14 define('translentor_DIR_Main', plugin_dir_path(__FILE__)); 14 15 define('translentor_URL', plugin_dir_url(__FILE__)); 15 define('translentor_VERSION', '1. 5');16 define('translentor_VERSION', '1.6.2'); 16 17 define('translentor_slug', 'translentor'); 17 18 define('translentor_category_icon', 'fa fa-plug'); 18 19 define('translentor_category', 'Translator'); 20 19 21 use Elementor\Plugin; 20 22 … … 23 25 function cyb_activation_redirect($plugin) 24 26 { 25 if ($plugin == plugin_basename(__FILE__)) {26 exit(wp_redirect(admin_url('admin.php?page=translentor-module')));27 }27 if ($plugin == plugin_basename(__FILE__)) { 28 exit(wp_redirect(admin_url('admin.php?page=translentor-module'))); 29 } 28 30 } 29 31 add_action('elementor/elements/categories_registered', function () { 30 $elementsManager = Plugin::instance()->elements_manager;32 $elementsManager = Plugin::instance()->elements_manager; 31 33 32 $elementsManager->add_category 33 ( 34 'translentor-category', 35 array( 36 'title' => translentor_category, 37 'icon' => translentor_category_icon, 38 ) 34 $elementsManager->add_category( 35 'translentor-category', 36 array( 37 'title' => translentor_category, 38 'icon' => translentor_category_icon, 39 ) 39 40 ); 40 41 }); … … 47 48 { 48 49 49 if (!class_exists('Elementor\Plugin')) {50 if (!class_exists('Elementor\Plugin')) { 50 51 51 ?> 52 <div class="notice notice-warning is-dismissible"> 53 <p><strong>Warning</strong>: Translentor work with Elementor Plugin. Please Activate Elementor Plugin</p> 54 </div> 55 <?php 56 } 57 52 ?> 53 <div class="notice notice-warning is-dismissible"> 54 <p><strong>Warning</strong>: Translentor work with Elementor Plugin. Please Activate Elementor Plugin</p> 55 </div> 56 <?php 57 } 58 58 } 59 59 60 60 add_action('admin_notices', 'translentor_admin_notices'); 61 62 -
translate-websites-translentor/trunk/translentor/website-translator/widget/tanslentor_widget.php
r3121843 r3371920 7 7 */ 8 8 9 10 // Elementor Classes.11 9 use Elementor\Widget_Base; 12 10 use Elementor\Utils; … … 33 31 34 32 protected $position; 33 34 /** 35 * Static flag to track if Google Translate script has been loaded 36 * Prevents duplicate script loading when multiple widgets are on the same page 37 */ 38 private static $script_loaded = false; 39 35 40 public function __construct($data = [], $args = null) 36 41 { 37 42 parent::__construct($data, $args); 38 39 40 43 } 41 44 … … 58 61 { 59 62 return [ 'translentor-category' ]; 60 //return [ 'general' ];61 63 } 62 64 63 65 public function get_style_depends() 64 66 { 65 return [ 'translentor-website-translentor' ]; 67 return [ 68 'translentor-website-translator-css', 69 'translentor-website-translator-toast-css' 70 ]; 66 71 } 67 72 … … 69 74 { 70 75 return [ 71 72 'translentor-website-translentor', 73 'translentor-website-translentor-toast' 74 76 'translentor-website-translator-js', 77 'translentor-website-translator-toast-js' 75 78 ]; 76 79 } … … 1528 1531 1529 1532 $selected = array(); 1530 if(get_option('google_translation')=='yes') 1531 { 1532 1533 ?> 1533 ?> 1534 1534 1535 1535 <div <?php echo $this->get_render_attribute_string( 'toast_title' ); ?>><?php echo esc_html($settings['toast_title']);?></div> … … 1581 1581 left: 0px; 1582 1582 text-align: center;"; 1583 $position='position: relative'; 1583 1584 $class="t-footer-center-side"; 1584 1585 } … … 1620 1621 left: 0px; 1621 1622 text-align: center;"; 1623 $position='position: relative'; 1622 1624 $class="t-footer-center-side"; 1623 1625 } … … 1788 1790 </div> 1789 1791 </div> 1792 <?php 1793 // Only load Google Translate script once per page (prevent duplicate loading when multiple widgets exist) 1794 if (!self::$script_loaded) { 1795 self::$script_loaded = true; 1796 ?> 1790 1797 <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 1791 1798 … … 1804 1811 } 1805 1812 </script> 1813 <?php 1814 } 1815 ?> 1806 1816 <script> 1807 1817 jQuery('.drop_footer').on('click', function() { … … 1860 1870 left: 0px; 1861 1871 text-align: center;"; 1872 $position='position: relative'; 1862 1873 $class="t-center-side"; 1863 1874 } … … 1898 1909 left: 0px; 1899 1910 text-align: center;"; 1911 $position='position: relative'; 1900 1912 $class="t-center-side"; 1901 1913 } … … 2061 2073 </div> 2062 2074 </div> 2075 <?php 2076 // Only load Google Translate script once per page (prevent duplicate loading when multiple widgets exist) 2077 if (!self::$script_loaded) { 2078 self::$script_loaded = true; 2079 ?> 2063 2080 <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 2064 2081 … … 2077 2094 } 2078 2095 </script> 2096 <?php 2097 } 2098 ?> 2079 2099 <script> 2080 2100 jQuery('.drop').on('click', function() { … … 2094 2114 echo '<h6 style="color: transparent;background: transparent; display:none;">hide</h6>'; 2095 2115 } 2096 2097 2098 // update_option('translentor_settings_elementor',$elementor_setting);2099 }2100 2101 2102 2116 } 2103 2117 protected function content_template() { -
translate-websites-translentor/trunk/widgets/index.php
r3098888 r3371920 1 1 <?php 2 use Elementor\Plugin;3 2 4 5 6 // load_styles(); 7 // load_scripts(); 8 9 add_action( 'elementor/widgets/widgets_registered', function() 10 { 11 12 require_once translentor_DIR_Main . 'translentor/website-translator/widget.php'; 13 14 } 15 ); 3 /** 4 * Register Translentor Widget with Elementor 5 * Using modern Elementor API (elementor/widgets/register hook) 6 */ 7 add_action( 'elementor/widgets/register', function( $widgets_manager ) { 8 9 // Load widget class file 10 require_once translentor_DIR_Main . 'translentor/website-translator/widget.php'; 11 12 // Register the widget with Elementor using modern API 13 $widgets_manager->register( new \translentor_elementor_widget() ); 14 15 }); 16 16 17 17 // function load_styles()
Note: See TracChangeset
for help on using the changeset viewer.