From 1bf6b6e44a278427953619b291f2139acc1aaaf0 Mon Sep 17 00:00:00 2001 From: piinthecloud Date: Thu, 22 Aug 2024 14:25:57 +0200 Subject: [PATCH] fix lint rule (#50843) * fix lint rule * add manifest * add changelog --- docs/.markdownlint.json | 2 +- docs/docs-manifest.json | 8 ++++---- docs/extension-development/data-storage.md | 6 ++++++ docs/product-editor-development/README.md | 2 +- plugins/woocommerce/changelog/update-contribution-docs | 4 ++++ 5 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 plugins/woocommerce/changelog/update-contribution-docs diff --git a/docs/.markdownlint.json b/docs/.markdownlint.json index 6728d0fd76a..3297523f014 100644 --- a/docs/.markdownlint.json +++ b/docs/.markdownlint.json @@ -3,7 +3,7 @@ "MD003": { "style": "atx" }, "MD007": { "indent": 4 }, "MD013": { "line_length": 9999 }, - "MD024": { "allow_different_nesting": true }, + "MD024": { "siblings_only": true }, "MD033": { "allowed_elements": ["video"] }, "MD035": false, "MD041": false, diff --git a/docs/docs-manifest.json b/docs/docs-manifest.json index 00c65ffeb77..9537ea57ba4 100644 --- a/docs/docs-manifest.json +++ b/docs/docs-manifest.json @@ -761,7 +761,7 @@ "menu_title": "Data storage", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/data-storage.md", - "hash": "ea827670b3a888f69cb50bc78dc10827c802abb135a5846f31cfa55e882f7faa", + "hash": "1ea2fabf927f9ced2fee89f930e9195c7df4d98ceb3d847436337376578802a3", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/data-storage.md", "id": "b3e0b17ca74596e858c26887c1e4c8ee6c8f6102" }, @@ -1059,7 +1059,7 @@ "categories": [] }, { - "content": "\nDiscover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.\n\nThis handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.", + "content": "\nDiscover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.\n\nThis handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.\n", "category_slug": "product-editor", "category_title": "Product Editor", "posts": [ @@ -1378,7 +1378,7 @@ { "post_title": "Template structure & Overriding templates via a theme", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/template-structure.md", - "hash": "c0e346e7e21682bd645998f0607efe18f9f63601f53f4a53ab43248eefcab2d1", + "hash": "ff781eff7998ea93723f644bddd4f6da6f73c635bcfc3cd46950f03a8b83b26c", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/template-structure.md", "id": "34bfebec9fc45e680976814928a7b8a1778af14e" }, @@ -1731,5 +1731,5 @@ "categories": [] } ], - "hash": "95e835afe855d5a898bfc31337d2a42b582794d5e1aaacb9b4a98cfc97748e05" + "hash": "b6fab4eae1266824ee3e876c8fa5fd0342f59b4a0e5978f1460afc67d82e6d94" } \ No newline at end of file diff --git a/docs/extension-development/data-storage.md b/docs/extension-development/data-storage.md index e6c05919192..8eb1350fa0b 100644 --- a/docs/extension-development/data-storage.md +++ b/docs/extension-development/data-storage.md @@ -7,21 +7,27 @@ tags: reference When developing for WordPress and WooCommerce, it's important to consider the nature and permanence of your data. This will help you decide the best way to store it. Here's a quick primer: ## Transients + If the data may not always be present (i.e., it expires), use a [transient](https://developer.wordpress.org/apis/handbook/transients/). Transients are a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted. ## WP Cache + If the data is persistent but not always present, consider using the [WP Cache](https://developer.wordpress.org/reference/classes/wp_object_cache/). The WP Cache functions allow you to cache data that is computationally expensive to regenerate, such as complex query results. ## wp_options Table + If the data is persistent and always present, consider the [wp_options table](https://developer.wordpress.org/apis/handbook/options/). The Options API is a simple and standardized way of storing data in the wp_options table in the WordPress database. ## Post Types + If the data type is an entity with n units, consider a [post type](https://developer.wordpress.org/post_type/). Post types are "types" of content that are stored in the same way, but are easy to distinguish in the code and UI. ## Taxonomies + If the data is a means of sorting/categorizing an entity, consider a [taxonomy](https://developer.wordpress.org/taxonomy/). Taxonomies are a way of grouping things together. ## Logging + Logs should be written to a file using the [WC_Logger](https://woocommerce.com/wc-apidocs/class-WC_Logger.html) class. This is a simple and standardized way of recording events and errors for debugging purposes. Remember, the best method of data storage depends on the nature of the data and how it will be used in your application. diff --git a/docs/product-editor-development/README.md b/docs/product-editor-development/README.md index 1d717ad5322..db9e8f5d4bd 100644 --- a/docs/product-editor-development/README.md +++ b/docs/product-editor-development/README.md @@ -6,4 +6,4 @@ post_title: Product Editor Discover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities. -This handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem. \ No newline at end of file +This handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem. diff --git a/plugins/woocommerce/changelog/update-contribution-docs b/plugins/woocommerce/changelog/update-contribution-docs new file mode 100644 index 00000000000..0712915d3bc --- /dev/null +++ b/plugins/woocommerce/changelog/update-contribution-docs @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +fix small lint errors and fix lint rule to make doc contribution easier