Use alternative CDN for JavaScript libraries

Usage The Microsoft 365 apps included in the WPO365 | LOGIN plugin (and their advanced versions that are included in the WPO365 | INTRANET and WPO365 | M365 APPS) use 2 React JavaScript dependencies. These files are not included in the app package and the plugin instructs the browser to download those from the unpkg.com CDN. These dependencies are:

  • react.js (https://unpkg.com/react@16/umd/react.production.min.js, version 16.14)
  • react-dom.js (https://unpkg.com/react-dom@16/umd/react-dom.production.min.js, version 16.14)

Very seldom this CDN may not be reachable, and users may experience difficulties loading the apps. In such cases, administrators can now check the option to Use (an) alternative CDN. When checked, the plugin will instead instruct the browser to download the dependencies from the CloudFlare CDN as follows.

  • react.js (https://cdnjs.cloudflare.com/ajax/libs/react/16.14.0/umd/react.production.min.js)
  • react-dom.js (https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.14.0/umd/react-dom.production.min.js)

Alternatively, administrators can download these dependencies (e.g., using the URLs above) and save them in their own domain / CDN (e.g., an Azure CDN, App Service or Blob Storage Account). To configure the plugin to instruct the browser to download the dependencies from your custom location, you must update your wp-config.php and introduce a new constant as shown below.

define('WPO_CDN', array(
	'react' => 'https://www.your-website.com/wp-content/uploads/libs/react/16.40/react.production.min.js',
	'react_dom' => 'https://www.your-website.com/wp-content/uploads/libs/react/16.40/react-dom.production.min.js'));

In the previous example you must then of course replace the URLs with the location where you uploaded the files.

Property path WP Admin > WPO365 > Integration > Use alternative CDN

Default value Unchecked

Versions ALL

Visit the website https://www.wpo365.com/

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us