A very good guide here
Author: adrian
-
Remove WordPress users via WP CLI
Remove users with customer role:
# Delete user 123 and reassign posts to user 567 $ wp user delete 123 --reassign=567 --yes Success: Removed user 123 from http://example.com # Delete all contributors and reassign their posts to user 2 $ wp user delete $(wp user list --role=customer --field=ID) --reassign=2 --yes Success: Removed user 813 from http://example.com Success: Removed user 578 from http://example.com # Delete all contributors in batches of 100 (avoid error: argument list too long: wp) $ wp user delete $(wp user list --role=customer --field=ID | head -n 100) --reassign=567 --yes
Source: https://developer.wordpress.org/cli/commands/user/delete/
-
Error: ENOSPC: System limit for number of file watchers reached
The meaning of this error is that the number of files monitored by the system has reached the limit!!
Result: The command executed failed! Or throw a warning (such as executing a react-native start VSCode)
Solution:
Modify the number of system monitoring files
Ubuntu
sudo gedit /etc/sysctl.conf
Add a line at the bottom
fs.inotify.max_user_watches=524288
Then save and exit!
sudo sysctl -p
to check it
Then it is solved!
-
Gutenberg attributes to console
Log attributes to console using the following:
wp.data.select( 'core/block-editor' ).getSelectedBlock().attributes;
Source: https://notlaura.com/log-gutenberg-blocks-attributes-to-console/
-
JavaScript email validation
var emailreg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,10})$/; if( emailreg.test( 'value_to_test_against' ) == false ) { //Email invalid }
-
SSH-ADD on Windows
If you receive the following error when running the ssh-add command: Could not open a connection to your authentication agent, try this:
cd path-to-Git/bin (for me : cd C:\Program Files\Git\bin) bash exec ssh-agent bash ssh-add REPLACE_WITH_SSHKEY
-
Js/jQuery email validation
Using regular expressions
let email = jQuery('.nl-sub-email'); let emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,10})$/; let errors = 0; if( ! email.val() || emailReg.test( email.val() ) == false ) { email.css('border', '1px solid red'); email.focus(); errors = 1; } else { email.css('border', '1px solid transparent'); errors = 0; }
-
Preloader CSS
Animation required:
@keyframes lds-dual-ring { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
Practical example
button::after { content: ""; display: inline-block; width: 18px; height: 18px; margin: 0 0 0 8px; border-radius: 50%; border: 3px solid white; border-color: white transparent white transparent; animation: lds-dual-ring 1.2s linear infinite; }
-
Keyword checkers
https://trends.google.com/trends/
https://www.wordstream.com/keywords
https://keywordsheeter.com/
https://answerthepublic.com/
https://chrome.google.com/…/bafijghppfhdpldihckdcadbcob…
https://www.highervisibility.com/seo/tools/keyworddit
https://search.google.com/search-console/about
https://questiondb.io/
https://www.highervisibility.com/…/bulk-keyword-generator/
https://www.google.com/Updated:
https://alsoasked.com
https://soovle.com/
https://answersocrates.com/
https://pypi.org/project/pytrends/Google Auto Suggest
https://keywordtool.io/
https://keywordsheeter.com/
https://soovle.com/
https://chrome.google.com/webstore/detail/seo-minion/giihipjfimkajhlcilipnjeohabimjhi?hl=en&fbclid=IwAR3vCWvDlg0s-_DgX5tab-xI_R4sNa8WiU8O871zLeXwSMVz9ZqDsf8SSiA