@mytechtoday/augment-extensions 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/augment-extensions/domain-rules/wordpress/README.md +163 -0
  2. package/augment-extensions/domain-rules/wordpress/module.json +32 -0
  3. package/augment-extensions/domain-rules/wordpress/rules/coding-standards.md +617 -0
  4. package/augment-extensions/domain-rules/wordpress/rules/directory-structure.md +270 -0
  5. package/augment-extensions/domain-rules/wordpress/rules/file-patterns.md +423 -0
  6. package/augment-extensions/domain-rules/wordpress/rules/gutenberg-blocks.md +493 -0
  7. package/augment-extensions/domain-rules/wordpress/rules/performance.md +568 -0
  8. package/augment-extensions/domain-rules/wordpress/rules/plugin-development.md +510 -0
  9. package/augment-extensions/domain-rules/wordpress/rules/project-detection.md +251 -0
  10. package/augment-extensions/domain-rules/wordpress/rules/rest-api.md +501 -0
  11. package/augment-extensions/domain-rules/wordpress/rules/security.md +564 -0
  12. package/augment-extensions/domain-rules/wordpress/rules/theme-development.md +388 -0
  13. package/augment-extensions/domain-rules/wordpress/rules/woocommerce.md +441 -0
  14. package/augment-extensions/domain-rules/wordpress-plugin/README.md +139 -0
  15. package/augment-extensions/domain-rules/wordpress-plugin/examples/ajax-plugin.md +1599 -0
  16. package/augment-extensions/domain-rules/wordpress-plugin/examples/custom-post-type-plugin.md +1727 -0
  17. package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block-plugin.md +428 -0
  18. package/augment-extensions/domain-rules/wordpress-plugin/examples/gutenberg-block.md +422 -0
  19. package/augment-extensions/domain-rules/wordpress-plugin/examples/mvc-plugin.md +1623 -0
  20. package/augment-extensions/domain-rules/wordpress-plugin/examples/object-oriented-plugin.md +1343 -0
  21. package/augment-extensions/domain-rules/wordpress-plugin/examples/rest-endpoint.md +734 -0
  22. package/augment-extensions/domain-rules/wordpress-plugin/examples/settings-page-plugin.md +1350 -0
  23. package/augment-extensions/domain-rules/wordpress-plugin/examples/simple-procedural-plugin.md +503 -0
  24. package/augment-extensions/domain-rules/wordpress-plugin/examples/singleton-plugin.md +971 -0
  25. package/augment-extensions/domain-rules/wordpress-plugin/module.json +53 -0
  26. package/augment-extensions/domain-rules/wordpress-plugin/rules/activation-hooks.md +770 -0
  27. package/augment-extensions/domain-rules/wordpress-plugin/rules/admin-interface.md +874 -0
  28. package/augment-extensions/domain-rules/wordpress-plugin/rules/ajax-handlers.md +629 -0
  29. package/augment-extensions/domain-rules/wordpress-plugin/rules/asset-management.md +559 -0
  30. package/augment-extensions/domain-rules/wordpress-plugin/rules/context-providers.md +709 -0
  31. package/augment-extensions/domain-rules/wordpress-plugin/rules/cron-jobs.md +736 -0
  32. package/augment-extensions/domain-rules/wordpress-plugin/rules/database-management.md +1057 -0
  33. package/augment-extensions/domain-rules/wordpress-plugin/rules/documentation-standards.md +463 -0
  34. package/augment-extensions/domain-rules/wordpress-plugin/rules/frontend-functionality.md +478 -0
  35. package/augment-extensions/domain-rules/wordpress-plugin/rules/gutenberg-blocks.md +818 -0
  36. package/augment-extensions/domain-rules/wordpress-plugin/rules/internationalization.md +416 -0
  37. package/augment-extensions/domain-rules/wordpress-plugin/rules/migration.md +667 -0
  38. package/augment-extensions/domain-rules/wordpress-plugin/rules/performance-optimization.md +878 -0
  39. package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-architecture.md +693 -0
  40. package/augment-extensions/domain-rules/wordpress-plugin/rules/plugin-structure.md +352 -0
  41. package/augment-extensions/domain-rules/wordpress-plugin/rules/rest-api.md +818 -0
  42. package/augment-extensions/domain-rules/wordpress-plugin/rules/scaffolding-workflow.md +624 -0
  43. package/augment-extensions/domain-rules/wordpress-plugin/rules/security-best-practices.md +866 -0
  44. package/augment-extensions/domain-rules/wordpress-plugin/rules/testing-patterns.md +1165 -0
  45. package/augment-extensions/domain-rules/wordpress-plugin/rules/testing.md +414 -0
  46. package/augment-extensions/domain-rules/wordpress-plugin/rules/vscode-integration.md +751 -0
  47. package/augment-extensions/domain-rules/wordpress-plugin/rules/woocommerce-integration.md +949 -0
  48. package/augment-extensions/domain-rules/wordpress-plugin/rules/wordpress-org-submission.md +458 -0
  49. package/augment-extensions/examples/gutenberg-block-plugin/README.md +101 -0
  50. package/augment-extensions/examples/gutenberg-block-plugin/examples/testimonial-block.md +428 -0
  51. package/augment-extensions/examples/gutenberg-block-plugin/module.json +40 -0
  52. package/augment-extensions/examples/rest-api-plugin/README.md +98 -0
  53. package/augment-extensions/examples/rest-api-plugin/examples/task-manager-api.md +1299 -0
  54. package/augment-extensions/examples/rest-api-plugin/module.json +40 -0
  55. package/augment-extensions/examples/woocommerce-extension/README.md +98 -0
  56. package/augment-extensions/examples/woocommerce-extension/examples/product-customizer.md +763 -0
  57. package/augment-extensions/examples/woocommerce-extension/module.json +40 -0
  58. package/augment-extensions/workflows/wordpress-plugin/README.md +232 -0
  59. package/augment-extensions/workflows/wordpress-plugin/ai-prompts.md +839 -0
  60. package/augment-extensions/workflows/wordpress-plugin/bead-decomposition-patterns.md +854 -0
  61. package/augment-extensions/workflows/wordpress-plugin/examples/complete-plugin-example.md +540 -0
  62. package/augment-extensions/workflows/wordpress-plugin/examples/custom-post-type-example.md +1083 -0
  63. package/augment-extensions/workflows/wordpress-plugin/examples/feature-addition-workflow.md +669 -0
  64. package/augment-extensions/workflows/wordpress-plugin/examples/plugin-creation-workflow.md +597 -0
  65. package/augment-extensions/workflows/wordpress-plugin/examples/secure-form-handler-example.md +925 -0
  66. package/augment-extensions/workflows/wordpress-plugin/examples/security-audit-workflow.md +752 -0
  67. package/augment-extensions/workflows/wordpress-plugin/examples/wordpress-org-submission-workflow.md +773 -0
  68. package/augment-extensions/workflows/wordpress-plugin/module.json +49 -0
  69. package/augment-extensions/workflows/wordpress-plugin/rules/best-practices.md +942 -0
  70. package/augment-extensions/workflows/wordpress-plugin/rules/development-workflow.md +702 -0
  71. package/augment-extensions/workflows/wordpress-plugin/rules/submission-workflow.md +728 -0
  72. package/augment-extensions/workflows/wordpress-plugin/rules/testing-workflow.md +775 -0
  73. package/cli/dist/cli.js +5 -1
  74. package/cli/dist/cli.js.map +1 -1
  75. package/cli/dist/commands/show.d.ts.map +1 -1
  76. package/cli/dist/commands/show.js +41 -0
  77. package/cli/dist/commands/show.js.map +1 -1
  78. package/modules.md +52 -0
  79. package/package.json +1 -1
