Title: Error: Set a Valid Document Source
Last modified: January 23, 2025

---

# Error: Set a Valid Document Source

 *  Resolved [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/)
 * Hi,
 * I am using dFlip and have unfortunately had to enable the Siteground Speed Optimiser,
   in order to resolve several other issues. However, since enabling the PDF book
   no longer loads. Instead I get the message ‘Error: Set a Valid Document Source’.
 * By turning off Combine JavaScript Files in Speed Optimiser, I resolve the issue,
   but alas, all my other woes reappear. So I have tried to exclude the JS files
   and excluded /plugins/dflip/assets/js/dflip.min.js however this does not resolve
   the issue.
 * Having tried everything I know, I wonder if you can point me in the right direction
   to fix this?
 * You’ll find the book in the ‘Take a sneak peek….’ section of the page
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-set-a-valid-document-source-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [DearHive](https://wordpress.org/support/users/dearhive/)
 * (@dearhive)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18261306)
 * Hi,
 * We see that there is script missing after the thumb. with class **df-shortcode-
   script**
 *     ```wp-block-code
       <script class="df-shortcode-script" type="application/javascript">window.df_option_5413 = .................
       ```
   
 * Looks like this inline script was merged or manipulated. Can you exclude **df-
   shortcode-script** in exclusions available. Maybe that will work,
 * We tried adding Sigeground optimizer to our site. even though the code part was
   manipulated it was working; since it was loaded later. Whereas in you site there
   is an error in siteground-optimizer js so maybe that is causing execution block.
 *     ```wp-block-code
       siteground-optimizer…bc13ffa2574afb.js:2 Uncaught Error: No Usercentrics script ID "usercentrics-cmp" found
       ```
   
 * Best Regards,
   DearHive
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18266396)
 * Hi,
 * Are you able to tell me the handle for this Shortcode, so that I can exclude 
   it from caching?
 * Thanks
 *  Plugin Author [DearHive](https://wordpress.org/support/users/dearhive/)
 * (@dearhive)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18266448)
 * Hi,
 * The shortcode is handled by a function `shortcode` in Class `DFlip_ShortCode`.
   This is in file inc/shortcodde.php
 *     ```wp-block-code
           add_shortcode( 'dflip', array( $this, 'shortcode' ) );
       ```
   
 * Not sure how are going to exclude php functions in cache.
 * For HTML cache, in other cache plugins like wp-rocket, excluding the script class**`
   df-shortcode-script`** works
 *     ```wp-block-code
       <script class="df-shortcode-script" type="application/javascript">window.df_option_5413 = .................
       ```
   
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18269223)
 * OK, so SiteGround are insisting there must be a Handle. I have followed their
   instructions to display the Handles in the HTML Inspector and tried excluding
   them all, but it has not worked. I really thought this Handle would do it, but
   it did not `dflip-script`
 * The SiteGround Speed Optimiser Plugin does have a Manage General window, which
   has a fields labeled ‘Exclude from HTML Minification’. You suggested that WP 
   Rocket has something similar, so I have added both DFlip_ShortCode and df-shortcode-
   script to Exclude from HTML Minification. But of course, this does not work either!
 * I am at complete loss here. I have inherited your plugin that seemingly doesn’t
   use handles and a caching plugin that doesn’t support whatever it is you do use(
   which I can’t quite understand either to be honest). Surely I can exclude your
   plugin from caching somehow?
 *  Plugin Author [DearHive](https://wordpress.org/support/users/dearhive/)
 * (@dearhive)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18270069)
 * Hi,
 * I too had a look at siteground plugin and it does have option to exclude files
   but not inline scripts.
 * wp rocket/litespeed has ability to exclude both files and inline scripts.
 * The handle they(siteground) are referring to is probably for registering script
   files. But in our case the issue is from inline scripts. Have you inquired how
   to exclude inline scripts? Or can you point me to their support thread( if it
   is wordpress.org)
 * Best Regards,
 * DearHive
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18271009)
 * I have just asked how to exclude inline scripts and am waiting response. Here
   is the thread;
 * [https://wordpress.org/support/topic/dflip-caching-issues/#post-18271007](https://wordpress.org/support/topic/dflip-caching-issues/#post-18271007)
 * Thanks
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18271122)
 * They have come back with the following, which I implemented but it did not work;
 * Hello,
 * You can exclude** **inline scripts from being combined using the following filter.
   Here’s a code snippet, you can add to your functions.php file to do so:
 *     ```wp-block-code
       add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
       function js_combine_exclude_inline_script( $exclude_list ) {
         $exclude_list[] = 'first few symbols of inline content script';
   
         return $exclude_list;
       }
       ```
   
 * Looking at the code, I think I need to add the ‘first few symbols of inline content
   script’. I tried df-shortcode-script but no good, so what are they?
 * Thanks
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18282924)
 * The team at Siteground provided this code which appears to have fixed the issue
   by excluding all dFlip files.
 * `add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script');
   
   function js_combine_exclude_inline_script( $exclude_list ) {$exclude_list[] ='
   df';return $exclude_list;}

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

The topic ‘Error: Set a Valid Document Source’ is closed to new replies.

 * ![](https://ps.w.org/3d-flipbook-dflip-lite/assets/icon-128x128.gif?rev=3175518)
 * [DearFlip - PDF Flipbook, 3D Flipbook, PDF embed, PDF viewer](https://wordpress.org/plugins/3d-flipbook-dflip-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/3d-flipbook-dflip-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/error-set-a-valid-document-source-2/#post-18282924)
 * Status: resolved