Posted on

How to turn on debugging and log the messages in WordPress

You can enable WordPress debug without displaying the messages publicly to the site visitors.

You can enable WordPress debug in WordPress by adding

set_error_handler(function() {

        $log = " ******************** TRACE: ";

        foreach ( debug_backtrace() as $i => $item ) {

            if ( 0 === $i ) {

                $log .= " " . $item['args'][1];

            } else {
if(isset($item['file'])){
    $log .= " " . $item['file'] . ' — line ' . $item['line'];
}
            }

        }

        $log .= "***********************";

        error_log( $log );

        return true;

    }, E_ALL);

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define( 'WP_DEBUG_DISPLAY', false );


to the wp-config.php file. 

WordPress debug messages are logged without displaying to your site visitors.

You can find wp-config.php in your WordPress directory and copy and paste the 3 lines above in that file. Make sure none of the lines are repeated in the file.

You can then find the debug.log file in the WordPress wp-content directory.

Posted on

How to make the NP Quote Plugin work with page caching plugins

Depending on your caching plugin you need to exclude dynamic pages and sometimes exclude cookies from cache. The pages to exclude are the quote request, product category (archive), shop and the product page. The most common problem caused by page caching is that items which are added to the quote cart cannot be found afterwards.

WP Rocket:

/wp-admin/options-general.php?page=wprocket#advanced_cache

Never Cache URL(s)

/quote-request/(.*)

/product-category/(.*)

/shop/(.*)

/product/(.*)

Never Cache Cookies

rfqtk_wp_session_

WP Optimize: https://neahplugins.com/wp-content/uploads/word-image-148.png

If are using Pantheon:

cid:image002.png@01D80D39.80539D50

cid:image003.png@01D80D39.80539D50

You could also change the session method to PHP Sessions as an alternative method. 

Posted on

Do I need to download/reinstall the plugin after purchasing the plus version

The NP Quote Request WooCommerce Plus is an extension that you install in addition to the free version to provides a lot more options and features.

After purchasing and downloading the Plus file (RFQTK.zip) to your computer , you can install by:

1: Navigate to the plugins page in your admin area.

2: Click add new on the top of page.

cid:image001.png@01D808B2.F5CF3CF0

3: Click on upload plugin

cid:image002.png@01D808B2.F5CF3CF0

4: Click on choose file

cid:image003.png@01D808B2.F5CF3CF0

5: Browse to where you stored rfqtk.zip and select the rfqtk.zip. click open.

cid:image007.png@01D808B3.8550C1A0

6. Click install now and then activate.

cid:image008.png@01D808B3.8550C1A0

7: after activating the plugin you will see a notification

cid:image005.png@01D808B3.F3F94F00

Click on the “Click Here” and  the license key and the email you used to purchase.

cid:image010.png@01D808B3.F3F94F00