Plugin Directory

Changeset 3233031


Ignore:
Timestamp:
02/01/2025 11:03:05 AM (14 months ago)
Author:
clonable
Message:

Release 2.3.2

Location:
clonable
Files:
116 added
14 edited

Legend:

Unmodified
Added
Removed
  • clonable/trunk/clonable-wp.php

    r3232500 r3233031  
    55Description: Official plugin for improving your clones made with Clonable.
    66Plugin URI: https://kb.clonable.net/en/introduction/getting-started/wordpress#de-clonable-plug-in-downloaden
    7 Version: 2.3.1
     7Version: 2.3.2
    88Author: Clonable BV
    99Author URI: https://www.clonable.net
     
    104104
    105105define('CLONABLE_NAME', 'Clonable');
    106 define('CLONABLE_VERSION', '2.3.1');
     106define('CLONABLE_VERSION', '2.3.2');
    107107
    108108try {
  • clonable/trunk/helpers/Session.php

    r3232500 r3233031  
    55class Session {
    66    const CLONABLE_VALIDATION_KEY = "clonable-validation-data";
     7    const EXPIRATION = 3600;
     8
     9    private static function get_validation_data_key(): string {
     10        $sId = wp_get_session_token();
     11        return self::CLONABLE_VALIDATION_KEY . ':' . $sId;
     12    }
     13
     14    private static function get_validation_data(): array {
     15        $trKey = self::get_validation_data_key();
     16        $tr = get_transient($trKey);
     17        if (is_array($tr)) {
     18            return $tr;
     19        } else {
     20            return [];
     21        }
     22    }
     23
     24    /**
     25     * Saves the provided validation data or deletes it on null.
     26     *
     27     * @param $data ?array array of data to save, or null to delete all validation data
     28     * @return void
     29     */
     30    private static function save_validation_data(?array $data) {
     31        $trKey = self::get_validation_data_key();
     32        if ($data == null) {
     33            delete_transient($trKey);
     34        } else {
     35            set_transient($trKey, $data, self::EXPIRATION);
     36        }
     37    }
    738
    839    public static function old($option_name, $default_value = false) {
    9         self::start_session_if_needed();
    10         if (isset($_SESSION[self::CLONABLE_VALIDATION_KEY][$option_name])) {
    11             return $_SESSION[self::CLONABLE_VALIDATION_KEY][$option_name];
     40        $validationData = self::get_validation_data();
     41        if (isset($validationData[$option_name])) {
     42            return $validationData[$option_name];
    1243        }
    1344        return get_option($option_name, $default_value);
     
    1546
    1647    public static function put_validation_data($key, $data) {
    17         self::start_session_if_needed();
     48        $validationData = self::get_validation_data();
    1849        $data = Json::handle_output(Json::handle_output($data));
    19         $_SESSION[self::CLONABLE_VALIDATION_KEY][$key] = $data;
     50        $validationData[$key] = $data;
     51        self::save_validation_data($validationData);
    2052    }
    2153
    2254    public static function clear_validation_data() {
    23         self::start_session_if_needed();
    24         unset($_SESSION[self::CLONABLE_VALIDATION_KEY]);
    25     }
    26 
    27     public static function start_session_if_needed() {
    28         if (!session_id()) {
    29             session_start();
    30         }
     55        self::save_validation_data(null);
    3156    }
    3257}
  • clonable/trunk/readme-da_DK.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Understøttelse af kloner af undermapper uden efterfølgende skråstreg.
  • clonable/trunk/readme-de_DE.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Unterstützung für Unterordner-Klone mit nicht-nachlaufendem Schrägstrich.
  • clonable/trunk/readme-es_ES.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Soporte para clones de subcarpetas sin barra diagonal.
  • clonable/trunk/readme-fr_FR.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Prise en charge des clones de sous-dossiers sans barre oblique de fin.
  • clonable/trunk/readme-it_IT.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Supporto per i cloni di sottocartelle con slash non traccianti.
  • clonable/trunk/readme-nb_NO.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Støtte for kloner av undermapper uten skråstrek.
  • clonable/trunk/readme-nl_NL.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Ondersteuning voor niet-trailing slash submappen klonen.
  • clonable/trunk/readme-sv_SE.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Stöd för kloner av undermappar med snedstreck utan efterföljande snedstreck.
  • clonable/trunk/readme.txt

    r3232500 r3233031  
    55Tested up to: 6.7.1
    66Requires PHP: 7.2
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.3.2
     35Improved session storage system.
     36Improved visibility of input validation errors
     37
    3438v2.3.1
    3539Support for non-trailing slash subfolder clones.
  • clonable/trunk/services/ApiService.php

    r3100441 r3233031  
    133133            CURLOPT_RETURNTRANSFER => 1,
    134134            CURLOPT_HTTPHEADER => $headers,
    135             CURLOPT_TIMEOUT => 1,
     135            CURLOPT_TIMEOUT => 10,
    136136            CURLOPT_FOLLOWLOCATION => 0,
    137137            CURLOPT_USERAGENT => "Clonable Wordpress " . CLONABLE_VERSION . " (curl)",
  • clonable/trunk/services/LanguageTagService.php

    r3198101 r3233031  
    306306                CURLOPT_RETURNTRANSFER => true,
    307307                CURLOPT_HTTPHEADER => array("Accept: text/plain"),
    308                 CURLOPT_TIMEOUT => 1,
     308                CURLOPT_TIMEOUT => 5,
    309309                CURLOPT_USERAGENT => "Clonable Wordpress " . CLONABLE_VERSION . " (curl)",
    310310            ]);
  • clonable/trunk/views/LanguageTagView.php

    r3154512 r3233031  
    3636                <li>5: The domain field should <span style="font-weight: bold">not</span> include the subfolder of the clone.</li>
    3737            </ul>
     38
     39        <?php
     40        $this->render_error('clonable_langtag_data');
     41        ?>
     42
    3843            <div class="wrap">
    3944                <div x-data="languageTags(<?php echo esc_textarea($option); ?>)">
     
    144149            </div>
    145150        <?php
    146         $this->render_error('clonable_langtag_data');
    147151    }
    148152
Note: See TracChangeset for help on using the changeset viewer.