Plugin Directory

Changeset 3185619


Ignore:
Timestamp:
11/11/2024 11:04:08 AM (17 months ago)
Author:
clonable
Message:

Version 2.2.7

Location:
clonable
Files:
116 added
16 edited

Legend:

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

    r3164377 r3185619  
    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.2.6
     7Version: 2.2.7
    88Author: Clonable BV
    99Author URI: https://www.clonable.net
     
    104104
    105105define('CLONABLE_NAME', 'Clonable');
    106 define('CLONABLE_VERSION', '2.2.6');
     106define('CLONABLE_VERSION', '2.2.7');
    107107
    108108try {
     
    158158    $locale_service = new LocaleService();
    159159} catch (Exception $exception) {
    160     error_log("[Clonable] Error setting allowed hosts: {$exception->getMessage()}");
     160    error_log("[Clonable] Error setting locale: {$exception->getMessage()}");
    161161}
     162
     163try {
     164    $short_code_service =  new ShortCodeService();
     165} catch (Exception $exception) {
     166    error_log("[Clonable] Error setting the Clonable shortcodes: {$exception->getMessage()}");
     167}
  • clonable/trunk/controllers/SettingController.php

    r3164377 r3185619  
    5858    }
    5959
     60    public function clonable_shortcode_service_enabled_validate($input) {
     61        return $this->validate_checkbox($input,'clonable_shortcode_service_enabled');
     62    }
     63
    6064    public function clonable_max_upstream_requests_validate($input) {
    6165        if (!$input) {
  • clonable/trunk/models/Settings.php

    r3164377 r3185619  
    3333            "setting" => "clonable_language_tag_service_enabled",
    3434        ],
     35        "clonable_shortcode_service_enabled" => [
     36            "render" => "shortcode_service_enabled_field",
     37            "name" => "Enable shortcode service",
     38            "setting" => "clonable_shortcode_service_enabled",
     39            "experimental" => true
     40        ],
    3541        "clonable_max_upstream_requests" => [
    3642            "render" => "max_upstream_requests_field",
  • clonable/trunk/readme-da_DK.txt

    r3164377 r3185619  
    33Tags: oversættelser, oversæt, flersproget, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Forbedringer af Ajax url til WooCommerce.
     36Tilføjet eksperimentel funktion til WordPress-kortkoder.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-de_DE.txt

    r3164377 r3185619  
    33Tags: Übersetzungen, übersetzen, mehrsprachig, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Ajax url Verbesserungen für WooCommerce.
     36Experimentelle Funktion für WordPress-Shortcodes hinzugefügt.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-es_ES.txt

    r3164377 r3185619  
    33Tags: traducciones, traducir, multilingüe, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Ajax url mejoras para WooCommerce.
     36Añadida función experimental para WordPress shortcodes.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-fr_FR.txt

    r3164377 r3185619  
    33Tags : traductions, traduire, multilingue, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Amélioration de l'url Ajax pour WooCommerce.
     36Ajout d'une fonctionnalité expérimentale pour les shortcodes WordPress.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-it_IT.txt

    r3164377 r3185619  
    33Tags: traduzioni, tradurre, multilingue, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Miglioramenti all'url Ajax per WooCommerce.
     36Aggiunta una funzione sperimentale per gli shortcode di WordPress.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-nb_NO.txt

    r3164377 r3185619  
    33Tags: oversettelser, oversette, flerspråklig, clonable
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Forbedringer av Ajax url for WooCommerce.
     36Lagt til eksperimentell funksjon for WordPress-kortkoder.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-nl_NL.txt

    r3164377 r3185619  
    33Tags: vertalingen, vertalen, meertalig, clonable
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Ajax url verbeteringen voor WooCommerce.
     36Experimentele functie toegevoegd voor WordPress shortcodes.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme-sv_SE.txt

    r3164377 r3185619  
    33Tags: översättningar, översätta, flerspråkig, clonable, seo
    44Requires at least: 5.0
    5 6.6.2
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Förbättringar av Ajax url för WooCommerce.
     36Tillagd experimentell funktion för WordPress-kortkoder.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/readme.txt

    r3164377 r3185619  
    55Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 2.2.6
     7Stable tag: 2.2.7
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.2.7
     35Ajax url improvements for WooCommerce.
     36Added experimental feature for WordPress shortcodes.
     37
    3438v2.2.6
    3539Bug fix: timeouts
  • clonable/trunk/services/ShortCodeService.php

    r3150610 r3185619  
    55class ShortCodeService {
    66    public function __construct() {
     7        if (get_option('clonable_shortcode_service_enabled', 'off') !== 'on') {
     8            return;
     9        }
     10
    711        add_shortcode('not-clone', array( $this, 'not_clone'));
    812        add_shortcode('clone-only', array( $this, 'clone_only'));
  • clonable/trunk/services/SubfolderService.php

    r3164377 r3185619  
    4444        if (isset($server_data['HTTP_CLONABLE_CLONE_SUBFOLDER']) && $params !== false) {
    4545            foreach ($params as $key => $value) {
     46                $subfolder = rtrim($server_data['HTTP_CLONABLE_CLONE_SUBFOLDER'],  '/');
    4647                if ($key === 'wc_ajax_url') {
    47                     $params[$key] = rtrim($server_data['HTTP_CLONABLE_CLONE_SUBFOLDER'],  '/') . $value;
     48                    $params[$key] = $subfolder . $value;
     49                }
     50
     51                if ($key === 'ajax_url' && !Functions::str_starts_with("$subfolder/", $params[$key])) {
     52                    $params[$key] = $subfolder . $value;
    4853                }
    4954            }
  • clonable/trunk/traits/Forms.php

    r3012322 r3185619  
    7070            $extra_arguments = array('class' => (($hide_field) ? 'hidden' : ''));
    7171            $description = ($field['description'] ?? null);
    72             add_settings_field($id, $this->render_title($field["name"], $description), array($this, $callback), $page, $section, $extra_arguments);
     72            $experimental = ($field['experimental'] ?? false);
     73            add_settings_field($id, $this->render_title($field["name"], $description, $experimental), array($this, $callback), $page, $section, $extra_arguments);
    7374        }
    7475    }
     
    8081     * @return string returns the html of the title.
    8182     */
    82     public function render_title($name, $description) {
     83    public function render_title($name, $description, $experimental = false) {
     84        $name_addition = '';
     85        if ($experimental) {
     86            $name_addition = '&nbsp;<span style="color: red">(Experimental)</span>';
     87        }
     88
    8389        if ($description != null) {
    8490            $info_mark = "<div class='clonable-info-wrapper'>
     
    8692                <span class='dashicons dashicons-info clonable-info-mark'></span>
    8793            </div>";
    88             return "<div class='clonable-setting-title'>" . $name . $info_mark . "</div>";
     94            return "<div class='clonable-setting-title'>" . $name . $name_addition . $info_mark . "</div>";
    8995        }
    90         return $name;
     96        return $name . $name_addition;
    9197    }
    9298
  • clonable/trunk/views/SettingsView.php

    r3164377 r3185619  
    5959    }
    6060
     61    public function shortcode_service_enabled_field() {
     62        $option = get_option('clonable_shortcode_service_enabled', 'off');
     63        $this->create_checkbox('clonable_shortcode_service_enabled', $option);
     64        echo "(Use shortcodes in WordPress to conditionally render blocks based on the locale of the clone)";
     65    }
    6166    public function max_upstream_requests_field() {
    6267        $option = max(2, intval(get_option('clonable_max_upstream_requests', 4)));
Note: See TracChangeset for help on using the changeset viewer.