Skip to content

Commit

Permalink
default dispatcher fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspijak committed Nov 14, 2023
1 parent 7a35c05 commit 7149b5f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ Yes. The SMS plugin for WooCommerce communicates with our BulkGate <a href="http

## Changelog

**3.0.2**
* Fix asset cron init bug

**3.0.1**
* Bug fix https://wordpress.org/support/topic/after-update-i-cannot-view-order/

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ Yes. The SMS plugin for WooCommerce communicates with our BulkGate <a href="http

== Changelog ==

= 3.0.2 =
* Fix asset cron init bug

= 3.0.1 =
* Bug fix https://wordpress.org/support/topic/after-update-i-cannot-view-order/

Expand Down
4 changes: 2 additions & 2 deletions src/Event/AssetDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function init(): void
{
add_action( 'init', function (): void
{
if (Factory::get()->getByClass(Settings::class)->load('main:dispatcher') === Dispatcher::Asset)
if ((Factory::get()->getByClass(Settings::class)->load('main:dispatcher') ?? Dispatcher::$default_dispatcher) === Dispatcher::Asset)
{
add_filter('script_loader_tag', fn (string $tag, string $handle, string $src): string => $handle === self::Handle ? wp_get_script_tag(['src' => $src, 'id' => "$handle-js", 'async' => true]) : $tag, 10, 3);
wp_enqueue_script(self::Handle, '/?' . http_build_query([self::QueryVar => Dispatcher::Asset]), [], null);
Expand All @@ -42,7 +42,7 @@ public static function init(): void

$settings = $di->getByClass(Settings::class);

if ($settings->load('main:dispatcher') === Dispatcher::Asset)
if (($settings->load('main:dispatcher') ?? Dispatcher::$default_dispatcher) === Dispatcher::Asset)
{
$count = $di->getByClass(Asynchronous::class)->run(max(5, (int) ($settings->load('main:cron-limit') ?? 10)));

Expand Down
2 changes: 1 addition & 1 deletion woosms-sms-module-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: BulkGate SMS Plugin for WooCommerce
* Plugin URI: https://www.bulkgate.com/en/integrations/sms-plugin-for-woocommerce/
* Description: Notify your customers about order status via SMS notifications.
* Version: 3.0.1
* Version: 3.0.2
* Author: BulkGate
* Author URI: https://www.bulkgate.com/
* Requires at least: 5.7
Expand Down

0 comments on commit 7149b5f

Please sign in to comment.