WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
Editor broken when using CDN + admin menu over HTTPS (4 posts)

  1. AlphaK
    Member
    Posted 11 months ago #

    I noticed the whole editor (buttons + content into the textarea) is not displayed anymore when the following cases are met:

    - WP_CONTENT_URL is defined into wp-config.php
    and
    - Admin menu is browsed over HTTPS (FORCE_SSL_ADMIN set to true)
    and
    - WP_CONTENT_URL cannot serve files over HTTPS (only available via HTTP)

    In fact I am using WP_CONTENT_URL as a CDN, so all my static files are served via the CDN over a non-encrypted connection.

    Over HTTPS in the admin menu, all TinyMCE Advanced js and css components are set up to be also retrieved using the CDN URL on https, which is not enabled, so the editor is not displayed.

    I'm not sure it is a bug, but since WordPress core seems to ignore WP_CONTENT_URL when the user is browing the admin menu (the admin menu style is correctly displayed), maybe plugins should do the same :)

    http://wordpress.org/plugins/tinymce-advanced/

  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 11 months ago #

    Unfortunately TinyMCE 3.x cannot be loaded from different domain/CDN mostly because all dialogs are separate iframes. Any mismatch in the domain or protocol will break it (same origin restrictions). TinyMCE 4.0 works, so when it lands in WordPress this setup will be possible.

    Don't see an easy workaround. Maybe set only wp-content/uploads to be external/CDN-like. Both the plugins and themes sub-dirs usually include quite a bit of scripts and something other will eventually break.

  3. AlphaK
    Member
    Posted 11 months ago #

    Thanks for the reply. I have a better overview now.

    I have actually found an easy workaround, which I applied as soon as I could: only declare the CDN when the connection is in play text (not over HTTPS). As in my case resources can be downloaded either from the CDN domain, either from the original domain, having an HTTPS connection just makes WP believe this is a standard installation with no CDN at all.

    Here's a sniplet of my wp-config.php:

    if(!isset($_SERVER['HTTPS'])) {
    define('WP_CONTENT_URL', 'http://cdn.mydomain.com/wp-content');
    }

    But I like perfection and hope this hack can be removed one day ^^, so I'll probably have a closer look on TinyMCE 4.0 when it comes to WordPress.

  4. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 11 months ago #

    ...only declare the CDN when the connection is in play text (not over HTTPS).

    Yep, that works too. I'm glad you found a workaround.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.