Plugin Directory

Changeset 3188801


Ignore:
Timestamp:
11/14/2024 02:55:55 PM (17 months ago)
Author:
easyling
Message:

Updating plugin to version 2.0

Location:
easyling
Files:
1 deleted
4 edited
12 copied

Legend:

Unmodified
Added
Removed
  • easyling/tags/2.0/easyling.php

    r3166604 r3188801  
    44Plugin URI: https://www.easyling.com/
    55Description: One-click website translation solution from Easyling.
    6 Version: 1.9
     6Version: 2.0
    77Author: Easyling
    88Copyright: Easyling
     
    4141   */
    4242  private $default_user_config = array(
    43     'status'                => 'enabled',
    44     'project_code'          => '',
    45     'location_host'         => 'app.easyling.com',
    46     'custom_location_host'  => '',
    47     'publishing_mode'       => 'js',
    48     'prerender_key'         => '',
    49     'redirect_system_pages' => 'on',
    50     'deployed'              => 'on',
    51     'translate_login_page'  => 'off',
     43    'status'                     => 'enabled',
     44    'project_code'               => '',
     45    'location_host'              => 'app.easyling.com',
     46    'custom_location_host'       => '',
     47    'publishing_mode'            => 'js',
     48    'prerender_key'              => '',
     49    'redirect_system_pages'      => 'on',
     50    'deployed'                   => 'on',
     51    'translate_login_page'       => 'off',
     52    'floating_language_selector' => '',
    5253  );
    5354
     
    5960   */
    6061  private $user_config_options = array(
    61     'status'          => array( 'enabled', 'disabled' ),
    62     'location_host'   => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ),
    63     'publishing_mode' => array( 'js', 'proxy' ),
     62    'status'                     => array( 'enabled', 'disabled' ),
     63    'location_host'              => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ),
     64    'publishing_mode'            => array( 'js', 'proxy' ),
     65    'floating_language_selector' => array( '', 'true', 'false' ),
    6466  );
    6567
     
    7880  private function __construct() {
    7981    $this->settings = array(
    80       'version'  => '1.9',
     82      'version'  => '2.0',
    8183      'path'     => plugin_dir_path( __FILE__ ),
    8284      'url'      => plugin_dir_url( __FILE__ ),
  • easyling/tags/2.0/inc/admin.php

    r3166604 r3188801  
    115115      'custom'           => __( 'Other', 'easyling' ),
    116116    );
     117    $floating_language_selector_options = array(
     118      ''      => __( 'Default', 'easyling' ),
     119      'true'  => __( 'Hide', 'easyling' ),
     120      'false' => __( 'Show', 'easyling' ),
     121    );
    117122
    118123    $should_save_user_config = ! empty( $_POST['easyling_nonce'] ) && wp_verify_nonce( $_POST['easyling_nonce'], 'easyling_save_settings' );
     
    134139      if ( ! empty( $publishing_mode_options[ $publishing_mode ] ) ) {
    135140        easyling()->update_user_config( 'publishing_mode', $publishing_mode );
     141      }
     142
     143      $floating_language_selector = sanitize_text_field( $_POST['floating_language_selector'] );
     144      if ( isset( $floating_language_selector_options[ $floating_language_selector ] ) ) {
     145        easyling()->update_user_config( 'floating_language_selector', $floating_language_selector );
    136146      }
    137147
     
    264274            </tr>
    265275            <tr>
     276              <th><?php esc_html_e( 'Floating language selector', 'easyling' ) ?></th>
     277              <td>
     278                <select name="floating_language_selector">
     279                  <?php foreach ( $floating_language_selector_options as $value => $name ) : ?>
     280                    <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $config['floating_language_selector'], $value ); ?>><?php echo esc_html( $name ) ?></option>
     281                  <?php endforeach; ?>
     282                </select>
     283                <p><?php esc_html_e( 'Override project settings for the floating sidebar language selector or choose "Default" to leave it as it is.', 'easyling' ) ?></p>
     284              </td>
     285            </tr>
     286            <tr>
    266287              <th><?php esc_html_e( 'Redirect system pages', 'easyling' ) ?></th>
    267288              <td>
  • easyling/tags/2.0/inc/frontend.php

    r3098777 r3188801  
    111111    if ( ! $this->is_wp_login_page() || ( 'on' === $translate_login_page ) ) {
    112112     
    113       add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed ) {
     113      add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed, $floating_language_selector ) {
    114114        if ( $is_prerender_app_request || ( 'js' === $publishing_mode ) ) {
    115115          $deployed_value = $deployed === 'on' ? 'true' : 'false';
    116           wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}", array(), null, true );
     116          $floating_language_selector_param = ! empty( $floating_language_selector ) ? "&disableSelector={$floating_language_selector}" : '';
     117          wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}{$floating_language_selector_param}", array(), null, true );
    117118        } if ( 'proxy' === $publishing_mode ) {
    118119          wp_enqueue_script( 'easyling-language-selector', "https://{$location_host}/_el/ext/js/languageSelector.js?code={$project_code}", array(), null, true );
  • easyling/tags/2.0/readme.txt

    r3166604 r3188801  
    44Requires at least: 4.7
    55Tested up to: 6.4.1
    6 Stable tag: 1.9
     6Stable tag: 2.0
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    4444
    4545== Changelog ==
     46= 2.0 =
     47Release Date: November 14th, 2024
     48
     49Enhancements:
     50
     51* Control floating sidebar language selector visibility from the admin panel
     52
    4653= 1.9 =
    4754Release Date: October 10th, 2024
  • easyling/trunk/easyling.php

    r3166604 r3188801  
    44Plugin URI: https://www.easyling.com/
    55Description: One-click website translation solution from Easyling.
    6 Version: 1.9
     6Version: 2.0
    77Author: Easyling
    88Copyright: Easyling
     
    4141   */
    4242  private $default_user_config = array(
    43     'status'                => 'enabled',
    44     'project_code'          => '',
    45     'location_host'         => 'app.easyling.com',
    46     'custom_location_host'  => '',
    47     'publishing_mode'       => 'js',
    48     'prerender_key'         => '',
    49     'redirect_system_pages' => 'on',
    50     'deployed'              => 'on',
    51     'translate_login_page'  => 'off',
     43    'status'                     => 'enabled',
     44    'project_code'               => '',
     45    'location_host'              => 'app.easyling.com',
     46    'custom_location_host'       => '',
     47    'publishing_mode'            => 'js',
     48    'prerender_key'              => '',
     49    'redirect_system_pages'      => 'on',
     50    'deployed'                   => 'on',
     51    'translate_login_page'       => 'off',
     52    'floating_language_selector' => '',
    5253  );
    5354
     
    5960   */
    6061  private $user_config_options = array(
    61     'status'          => array( 'enabled', 'disabled' ),
    62     'location_host'   => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ),
    63     'publishing_mode' => array( 'js', 'proxy' ),
     62    'status'                     => array( 'enabled', 'disabled' ),
     63    'location_host'              => array( 'app.easyling.com', 'eu.easyling.com', 'custom' ),
     64    'publishing_mode'            => array( 'js', 'proxy' ),
     65    'floating_language_selector' => array( '', 'true', 'false' ),
    6466  );
    6567
     
    7880  private function __construct() {
    7981    $this->settings = array(
    80       'version'  => '1.9',
     82      'version'  => '2.0',
    8183      'path'     => plugin_dir_path( __FILE__ ),
    8284      'url'      => plugin_dir_url( __FILE__ ),
  • easyling/trunk/inc/admin.php

    r3166604 r3188801  
    115115      'custom'           => __( 'Other', 'easyling' ),
    116116    );
     117    $floating_language_selector_options = array(
     118      ''      => __( 'Default', 'easyling' ),
     119      'true'  => __( 'Hide', 'easyling' ),
     120      'false' => __( 'Show', 'easyling' ),
     121    );
    117122
    118123    $should_save_user_config = ! empty( $_POST['easyling_nonce'] ) && wp_verify_nonce( $_POST['easyling_nonce'], 'easyling_save_settings' );
     
    134139      if ( ! empty( $publishing_mode_options[ $publishing_mode ] ) ) {
    135140        easyling()->update_user_config( 'publishing_mode', $publishing_mode );
     141      }
     142
     143      $floating_language_selector = sanitize_text_field( $_POST['floating_language_selector'] );
     144      if ( isset( $floating_language_selector_options[ $floating_language_selector ] ) ) {
     145        easyling()->update_user_config( 'floating_language_selector', $floating_language_selector );
    136146      }
    137147
     
    264274            </tr>
    265275            <tr>
     276              <th><?php esc_html_e( 'Floating language selector', 'easyling' ) ?></th>
     277              <td>
     278                <select name="floating_language_selector">
     279                  <?php foreach ( $floating_language_selector_options as $value => $name ) : ?>
     280                    <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $config['floating_language_selector'], $value ); ?>><?php echo esc_html( $name ) ?></option>
     281                  <?php endforeach; ?>
     282                </select>
     283                <p><?php esc_html_e( 'Override project settings for the floating sidebar language selector or choose "Default" to leave it as it is.', 'easyling' ) ?></p>
     284              </td>
     285            </tr>
     286            <tr>
    266287              <th><?php esc_html_e( 'Redirect system pages', 'easyling' ) ?></th>
    267288              <td>
  • easyling/trunk/inc/frontend.php

    r3098777 r3188801  
    111111    if ( ! $this->is_wp_login_page() || ( 'on' === $translate_login_page ) ) {
    112112     
    113       add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed ) {
     113      add_action( 'init', function() use ( $is_prerender_app_request, $publishing_mode, $project_code, $location_host, $deployed, $floating_language_selector ) {
    114114        if ( $is_prerender_app_request || ( 'js' === $publishing_mode ) ) {
    115115          $deployed_value = $deployed === 'on' ? 'true' : 'false';
    116           wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}", array(), null, true );
     116          $floating_language_selector_param = ! empty( $floating_language_selector ) ? "&disableSelector={$floating_language_selector}" : '';
     117          wp_enqueue_script( 'easyling-stub', "https://{$location_host}/client/{$project_code}/0/stub.js?deployed={$deployed_value}{$floating_language_selector_param}", array(), null, true );
    117118        } if ( 'proxy' === $publishing_mode ) {
    118119          wp_enqueue_script( 'easyling-language-selector', "https://{$location_host}/_el/ext/js/languageSelector.js?code={$project_code}", array(), null, true );
  • easyling/trunk/readme.txt

    r3166604 r3188801  
    44Requires at least: 4.7
    55Tested up to: 6.4.1
    6 Stable tag: 1.9
     6Stable tag: 2.0
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    4444
    4545== Changelog ==
     46= 2.0 =
     47Release Date: November 14th, 2024
     48
     49Enhancements:
     50
     51* Control floating sidebar language selector visibility from the admin panel
     52
    4653= 1.9 =
    4754Release Date: October 10th, 2024
Note: See TracChangeset for help on using the changeset viewer.