@@ -0,0 +1,441 @@
1
+ # WooCommerce Customization Workflow
2
+
3
+ ## Overview
4
+
5
+ This document provides workflows for customizing WooCommerce, the most popular WordPress eCommerce plugin.
6
+
7
+ ## Workflow 1: Template Overrides
8
+
9
+ ### Step 1: Locate WooCommerce Template
10
+
11
+ WooCommerce templates are located in:
12
+ ```
13
+ wp-content/plugins/woocommerce/templates/
14
+ ```
15
+
16
+ Common templates:
17
+ - `single-product.php` - Single product page
18
+ - `archive-product.php` - Product archive
19
+ - `cart/cart.php` - Shopping cart
20
+ - `checkout/form-checkout.php` - Checkout form
21
+ - `myaccount/my-account.php` - My Account page
22
+
23
+ ### Step 2: Copy Template to Theme
24
+
25
+ Create directory structure in your theme:
26
+ ```
27
+ your-theme/
28
+ └── woocommerce/
29
+ ├── single-product.php
30
+ ├── archive-product.php
31
+ ├── cart/
32
+ │ └── cart.php
33
+ └── checkout/
34
+ └── form-checkout.php
35
+ ```
36
+
37
+ Copy the template from WooCommerce plugin to your theme:
38
+ ```bash
39
+ cp wp-content/plugins/woocommerce/templates/single-product.php \
40
+ wp-content/themes/your-theme/woocommerce/single-product.php
41
+ ```
42
+
43
+ ### Step 3: Customize Template
44
+
45
+ Edit the copied template in your theme. WordPress will use your theme's version instead of the plugin's version.
46
+
47
+ **Example - Customize single product title**:
48
+ ```php
49
+ <?php
50
+ /**
51
+ * Single Product Title
52
+ */
53
+
54
+ if ( ! defined( 'ABSPATH' ) ) {
55
+ exit;
56
+ }
57
+
58
+ the_title( '<h1 class="product_title entry-title custom-product-title">', '</h1>' );
59
+ ```
60
+
61
+ ## Workflow 2: Add Custom Product Fields
62
+
63
+ ### Step 1: Add Custom Field to Product
64
+
65
+ **functions.php**:
66
+ ```php
67
+ /**
68
+ * Add custom field to product general tab
69
+ */
70
+ function add_custom_product_field() {
71
+ woocommerce_wp_text_input(
72
+ array(
73
+ 'id' => '_custom_product_field',
74
+ 'label' => __( 'Custom Field', 'your-theme' ),
75
+ 'placeholder' => __( 'Enter custom value', 'your-theme' ),
76
+ 'desc_tip' => true,
77
+ 'description' => __( 'This is a custom field.', 'your-theme' ),
78
+ )
79
+ );
80
+ }
81
+ add_action( 'woocommerce_product_options_general_product_data', 'add_custom_product_field' );
82
+ ```
83
+
84
+ ### Step 2: Save Custom Field
85
+
86
+ ```php
87
+ /**
88
+ * Save custom field value
89
+ */
90
+ function save_custom_product_field( $post_id ) {
91
+ $custom_field = isset( $_POST['_custom_product_field'] ) ? sanitize_text_field( $_POST['_custom_product_field'] ) : '';
92
+ update_post_meta( $post_id, '_custom_product_field', $custom_field );
93
+ }
94
+ add_action( 'woocommerce_process_product_meta', 'save_custom_product_field' );
95
+ ```
96
+
97
+ ### Step 3: Display Custom Field on Frontend
98
+
99
+ ```php
100
+ /**
101
+ * Display custom field on product page
102
+ */
103
+ function display_custom_product_field() {
104
+ global $post;
105
+
106
+ $custom_field = get_post_meta( $post->ID, '_custom_product_field', true );
107
+
108
+ if ( $custom_field ) {
109
+ echo '<div class="custom-product-field">';
110
+ echo '<strong>' . esc_html__( 'Custom Field:', 'your-theme' ) . '</strong> ';
111
+ echo esc_html( $custom_field );
112
+ echo '</div>';
113
+ }
114
+ }
115
+ add_action( 'woocommerce_single_product_summary', 'display_custom_product_field', 25 );
116
+ ```
117
+
118
+ ## Workflow 3: Customize Checkout
119
+
120
+ ### Add Custom Checkout Field
121
+
122
+ ```php
123
+ /**
124
+ * Add custom field to checkout
125
+ */
126
+ function add_custom_checkout_field( $fields ) {
127
+ $fields['billing']['billing_custom_field'] = array(
128
+ 'type' => 'text',
129
+ 'label' => __( 'Custom Field', 'your-theme' ),
130
+ 'placeholder' => __( 'Enter value', 'your-theme' ),
131
+ 'required' => true,
132
+ 'class' => array( 'form-row-wide' ),
133
+ 'clear' => true,
134
+ 'priority' => 100,
135
+ );
136
+
137
+ return $fields;
138
+ }
139
+ add_filter( 'woocommerce_checkout_fields', 'add_custom_checkout_field' );
140
+ ```
141
+
142
+ ### Validate Custom Checkout Field
143
+
144
+ ```php
145
+ /**
146
+ * Validate custom checkout field
147
+ */
148
+ function validate_custom_checkout_field() {
149
+ if ( empty( $_POST['billing_custom_field'] ) ) {
150
+ wc_add_notice( __( 'Please enter a value for Custom Field.', 'your-theme' ), 'error' );
151
+ }
152
+ }
153
+ add_action( 'woocommerce_checkout_process', 'validate_custom_checkout_field' );
154
+ ```
155
+
156
+ ### Save Custom Checkout Field
157
+
158
+ ```php
159
+ /**
160
+ * Save custom checkout field to order meta
161
+ */
162
+ function save_custom_checkout_field( $order_id ) {
163
+ if ( ! empty( $_POST['billing_custom_field'] ) ) {
164
+ update_post_meta( $order_id, '_billing_custom_field', sanitize_text_field( $_POST['billing_custom_field'] ) );
165
+ }
166
+ }
167
+ add_action( 'woocommerce_checkout_update_order_meta', 'save_custom_checkout_field' );
168
+ ```
169
+
170
+ ### Display Custom Field in Admin Order
171
+
172
+ ```php
173
+ /**
174
+ * Display custom field in admin order
175
+ */
176
+ function display_custom_field_in_admin_order( $order ) {
177
+ $custom_field = get_post_meta( $order->get_id(), '_billing_custom_field', true );
178
+
179
+ if ( $custom_field ) {
180
+ echo '<p><strong>' . esc_html__( 'Custom Field:', 'your-theme' ) . '</strong> ' . esc_html( $custom_field ) . '</p>';
181
+ }
182
+ }
183
+ add_action( 'woocommerce_admin_order_data_after_billing_address', 'display_custom_field_in_admin_order' );
184
+ ```
185
+
186
+ ## Workflow 4: Customize Email Templates
187
+
188
+ ### Step 1: Copy Email Template to Theme
189
+
190
+ Create directory structure:
191
+ ```
192
+ your-theme/
193
+ └── woocommerce/
194
+ └── emails/
195
+ ├── customer-completed-order.php
196
+ └── admin-new-order.php
197
+ ```
198
+
199
+ Copy template:
200
+ ```bash
201
+ cp wp-content/plugins/woocommerce/templates/emails/customer-completed-order.php \
202
+ wp-content/themes/your-theme/woocommerce/emails/customer-completed-order.php
203
+ ```
204
+
205
+ ### Step 2: Customize Email Template
206
+
207
+ Edit the template to add custom content:
208
+
209
+ ```php
210
+ <?php
211
+ /**
212
+ * Customer completed order email
213
+ */
214
+
215
+ if ( ! defined( 'ABSPATH' ) ) {
216
+ exit;
217
+ }
218
+
219
+ do_action( 'woocommerce_email_header', $email_heading, $email );
220
+
221
+ ?>
222
+
223
+ <p><?php esc_html_e( 'Hi there. Your order has been completed!', 'your-theme' ); ?></p>
224
+
225
+ <!-- Custom content here -->
226
+ <div class="custom-email-section">
227
+ <h2><?php esc_html_e( 'Thank you for your purchase!', 'your-theme' ); ?></h2>
228
+ <p><?php esc_html_e( 'We appreciate your business.', 'your-theme' ); ?></p>
229
+ </div>
230
+
231
+ <?php
232
+
233
+ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
234
+ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
235
+ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
236
+ do_action( 'woocommerce_email_footer', $email );
237
+ ```
238
+
239
+ ### Step 3: Add Custom Content to Emails
240
+
241
+ ```php
242
+ /**
243
+ * Add custom content to order emails
244
+ */
245
+ function add_custom_email_content( $order, $sent_to_admin, $plain_text, $email ) {
246
+ if ( $plain_text ) {
247
+ echo "\n" . __( 'Custom message for plain text emails', 'your-theme' ) . "\n";
248
+ } else {
249
+ echo '<div class="custom-email-content">';
250
+ echo '<p>' . esc_html__( 'Custom message for HTML emails', 'your-theme' ) . '</p>';
251
+ echo '</div>';
252
+ }
253
+ }
254
+ add_action( 'woocommerce_email_before_order_table', 'add_custom_email_content', 10, 4 );
255
+ ```
256
+
257
+ ## Workflow 5: Payment Gateway Integration
258
+
259
+ ### Create Custom Payment Gateway
260
+
261
+ **includes/class-custom-gateway.php**:
262
+ ```php
263
+ <?php
264
+ /**
265
+ * Custom Payment Gateway
266
+ */
267
+
268
+ if ( ! defined( 'ABSPATH' ) ) {
269
+ exit;
270
+ }
271
+
272
+ class WC_Custom_Gateway extends WC_Payment_Gateway {
273
+
274
+ /**
275
+ * Constructor
276
+ */
277
+ public function __construct() {
278
+ $this->id = 'custom_gateway';
279
+ $this->icon = '';
280
+ $this->has_fields = true;
281
+ $this->method_title = __( 'Custom Gateway', 'your-theme' );
282
+ $this->method_description = __( 'Custom payment gateway description', 'your-theme' );
283
+
284
+ // Load settings
285
+ $this->init_form_fields();
286
+ $this->init_settings();
287
+
288
+ // Get settings
289
+ $this->title = $this->get_option( 'title' );
290
+ $this->description = $this->get_option( 'description' );
291
+ $this->enabled = $this->get_option( 'enabled' );
292
+
293
+ // Actions
294
+ add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
295
+ }
296
+
297
+ /**
298
+ * Initialize form fields
299
+ */
300
+ public function init_form_fields() {
301
+ $this->form_fields = array(
302
+ 'enabled' => array(
303
+ 'title' => __( 'Enable/Disable', 'your-theme' ),
304
+ 'type' => 'checkbox',
305
+ 'label' => __( 'Enable Custom Gateway', 'your-theme' ),
306
+ 'default' => 'no',
307
+ ),
308
+ 'title' => array(
309
+ 'title' => __( 'Title', 'your-theme' ),
310
+ 'type' => 'text',
311
+ 'description' => __( 'Payment method title', 'your-theme' ),
312
+ 'default' => __( 'Custom Payment', 'your-theme' ),
313
+ 'desc_tip' => true,
314
+ ),
315
+ 'description' => array(
316
+ 'title' => __( 'Description', 'your-theme' ),
317
+ 'type' => 'textarea',
318
+ 'description' => __( 'Payment method description', 'your-theme' ),
319
+ 'default' => __( 'Pay with custom gateway', 'your-theme' ),
320
+ ),
321
+ );
322
+ }
323
+
324
+ /**
325
+ * Process payment
326
+ */
327
+ public function process_payment( $order_id ) {
328
+ $order = wc_get_order( $order_id );
329
+
330
+ // Process payment here
331
+ // ...
332
+
333
+ // Mark order as processing or completed
334
+ $order->payment_complete();
335
+
336
+ // Reduce stock levels
337
+ wc_reduce_stock_levels( $order_id );
338
+
339
+ // Remove cart
340
+ WC()->cart->empty_cart();
341
+
342
+ // Return success
343
+ return array(
344
+ 'result' => 'success',
345
+ 'redirect' => $this->get_return_url( $order ),
346
+ );
347
+ }
348
+ }
349
+ ```
350
+
351
+ ### Register Payment Gateway
352
+
353
+ **functions.php**:
354
+ ```php
355
+ /**
356
+ * Add custom payment gateway
357
+ */
358
+ function add_custom_payment_gateway( $gateways ) {
359
+ $gateways[] = 'WC_Custom_Gateway';
360
+ return $gateways;
361
+ }
362
+ add_filter( 'woocommerce_payment_gateways', 'add_custom_payment_gateway' );
363
+
364
+ /**
365
+ * Load custom gateway class
366
+ */
367
+ function load_custom_gateway_class() {
368
+ require_once get_template_directory() . '/includes/class-custom-gateway.php';
369
+ }
370
+ add_action( 'plugins_loaded', 'load_custom_gateway_class' );
371
+ ```
372
+
373
+ ## Workflow 6: Customize Product Loop
374
+
375
+ ### Modify Products Per Page
376
+
377
+ ```php
378
+ /**
379
+ * Change number of products per page
380
+ */
381
+ function custom_products_per_page( $cols ) {
382
+ return 12;
383
+ }
384
+ add_filter( 'loop_shop_per_page', 'custom_products_per_page', 20 );
385
+ ```
386
+
387
+ ### Modify Product Loop Columns
388
+
389
+ ```php
390
+ /**
391
+ * Change number of product columns
392
+ */
393
+ function custom_product_columns( $columns ) {
394
+ return 4;
395
+ }
396
+ add_filter( 'loop_shop_columns', 'custom_product_columns' );
397
+ ```
398
+
399
+ ### Add Custom Content to Product Loop
400
+
401
+ ```php
402
+ /**
403
+ * Add custom badge to products on sale
404
+ */
405
+ function add_sale_badge() {
406
+ global $product;
407
+
408
+ if ( $product->is_on_sale() ) {
409
+ echo '<span class="sale-badge">' . esc_html__( 'Sale!', 'your-theme' ) . '</span>';
410
+ }
411
+ }
412
+ add_action( 'woocommerce_before_shop_loop_item_title', 'add_sale_badge', 10 );
413
+ ```
414
+
415
+ ## Best Practices
416
+
417
+ ### DO
418
+
419
+ ✅ Use child themes for customizations
420
+ ✅ Copy templates to theme, don't modify plugin files
421
+ ✅ Use WooCommerce hooks and filters
422
+ ✅ Sanitize and validate all input
423
+ ✅ Escape all output
424
+ ✅ Test with WooCommerce updates
425
+ ✅ Follow WooCommerce coding standards
426
+ ✅ Use translation functions
427
+ ✅ Check WooCommerce is active before using functions
428
+ ✅ Document customizations
429
+
430
+ ### DON'T
431
+
432
+ ❌ Modify WooCommerce plugin files directly
433
+ ❌ Ignore template version compatibility
434
+ ❌ Skip input validation
435
+ ❌ Hardcode values
436
+ ❌ Use deprecated WooCommerce functions
437
+ ❌ Forget to test checkout process
438
+ ❌ Ignore mobile responsiveness
439
+ ❌ Skip security best practices
440
+ ❌ Forget to handle edge cases
441
+
@@ -0,0 +1,139 @@
1
+ # WordPress Plugin Development Module
2
+
3
+ ## Overview
4
+
5
+ This module provides comprehensive guidelines for WordPress plugin development, optimized for AI-assisted development workflows in VS Code using Augment Code AI, OpenSpec, and Beads task management.
6
+
7
+ ## Key Benefits
8
+
9
+ - **Plugin Structure Detection**: Automatically detect WordPress plugin projects and apply appropriate guidelines
10
+ - **Architecture Patterns**: 7 proven plugin architecture patterns from simple procedural to enterprise-level
11
+ - **Security First**: Built-in security best practices (nonces, sanitization, escaping, capability checks)
12
+ - **Performance Optimized**: Caching strategies, query optimization, and performance guidelines
13
+ - **WordPress.org Ready**: Submission preparation and compliance guidelines
14
+ - **AI-Assisted Development**: Optimized for AI code generation with clear patterns and examples
15
+
16
+ ## Installation
17
+
18
+ ### With CLI (Future)
19
+ ```bash
20
+ augx link domain-rules/wordpress-plugin
21
+ ```
22
+
23
+ ### Manual Installation
24
+ Copy the contents of this module to your project's `.augment/` directory or reference it from the Augment Extensions repository.
25
+
26
+ ## Directory Structure
27
+
28
+ ```
29
+ augment-extensions/domain-rules/wordpress-plugin/
30
+ ├── module.json # Module metadata
31
+ ├── README.md # This file
32
+ ├── rules/ # Detailed guidelines
33
+ │ ├── plugin-structure.md # Plugin detection and structure
34
+ │ ├── plugin-architecture.md # Architecture patterns
35
+ │ ├── activation-hooks.md # Activation/deactivation/uninstall
36
+ │ ├── admin-interface.md # Settings pages, meta boxes
37
+ │ ├── frontend-functionality.md # CPT, taxonomies, shortcodes, widgets
38
+ │ ├── gutenberg-blocks.md # Block development
39
+ │ ├── rest-api.md # REST API endpoints
40
+ │ ├── ajax-handlers.md # AJAX implementation
41
+ │ ├── database-management.md # Custom tables, queries
42
+ │ ├── cron-jobs.md # Scheduled tasks
43
+ │ ├── security-best-practices.md # Security guidelines
44
+ │ ├── performance-optimization.md # Performance best practices
45
+ │ ├── internationalization.md # i18n/l10n
46
+ │ ├── asset-management.md # Scripts and styles
47
+ │ ├── woocommerce-integration.md # WooCommerce extensions
48
+ │ ├── testing-patterns.md # PHPUnit, integration tests
49
+ │ ├── documentation-standards.md # PHPDoc, readme.txt
50
+ │ └── wordpress-org-submission.md # Submission process
51
+ └── examples/ # Complete code examples
52
+ ├── simple-procedural-plugin.md
53
+ ├── object-oriented-plugin.md
54
+ ├── mvc-plugin.md
55
+ ├── singleton-plugin.md
56
+ ├── custom-post-type-plugin.md
57
+ ├── gutenberg-block-plugin.md
58
+ ├── rest-api-plugin.md
59
+ ├── settings-page-plugin.md
60
+ ├── ajax-plugin.md
61
+ ├── woocommerce-extension.md
62
+ └── complete-plugin-example.md
63
+ ```
64
+
65
+ ## Core Workflows
66
+
67
+ ### 1. Plugin Scaffolding
68
+ Create new WordPress plugins with proper structure, headers, and boilerplate code.
69
+
70
+ ### 2. Feature Development
71
+ Add functionality: custom post types, Gutenberg blocks, REST endpoints, admin interfaces.
72
+
73
+ ### 3. Security Hardening
74
+ Implement security best practices: nonces, sanitization, escaping, capability checks.
75
+
76
+ ### 4. Performance Optimization
77
+ Apply caching, query optimization, and performance best practices.
78
+
79
+ ### 5. WordPress.org Submission
80
+ Prepare plugins for WordPress.org directory submission.
81
+
82
+ ## Usage
83
+
84
+ ### For AI Agents
85
+
86
+ When working on WordPress plugin development:
87
+
88
+ 1. **Detect Plugin Context**: Check for plugin header in PHP files
89
+ 2. **Apply Architecture Pattern**: Choose appropriate pattern based on plugin complexity
90
+ 3. **Follow Security Rules**: Always sanitize input, escape output, verify nonces
91
+ 4. **Optimize Performance**: Use transients, object caching, query optimization
92
+ 5. **Document Code**: PHPDoc blocks, inline comments, readme.txt
93
+
94
+ ### Example AI Prompts
95
+
96
+ **Create Custom Post Type:**
97
+ ```
98
+ Create a WordPress plugin for a Portfolio custom post type with:
99
+ - Custom taxonomy (Portfolio Categories)
100
+ - Meta box for project URL
101
+ - Archive and single templates
102
+ - Shortcode to display portfolio items
103
+ ```
104
+
105
+ **Add Gutenberg Block:**
106
+ ```
107
+ Add a Gutenberg block to display testimonials with:
108
+ - Author name and image
109
+ - Quote text
110
+ - Block controls for styling
111
+ ```
112
+
113
+ ## Character Count
114
+
115
+ **Total**: ~344,186 characters
116
+
117
+ ## Contents
118
+
119
+ - **19 Rule Files**: Comprehensive guidelines for all aspects of plugin development
120
+ - WooCommerce Integration
121
+ - Testing Patterns
122
+ - **1 Example File**: Simple Procedural Plugin (complete working example)
123
+ - **Security Focus**: Critical security rules and patterns
124
+ - **Performance Focus**: Optimization strategies and caching patterns
125
+ - **WordPress.org Ready**: Submission guidelines and checklist
126
+
127
+ ## Related Modules
128
+
129
+ - `workflows/wordpress-plugin` - Plugin development workflows
130
+ - `domain-rules/wordpress` - General WordPress development (themes, core)
131
+
132
+ ## Version
133
+
134
+ **1.1.0** - Added WooCommerce Integration and Testing Patterns
135
+
136
+ ## License
137
+
138
+ MIT
139
+