## ✅ Step 4-5: Rich Text Editor & Integration ### RichTextEditor Component (TipTap) - ✅ Modern WYSIWYG editor for React - ✅ Toolbar: Bold, Italic, Lists, Links, Undo/Redo - ✅ Variable insertion with buttons - ✅ Placeholder support - ✅ Clean, minimal UI ### TemplateEditor Updated - ✅ Replaced Textarea with RichTextEditor - ✅ Variables shown as clickable buttons - ✅ Better UX for content editing - ✅ HTML output for email templates ### Bootstrap Integration - ✅ EmailManager initialized on plugin load - ✅ Hooks into WooCommerce events automatically - ✅ Disables WC emails to prevent duplicates ### Plugin Constants - ✅ WOONOOW_PATH for template paths - ✅ WOONOOW_URL for assets - ✅ WOONOOW_VERSION for versioning ### Dependencies - ✅ @tiptap/react - ✅ @tiptap/starter-kit - ✅ @tiptap/extension-placeholder - ✅ @tiptap/extension-link --- **Status:** Core email system complete! **Next:** Test and create content templates 🚀
47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: WooNooW
|
|
* Description: The modern experience layer for WooCommerce (no migration, no risk).
|
|
* Version: 0.1.0
|
|
* Author: Dewe
|
|
* Requires Plugins: woocommerce
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) exit;
|
|
|
|
// Define plugin constants
|
|
define('WOONOOW_PATH', plugin_dir_path(__FILE__));
|
|
define('WOONOOW_URL', plugin_dir_url(__FILE__));
|
|
define('WOONOOW_VERSION', '0.1.0');
|
|
|
|
spl_autoload_register(function ($class) {
|
|
$prefix = 'WooNooW\\';
|
|
$base_dir = __DIR__ . '/includes/';
|
|
if (strncmp($prefix, $class, strlen($prefix)) !== 0) return;
|
|
$relative = substr($class, strlen($prefix));
|
|
$file = $base_dir . str_replace('\\', '/', $relative) . '.php';
|
|
if (file_exists($file)) require $file;
|
|
});
|
|
|
|
// Load translations on init hook (WordPress 6.7+ requirement)
|
|
add_action('init', function() {
|
|
load_plugin_textdomain('woonoow', false, dirname(plugin_basename(__FILE__)) . '/languages');
|
|
});
|
|
|
|
add_action('plugins_loaded', function () {
|
|
if (!class_exists('WooCommerce')) {
|
|
add_action('admin_notices', function () {
|
|
echo '<div class="notice notice-error"><p>WooNooW membutuhkan WooCommerce aktif.</p></div>';
|
|
});
|
|
return;
|
|
}
|
|
WooNooW\Core\Bootstrap::init();
|
|
});
|
|
|
|
register_activation_hook(__FILE__, function () {
|
|
update_option('woocommerce_custom_orders_table_enabled', 'yes');
|
|
update_option('woocommerce_custom_orders_table_migration_enabled', 'yes');
|
|
});
|
|
|
|
add_filter('woonoow/admin_is_dev', '__return_true');
|
|
add_filter('woonoow/admin_dev_server', fn() => 'https://woonoow.local:5173'); |