Title: Problem with ESI
Last modified: September 15, 2021

---

# Problem with ESI

 *  Resolved [pzxyz](https://wordpress.org/support/users/pzxyz/)
 * (@pzxyz)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-esi/)
 * When litespeed cache plugin is on page views counter doesn’t work. I’m trying
   to exclude from cache page views counter ([https://pl.wordpress.org/plugins/page-views-count/](https://pl.wordpress.org/plugins/page-views-count/)).
 * I added snippet:
 *     ```
       add_action( 'litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load' );
   
       function my_esi_block_esi_load()
       {
       #do_action( 'litespeed_control_set_ttl', 300 );
       do_action( 'litespeed_control_set_nocache' );	
   
       include ("/wp-content/plugins/page-views-count/page-views-count.php");
       }
       ```
   
 * and I included filter in the code like this (I’m using Oxygen Page Builder code
   block to insert this):
 *     ```
       <div>
       <?php
       echo apply_filters( 'litespeed_esi_url', 'my_esi_block', 'Custom ESI block' ); ?>
       	<?php pvc_stats_update( $postid, 1 ); ?> 
       </div>
       ```
   
 * It returns warnings:
 *     ```
       Warning: include(/wp-content/plugins/page-views-count/page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
   
       Warning: include(): Failed opening '/wp-content/plugins/page-views-count/page-views-count.php' for inclusion (include_path='.:/usr/local/php/7.4/7.4.15-dh36/lib/php') in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
       ```
   
 * Can you help me and tell where the problem is?
    -  This topic was modified 4 years, 9 months ago by [pzxyz](https://wordpress.org/support/users/pzxyz/).
    -  This topic was modified 4 years, 9 months ago by [pzxyz](https://wordpress.org/support/users/pzxyz/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-esi%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-esi/#post-14875792)
 * Hi,
 * `/wp-content/plugins/page-views-count/page-views-count.php`
 * don’t use absolute path like this , make it relative path or full path with correct
   path in your case ,
 * /home/[…]/public_html/wp-content/plugins/page-views-count/page-views-count.php
 * Best regards,
 *  Thread Starter [pzxyz](https://wordpress.org/support/users/pzxyz/)
 * (@pzxyz)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-esi/#post-14876252)
 * Thank you.
 * With relative path:
 *     ```
       add_action( 'litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load' );
   
       function my_esi_block_esi_load()
       {
       #do_action( 'litespeed_control_set_ttl', 300 );
       do_action( 'litespeed_control_set_nocache' );	
   
       include ("page-views-count.php");
       }
       ```
   
 * I have 3 warnings:
 *     ```
       Warning: include(page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
   
       Warning: include(page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
   
       Warning: include(): Failed opening 'page-views-count.php' for inclusion (include_path='.:/usr/local/php/7.4/7.4.15-dh36/lib/php') in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
       ```
   
 * With absolute path I have fatal error:
    `Fatal error: Cannot redeclare a3_pvc_load_plugin_textdomain()(
   previously declared in /home/[...]/public_html/wp-content/plugins/page-views-
   count/page-views-count.php:74) in /home/[...]/public_html/wp-content/plugins/
   page-views-count/page-views-count.php on line 74`
 * How to make things work?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-esi/#post-14876522)
 * well …
 * you can’t just include the file , it’s bit of complicated then that
 * a simpler solution is to find a post counter plugin that uses ajax call or WP
   REST to get the counter , instead of making ESI block

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with ESI’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

## Tags

 * [esi](https://wordpress.org/support/topic-tag/esi/)

 * 3 replies
 * 2 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-esi/#post-14876522)
 * Status: resolved