1 | | 1) Make the code readable (don't use short variable names such as `tx`, `w`, `tc`, `t`, `wc`, `c`, which have no meaning). |
2 | | 2) Make the word count function more abstract so that it can be used elsewhere. So, it should only count the words in a given text, nothing else. |
3 | | 3) Maybe move to `wp-includes`. |
4 | | 4) The word count should update at the right times. At the moment it updates on `enter`, `delete` and `backspace`. It should at least be updated on `space` too. Consider things like cut and paste, and look at TinyMCE events that change the content. |
5 | | 5) Exclude more patterns like known shortcodes and ellipsis (#27386, #27391). |
6 | | 6) Add some good unit tests for all of this. |
7 | | 7) Make sure it's as fast as it can be (e.g. don't needlessly manipulate the DOM). |
| 1 | 1. Make the code readable (don't use short variable names such as `tx`, `w`, `tc`, `t`, `wc`, `c`, which have no meaning). |
| 2 | 2. Make the word count function more abstract so that it can be used elsewhere. So, it should only count the words in a given text, nothing else. |
| 3 | 3. Maybe move to `wp-includes`. |
| 4 | 4. The word count should update at the right times. At the moment it updates on `enter`, `delete` and `backspace`. It should at least be updated on `space` too. Consider things like cut and paste, and look at TinyMCE events that change the content. |
| 5 | 5. Exclude more patterns like known shortcodes and ellipsis (#27386, #27391). |
| 6 | 6. Add some good unit tests for all of this. |
| 7 | 7. Make sure it's as fast as it can be (e.g. don't needlessly manipulate the DOM). |