Events Made Easy Forums Bug fixed or feature request implemented Plugin not properly initialising

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #61238
    gheaven
    Participant

    I am using the Multiple Domains plugin on my dev site and EME is not displaying some of the js or the maps properly when on the second domain alias. I am seeing cross domain warnings on the browser console. Multiple Domains works by re-writing plugins_url() with the domain name of the caller. In my case I have mydomain.nz and 192.168.1.74 and when calling with the ip address eme was returning links with the default wordpress domain name.

    Taking a wee peek at the code has revealed that the plugin is initialising when it is enqueued rather than in response to the plugin loaded event (as per the current wordpress recommendations)

    I tweaked events-manager.php so that the two URL defines are plugin url (lines 36/37) are called by an action hook from ‘plugins_loaded’. This and all works quite well now. We have the correct domain name consistently and no more console warnings. Yous spam filter blocks me pasting my code.

    I will leave it over to you Frankie to decide what the scope of initialisation should be. I could not see anything else that should wait and I do not know what other magic like your cron does and what triggers it.

    #61239
    Franky
    Keymaster

    You can always mail me the improvements (or copy/paste your code here using the “code” block, I’m not blocking anything specific on the forum. The reason behind the initialisation is (probably) because EME – while mostly ready – is not class-rewritten, so some things are harder to do. I’m open to suggestions here though, if someone wants to help with that rewrite I’m all ears.

    #61240
    gheaven
    Participant
    // GH Added Code Needs to run after Multiple Domains is loaded....
    function eme_events_manager_init() {
    	define('EME_PLUGIN_URL', plugins_url('',plugin_basename(__FILE__)).'/'); //PLUGIN URL
    	define('EME_PLUGIN_DIR', ABSPATH.PLUGINDIR.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'/'); //PLUGIN DIRECTORY
    }
    add_action( 'plugins_loaded', 'eme_events_manager_init', 20 );
    // End GH Added Code
    #61245
    Franky
    Keymaster

    Would you mind testing out the dev version of EME?
    You can download it at the bottom of this page:
    https://wordpress.org/plugins/events-made-easy/advanced/

    #61249
    gheaven
    Participant

    Hi Franky
    That Dev version looks like it has done the trick.
    Gary.

    #61250
    Franky
    Keymaster

    Thanks for testing. Would you mind telling me when (date and time) you downloaded the dev version? Since I made other changes as well it would be nice if you downloaded the version from just before your reply 🙂

    #61251
    gheaven
    Participant

    Hi Franky

    It took me about an hour to download unpack and test. The most recent timestamp (on eme-events.php) is 25-05-2020 10:27pm. Happy to retest. Also as a head up, I am working on locations and maps and I have a growing number of questions. These are important but low priority as the core works well enough for what I want to do at present.

    Gary.

    #61252
    Franky
    Keymaster

    Ok, the latest committed change was 32 hours ago, so I think you tested all other changes in there (don’t worry, nothing major changed and I tested also).

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.