From the Knowledgebase

Using Caching or Minifying Plugins

Using WP Super Cache, W3 Total Cache, WP Rocket, Autoptimize, or other plugins to minify and/or cache the scripts running on your site has been known to create issues with the plugin's function. Some themes also provided caching / minifying of JavaScript. The plugin scripts are already minified so you will not be losing any efficiency or load speed by excluding them from these tools.

This error often presents as PDFs failing to load, appearing as a link, or get stuck on loading. To rectify this error, you will need to exclude the following URIs for the plugin scripts from any caching and/or minifying tools:

Latest Lite version paths (v4.7+):

  • /wp-content/plugins/pdf-embedder/assets/js/pdfjs/pdf.min.js
  • /wp-content/plugins/pdf-embedder/assets/js/pdfjs/pdf.worker.min.js
  • /wp-content/plugins/pdf-embedder/assets/js/pdfemb.min.js

Latest Premium version paths (v5.2+):

  • /wp-content/plugins/pdf-embedder-premium/assets/js/pdf-viewer.min.js
  • /wp-content/plugins/pdf-embedder-premium/assets/js/pdf-worker.min.js

If you updated from the old versions of the plugin (v4.x, v5.0.x, or v5.1.x) you will have a different old folder name, which we preserved for backward compatibility:

  • /wp-content/plugins/PDFEmbedder-premium/assets/js/pdf-viewer.min.js
  • /wp-content/plugins/PDFEmbedder-premium/assets/js/pdf-worker.min.js
  • or:
  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/pdf-viewer.min.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/pdf-worker.min.js

Basically, paths are the same, only the folder name is different for you. The best way to check which one you need is to open your /wp-content/plugins/ directory via FTP or Files Editor module in CPanel, and check which plugin folder do you see: pdf-embedder-premium, PDFEmbedder-premium, or PDFEmbedder-premium-secure.

Legacy versions

Premium version paths (v5.0.x):

  • /wp-content/plugins/PDFEmbedder-premium/js/all-pdfemb-premium-5.0.2.min.js
  • /wp-content/plugins/PDFEmbedder-premium/js/pdfjs/pdf-5.0.2.min.js
  • /wp-content/plugins/PDFEmbedder-premium/js/pdfjs/pdf-5.0.2.worker.min.js

Premium version paths (v5.1.x):

  • /wp-content/plugins/PDFEmbedder-premium/assets/js/all-pdfemb-premium.js
  • /wp-content/plugins/PDFEmbedder-premium/assets/js/min/pdf-viewer-min.js
  • /wp-content/plugins/PDFEmbedder-premium/assets/js/min/pdf-worker-min.js

Premium Secure version paths (v5.0.x):

  • /wp-content/plugins/PDFEmbedder-premium-secure/js/all-pdfemb-premium-5.0.2.min.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/js/pdfjs/pdf-5.0.2.min.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/js/pdfjs/pdf-5.0.2.worker.min.js

Premium Secure version paths (v5.1.x):

  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/pdf-embedder.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/pdf-js-viewer.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/min/pdf-viewer-min.js
  • /wp-content/plugins/PDFEmbedder-premium-secure/assets/js/min/pdf-worker-min.js

Note: all caching and minifying plugins differ as to where exclusions can be added. Please refer to the caching/minifying plugin's documentation for specific instructions on where and how to add these script paths as these exclusions may be located in "hidden" Advanced settings options. The scripts should be excluded from aggregate / inline caching as well as general JS caching.

Be sure to flush any caches including ones specifically for JS after you exclude the scripts so that they can be loaded by the site again and the embed viewer should be displayed correctly once this has been done.