Fixing PHP fatal error of WooCommerce Predictive Search Plugin

I updated the old version of WooCommerce Predictive Search Plugin with latest version and it produced the PHP fatal error:

Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;’ in /htdocs/wp-content/plugins/woocommerce-predictive-search/admin/admin-ui.php on line 37

I thought that Plugin’s files are not updated properly. So I downloaded the latest version from WordPress repository and uploaded the plugin via FTP. But PHP fatal error is not resolving.

Finally I opened the admin-ui.php file and replaced the following PHP code

public $google_api_key_option  = WOOPS_KEY . '_google_api_key';
public $toggle_box_open_option = WOOPS_KEY . '_toggle_box_open';
public $version_transient      = WOOPS_KEY . '_licinfo';

WITH

public $google_api_key_option  = 'woo_predictive_search_google_api_key';
public $toggle_box_open_option = 'woo_predictive_search_toggle_box_open';
public $version_transient      = 'woo_predictive_search_licinfo';

It worked like a charm and fixed the issue.

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.