Limitations WP-CLI: verschil tussen versies
(Nieuwe pagina aangemaakt met 'I really like WP-CLI, but like everything in this world, it has its limitations. Sometimes, other tools (e.g., SQL) are better suited: == Speed == Depending on th...') |
|||
(3 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
I really like WP-CLI, but like everything in this world, it has its limitations. Sometimes, other tools (e.g., SQL) are better suited: | I really like WP-CLI, but like everything in this world, it has its limitations. Sometimes, other tools (e.g., SQL) are better suited: | ||
+ | |||
+ | == Max 100 items == | ||
+ | |||
+ | Quite a number of WP-CLI command, return maximally 100 items from a set. Of course, that can be circumvented, but it's quite annoying and makes stuff more complicated. For details: [[Iterate over objects (WP-CLI)]] & [[Wp wc product list#Get_all_IDs | wp wc product list » Get all IDs]] | ||
== Speed == | == Speed == | ||
Regel 8: | Regel 12: | ||
* Sometimes, doing something in SQL, is like seemingly infinitely faster than using WP-CLI. | * Sometimes, doing something in SQL, is like seemingly infinitely faster than using WP-CLI. | ||
− | == Update an arbitrary property of a set of items | + | == Update an arbitrary property of a set == |
+ | |||
+ | It's in general not possible to update an arbitrary property of all items in a set - E.g., update the value for <code>reviews_allowed</code> for all WooCommerce products where this property has a certain value. | ||
− | See [[Update all objects in a set (WP-CLI)]] for | + | See [[Update all objects in a set (WP-CLI)]] for details. |
== See also == | == See also == | ||
+ | * [[Iterate over objects (WP-CLI)]] | ||
* [[Update all objects in a set (WP-CLI)]] | * [[Update all objects in a set (WP-CLI)]] | ||
+ | * [[Wp wc product list#Get_all_IDs | wp wc product list » Get all IDs]] |
Huidige versie van 26 jun 2024 om 12:21
I really like WP-CLI, but like everything in this world, it has its limitations. Sometimes, other tools (e.g., SQL) are better suited:
Max 100 items
Quite a number of WP-CLI command, return maximally 100 items from a set. Of course, that can be circumvented, but it's quite annoying and makes stuff more complicated. For details: Iterate over objects (WP-CLI) & wp wc product list » Get all IDs
Speed
Depending on the use case, WP-CLI sometimes is very, very slow. Even when doing stuff in parallel using e.g., GNU Parallel on a big server.
- The trouble when stuff takes time, is that debugging becomes really hard
- Sometimes, doing something in SQL, is like seemingly infinitely faster than using WP-CLI.
Update an arbitrary property of a set
It's in general not possible to update an arbitrary property of all items in a set - E.g., update the value for reviews_allowed
for all WooCommerce products where this property has a certain value.
See Update all objects in a set (WP-CLI) for details.