[resolved] Content URL conflict if on another domain (3 posts)

  1. Markus Stefanko
    Posted 3 years ago #

    My current blog url is in the format of http://sitename.com and the WP_CONTENT_URL is set for a cookie-less subdomain on another domain - where PHP is not enabled http://sitename.otherdomain.com ( it's purely for fast content serving! )

    Due to that it seems that some features of WP_Insert are not working, such as country selection in the pop up. Google Chrome Inspector produces the following errors

    Failed to load resource: the server responded with a status of 404 (Not Found) http://sitename.otherdomain.com/plugins/wp-insert/includes/common/popups/countries.php?data=&target=wp-insert-inpostads-above-content-country_1
    ( most likely due to php being disabled, the country list however loads )

    Then when pressing the green OK button, after selecting a few areas, nothing happens with the following errors :
    Unsafe JavaScript attempt to access frame with URL http://sitename.com/wp-admin/admin.php?page=wp-insert&w3tc_note=flush_all&settings-updated=true from frame with URL http://sitename.otherdomain.com/plugins/wp-insert/includes/common/popups/countries.php?data=&target=wp-insert-inpostads-above-content-country_1. Domains, protocols and ports must match.

    Uncaught TypeError: Property 'jQuery' of object [object Window] is not a function

    These errors are straight-forward. The fixing would most likely be by using the site-url for the admin area features, so your script would stay on the same domain and would not have problems with dynamic .js through the php script.

    PS : Is it possible to set custom areas where advertisements will be placed? E.g. I'd like to have one ad area displayed in a certain pre-formatted box for example.


  2. Markus Stefanko
    Posted 3 years ago #

    I tried it first with a partial fix was to add a condition into wp-config, which would only define WP_CONTENT_URL for the frontend, and not the backend;

    if( !defined('WP_ADMIN') ) { define('WP_CONTENT_URL', 'http://contentdomain'); }

    It wasn't optimal, but worked. However I think it was due to WP_PLUGINS_URL not being set. Now after setting WP_PLUGINS_URL, the issue is gone.

  3. namith.jawahar
    Plugin Author

    Posted 3 years ago #

    WP_PLUGINS_URL is supposed to be always available..

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Wp-Insert
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic