Home Forums WoodMart support forum Critical Debugging Code Found in Production (inc/helpers.php)

Critical Debugging Code Found in Production (inc/helpers.php)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #722627

    adsblogger
    Participant

    Hello Woodmart Support Team,

    I am writing to report a critical issue regarding the inc/helpers.php file in the current version of the theme.

    During an investigation into server storage depletion, I identified an active print_r($data); statement on line 671. This instruction is causing massive data dumps into the server’s PHP error logs whenever specific product data or session triggers are processed.

    This debug code is causing significant performance degradation and storage issues in production environments. Please remove this statement in the next theme update to ensure stability for all users.

    Best regards,

    #722639

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    Thanks for the report. The ar() function in inc/helpers.php is an intentional developer utility, not a stray debug statement.

    function ar( $data ) {
        echo '<pre>';
            print_r( $data );
        echo '</pre>';
    }

    It only runs when a developer explicitly calls ar($someVariable). Nothing calls it automatically during page loads, product processing, or session handling. The phpcs:ignore comment is there because the linter flags print_r as a development tool, and it was deliberately left in.

    If you’re seeing error log spam or unexpected output, the source is elsewhere. Most likely a stray ar(), var_dump(), or error_log() call in a customization. A few things worth checking:

    – Your child theme (wp-content/themes/woodmart-child/) for any calls to ar(, var_dump(, or print_r(
    – Active plugins for debug output left in accidentally
    – Enable WP_DEBUG_LOG temporarily to trace where the log entries actually come from

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)