Plugin Directory

Changeset 3329584


Ignore:
Timestamp:
07/17/2025 10:19:54 AM (9 months ago)
Author:
clonable
Message:

version 2.5.5

Location:
clonable
Files:
123 added
10 edited

Legend:

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

    r3314356 r3329584  
    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.5.4
     7Version: 2.5.5
    88Author: Clonable BV
    99Author URI: https://www.clonable.net
     
    114114
    115115define('CLONABLE_NAME', 'Clonable');
    116 define('CLONABLE_VERSION', '2.5.4');
    117 
    118 try {
    119     $clonable_plugin = new Bootstrap(CLONABLE_NAME, CLONABLE_VERSION);
    120     add_action('wp_head', array($clonable_plugin, 'verification'), 1);
    121 } catch (Exception $exception) {
    122     error_log("[Clonable] Error while initializing plug-in: {$exception->getMessage()}");
    123     return;
     116define('CLONABLE_VERSION', '2.5.5');
     117
     118if (defined('WP_CLI') && WP_CLI) {
     119    // Do nothing for now if CLI mode is enabled
     120} else {
     121    clonable_init_plugin();
    124122}
    125123
    126 try {
    127     $allowed_hosts_service = new AllowedHostsService();
    128 } catch (Exception $exception) {
    129     error_log("[Clonable] Error setting allowed hosts: {$exception->getMessage()}");
     124function clonable_init_plugin() {
     125    try {
     126        $clonable_plugin = new Bootstrap(CLONABLE_NAME, CLONABLE_VERSION);
     127        add_action('wp_head', array($clonable_plugin, 'verification'), 1);
     128    } catch (Exception $exception) {
     129        error_log("[Clonable] Error while initializing plug-in: {$exception->getMessage()}");
     130        return;
     131    }
     132
     133    try {
     134        $allowed_hosts_service = new AllowedHostsService();
     135    } catch (Exception $exception) {
     136        error_log("[Clonable] Error setting allowed hosts: {$exception->getMessage()}");
     137    }
     138
     139    try {
     140        $language_tag_service = new LanguageTagService();
     141        add_action('wp_head', array($language_tag_service, 'clonable_echo_language_tags'), 5);
     142        add_action('clonable_public_key_cron_hook', array($language_tag_service, 'clonable_get_public_key'), 10, 1);
     143        // Schedule cronjob for public key if it doesn't exist yet
     144        if(wp_next_scheduled("clonable_public_key_cron_hook", array(true)) === false) {
     145            wp_schedule_event(time(), 'daily', 'clonable_public_key_cron_hook', array(true));
     146        }
     147    } catch (Exception $exception) {
     148        error_log("[Clonable] Error while setting up language tags: {$exception->getMessage()}");
     149    }
     150
     151    try {
     152        // Add language switcher hook
     153        $language_switcher_service = new LanguageSwitcherService();
     154        add_action("wp_head", array($language_switcher_service, 'print_language_switcher'));
     155    } catch (Exception $exception) {
     156        error_log("[Clonable] Error while setting up language switcher: {$exception->getMessage()}");
     157    }
     158
     159
     160    try {
     161        // Constructor automatically fixes the initialisation of the subfolders
     162        $subfolder_service = new SubfolderService();
     163    } catch (Exception $exception) {
     164        error_log("[Clonable] Error while setting up Clonable subfolders: {$exception->getMessage()}");
     165    }
     166
     167    try {
     168        // Instantiate all the services that are used for different kind of WooCommerce functionalities.
     169        $woocommerce_service = new ClonableWooCommerceService();
     170        add_action( 'before_woocommerce_init', function() {
     171            if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
     172                \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true);
     173            }
     174        });
     175    } catch (Exception $exception) {
     176        error_log("[Clonable] Error while setting up WooCommerce modules: {$exception->getMessage()}");
     177    }
     178
     179    try {
     180        $locale_service = new LocaleService();
     181    } catch (Exception $exception) {
     182        error_log("[Clonable] Error setting locale: {$exception->getMessage()}");
     183    }
     184
     185    try {
     186        $short_code_service =  new ShortCodeService();
     187    } catch (Exception $exception) {
     188        error_log("[Clonable] Error setting the Clonable shortcodes: {$exception->getMessage()}");
     189    }
     190
     191    try {
     192        $multi_currency_service = new MultiCurrencyService();
     193    } catch (Exception $exception) {
     194        error_log("[Clonable] Error setting the Multi currency settings: {$exception->getMessage()}");
     195    }
     196
     197    try {
     198        $cache_service = new CacheService();
     199    } catch (Exception $exception) {
     200        error_log("[Clonable] Error handling cache service: {$exception->getMessage()}");
     201    }
     202
     203    try {
     204        if (!function_exists('clonable_current_domain')) {
     205            function clonable_current_domain(): string {
     206                $domain = ClonableConfig::current_clonable_domain();
     207                if ($domain === ClonableCOnfig::ORIGINAL_SHOP) {
     208                    return $_SERVER['host'] ?? ''; // return the standard host
     209                }
     210                return $domain;
     211            }
     212        }
     213    } catch (Exception $exception) {
     214        error_log("Could not setup global Clonable functions: {$exception->getMessage()}");
     215    }
    130216}
    131 
    132 try {
    133     $language_tag_service = new LanguageTagService();
    134     add_action('wp_head', array($language_tag_service, 'clonable_echo_language_tags'), 5);
    135     add_action('clonable_public_key_cron_hook', array($language_tag_service, 'clonable_get_public_key'), 10, 1);
    136     // Schedule cronjob for public key if it doesn't exist yet
    137     if(wp_next_scheduled("clonable_public_key_cron_hook", array(true)) === false) {
    138         wp_schedule_event(time(), 'daily', 'clonable_public_key_cron_hook', array(true));
    139     }
    140 } catch (Exception $exception) {
    141     error_log("[Clonable] Error while setting up language tags: {$exception->getMessage()}");
    142 }
    143 
    144 try {
    145     // Add language switcher hook
    146     $language_switcher_service = new LanguageSwitcherService();
    147     add_action("wp_head", array($language_switcher_service, 'print_language_switcher'));
    148 } catch (Exception $exception) {
    149     error_log("[Clonable] Error while setting up language switcher: {$exception->getMessage()}");
    150 }
    151 
    152 
    153 try {
    154     // Constructor automatically fixes the initialisation of the subfolders
    155     $subfolder_service = new SubfolderService();
    156 } catch (Exception $exception) {
    157     error_log("[Clonable] Error while setting up Clonable subfolders: {$exception->getMessage()}");
    158 }
    159 
    160 try {
    161     // Instantiate all the services that are used for different kind of WooCommerce functionalities.
    162     $woocommerce_service = new ClonableWooCommerceService();
    163     add_action( 'before_woocommerce_init', function() {
    164         if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
    165             \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true);
    166         }
    167     });
    168 } catch (Exception $exception) {
    169     error_log("[Clonable] Error while setting up WooCommerce modules: {$exception->getMessage()}");
    170 }
    171 
    172 try {
    173     $locale_service = new LocaleService();
    174 } catch (Exception $exception) {
    175     error_log("[Clonable] Error setting locale: {$exception->getMessage()}");
    176 }
    177 
    178 try {
    179     $short_code_service =  new ShortCodeService();
    180 } catch (Exception $exception) {
    181     error_log("[Clonable] Error setting the Clonable shortcodes: {$exception->getMessage()}");
    182 }
    183 
    184 try {
    185     $multi_currency_service = new MultiCurrencyService();
    186 } catch (Exception $exception) {
    187     error_log("[Clonable] Error setting the Multi currency settings: {$exception->getMessage()}");
    188 }
    189 
    190 try {
    191     $cache_service = new CacheService();
    192 } catch (Exception $exception) {
    193     error_log("[Clonable] Error handling cache service: {$exception->getMessage()}");
    194 }
    195 
    196 try {
    197     if (!function_exists('clonable_current_domain')) {
    198         function clonable_current_domain(): string {
    199             $domain = ClonableConfig::current_clonable_domain();
    200             if ($domain === ClonableCOnfig::ORIGINAL_SHOP) {
    201                 return $_SERVER['host'] ?? ''; // return the standard host
    202             }
    203             return $domain;
    204         }
    205     }
    206 } catch (Exception $exception) {
    207     error_log("Could not setup global Clonable functions: {$exception->getMessage()}");
    208 }
  • clonable/trunk/readme-da_DK.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-de_DE.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-es_ES.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-fr_FR.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-it_IT.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-nb_NO.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-nl_NL.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme-sv_SE.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
  • clonable/trunk/readme.txt

    r3314356 r3329584  
    55Tested up to: 6.8.1
    66Requires PHP: 7.2
    7 Stable tag: 2.5.4
     7Stable tag: 2.5.5
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.5.5
     35Added WordPress CLI check in the WooCommerce service
     36
    3437v2.5.4
    3538Fixed problems with null byte files
Note: See TracChangeset for help on using the changeset viewer.