Plugin Directory

Changeset 3371920


Ignore:
Timestamp:
10/02/2025 04:47:53 PM (6 months ago)
Author:
0aksmith
Message:

Version 1.6.2

Location:
translate-websites-translentor/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • translate-websites-translentor/trunk/readme.txt

    r3121856 r3371920  
    44Donate link: https://translentor.com/contact/
    55Tags: 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
     6Tested up to: 6.8.3
     7Requires PHP: 7.4
     8Requires at least: 6.6
     9Requires Plugins: elementor
     10Stable tag: 1.6.2
    911Requires PHP: 7.4
    1012License: GPLv2 or later
     
    1151178. Elementor Reset Password Widget
    116118
     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  
    11<?php
     2
    23/**
    34 * Plugin Name: Translentor
    45 * Plugin URI: https://translentor.com
    56 * Description: This plugin adds a language translator widget to the Elementor Page Builder.
    6  * Version: 1.6.1
    7  * Author: Translentor
     7 * Version: 1.6.2
     8 * Author: Code Snippets Pro
    89 * Author URI: https://translentor.com
    910 * Domain Path: translentor
     
    1314define('translentor_DIR_Main', plugin_dir_path(__FILE__));
    1415define('translentor_URL', plugin_dir_url(__FILE__));
    15 define('translentor_VERSION', '1.5');
     16define('translentor_VERSION', '1.6.2');
    1617define('translentor_slug', 'translentor');
    1718define('translentor_category_icon', 'fa fa-plug');
    1819define('translentor_category', 'Translator');
     20
    1921use Elementor\Plugin;
    2022
     
    2325function cyb_activation_redirect($plugin)
    2426{
    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  }
    2830}
    2931add_action('elementor/elements/categories_registered', function () {
    30     $elementsManager = Plugin::instance()->elements_manager;
     32  $elementsManager = Plugin::instance()->elements_manager;
    3133
    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      )
    3940    );
    4041});
     
    4748{
    4849
    49     if (!class_exists('Elementor\Plugin')) {
     50  if (!class_exists('Elementor\Plugin')) {
    5051
    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  }
    5858}
    5959
    6060add_action('admin_notices', 'translentor_admin_notices');
    61 
    62 
  • translate-websites-translentor/trunk/translentor/website-translator/widget/tanslentor_widget.php

    r3121843 r3371920  
    77 */
    88
    9 
    10 // Elementor Classes.
    119use Elementor\Widget_Base;
    1210use Elementor\Utils;
     
    3331   
    3432    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   
    3540    public function __construct($data = [], $args = null)
    3641    {
    3742        parent::__construct($data, $args);
    38    
    39        
    4043    }
    4144   
     
    5861    {
    5962        return [ 'translentor-category' ];
    60         //return [ 'general' ];
    6163    }
    6264   
    6365    public function get_style_depends()
    6466    {
    65         return [ 'translentor-website-translentor' ];
     67        return [
     68          'translentor-website-translator-css',
     69          'translentor-website-translator-toast-css'
     70        ];
    6671    }
    6772   
     
    6974    {
    7075        return [
    71            
    72             'translentor-website-translentor',
    73             'translentor-website-translentor-toast'
    74            
     76                'translentor-website-translator-js',
     77                'translentor-website-translator-toast-js'
    7578        ];
    7679    }
     
    15281531
    15291532$selected = array();
    1530         if(get_option('google_translation')=='yes')
    1531         {
    1532            
    1533         ?>
     1533?>
    15341534
    15351535<div <?php echo $this->get_render_attribute_string( 'toast_title' ); ?>><?php echo esc_html($settings['toast_title']);?></div>
     
    15811581        left: 0px;
    15821582        text-align: center;";
     1583        $position='position: relative';
    15831584        $class="t-footer-center-side";
    15841585                            }
     
    16201621        left: 0px;
    16211622        text-align: center;";
     1623        $position='position: relative';
    16221624        $class="t-footer-center-side";
    16231625                            }
     
    17881790    </div>
    17891791</div>
     1792<?php
     1793// Only load Google Translate script once per page (prevent duplicate loading when multiple widgets exist)
     1794if (!self::$script_loaded) {
     1795    self::$script_loaded = true;
     1796?>
    17901797<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    17911798
     
    18041811}
    18051812</script>
     1813<?php
     1814}
     1815?>
    18061816<script>
    18071817jQuery('.drop_footer').on('click', function() {
     
    18601870                    left: 0px;
    18611871                    text-align: center;";
     1872                    $position='position: relative';
    18621873                    $class="t-center-side";
    18631874                                        }
     
    18981909        left: 0px;
    18991910        text-align: center;";
     1911        $position='position: relative';
    19001912        $class="t-center-side";
    19011913                            }
     
    20612073    </div>
    20622074</div>
     2075<?php
     2076// Only load Google Translate script once per page (prevent duplicate loading when multiple widgets exist)
     2077if (!self::$script_loaded) {
     2078    self::$script_loaded = true;
     2079?>
    20632080<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    20642081
     
    20772094}
    20782095</script>
     2096<?php
     2097}
     2098?>
    20792099<script>
    20802100jQuery('.drop').on('click', function() {
     
    20942114            echo '<h6 style="color: transparent;background:  transparent; display:none;">hide</h6>';
    20952115            }
    2096    
    2097            
    2098         //  update_option('translentor_settings_elementor',$elementor_setting);
    2099         }
    2100 
    2101 
    21022116    }
    21032117    protected function content_template() {
  • translate-websites-translentor/trunk/widgets/index.php

    r3098888 r3371920  
    11<?php
    2 use Elementor\Plugin;
    32
    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 */
     7add_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});
    1616 
    1717    //  function load_styles()
Note: See TracChangeset for help on using the changeset viewer.