How to remove WP Bakery (Visual Composer) tabs animation

A client didn’t like the tab animation used by the WP Bakery (Visual Composer) WordPress plugin.
There aren’t any options to change this, however the nature of JavaScript means that you can override methods.
WP Bakery builds their JavaScript files as jQuery plugins so this example can be adapted to override the method of any jQuery plugin.

For WP Bakery add the following JavaScript to a file that is being used by your page or create a new one if necessary:

jQuery(function(){
    var _isAnimated = jQuery.fn.vcAccordion.Constructor.prototype.isAnimated;
    jQuery.fn.vcAccordion.Constructor.prototype.isAnimated = function() {
        return 0;
    }
});

This replaces the isAnimated function with one that just returns 0, making it think the animation is already complete.

For other jQuery plugins you will need to spend some time in your browser developer tools stepping through the code to see which function needs to be replaced.

With help from https://stackoverflow.com/questions/9137311/how-to-extend-twitter-bootstrap-plugin.

Windows 10 April Update and problems printing to shared printer on a Mac

After installing the Windows 10 April update on my laptop I couldn’t print to the shared printer attached to my Mac any more.
I didn’t remember how I originally got the printer working but I already had Bonjour installed. Bonjour is the recommended way of remote printing between Windows and MacOS (download Bonjour from Apple here https://support.apple.com/kb/DL999)

When I tried to find and connect to the remote printer this time I got the message: “Error 1796 You do not have sufficient access to your computer to connect to the printer”.
My account has Admin rights so that shouldn’t have been a problem. I located where the Bonjour executable was found and right clicked to ‘Run as administrator’ but that gave the same message.

I searched the web but couldn’t find any solutions that worked so I have documented what worked for me below.

The solution: I downloaded the latest version of Bonjour and ran it. It gave me the option to Change, Repair or Remove. I removed it. Then digging around in C:\Program Files and C:\Program Files (x86), I noticed that Bonjour folders were still present.
I went into Windows System \ Control Panel \ Uninstall a program and Bonjour was listed in there. I uninstalled and rebooted. There were no longer any Bonjour folders on the disk. I ran the Bonjour installer again and then ran Bonjour Printer Wizard – this time it found my printer, when asked to select a model there is a fairly meaningless list of options. For my Brother printer I chose the last in the list: Brother PS Class Driver in the hope that was PostScript. It worked fine and no Error 1796 message.

I can now successfully print via the remote printer again.

ServerPilot Pagespeed Message History

To enable Message History in Pagespeed on a server managed with ServerPilot – useful if you need to diagnose if there are any problems. You need to create a global level config file – adding it for a particular vhost isn’t good enough.

Create a file pagespeed.conf in /etc/nginx-sp/http.d

pagespeed on;
pagespeed MessageBufferSize 100000;
pagespeed FileCachePath /var/cache/pagespeed;
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;

Create the folder to hold the logs at:

mkdir /var/log/pagespeed;
chmod 755 /var/log/pagespeed;
chown www-data /var/log/pagespeed

This enables Pagespeed for all the sites on the server so if there are any that shouldn’t be using it, you’ll need to add pagespeed off; to a config file in that particular vhost folder.

WordPress WooCommerce SagePay mcrypt

WordPress WooCommerce SagePay Form extension https://woocommerce.com/products/sage-pay-form/ requires the PHP mcrypt extension to operate.

If your site uses this extension and one day stops going through the full checkout process be aware of the following:

mcrypt has been deprecated as of PHP 7.1.0 and will be moved to PECL as of PHP 7.2.0 – this is because it relies upon libmcrypt which is dead and unmaintained since 2007 http://php.net/manual/en/intro.mcrypt.php.

Your host may have disabled the mcrypt extension.

I’ve heard that the WooCommerce SagePay Form extension is currently being updated to use openssl_encrypt so there may be an update soon to rectify this.