feat: Rename WordPress plugin to CannaIQ Menus v1.5.3
- Rename plugin from Crawlsy Menus to CannaIQ Menus - Update version to 1.5.3 - Update text domain to cannaiq-menus - Rename all CSS classes from crawlsy-* to cannaiq-* - Update shortcodes to [cannaiq_products] and [cannaiq_product] - Add backward compatibility for legacy shortcodes - Update download links on Home and LandingPage - Fix health panel Redis timeout issue - Add clear error message when backend not running 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,14 @@ if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
class CannaIQ_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'crawlsy_single_product';
|
||||
return 'cannaiq_single_product';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return __('Crawlsy Single Product', 'crawlsy-menus');
|
||||
return __('CannaIQ Single Product', 'cannaiq-menus');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
@@ -31,9 +31,9 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
* @return array Associative array of product_id => product_name
|
||||
*/
|
||||
protected function get_products_for_select() {
|
||||
$options = ['' => __('-- Select a Product --', 'crawlsy-menus')];
|
||||
$options = ['' => __('-- Select a Product --', 'cannaiq-menus')];
|
||||
|
||||
$plugin = Crawlsy_Menus_Plugin::instance();
|
||||
$plugin = CannaIQ_Menus_Plugin::instance();
|
||||
$products = $plugin->fetch_products(['limit' => 500]);
|
||||
|
||||
if ($products && is_array($products)) {
|
||||
@@ -58,7 +58,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->start_controls_section(
|
||||
'content_section',
|
||||
[
|
||||
'label' => __('Content', 'crawlsy-menus'),
|
||||
'label' => __('Content', 'cannaiq-menus'),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
@@ -69,22 +69,22 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'product_id',
|
||||
[
|
||||
'label' => __('Select Product', 'crawlsy-menus'),
|
||||
'label' => __('Select Product', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SELECT2,
|
||||
'options' => $products_options,
|
||||
'default' => '',
|
||||
'label_block' => true,
|
||||
'description' => __('Search and select a product to display', 'crawlsy-menus'),
|
||||
'description' => __('Search and select a product to display', 'cannaiq-menus'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'product_id_manual',
|
||||
[
|
||||
'label' => __('Or Enter Product ID', 'crawlsy-menus'),
|
||||
'label' => __('Or Enter Product ID', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'default' => '',
|
||||
'description' => __('Manually enter a product ID if not found in dropdown', 'crawlsy-menus'),
|
||||
'description' => __('Manually enter a product ID if not found in dropdown', 'cannaiq-menus'),
|
||||
'condition' => [
|
||||
'product_id' => '',
|
||||
],
|
||||
@@ -94,12 +94,12 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'layout',
|
||||
[
|
||||
'label' => __('Layout', 'crawlsy-menus'),
|
||||
'label' => __('Layout', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => 'horizontal',
|
||||
'options' => [
|
||||
'horizontal' => __('Horizontal', 'crawlsy-menus'),
|
||||
'vertical' => __('Vertical', 'crawlsy-menus'),
|
||||
'horizontal' => __('Horizontal', 'cannaiq-menus'),
|
||||
'vertical' => __('Vertical', 'cannaiq-menus'),
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -110,7 +110,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->start_controls_section(
|
||||
'display_section',
|
||||
[
|
||||
'label' => __('Display Options', 'crawlsy-menus'),
|
||||
'label' => __('Display Options', 'cannaiq-menus'),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
@@ -118,10 +118,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_image',
|
||||
[
|
||||
'label' => __('Show Image', 'crawlsy-menus'),
|
||||
'label' => __('Show Image', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -130,10 +130,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_price',
|
||||
[
|
||||
'label' => __('Show Price', 'crawlsy-menus'),
|
||||
'label' => __('Show Price', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -142,10 +142,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_description',
|
||||
[
|
||||
'label' => __('Show Description', 'crawlsy-menus'),
|
||||
'label' => __('Show Description', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -154,10 +154,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_thc',
|
||||
[
|
||||
'label' => __('Show THC', 'crawlsy-menus'),
|
||||
'label' => __('Show THC', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -166,10 +166,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_cbd',
|
||||
[
|
||||
'label' => __('Show CBD', 'crawlsy-menus'),
|
||||
'label' => __('Show CBD', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -178,10 +178,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_terpenes',
|
||||
[
|
||||
'label' => __('Show Terpenes', 'crawlsy-menus'),
|
||||
'label' => __('Show Terpenes', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -190,10 +190,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_effects',
|
||||
[
|
||||
'label' => __('Show Effects', 'crawlsy-menus'),
|
||||
'label' => __('Show Effects', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -202,10 +202,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'show_brand',
|
||||
[
|
||||
'label' => __('Show Brand', 'crawlsy-menus'),
|
||||
'label' => __('Show Brand', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'crawlsy-menus'),
|
||||
'label_off' => __('No', 'crawlsy-menus'),
|
||||
'label_on' => __('Yes', 'cannaiq-menus'),
|
||||
'label_off' => __('No', 'cannaiq-menus'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
@@ -217,7 +217,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->start_controls_section(
|
||||
'style_section',
|
||||
[
|
||||
'label' => __('Style', 'crawlsy-menus'),
|
||||
'label' => __('Style', 'cannaiq-menus'),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
@@ -225,11 +225,11 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => __('Background Color', 'crawlsy-menus'),
|
||||
'label' => __('Background Color', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .crawlsy-single-product' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .cannaiq-single-product' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -237,7 +237,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'crawlsy-menus'),
|
||||
'label' => __('Border Radius', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
@@ -250,7 +250,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
'size' => 8,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .crawlsy-single-product' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .cannaiq-single-product' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -258,11 +258,11 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'text_color',
|
||||
[
|
||||
'label' => __('Text Color', 'crawlsy-menus'),
|
||||
'label' => __('Text Color', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'default' => '#333333',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .crawlsy-single-product' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .cannaiq-single-product' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -277,93 +277,88 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
|
||||
$product_id = !empty($settings['product_id']) ? $settings['product_id'] : $settings['product_id_manual'];
|
||||
|
||||
if (empty($product_id)) {
|
||||
echo '<p>' . __('Please select or enter a product ID.', 'crawlsy-menus') . '</p>';
|
||||
echo '<p>' . __('Please select or enter a product ID.', 'cannaiq-menus') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
$plugin = Crawlsy_Menus_Plugin::instance();
|
||||
$plugin = CannaIQ_Menus_Plugin::instance();
|
||||
$product = $plugin->fetch_product($product_id);
|
||||
|
||||
if (!$product) {
|
||||
echo '<p>' . __('Product not found.', 'crawlsy-menus') . '</p>';
|
||||
echo '<p>' . __('Product not found.', 'cannaiq-menus') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
$layout = $settings['layout'];
|
||||
$image_url = $product['image_url'] ?? '';
|
||||
?>
|
||||
<div class="crawlsy-single-product crawlsy-layout-<?php echo esc_attr($layout); ?>">
|
||||
<?php if ($settings['show_image'] === 'yes' && !empty($product['image_url_full'])): ?>
|
||||
<div class="crawlsy-single-product-image">
|
||||
<img src="<?php echo esc_url($product['image_url_full']); ?>"
|
||||
<div class="cannaiq-single-product cannaiq-layout-<?php echo esc_attr($layout); ?>">
|
||||
<?php if ($settings['show_image'] === 'yes' && !empty($image_url)): ?>
|
||||
<div class="cannaiq-single-product-image">
|
||||
<img src="<?php echo esc_url($image_url); ?>"
|
||||
alt="<?php echo esc_attr($product['name']); ?>" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="crawlsy-single-product-details">
|
||||
<h2 class="crawlsy-single-product-title">
|
||||
<div class="cannaiq-single-product-details">
|
||||
<h2 class="cannaiq-single-product-title">
|
||||
<?php echo esc_html($product['name']); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ($settings['show_brand'] === 'yes' && !empty($product['brand'])): ?>
|
||||
<div class="crawlsy-single-product-brand">
|
||||
<strong><?php _e('Brand:', 'crawlsy-menus'); ?></strong>
|
||||
<div class="cannaiq-single-product-brand">
|
||||
<strong><?php _e('Brand:', 'cannaiq-menus'); ?></strong>
|
||||
<?php echo esc_html($product['brand']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($settings['show_description'] === 'yes' && !empty($product['description'])): ?>
|
||||
<div class="crawlsy-single-product-description">
|
||||
<div class="cannaiq-single-product-description">
|
||||
<?php echo wp_kses_post(nl2br($product['description'])); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="crawlsy-single-product-info">
|
||||
<?php if ($settings['show_thc'] === 'yes' && !empty($product['metadata']['thc'])): ?>
|
||||
<div class="crawlsy-info-item">
|
||||
<strong><?php _e('THC:', 'crawlsy-menus'); ?></strong>
|
||||
<span><?php echo esc_html($product['metadata']['thc']); ?></span>
|
||||
<div class="cannaiq-single-product-info">
|
||||
<?php if ($settings['show_thc'] === 'yes' && !empty($product['thc_percentage'])): ?>
|
||||
<div class="cannaiq-info-item">
|
||||
<strong><?php _e('THC:', 'cannaiq-menus'); ?></strong>
|
||||
<span><?php echo esc_html($product['thc_percentage']); ?>%</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($settings['show_cbd'] === 'yes' && !empty($product['metadata']['cbd'])): ?>
|
||||
<div class="crawlsy-info-item">
|
||||
<strong><?php _e('CBD:', 'crawlsy-menus'); ?></strong>
|
||||
<span><?php echo esc_html($product['metadata']['cbd']); ?></span>
|
||||
<?php if ($settings['show_cbd'] === 'yes' && !empty($product['cbd_percentage'])): ?>
|
||||
<div class="cannaiq-info-item">
|
||||
<strong><?php _e('CBD:', 'cannaiq-menus'); ?></strong>
|
||||
<span><?php echo esc_html($product['cbd_percentage']); ?>%</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($settings['show_terpenes'] === 'yes' && !empty($product['metadata']['terpenes'])): ?>
|
||||
<div class="crawlsy-info-item crawlsy-terpenes">
|
||||
<strong><?php _e('Terpenes:', 'crawlsy-menus'); ?></strong>
|
||||
<?php if (is_array($product['metadata']['terpenes'])): ?>
|
||||
<span><?php echo esc_html(implode(', ', $product['metadata']['terpenes'])); ?></span>
|
||||
<?php if ($settings['show_effects'] === 'yes' && !empty($product['effects'])): ?>
|
||||
<div class="cannaiq-info-item cannaiq-effects">
|
||||
<strong><?php _e('Effects:', 'cannaiq-menus'); ?></strong>
|
||||
<?php if (is_array($product['effects'])): ?>
|
||||
<span><?php echo esc_html(implode(', ', $product['effects'])); ?></span>
|
||||
<?php else: ?>
|
||||
<span><?php echo esc_html($product['metadata']['terpenes']); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($settings['show_effects'] === 'yes' && !empty($product['metadata']['effects'])): ?>
|
||||
<div class="crawlsy-info-item crawlsy-effects">
|
||||
<strong><?php _e('Effects:', 'crawlsy-menus'); ?></strong>
|
||||
<?php if (is_array($product['metadata']['effects'])): ?>
|
||||
<span><?php echo esc_html(implode(', ', $product['metadata']['effects'])); ?></span>
|
||||
<?php else: ?>
|
||||
<span><?php echo esc_html($product['metadata']['effects']); ?></span>
|
||||
<span><?php echo esc_html($product['effects']); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($settings['show_price'] === 'yes' && isset($product['price'])): ?>
|
||||
<div class="crawlsy-single-product-price">
|
||||
$<?php echo number_format($product['price'], 2); ?>
|
||||
<?php if ($settings['show_price'] === 'yes' && isset($product['regular_price'])): ?>
|
||||
<div class="cannaiq-single-product-price">
|
||||
<?php if (!empty($product['sale_price']) && $product['sale_price'] != $product['regular_price']): ?>
|
||||
<span class="cannaiq-price-sale">$<?php echo esc_html($product['sale_price']); ?></span>
|
||||
<span class="cannaiq-price-regular cannaiq-strikethrough">$<?php echo esc_html($product['regular_price']); ?></span>
|
||||
<?php else: ?>
|
||||
$<?php echo esc_html($product['regular_price']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$product['in_stock']): ?>
|
||||
<div class="crawlsy-out-of-stock">
|
||||
<?php _e('Out of Stock', 'crawlsy-menus'); ?>
|
||||
<div class="cannaiq-out-of-stock">
|
||||
<?php _e('Out of Stock', 'cannaiq-menus'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user