fbpx
Booster for WooCommerce - Custom PHP Booster for WooCommerce - Custom PHP

Overview #

The Custom PHP Plugin lets store owners add custom PHP code to their website without editing the “functions.php” file or frequently using the FTP client. The plugin will add a PHP file in your uploads folder automatically, and execute it from there only. 

Location: /wp-content/uploads/woocommerce_uploads/wcj_uploads/custom_php/booster.php

On editing the code through the custom PHP plugin’s settings, this file will be updated. 

With this plugin installed on your store, you will not be updating your core PHP files of the theme, including “functions.php”, when your WordPress is updated. Your custom PHP code will remain intact during updates.

Note: Be extra-cautious while adding Custom PHP to your website. One slight mistake and your website will either be unavailable or load with errors.

How to Make your Site Functional After It is Not Loading Due to Invalid Custom PHP? #

If you have enabled Custom PHP for your website, and because the code is erroneous, your site has become unavailable, do not panic.

To fix the problem, you need to add the following attribute to your website’s URL:

wcj_disable_custom_php

Make sure that you are using admin or shop manager credentials to log in while trying this. Also, to avoid trouble for you, the Custom PHP Plugin does not execute the custom PHP code on the wp-login.php page. 

Let us give you a few examples to view your admin portal with the help of this solution:

This URL will take you to the WooCommerce > Settings > Booster > EMAIL & MISC. > Custom PHP plugin settings page:

https://bplus.magentogroup.in/wp-admin/admin.php?page=wc-settings&tab=jetpack&wcj-cat=emails_and_misc&section=custom_php&wcj_disable_custom_php

Similarly, see these 2 examples to view your shop’s frontend when the URL has no attribute already vs. when it has attribute(s) already:

How to Enable Adding Custom PHP to the WooCommerce Store through a Plugin? #

Note: Download, install, and activate the Booster for WooCommerce Plugin before you follow these steps. Booster is the parent plugin for Custom PHP Plugin, and therefore, it is essential to activate it first.

  • Login to your WordPress administrator dashboard.
  • Go to WooCommerce > Settings.
  • Go to the Booster tab and click on the EMAIL & MISC. link.
  • Click on the Custom PHP link to open the plugin settings dashboard.
  • Select Enable Module for the Custom PHP option.

How to Add Custom PHP Code to your WordPress or WooCommerce Site? #

You can use Booster’s Custom PHP Code Plugin to add custom PHP code to your WordPress or WooCommerce website. For this, enable the plugin and insert the code in the Options > Custom PHP input field.

Be Careful, because incorrect or flawed code will result in your site’s downtime.

Note: Do not use the “<?php” or “?>” tag in this field. Add the code directly.

Here is an example:

Reset Settings #

Click on the Reset Settings button to clear the custom PHP code and disable the plugin at once. Basically, the function of this button is to restore the plugin’s default settings.

You may also disable the Custom PHP plugin instead of clearing your code, in order to prevent it from affecting your website so that you could edit the code and use it later on.

Store Preview: Frontend of a WooCommerce Store with the Custom PHP Code Executed

Input: echo (“Hello, buyers”);

Powered by BetterDocs