Skip to content

Commit bf150d0

Browse files
authored
TT-10118 - Fixed crashing when woocommerce is not activated/installed (#48)
* fix: crash when woocommerce is not activated/installed * chore: bumped wordpress version for test workflow
1 parent 6f9c7cc commit bf150d0

File tree

8 files changed

+22
-12
lines changed

8 files changed

+22
-12
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
include:
1212
- node-version: '14.x'
13-
WORDPRESS_VERSION: 5.7.2
13+
WORDPRESS_VERSION: 5.8.3
1414
PHP_VERSION: 7.4
1515
WOOCOMMERCE_VERSION: 5.7.1
1616
WORDPRESS_THEME: twentytwenty

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PLUGIN := 3-word-address-validation-field
22

33
# Define the version (this is your single source of truth)
4-
VERSION := 4.0.17
4+
VERSION := 4.0.18
55

66
# Define file paths
77
PLUGIN_FILE := w3w-autosuggest/w3w-autosuggest.php

w3w-autosuggest-blocks/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

w3w-autosuggest-blocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "w3w-autosuggest-blocks",
3-
"version": "4.0.17",
3+
"version": "4.0.18",
44
"description": "what3words plugin for blocks based woocommerce checkout",
55
"author": "what3words",
66
"license": "GPL-2.0-only",

w3w-autosuggest-blocks/src/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 3,
4-
"version": "4.0.17",
4+
"version": "4.0.18",
55
"title": "what3words Autosuggest",
66
"category": "widgets",
77
"attributes": {

w3w-autosuggest/README.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: what3words
33
Tags: what3words, 3 word address, three word address, searchbox, search, address, validation, autosuggest, w3w
44
Requires at least: 4.7
55
Tested up to: 6.7.2
6-
Stable tag: 4.0.17
6+
Stable tag: 4.0.18
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -74,6 +74,14 @@ Have any questions? Want to learn more about how the what3words Address Field pl
7474

7575
== Changelog ==
7676

77+
= 4.0.18 =
78+
* Release 2025.08.19
79+
* Bug fixed for wordpress instances crashing when it doesn't have woocommerce
80+
81+
= 4.0.17 =
82+
* Release 2025.07.03
83+
* Support for woocommerce blocks based check out
84+
7785
= 4.0.16 =
7886
* Release 2025.02.10
7987
* Added input text sanitation in plugin settings

w3w-autosuggest/includes/class-w3w-autosuggest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ private function set_locale()
173173

174174
private function setup_blocks()
175175
{
176-
if (!class_exists('W3W_Autosuggest_Blocks')) {
177-
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-w3w-autosuggest-blocks.php';
176+
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
177+
if (!class_exists('W3W_Autosuggest_Blocks')) {
178+
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-w3w-autosuggest-blocks.php';
179+
}
180+
new W3W_Autosuggest_Blocks($this->loader);
178181
}
179-
new W3W_Autosuggest_Blocks($this->loader);
180182
}
181183

182184
/**

w3w-autosuggest/w3w-autosuggest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: what3words Address Field
1717
* Plugin URI: https://github.com/what3words/wordpress-autosuggest-plugin
1818
* Description: Official plugin to allow customers to enter and validate a what3words address on your checkout for accurate deliveries
19-
* Version: 4.0.17
19+
* Version: 4.0.18
2020
* Author: what3words
2121
* Author URI: https://what3words.com
2222
* License: GPL-2.0+
@@ -55,7 +55,7 @@
5555
* Current plugin version.
5656
*/
5757
if (!defined('W3W_PLUGIN_VERSION')) {
58-
define('W3W_PLUGIN_VERSION', '4.0.17');
58+
define('W3W_PLUGIN_VERSION', '4.0.18');
5959
}
6060
/**
6161
* Plugin settings name

0 commit comments

Comments
 (0)