WordPress.org

Ready to get started?Download WordPress

Forums

Imsanity
[resolved] Multisite support (30 posts)

  1. Andy Fragen
    Member
    Posted 2 years ago #

    I'm using Imsanity on a multisite installation and it works great, but I have to set it up for every site that is created. Is it possible to have an option allowing me to set up options under the superadmin that will carry over to all the sites?

    Thanks and great work.

    http://wordpress.org/extend/plugins/imsanity/

  2. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    I have it running on mine and was able to do that using Network Activate in the plugins section. Did you try that?

  3. Andy Fragen
    Member
    Posted 2 years ago #

    I think you misunderstand. I have it running and it works great but each site in a multisite installation has it's own settings. I was wondering if there could be an option for universal settings.

  4. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    ah yea they each have their own settings. if you know of any other plugins that work that way (one settings page for all sites) then send a link my way and I'll try to see how it is done.

  5. Andy Fragen
    Member
    Posted 2 years ago #

    One that I am using is Stop Spammer Registrations. In a multisite installation the settings are on the Super Admin page an give the option of a settings control only on the "main blog".

  6. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    interesting. i don't really like the way they hard-coded in the site id = 1. I suppose it works most of the time, but it seems a bit fragile to rely on the site id.

    i definitely imagined this plugin being useful for enforcement on a multi-site install, though. I'm going to think of another way to do this. My current idea is to create a config file which if it exists in a certain location Imsanity will use that for settings instead of showing the options page on each site.

    The down-side of that is that you have to edit the settings in a file instead of a nice GUI, but for a network install it seems like it might be OK. The config file would likely be incredibly simple to understand.

  7. Andy Fragen
    Member
    Posted 2 years ago #

    While a config file would work...clearly not ideal.

    Is there any way to force the settings only to show up under the same Network Admin Settings tab as settings for the plugin and just not display that for any other site.

    The other plugin seems to display a settings under Network Admin Settings but also under the Settings tab for the main blog. How about only under the Network Admin?

  8. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    there definitely is but i don't currently know the hooks for multi-site plugins. if anybody want's to contribute code i'd be glad to put it in. I definitely think it's a feature worth including due to the nature of the plugin

  9. Andy Fragen
    Member
    Posted 2 years ago #

    As I've never written a plugin, I'm not sure trying to cut my teeth on a multisite plugin is the best way to start. A quick bit of googling found me these.

    Write a Plugin for WordPress Multisite

    Override WordPress Plugin Options for All Sites in MultiSite

    I hope it's a little helpful. Also, while the idea of hardcoding site id = 1 seems bad, it does seem to work.

  10. Andy Fragen
    Member
    Posted 2 years ago #

    I also found some interesting info in this Events Manager plugin.

    From that plugin's developer a post called Multisite, be sure to look at the end of the post. It seems as if this should be possible.

  11. Andy Fragen
    Member
    Posted 2 years ago #

  12. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    cool thanks. i'll check them out. the biggest issue is really finding the time to learn and understand the mechanics. to many projects, not enough time!

  13. janiu
    Member
    Posted 2 years ago #

    One more vote for this feature request :)

  14. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    the mult-site feature is definitely coming, I have it nearly working. it's been a bit tricky because multi-site doesn't get as much attention so there's not as much good info out there. The next update will have a page in the "network settings" area for setting server-wide settings & prevent individual sites from overriding them.

  15. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    I've added this feature into version 2.0.0. On the Network configuration page under "settings" there is an Imsanity Network Settings page.

    This allows you to set the configuration for the entire server and they cannot be changed on a per-site basis. The site settings page will show a message indicating that settings have been configured by the server admin.

    I'd appreciate any feedback. I've only tested on the latest version of WordPress. I don't know if I will provide support for this feature on versions prior to 3.0 when WordPress MU was a separate application.

  16. marikamitsos
    Member
    Posted 2 years ago #

    Hello and thank you for an excellent plugin.
    And I must add that I admire your determination on it. :)

    I want to try it out on a multisite environment but there are a couple of things I want to ask first.

    1. What happens if some blogs have their own media size settings altered on their site?
    2. A quite common situation is domain mapping. Would the sites have any issues with such a configuration?

    Thank you in advance

  17. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    thanks for the message. I wrote Imsanity partially as a helper for the end-user, but mainly for the server admin on WordPress network installation. so it is meant to run well in that situation.

    # 1. What happens if some blogs have their own media size settings altered on their site?

    I'm guessing you refer to the WordPress media sizes that you can configure for large, medium, thumbnail sizes that will be generated? Imsanity resizes the file before those functions are called so the user cannot do anything to create files larger than what is allowed by Imsanity. If the imsanity configured max is 800x600 and the "large" file size is set to 1024x1024 then what will happen is that the large sizes will never be generated. WordPress only generates large/medium size if necessary (if they are smaller than the original)

    Basically you can think of Imsanity as working the same as if the user manually scaled down the image before they uploaded it. It hooks into WordPress at the level immediately after the upload (when it is being saved) before any other processing happens.

    # 2. A quite common situation is domain mapping. Would the sites have any issues with such a configuration?

    It works fine with domain mapping as well, I use it on my own server that way.

  18. marikamitsos
    Member
    Posted 2 years ago #

    Thank you !!!!!

    Quick, prompt, to the point reply.
    I am truly thankful. I have to at least, try this plugin.

  19. janiu
    Member
    Posted 2 years ago #

    With this feature there seems to be some issue.

    I have set the network settings but those are only used in the main blog (id1). If I go there as the same user that's the whole network's admin, it says correctly that "Imsanity settings have been configured by the server administrator. There are no site-specific settings available."

    But if I go to some sub blog I'm able to change these settings and the network settings are not in use. Instead there are the original values.

    I also tried creating a new blog but it does not take the settings from network admin, it uses 1024. No matter if I login as network admin or blog admin.

    I tried to deactivate and activate the plugin.

    I'm using subdirectory setup so my main blog where it works is just domain.com and the other blogs where it does not work are domain.com/blogname/

  20. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    ah thanks for the report - i see the problem is with wordpress creating the settings table for each blog instead of just one global table for all blogs.

    i'll have a version 2.1.1 released soon today to fix that. i have to figure out how to do it correctly since the previous method i was using wasn't right.

  21. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    crap, 2.1.1 still didn't fix the issues. I just posted 2.1.2 which does fix the issue.

  22. Ovidiu
    Member
    Posted 2 years ago #

    getting this error every now and then when resizing:

    ERROR: /var/www/clients/client1/web1/web/wp-content/blogs.dir/1211/files/2011/11/20111126_dsc1328_copy.jpg (Could not calculate resized image dimensions)
    RESIZE COMPLETE

    might it be the php memory limits? which one would I need to check/raise for a jpg picture the size of 4592 x 3056?

    edit: using multisite that is the reason I posted in this thread. Network settings are working fine :-)

  23. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    Interesting. That is a WordPress error when it tries to get the dimensions of the image. My best guess at this moment is either the file is not fully uploading, but it could possibly be a memory thing.

    If it was a memory or a timeout issue, I'd think you'd see PHP die with a relevant error message. Instead it's coming from a specific line in WordPress /wp-includes/media.php:

    $dims = image_resize_dimensions($orig_w, $orig_h, $max_w, $max_h, $crop);

    That is returning nothing, which means the failure happened with GD.

    The best suggestion I would have to start with is to temporarily change the line after that statement like so:

    if ( !$dims )
        die("have a look at $file");
        // return new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions') );

    what that will do is just stop WordPress the moment in encounters that error and it will leave the original image alone instead of deleting it. Then go on your server and download that image to see if it's exactly the same as the original.

    if it is exactly the same, then that rules out problems during the upload or file copy and it means the problem has to be somewhere with the PHP GD library (or a memory issue, timeout, etc)

    if the file is not exactly the same then there is a problem with the upload process (which seems unlikely but you don't know until you rule it out)

  24. Ovidiu
    Member
    Posted 2 years ago #

    sorry man, I omitted some very important info:

    the problem occurred when trying to resize images that had already been uploaded.

    in this case, shall I still try your suggestion or won't it make sense since the images are already uploaded.

    If you have another idea, I can check anything you want, I am on my own root server so I can fiddle around if needed.

  25. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    hmm, well if you already know the image is good and it is intermittent (fails one time them works the next) then that narrows the possibilities to something between PHP and GD. If it fails on some images but not others, then I would suspect something with the images themselves is incompatible with GD.

    Essentially PHP is making a command-line call to GD to get the dimensions of the image. And for whatever reason that GD command is not returning the correct info to PHP. Whether there is some extension timeout setting for that command that is too low, or whether you have to specify something when you compile the GD extension, I wish I could say but I don't really know.

    I'd probably start with the easy thing of just making sure you have current versions of everything.

  26. Ovidiu
    Member
    Posted 2 years ago #

    nope, none of that. I noticed someone had uploaded huge images so I activated your plugin network wide. I used to use another solution but that one stopped working a few versions ago.

    so I set up the defaults for this plugin and went to this one blog, verified all images and tried resizing them all.

    4 of them simply fail. I assumed it is because of their size but I guess its not. I'll leave it at this for now.

  27. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    oh hmm, if it's the same 4 images every time then I would definitely just suspect those particular images have something about them that GD doesn't like. Perhaps they have partial corruption or something which isn't noticeable in a viewer but chokes GD

  28. attorresi
    Member
    Posted 2 years ago #

    Sorry, I am using the translator, I'm from Brazil.
    I wonder if the plugin does not have to make only a certain period, because I have 16,000 images on the site, and the plugin so can not read everything. I left five hours, but not brought me any result.

    Thank you,

    Attorresi

  29. Sofian J. Anom
    Member
    Posted 2 years ago #

    I imagine, if Imsanity can function like New Blog Defaults plugin, definitely he will be one mandatory plugin for WordPress Multisite. :)

  30. Sofian J. Anom
    Member
    Posted 2 years ago #

    Glad to see this plugin now multisite support, and it works as expected.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags