[Hummingbird] Page Caching module adds PHP code to the source code of the site

When I check the source code of my site, I notice the following string at the top:
<?php die(); ?>
this comes from Hummingbird wp-content/plugins/wp-hummingbird/core/modules/class-page-cache.php line 1204
I replaced

if ( preg_match( '/.php/', basename( $wphb_cache_file ) ) && ! $is_404 ) {
$content = '<?php die(); ?>' . $content;


if ( preg_match( '/.php/', basename( $wphb_cache_file ) ) && ! $is_404 ) {
$content = $content;

and now its fine. Could you fix this in upcoming versions of the plugin?

  • Anton Vanyukov
    • Developer

    Hi LIJE ,

    This is intentional behaviour.
    <?php die(); ?> is added to cache files, when you have selected to cache for logged in users. This is a security measure so that the files, which might contain sensitive data, do not get accessed directly. The die() is removed in the send_file() method later on in the class-page-cache.php file.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.