I had a Redis Cache Plugin enabled for the website. It turns out that the Redis Cache Plugin uses the table prefix as a prefix for the Redis Cache keys. So if your staging site has a separate DB, but with the same prefix as in the prod one, the Redis Cache will get mixed… Continue reading WordPress: Creating a staging version, makes the production wp-login redirect to the staging one.
Category: WordPress
JS variable loaded using wp_localize_script is no longer available
TL;DR: Call the wp_localize_script after registering/enqueuing the script you are localizing. Recently (WP 4.1.4 / WP 4.2) my ajax scripts stopped working. I’ve noticed that it was caused by the fact that the variable for the ajax_url was undefined so for some reason it ws no longer loaded to the page. The reason turned out… Continue reading JS variable loaded using wp_localize_script is no longer available
Retrieving data from a form created with Contact Form 7
If you want to get the data from a form created with Contact Form 7 you can use the ‘wpcf7_before_send_mail’ hook. In your functions.php or from your plugin add action like follows: add_action( ‘wpcf7_before_send_mail’, ‘my_plugin_wpcf7_before_send_mail’ ); function my_plugin_wpcf7_before_send_mail ( $contact_form ) { // TODO: get the data } Since version 3.9 Contact Form 7 removed $contact_form->posted data so… Continue reading Retrieving data from a form created with Contact Form 7
geeneric.com is live
We at Shtrak have been working lately on a WordPress and WooCommerce based platform for online shops. You can create your eCommerce site for free on geeneric.com Let me know what do you think about our service – I’m open to any ideas for improvement!
[Tips and Tricks for Writing WordPress Themes and Plugins] Forcing the browser to refresh your scripts and styles
I’m starting a some kind of thread of posts where I write down some of the nice tricks I meet in WordPress development. First one is how to write your custom theme and plugin files so after each deployment / update you’ll be sure that the browser doesn’t use the cached version of your JS and CSS.… Continue reading [Tips and Tricks for Writing WordPress Themes and Plugins] Forcing the browser to refresh your scripts and styles
Google analytics is no loger working with WooCommerce out of the box
Recently I updated WooCommerce site from version 2.0.* to 2.1.* and today I noticed that the site stats from Google Analytics are no longer working. I went to the settigns page and noticed that the Integration tab where the google analytics ID was suposed to be was gone. Turns out that they dropped the Google… Continue reading Google analytics is no loger working with WooCommerce out of the box
Regenerating WooCommerce System Pages (When you forgot to add them)
Update: recently I found the tools tab of WooCommerce http://example.com/wp-admin/admin.php?page=wc-status&tab=tools. (It’s located in the WooCommerce -> System Status, in the Tools Tab). From there you can create your WooCommerce special pages and many more nice things. When you install WooCommerce it asks you if you want to add the system pages – Shop, Checkout and so… Continue reading Regenerating WooCommerce System Pages (When you forgot to add them)
Error 500 on a WordPress after an intensive hacker attack
Last couple of days we’ve had a website that is actively under DDoS attack. At some point I’ve noticed that the attack have stopped (or at least my notifications for it from the security plugin we use – Better WP Security) Opening the website I’ve noticed that it returned Error 500 so I started looking… Continue reading Error 500 on a WordPress after an intensive hacker attack
WordPress Empty Search Template
WordPress provides you with a nice and easy way to style the search page template using the search.php in your theme. However there is something that is relatively strange related to the searches in WordPress. If somebody hits the search button without having the search field filled in it gives you the blog archieve template… Continue reading WordPress Empty Search Template
WooCommerce BGN
To ease the stuff even more I’ve created a plugin WooCommerce BGN to simply add Bulgarian lev to the currency list in WooCommerce. This is inspired by my blog post for adding a custom currency to WooCommerce. You can download WooCommerce BGN here. Installing: Download the zip file Upload it using the Plugins > Add… Continue reading WooCommerce BGN