Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Commit 551594e

Browse files
committed
Merge branch 'dev-1.1.4' into 'master'
fixed option name See merge request iamapinan/woocommerce-line-notify!16
2 parents 609f150 + 30c0cd5 commit 551594e

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
repos/
1+
logs/*
2+
vendor/
3+
*.lock

inc/Actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function thai_states( $states ) {
9797
*/
9898
public function send_notify($msg, $source = 'local') {
9999
// Get plugin options
100-
$get_option = get_option( '_option_notify' );
100+
$get_option = get_option( '_option_name' );
101101
$get_debug = get_option( '_option_debug' );
102102
$counter = get_option('wln_source_' . $source);
103103
$endpoint = get_option('wln-api-endpoint');

inc/LineNotifyAdmin.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function NotificationTrigger( $order_id ) {
155155
$order_data = $order->get_data(); // The Order data
156156

157157
// Get plugin options
158-
$get_option = get_option( '_option_notify' );
158+
$get_option = get_option( '_option_name' );
159159

160160
// Check notify rule
161161
$availableStatus = json_decode( $get_option['status'] );
@@ -257,7 +257,7 @@ public function Wln_Page_Init() {
257257
// Notification setting
258258
register_setting(
259259
'_notification_group', // option_group
260-
'_option_notify', // option_name
260+
'_option_name', // option_name
261261
array( $this, 'noti_sanitize' ) // sanitize_callback
262262
);
263263
add_settings_section(
@@ -294,7 +294,7 @@ public function Wln_Page_Init() {
294294
// About
295295
register_setting(
296296
'_about_group', // option_group
297-
'_option_notify' // option_name
297+
'_option_name' // option_name
298298
// array( $this, '_sanitize' ) // sanitize_callback
299299
);
300300
add_settings_section(
@@ -310,7 +310,7 @@ public function _section_info() {
310310

311311
switch ( $active_tab ) {
312312
case 'notification_setting':
313-
$this->options = get_option( '_option_notify' );
313+
$this->options = get_option( '_option_name' );
314314
echo __('Order notification setting','woo-line-notify');
315315
add_settings_field(
316316
'endpoint', // id
@@ -480,7 +480,7 @@ public function api_callback() {
480480
}
481481
public function token_callback() {
482482
printf(
483-
'<input class="regular-text" type="password" name="_option_notify[token]" id="token" value="%s" required> <a href="https://notify-bot.line.me/my/" target="_blank" class="button button-secondary">' . __('Create Token', 'woo-line-notify') . '</a>',
483+
'<input class="regular-text" type="password" name="_option_name[token]" id="token" value="%s" required> <a href="https://notify-bot.line.me/my/" target="_blank" class="button button-secondary">' . __('Create Token', 'woo-line-notify') . '</a>',
484484
isset( $this->options['token'] ) ? esc_attr( $this->options['token']) : ''
485485
);
486486
}
@@ -495,7 +495,7 @@ public function endpoint_callback() {
495495

496496
public function pattern_callback() {
497497
printf(
498-
'<textarea class="large-text" maxlength="500" placeholder="' . __('You have new order on', 'woo-line-notify') . ' [order_status]" rows="5" name="_option_notify[pattern]" id="pattern" style="max-width: 580px;height: 200px;">%s</textarea>
498+
'<textarea class="large-text" maxlength="500" placeholder="' . __('You have new order on', 'woo-line-notify') . ' [order_status]" rows="5" name="_option_name[pattern]" id="pattern" style="max-width: 580px;height: 200px;">%s</textarea>
499499
<p>
500500
<a href="" class="button button-secondary" id="add_default_pattern">' . __('Use default value', 'woo-line-notify') . '</a>
501501
</p>
@@ -527,7 +527,7 @@ public function order_status_callback() {
527527
$orderStatus = wc_get_order_statuses();
528528
foreach($orderStatus as $sid => $sv) {
529529
$check = @(in_array($sid, $statusSelected)) ? 'checked' : '';
530-
echo "<p><span class='order_status_check'><input type='checkbox' name='_option_notify[status][]' $check value='$sid' id='status_$sid'> <label for='status_$sid'>$sv</label></span>&nbsp;&nbsp;</p>";
530+
echo "<p><span class='order_status_check'><input type='checkbox' name='_option_name[status][]' $check value='$sid' id='status_$sid'> <label for='status_$sid'>$sv</label></span>&nbsp;&nbsp;</p>";
531531
}
532532
} else {
533533
echo __("<p>Please install and activate <a href='https://th.wordpress.org/plugins/woocommerce/'>Woocommerce</a> to use this feature.</p>", 'woo-line-notify');

readme.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://paypal.me/apinu
44
Tags: woocommerce line notify, woo line notify, woo-line-notify, notification, line notification, line notify, woocommerce, notify, messager, alert, order, line, line bot
55
Requires at least: 4.8
66
Tested up to: 5.2.2
7-
Stable tag: 1.1.1
7+
Stable tag: 1.1.4
88
Requires PHP: 7.0
99
License: GPLv3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -124,9 +124,9 @@ To send message via static method just put your message to the method like below
124124
== REST API ==
125125
URL: domain/wp-json/woo-line-notify/v1/notify
126126
METHOD: POST
127-
PARAMETERS: `message` <Your message to send>
127+
PARAMETERS: `message` Your message to send
128128
Authentication: Basic Authen
129-
USERNAME/PASSWORD: <API Key>:<API_Key>
129+
USERNAME/PASSWORD: API Key:API_Key
130130

131131
= For example. =
132132
Send post request to `http://localhost/wp-json/woo-line-notify/v1/notify` you must be send parameter `message` by form/data and add Authenticate to header with value `Basic base64_encode( some_api_key_from_api_option:some_api_key_from_api_option )`
@@ -153,6 +153,12 @@ Yes you can do it by adding shortcode [product] to your message pattern.
153153
5. Dashboard widget.
154154

155155
== Changelog ==
156+
= 1.1.4 =
157+
- fixed action
158+
= 1.1.3 =
159+
- update version
160+
= 1.1.2 =
161+
- fixed old value missing.
156162
= 1.1.1 =
157163
- add code
158164

woo-line-notify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Woocommerce Line Notify
44
Plugin URI: https://git.iotech.co.th/iamapinan/woocommerce-line-notify
55
Description: Woocommerce new order notify to line chat.
6-
Version: 1.1.1
6+
Version: 1.1.4
77
Author: Apinan Woratrakun
88
Author URI: https://facebook.com/9apinan
99
License: GNU General Public License v3.0

0 commit comments

Comments
 (0)