Plugin Directory

Changeset 2863637


Ignore:
Timestamp:
02/11/2023 11:45:52 AM (3 years ago)
Author:
alexgff
Message:

Version 2.2.0

Location:
wpglobus-translate-options/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wpglobus-translate-options/trunk/README.md

    r2811605 r2863637  
    44**Tags:** WPGlobus, localization, multilingual, translate, translation 
    55**Requires at least:** 5.5 
    6 **Tested up to:** 6.1
     6**Tested up to:** 6.1  
    77**Stable tag:** trunk 
    88**Requires PHP:** 5.6 
     
    6262
    6363## Changelog ##
     64
     65### 2.2.0 ###
     66* Code cleanup and additional security measures.
    6467
    6568### 2.1.0 ###
  • wpglobus-translate-options/trunk/includes/class-wpglobus-translate-options.php

    r2633240 r2863637  
    396396            /** @todo These two vars are set inside a condition. Should refactor. */
    397397            $page = '';
    398             $option = false;
    399 
     398            // @since 2.2.0
     399            $option = $this->safe_get_option();
     400                       
    400401            $tab_active = array();
    401402            $tab_active[self::TRANSLATE_OPTIONS_PAGE] = '';
     
    407408            if ( $pagenow == 'admin.php' && isset($_GET['page']) ) :
    408409
    409                 $page = $_GET['page'];
    410 
    411                 if ( self::TRANSLATE_OPTIONS_PAGE == $page  ) {
     410                $page = WPGlobus_Utils::safe_get('page');
     411
     412                if ( self::TRANSLATE_OPTIONS_PAGE === $page  ) {
    412413
    413414                    $tab_active[self::TRANSLATE_OPTIONS_PAGE] = ' nav-tab-active';
    414                     if ( isset($_GET['option']) ) {
    415 
    416                         $option = $_GET['option'];
    417 
    418                     } else {
    419 
    420                         $option = false;
    421 
    422                     }
    423 
    424                 } elseif ( self::SETTINGS_PAGE == $page  ) {
     415
     416                } elseif ( self::SETTINGS_PAGE === $page  ) {
    425417
    426418                    $tab_active[self::SETTINGS_PAGE] = ' nav-tab-active';
    427419
    428                 } elseif ( self::ABOUT_PAGE == $page  ) {
     420                } elseif ( self::ABOUT_PAGE === $page  ) {
    429421                   
    430422                    $tab_active[self::ABOUT_PAGE] = ' nav-tab-active';
    431423               
    432                 } elseif ( self::THEME_PAGE == $page  ) {
     424                } elseif ( self::THEME_PAGE === $page  ) {
    433425                   
    434426                    $tab_active[self::THEME_PAGE] = ' nav-tab-active';
     
    437429
    438430            endif;
    439 
    440431
    441432            if ( isset( $_POST['wpglobus_translate_form'] ) ) {
     
    514505                    case self::TRANSLATE_OPTIONS_PAGE : ?>
    515506                        <?php
    516                         if ( empty($_GET['option']) ) :
     507                        if ( ! $option ) :
    517508                        ?>
    518509                            <div class="search">
     
    534525                        <?php
    535526                        endif;
     527
    536528                        ?>
    537529                        <form method="post" id="options"> <?php
    538 
     530                            // @since 2.2.0
    539531                            $search = false;
    540532                            if ( ! empty( $_POST['search'] ) ) {
    541                                 $search = $_POST['search'];
    542                                 $option = '[]';
     533                               
     534                                $search = sanitize_text_field( $_POST['search'] );
     535                           
     536                                if ( ! empty($search) ) {
     537                                    $option = '[]';
     538                                }
    543539                            }
    544 
     540                           
    545541                            if ( $option ) {
    546542
     
    862858
    863859            endif;
    864 
    865860        }
    866861
     
    889884
    890885            endif;
    891 
    892         }
     886        }
     887
     888        /**
     889         * Get value of $_GET['option'].
     890         *
     891         * @since 2.2.0
     892         */
     893        protected function safe_get_option() {
     894            $option = WPGlobus_Utils::safe_get('option');
     895            if ( $option === '' ) {
     896                return false;
     897            }
     898            return $option;
     899        }
     900       
    893901    }
    894902       
  • wpglobus-translate-options/trunk/languages/wpglobus-translate-options.pot

    r2651767 r2863637  
    1 # Copyright (C) 2022 WPGlobus
     1# Copyright (C) 2023 WPGlobus
    22# This file is distributed under the GPL-3.0.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WPGlobus Translate Options 2.1.0\n"
     5"Project-Id-Version: WPGlobus Translate Options 2.2.0\n"
    66"Report-Msgid-Bugs-To: https://wpglobus.com/pg/contact-us/\n"
    7 "POT-Creation-Date: 2022-01-02 07:55:52+00:00\n"
     7"POT-Creation-Date: 2023-02-11 11:23:25+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: The WPGlobus Team <support@wpglobus.com>\n"
    1313"Language-Team: The WPGlobus Team <support@wpglobus.com>\n"
     
    2424"X-Textdomain-Support: yes\n"
    2525
    26 #: includes/class-wpglobus-to-2.php:488
     26#: includes/class-wpglobus-to-2.php:489
    2727#: includes/class-wpglobus-translate-options.php:191
    2828msgid "Options"
     
    3333msgstr ""
    3434
    35 #: includes/class-wpglobus-to-rest-controller.php:272
     35#: includes/class-wpglobus-to-rest-controller.php:276
    3636msgid "Options to translate."
    3737msgstr ""
    3838
    39 #: includes/class-wpglobus-to-rest-controller.php:944
    40 #: includes/class-wpglobus-to-rest-controller.php:974
     39#: includes/class-wpglobus-to-rest-controller.php:959
     40#: includes/class-wpglobus-to-rest-controller.php:989
    4141msgid "Sorry, you are not allowed to read options."
    4242msgstr ""
    4343
    44 #: includes/class-wpglobus-translate-options.php:495
     44#: includes/class-wpglobus-translate-options.php:486
    4545msgid "All options"
    4646msgstr ""
    4747
    48 #: includes/class-wpglobus-translate-options.php:497
     48#: includes/class-wpglobus-translate-options.php:488
    4949msgid "Theme properties"
    5050msgstr ""
    5151
    52 #: includes/class-wpglobus-translate-options.php:499
     52#: includes/class-wpglobus-translate-options.php:490
    5353msgid "Settings"
    5454msgstr ""
    5555
    56 #: includes/class-wpglobus-translate-options.php:501
     56#: includes/class-wpglobus-translate-options.php:492
    5757msgid "About"
    5858msgstr ""
    5959
    60 #: includes/class-wpglobus-translate-options.php:503
     60#: includes/class-wpglobus-translate-options.php:494
    6161msgid "Switch to new interface v.2"
    6262msgstr ""
  • wpglobus-translate-options/trunk/package.json

    r2651767 r2863637  
    11{
    22  "name": "wpglobus-translate-options",
    3   "version": "2.1.0",
     3  "version": "2.2.0",
    44  "title": "WPGlobus Translate Options",
    55  "description": "WPGlobus Translate Options is an extension to the WPGlobus plugin. It allows translate options from wp_options table.",
  • wpglobus-translate-options/trunk/readme.txt

    r2811605 r2863637  
    5656
    5757== Changelog ==
     58
     59= 2.2.0 =
     60* Code cleanup and additional security measures.
    5861
    5962= 2.1.0 =
  • wpglobus-translate-options/trunk/wpglobus-translate-options.php

    r2770439 r2863637  
    66 * Text Domain: wpglobus-translate-options
    77 * Domain Path: /languages/
    8  * Version: 2.1.0
     8 * Version: 2.2.0
    99 * Author: WPGlobus
    1010 * Author URI: https://wpglobus.com/
    1111 * Network: false
    12  * Copyright 2015-2022 Alex Gor (alexgff) / WPGlobus
     12 * Copyright 2015-2023 Alex Gor (alexgff) / WPGlobus
    1313 * License: GPL-3.0
    1414 * License URI: http://www.gnu.org/licenses/gpl.txt
     
    2020}
    2121
    22 define( 'WPGLOBUS_TRANSLATE_OPTIONS_VERSION', '2.1.0' );
     22define( 'WPGLOBUS_TRANSLATE_OPTIONS_VERSION', '2.2.0' );
    2323define( 'WPGLOBUS_TRANSLATE_OPTIONS_KEY', 'wpglobus_translate_options' );
    2424define( 'WPGLOBUS_TRANSLATE_OPTIONS_INTERFACE_VERSION_KEY', 'interface_version' );
Note: See TracChangeset for help on using the changeset viewer.