Update WordPress plugin to v1.4.0 with new public API v1
- Switch from /api to /api/v1 endpoints - Use X-API-Key header instead of Bearer token - Update test connection to use /menu endpoint 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
BIN
backend/public/downloads/crawlsy-menus-v1.4.0.zip
Normal file
BIN
backend/public/downloads/crawlsy-menus-v1.4.0.zip
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
* Plugin Name: Crawlsy Menus
|
* Plugin Name: Crawlsy Menus
|
||||||
* Plugin URI: https://creationshop.io
|
* Plugin URI: https://creationshop.io
|
||||||
* Description: Display cannabis product menus from Crawlsy with Elementor integration
|
* Description: Display cannabis product menus from Crawlsy with Elementor integration
|
||||||
* Version: 1.3.0
|
* Version: 1.4.0
|
||||||
* Author: Creationshop
|
* Author: Creationshop
|
||||||
* Author URI: https://creationshop.io
|
* Author URI: https://creationshop.io
|
||||||
* License: GPL v2 or later
|
* License: GPL v2 or later
|
||||||
@@ -15,8 +15,8 @@ if (!defined('ABSPATH')) {
|
|||||||
exit; // Exit if accessed directly
|
exit; // Exit if accessed directly
|
||||||
}
|
}
|
||||||
|
|
||||||
define('CRAWLSY_MENUS_VERSION', '1.3.0');
|
define('CRAWLSY_MENUS_VERSION', '1.4.0');
|
||||||
define('CRAWLSY_MENUS_API_URL', 'https://dispos.crawlsy.com/api');
|
define('CRAWLSY_MENUS_API_URL', 'https://dispos.crawlsy.com/api/v1');
|
||||||
define('CRAWLSY_MENUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
define('CRAWLSY_MENUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||||
define('CRAWLSY_MENUS_PLUGIN_URL', plugin_dir_url(__FILE__));
|
define('CRAWLSY_MENUS_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||||
|
|
||||||
@@ -156,15 +156,15 @@ class Crawlsy_Menus_Plugin {
|
|||||||
$('#api-test-result').html('<p>Testing connection...</p>');
|
$('#api-test-result').html('<p>Testing connection...</p>');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: apiUrl + '/auth/me',
|
url: apiUrl + '/menu',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer ' + apiToken
|
'X-API-Key': apiToken
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
$('#api-test-result').html(
|
$('#api-test-result').html(
|
||||||
'<div class="notice notice-success"><p><strong>Success!</strong> Connected as: ' +
|
'<div class="notice notice-success"><p><strong>Success!</strong> Connected to: ' +
|
||||||
response.user.email + '</p></div>'
|
response.dispensary + ' (' + response.menu.total_products + ' products)</p></div>'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
error: function(xhr) {
|
error: function(xhr) {
|
||||||
@@ -241,7 +241,7 @@ class Crawlsy_Menus_Plugin {
|
|||||||
|
|
||||||
$response = wp_remote_get($url, [
|
$response = wp_remote_get($url, [
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Authorization' => 'Bearer ' . $api_token
|
'X-API-Key' => $api_token
|
||||||
],
|
],
|
||||||
'timeout' => 30
|
'timeout' => 30
|
||||||
]);
|
]);
|
||||||
@@ -270,7 +270,7 @@ class Crawlsy_Menus_Plugin {
|
|||||||
|
|
||||||
$response = wp_remote_get($url, [
|
$response = wp_remote_get($url, [
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Authorization' => 'Bearer ' . $api_token
|
'X-API-Key' => $api_token
|
||||||
],
|
],
|
||||||
'timeout' => 30
|
'timeout' => 30
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user