Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Benjamin Pick

    (@benjamin4)

    Good question I never tried. Probably not because the uploads folder are different for each subsite. (Note to self: how would cron update work?)

    function geoip_detect_get_database_upload_filename()
    {
            $upload_dir = wp_upload_dir();
            $dir = $upload_dir['basedir'];
    
            $filename = $dir . '/' . GEOIP_DETECT_DATA_FILENAME;
            return $filename;
    }

    The basedir is the same for all sites on multisite, so I believe that this function returns the same path for all sites.

    Thread Starter ak47marx22

    (@ak47marx22)

    Thanks David. Tried it but page turned blank. Activated debug and got..
    ( ! ) Fatal error: Cannot redeclare geoip_detect_get_database_upload_filename() (previously declared in /var/www/domain.org/htdocs/wp-content/plugins/geoip-detect/updater.php:10) in /var/www/domain.org/htdocs/wp-content/themes/blankslate/functions.php on line 652

    Too much rocket science for me but it would be really cool if this plugin had single database for all multisite users ??

    Thread Starter ak47marx22

    (@ak47marx22)

    Ups, I think i’m confusing things. The code David mentioned, is already in the plugin and now even if I update database under subsite, I dont see duplicate database in that sites upload folder. So as I understand, the plugin has single database for multiste but you still need to update it manually under subsites?

    Plugin Author Benjamin Pick

    (@benjamin4)

    Cron probably will try to update (the same file) automatically – which made me realise that nothing currently prevents concurrency issues (ie 2 processes writing the same file at the same time). Will try to fix that for the next version.

    I won’t support multisite as I don’t have experience with it but if somebody writes a pull request (if possible, also some unit tests), I will be happy to merge it.

    Will this plugin work with WP Multisite in this way:

    So for an example scenario: IP is detected, pop up says “it looks like you’re close to one of these areas” > user picks the location > user is taken to a multisite network site that is all about that location and is a separate site from the top-level site on the root domain.

    Or a similar solution (open to ideas)

    Thanks for any help you can offer!

    Plugin Author Benjamin Pick

    (@benjamin4)

    Multisite aside: yes this scenario is possible but will require some developer working on this. In principle, you simply use the plugin to choose a website URL where to redirect to, by comparing the detected lat/lon-Values to pre-known points (or areas). You will also need to consider that the free dataset is somewhat incomplete/inaccurate so what if the IP only gives you the country and so on.

    Which issue arise from using this plugin on multisite: I never tried.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Will this work with multisite?’ is closed to new replies.