Contact form 7 – Javascript API

Contact Form 7 emits a number of Javascript events that bubble up to the document object. In version 4.1 they can be found in contact-form-7/includes/js/scripts.js. If you’re using jQuery you can access those events like this:

$(document).on('spam.wpcf7', function () {
console.log('submit.wpcf7 was triggered!');
});

$(document).on('invalid.wpcf7', function () {
console.log('invalid.wpcf7 was triggered!');
});

$(document).on('mailsent.wpcf7', function () {
console.log('mailsent.wpcf7 was triggered!');
});

$(document).on('mailfailed.wpcf7', function () {
console.log('mailfailed.wpcf7 was triggered!');
});

Sync AMPPS with multiple machines

Here is a roadmap to establish AMPPS with Dropbox:

  • Download and install the latest version of AMPPS. In the Programs folder will include the folder “var” and “www” are created. In the database files already come “var” folder and “www”, all individual files of your website.
  • Create a folder under your Dropbox account “AMPPS” on it. Move the folder “var” and “www” in your AMPPS folder to your Dropbox folder. The folders are so removed from your Application folder. With the following commands, create a symlink from the Dropbox folder, and the folder AMPPS. To do this to you Mac Terminal.

cd ~ / Dropbox / AMPPS

ln -s ~ /Dropbox/AMPPS/var /Applications/AMPPS/var

ln -s ~ /Dropbox/AMPPS/www /Applications/AMPPS/www

To see if everything is linked correctly, you can check this yet:

cd /Applications/AMPPS

ls -ll

Reset “Use Secure in Front End or Admin” in Database – Magento

I ran into an issue this week where I switched on SSL on a development site and then realized the SSL cert was not installed correctly. This is a big issue in Magento because there is no way to get back to the admin to switch it back off.

If this ever happens do the following to switch back:

1. Open up your admin panel (cPanel or other)
2. Go to phpMyAdmin (if MySql)
3. Find your Magento Database
4. Find table “core_config_data”
5. Look for the columns “web/secure/use_in_frontend” and “web/secure/use_in_adminhtml”
6. Edit both values, make them equal to “0”

After this is done you will be back in action.