Changeset 3164377
- Timestamp:
- 10/07/2024 02:34:39 PM (18 months ago)
- Location:
- clonable
- Files:
-
- 116 added
- 3 deleted
- 14 edited
-
tags/2.2.6 (added)
-
tags/2.2.6/Bootstrap.php (added)
-
tags/2.2.6/clonable-wp.php (added)
-
tags/2.2.6/controllers (added)
-
tags/2.2.6/controllers/Controller.php (added)
-
tags/2.2.6/controllers/DashboardController.php (added)
-
tags/2.2.6/controllers/LandingPageController.php (added)
-
tags/2.2.6/controllers/LanguageSwitcherController.php (added)
-
tags/2.2.6/controllers/LanguageTagController.php (added)
-
tags/2.2.6/controllers/SettingController.php (added)
-
tags/2.2.6/controllers/WoocommerceController.php (added)
-
tags/2.2.6/controllers/index.php (added)
-
tags/2.2.6/helpers (added)
-
tags/2.2.6/helpers/Functions.php (added)
-
tags/2.2.6/helpers/Html.php (added)
-
tags/2.2.6/helpers/Json.php (added)
-
tags/2.2.6/helpers/Locales.php (added)
-
tags/2.2.6/helpers/Session.php (added)
-
tags/2.2.6/helpers/clonable-locales-list.php (added)
-
tags/2.2.6/helpers/index.php (added)
-
tags/2.2.6/images (added)
-
tags/2.2.6/images/clonable-full-logo.png (added)
-
tags/2.2.6/images/clonable.png (added)
-
tags/2.2.6/images/configure-wordpress-thumbnail.png (added)
-
tags/2.2.6/images/flags.png (added)
-
tags/2.2.6/images/index.php (added)
-
tags/2.2.6/images/language-switcher-thumbnail.png (added)
-
tags/2.2.6/index.php (added)
-
tags/2.2.6/middleware (added)
-
tags/2.2.6/middleware/Auth.php (added)
-
tags/2.2.6/middleware/ClonedSite.php (added)
-
tags/2.2.6/middleware/MiddlewareHandler.php (added)
-
tags/2.2.6/middleware/MiddlewareInterface.php (added)
-
tags/2.2.6/middleware/WooCommerce.php (added)
-
tags/2.2.6/middleware/index.php (added)
-
tags/2.2.6/models (added)
-
tags/2.2.6/models/ApiKey.php (added)
-
tags/2.2.6/models/ClonableWooCommerce.php (added)
-
tags/2.2.6/models/ClonedSite.php (added)
-
tags/2.2.6/models/LanguageSwitcher.php (added)
-
tags/2.2.6/models/LanguageTag.php (added)
-
tags/2.2.6/models/Settings.php (added)
-
tags/2.2.6/models/Site.php (added)
-
tags/2.2.6/models/index.php (added)
-
tags/2.2.6/objects (added)
-
tags/2.2.6/objects/ApiResponse.php (added)
-
tags/2.2.6/objects/CircuitBreaker.php (added)
-
tags/2.2.6/objects/ClonableConfig.php (added)
-
tags/2.2.6/objects/ClonableResponse.php (added)
-
tags/2.2.6/objects/CurlBuilder.php (added)
-
tags/2.2.6/objects/ExcludedProductTerm.php (added)
-
tags/2.2.6/objects/Notification.php (added)
-
tags/2.2.6/objects/index.php (added)
-
tags/2.2.6/readme-da_DK.txt (added)
-
tags/2.2.6/readme-de_DE.txt (added)
-
tags/2.2.6/readme-es_ES.txt (added)
-
tags/2.2.6/readme-fr_FR.txt (added)
-
tags/2.2.6/readme-it_IT.txt (added)
-
tags/2.2.6/readme-nb_NO.txt (added)
-
tags/2.2.6/readme-nl_NL.txt (added)
-
tags/2.2.6/readme-sv_SE.txt (added)
-
tags/2.2.6/readme.txt (added)
-
tags/2.2.6/routes (added)
-
tags/2.2.6/routes/Router.php (added)
-
tags/2.2.6/routes/index.php (added)
-
tags/2.2.6/services (added)
-
tags/2.2.6/services/AllowedHostsService.php (added)
-
tags/2.2.6/services/ApiService.php (added)
-
tags/2.2.6/services/ClonableWooCommerceService.php (added)
-
tags/2.2.6/services/LanguageSwitcherService.php (added)
-
tags/2.2.6/services/LanguageTagService.php (added)
-
tags/2.2.6/services/LocaleService.php (added)
-
tags/2.2.6/services/ShortCodeService.php (added)
-
tags/2.2.6/services/SubfolderService.php (added)
-
tags/2.2.6/services/SyncService.php (added)
-
tags/2.2.6/services/index.php (added)
-
tags/2.2.6/services/modules (added)
-
tags/2.2.6/services/modules/DataPanelModule.php (added)
-
tags/2.2.6/services/modules/ExclusionModule.php (added)
-
tags/2.2.6/services/modules/ProductImporterModule.php (added)
-
tags/2.2.6/services/modules/TaxonomyModule.php (added)
-
tags/2.2.6/services/modules/index.php (added)
-
tags/2.2.6/traits (added)
-
tags/2.2.6/traits/Forms.php (added)
-
tags/2.2.6/traits/Validation.php (added)
-
tags/2.2.6/traits/WooCommerceCheck.php (added)
-
tags/2.2.6/traits/index.php (added)
-
tags/2.2.6/uninstall.php (added)
-
tags/2.2.6/views (added)
-
tags/2.2.6/views/DashboardView.php (added)
-
tags/2.2.6/views/LanguageSwitcherView.php (added)
-
tags/2.2.6/views/LanguageTagView.php (added)
-
tags/2.2.6/views/Layout.php (added)
-
tags/2.2.6/views/OnboardingView.php (added)
-
tags/2.2.6/views/SettingsView.php (added)
-
tags/2.2.6/views/ViewInterface.php (added)
-
tags/2.2.6/views/WoocommerceView.php (added)
-
tags/2.2.6/views/css (added)
-
tags/2.2.6/views/css/clonable-extra-button.css (added)
-
tags/2.2.6/views/css/clonable-global.css (added)
-
tags/2.2.6/views/css/clonable-thumbnails.css (added)
-
tags/2.2.6/views/css/clonable-woocommerce.css (added)
-
tags/2.2.6/views/css/clonable.css (added)
-
tags/2.2.6/views/css/fomantic-dropdown.css (added)
-
tags/2.2.6/views/css/fomantic-transition.css (added)
-
tags/2.2.6/views/css/freakflags.css (added)
-
tags/2.2.6/views/css/index.php (added)
-
tags/2.2.6/views/index.php (added)
-
tags/2.2.6/views/scripts (added)
-
tags/2.2.6/views/scripts/alpine.js (added)
-
tags/2.2.6/views/scripts/dohjs.js (added)
-
tags/2.2.6/views/scripts/fomantic-dropdown.js (added)
-
tags/2.2.6/views/scripts/fomantic-transition.js (added)
-
tags/2.2.6/views/scripts/index.php (added)
-
tags/2.2.6/views/scripts/onload.js (added)
-
tags/2.2.6/views/scripts/woocommerce-clone-field.js (added)
-
trunk/clonable-wp.php (modified) (2 diffs)
-
trunk/controllers/AnalyticsController.php (deleted)
-
trunk/controllers/GeneralSettingController.php (deleted)
-
trunk/controllers/SettingController.php (modified) (1 diff)
-
trunk/models/Settings.php (modified) (1 diff)
-
trunk/readme-da_DK.txt (modified) (2 diffs)
-
trunk/readme-de_DE.txt (modified) (2 diffs)
-
trunk/readme-es_ES.txt (modified) (2 diffs)
-
trunk/readme-fr_FR.txt (modified) (2 diffs)
-
trunk/readme-it_IT.txt (modified) (2 diffs)
-
trunk/readme-nb_NO.txt (modified) (2 diffs)
-
trunk/readme-nl_NL.txt (modified) (2 diffs)
-
trunk/readme-sv_SE.txt (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/services/SubfolderService.php (modified) (4 diffs)
-
trunk/views/GeneralSettingsView.php (deleted)
-
trunk/views/SettingsView.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
clonable/trunk/clonable-wp.php
r3163099 r3164377 5 5 Description: Official plugin for improving your clones made with Clonable. 6 6 Plugin URI: https://kb.clonable.net/en/introduction/getting-started/wordpress#de-clonable-plug-in-downloaden 7 Version: 2.2. 57 Version: 2.2.6 8 8 Author: Clonable BV 9 9 Author URI: https://www.clonable.net … … 104 104 105 105 define('CLONABLE_NAME', 'Clonable'); 106 define('CLONABLE_VERSION', '2.2. 5');106 define('CLONABLE_VERSION', '2.2.6'); 107 107 108 108 try { -
clonable/trunk/controllers/SettingController.php
r3121209 r3164377 57 57 return $this->validate_checkbox($input,'clonable_language_tag_service_enabled'); 58 58 } 59 60 public function clonable_max_upstream_requests_validate($input) { 61 if (!$input) { 62 return null; 63 } 64 65 if (intval($input) < 2) { 66 add_settings_error('clonable_max_upstream_requests', 'err_invalid_value', 'The value has to be at least 2.'); 67 } 68 69 if (intval($input) > 200) { 70 add_settings_error('clonable_max_upstream_requests', 'err_invalid_value', 'The value has to be at most 200.'); 71 } 72 73 return $input; 74 } 75 76 public function clonable_max_upstream_queued_validate($input) { 77 if (!$input) { 78 return null; 79 } 80 81 if (intval($input) < 0) { 82 add_settings_error('clonable_max_upstream_queued', 'err_invalid_value', 'The value has to be at least 0.'); 83 } 84 85 if (intval($input) > 200) { 86 add_settings_error('clonable_max_upstream_queued', 'err_invalid_value', 'The value has to be at most 200.'); 87 } 88 89 return $input; 90 } 59 91 } -
clonable/trunk/models/Settings.php
r3121209 r3164377 32 32 "name" => "Enable language tag service", 33 33 "setting" => "clonable_language_tag_service_enabled", 34 ] 34 ], 35 "clonable_max_upstream_requests" => [ 36 "render" => "max_upstream_requests_field", 37 "name" => "Maximum number of simultaneous upstream requests", 38 "setting" => "clonable_max_upstream_requests", 39 "description" => "This is the maximum number of requests that can be proxied to Clonable at the same time. This should be at most half of the maximum amount of php processes (pm.max_children).", 40 ], 41 "clonable_max_upstream_queued" => [ 42 "render" => "max_upstream_queued_field", 43 "name" => "Maximum number of upstream requests that may be queued ", 44 "setting" => "clonable_max_upstream_queued", 45 "description" => "This is the maximum number of requests that can be queued to be proxied to Clonable at the same time when the setting above is exceeded. This should be at most half of the maximum amount of simultaneous upstream requests.", 46 ], 35 47 ]; 36 48 } -
clonable/trunk/readme-da_DK.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-de_DE.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-es_ES.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-fr_FR.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-it_IT.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-nb_NO.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-nl_NL.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme-sv_SE.txt
r3163099 r3164377 5 5 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/readme.txt
r3163099 r3164377 5 5 Tested up to: 6.6.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.2. 57 Stable tag: 2.2.6 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.2.6 35 Bug fix: timeouts 36 34 37 v2.2.5 35 38 Improve circuit breaker logic -
clonable/trunk/services/SubfolderService.php
r3125005 r3164377 12 12 class SubfolderService { 13 13 private $circuit_breaker; 14 15 private const SEMAPHORE_UPSTREAM = 62342001; 16 private const SEMAPHORE_UPSTREAM_QUEUE = 62342002; 14 17 15 18 public function __construct() { … … 229 232 } 230 233 234 // Semaphore 235 if (function_exists("sem_get") && function_exists("sem_acquire") && function_exists("sem_release")) { 236 $std_limit = max(2, intval(get_option("clonable_max_upstream_requests", 4))); 237 $queue_limit = $std_limit + max(0, intval(get_option("clonable_max_upstream_queued", 2))); 238 239 $semaphore = sem_get(self::SEMAPHORE_UPSTREAM, $std_limit); 240 $semaphore_queue = sem_get(self::SEMAPHORE_UPSTREAM_QUEUE, $queue_limit); 241 if ($semaphore !== false) { 242 if (!sem_acquire($semaphore_queue, true)) { 243 return new ClonableResponse("Server is busy. Please try again soon.", ['retry-after' => ['5'], 'location' => [$url]], 307, false); 244 } 245 sem_acquire($semaphore); 246 } else { 247 $semaphore = null; 248 } 249 } 250 251 231 252 // Send the request to Clonable 232 253 $response = curl_exec($curl); … … 239 260 if (Functions::can_log_sensitive()) { 240 261 $message .= $error; 262 } 263 264 if (isset($semaphore) && isset($semaphore_queue)) { 265 sem_release($semaphore); 266 sem_release($semaphore_queue); 241 267 } 242 268 return new ClonableResponse($message, $headers ?? [], 504, str_contains($error, 'timed out')); … … 251 277 } 252 278 279 if (isset($semaphore) && isset($semaphore_queue)) { 280 sem_release($semaphore); 281 sem_release($semaphore_queue); 282 } 253 283 return new ClonableResponse($body, $headers, $status_code); 254 284 } -
clonable/trunk/views/SettingsView.php
r3121209 r3164377 58 58 echo "(Add the language tags of the original website and the clones to the header of the page.)"; 59 59 } 60 61 public function max_upstream_requests_field() { 62 $option = max(2, intval(get_option('clonable_max_upstream_requests', 4))); 63 echo "<input name='clonable_max_upstream_requests' min='2' max='200' type='number' value='$option'/>"; 64 echo ""; 65 } 66 67 public function max_upstream_queued_field() { 68 $option = max(0, intval(get_option('clonable_max_upstream_queued', 2))); 69 echo "<input name='clonable_max_upstream_queued' min='0' max='200' type='number' value='$option'/>"; 70 echo ""; 71 } 60 72 }
Note: See TracChangeset
for help on using the changeset viewer.