- How to optimize wordpress site loading time
Here is some instructions and code you can use for site speed optimizing which you can test here https://developers.google.com/speed/pagespeed/insights/?hl=en Install plugin Autoptimize and set next options: Install plugin WP Super Cache Install plugin Compress JPEG & PNG images Set your options here ‘/wp-admin/options-general.php?page=tinify’ Install plugin Disable Embeds Install plugin Disable Emojis (GDPR friendly) Add next… read more
- HTTP Error 500 Internal server error
Internal server errors (errors 5xx) are often caused by plugin or theme function conflicts, so if you have access to your admin panel, try deactivating all plugins, to define source of the troubles. If you do not have access to your site wp admin panel, try manually reset the plugins (no Dashboard access required): by… read more
- How to test WordPress plugins to get script conflicts
Use next algorithm to define what exactly does not work on your WordPress site after any changes with core, theme or/and plugins: create site duplicate using plugin https://wordpress.org/plugins/duplicator/ create test subdomain on your site using hosting panel install duplicate bundle on your test subdomain on the test sub-domain deactivate all plugins except one main plugin… read more
- How to remove fields on woocommerce shop checkout page
To remove fields on woocommerce shop checkout page use hook: woocommerce_checkout_fields As an example drop next code in your site current wordpress theme file functions.php:
12345678910111213141516171819add_filter('woocommerce_checkout_fields', function ($fields) {//unset($fields['billing']['billing_first_name']);//unset($fields['billing']['billing_last_name']);unset($fields['billing']['billing_company']);unset($fields['billing']['billing_address_1']);unset($fields['billing']['billing_address_2']);unset($fields['billing']['billing_city']);unset($fields['billing']['billing_postcode']);unset($fields['billing']['billing_country']);unset($fields['billing']['billing_state']);unset($fields['billing']['billing_phone']);//unset($fields['order']['order_comments']);//unset($fields['billing']['billing_email']);//unset($fields['account']['account_username']);//unset($fields['account']['account_password']);//unset($fields['account']['account_password-2']);return $fields;});See fields keys you can disable: Billing Fields billing_first_name billing_last_name billing_company billing_country billing_address_1 billing_address_2 billing_city billing_state billing_postcode billing_phone billing_email Shipping Fields shipping_first_name shipping_last_name shipping_company shipping_country shipping_address_1 shipping_address_2 shipping_city shipping_state… read more
- How to reset page cache in the browser
press CTRL+R CTRL+F5 Ctrl+Shift+R Apple + R or command + R (apple) in Chrome browser the best way is: Open the developer tools: Ctrl + Shift + I Now, leaving the panel open, left click on the “Update” button (next to the address line) and do not release the button. After a few seconds, you… read more
- How to remove type=”text/javascript” from WordPress site
Install this plugin: https://wordpress.org/plugins/autoptimize/ Enable in its options wp-admin/options-general.php?page=autoptimize ‘Optimize HTML Code?’ In file functions.php of your current wp theme apply next code
123456789101112131415161718add_filter('autoptimize_html_after_minify', function($content) {$site_url = 'https://bulk-editor.com/';$content = str_replace("", ' ', $content);$content = str_replace('', ' ', $content);$content = str_replace(" ", ' ', $content);$content = str_replace(' ', ' ', $content);$content = str_replace($site_url . '/wp-includes/js', '/wp-includes/js', $content);$content = str_replace($site_url . '/wp-content/cache/autoptimize', '/wp-content/cache/autoptimize', $content);$content = str_replace($site_url . '/wp-content/themes/', '/wp-content/themes/', $content);$content = str_replace($site_url . '/wp-content/uploads/', '/wp-content/uploads/', $content);$content = str_replace($site_url . '/wp-content/plugins/', '/wp-content/plugins/', $content);return $content;}, 10, 1);Do not forget in $site_url change link to your site link without slash on its end
- How to make auto-update for WordPress plugins and themes bought on Envato
Install next plugin: https://envato.com/market-plugin/ – this plugin helps customers receive updates to the premium Themes & Plugins purchased through Envato Market (ThemeForest & CodeCanyon). Do next steps: Install the plugin on your site Go to https://build.envato.com/create-token/?purchase:download=t&purchase:verify=t&purchase:list=t Enter token name there, any words you like, or set of random symbols Below entered token-key select any services you want,… read more
- How to add WordPress user using php code
Sometimes its necessary to create new user on WordPress site using PHP code. Below is code which will make this work …
- Is key exists in JavaScript object
If its necessary to define is item with any key exists in the JavaScript object …