The MU forums have moved to WordPress.org

WPMU SPEEDY? (19 posts)

  1. boonika
    Member
    Posted 14 years ago #

    What do You thing about this. Has anyone tried to use this plugin. Thanks.

    http://aciddrop.com/2008/03/22/php-speedy-wordpress-plugin-version-04/

  2. Ovidiu
    Member
    Posted 14 years ago #

    funny.
    I was just playing with it...
    I remember reading a comment of its author somewhere explaining something about wpmu compatibility but can't find that comment again.

    I tried using it with plugin commander, and mass activate, but that leaves all users the option of activating/deactivating it and even configuring it.

    haven't tried running it from the wpmu folder, although I doubt that would make any difference.

    I would love the config to be only accessible by the site admin, I guess thats not hard to change..

    unfortunately comments on his site are off, have you tried contacting the author yet?

  3. Ovidiu
    Member
    Posted 14 years ago #

    I foudn the comment I was looking for, its inside the speedy config menu actually:

    In Wordpress MU, you cannot configure your MU sites for PHP Speedy individually; the same config affects all the sites you have enabled PHP Speedy on. This is a feature (not a bug). You should also turn off PHP Speedy file cleanup if using MU.

    BUT I guess inside the plugin he is using is_admin not is_site_admin so any admin will be able to configure the plugin :-(

    btw. how does one check if its wp or wpmu running?

  4. boonika
    Member
    Posted 14 years ago #

    "I would love the config to be only accessible by the site admin, I guess thats not hard to change.."

    Try with hiding menus. Dsaders has some solutions for that. Btw, viperbond's (again;)) admin bar allows you to hide menus insida Site Admin:) When you hide it, all you have to do is add redirect function (in a plugin) so no one can use direct URL to access it. But maybe it is enough to redirect it's parent admin bar to, let say, post-new.php. I don't know for sure cause I'm not an excerpt.

  5. Ovidiu
    Member
    Posted 14 years ago #

    "I would love the config to be only accessible by the site admin, I guess thats not hard to change.."

    that is actually pretty easy, just find the code where the menu page is generated and inclose it in an if is_site_admin statement thats all. => no site admin, no menu :-)

    let me know how your tests with vipers plugin go, maybe someone can come up with some hacks for wpmu? I am not that good with code either...

  6. andrea_r
    Moderator
    Posted 14 years ago #

    Even easier - find the code where the menu is generated and move it under the Site Admin menu instead. :D

  7. boonika
    Member
    Posted 14 years ago #

    There you go:)

  8. MrBrian
    Member
    Posted 14 years ago #

    I found some silly bugs with it. The config file stores the cache and file directories with double quotes "", which in my case caused php to interpret a directory such as "C:\www\testserver\wp-content\mu-plugins\php_speedy_wp/cache"

    as this "C:\www estserver\wp-content\mu-plugins\php_speedy_wp/cache"

    If you're confused as to why \t turned into a TAB, it's because double quotes cause PHP to evaluate the contents. Replace with single quotes and it's all good.

  9. MrBrian
    Member
    Posted 14 years ago #

    Also, to fix it in code, change line 214 in controller/admin.php to this:
    $content = preg_replace("@(" . $this->regex_escape($option_name) . ") = '(.*?)'@is","$1 = '" . $option_value . "'",$content);

  10. boonika
    Member
    Posted 14 years ago #

  11. MrBrian
    Member
    Posted 14 years ago #

    That fix is already in the latest version 0.4.7. The site is a little messy hehe, http://aciddrop.com/2008/07/15/php-speedy-wp-version-047-works-with-wp26/

    Also, here's the new mt_add_pages function that works better with WPMU.

    function mt_add_pages() {
    		if(function_exists('is_site_admin')){
    			add_submenu_page('wpmu-admin.php', 'PHP Speedy', 'PHP Speedy', 10, $this->home_url, array(&$this, 'menu_system'));
    		} else {
    			add_options_page('php_speedy_wp.php', 'PHP Speedy', 10, $this->home_url, array(&$this, 'menu_system'));
    		}
    	}
  12. boonika
    Member
    Posted 14 years ago #

    Thanks Mr B.

  13. MrBrian
    Member
    Posted 13 years ago #

    Just want to make a note that windows users will find this plugin will actually hurt the performance of the windows server as it does a lot of is_readable and is_file/is_directory which are really slow on windows. Linux is a lot better with those functions, but I think the plugin could use some reworking in this area. I still have it enabled for my WPMU site because pages are delivered faster, and my server is not under heavy load.

  14. MrBrian
    Member
    Posted 13 years ago #

    Correction. Just did some benchmarking on my linux server... this plugin will severely slow down your server's performance under load. Were talking entire seconds per request. Highly recommend you do not use this plugin at all.

  15. tdjcbe
    Member
    Posted 13 years ago #

    There's a note on that page if you're using Donncha's super cache with along an adjustment that needs to be made.

    I normally don't suggest this as I'm one of these people who don't like the idea of moving files off to a third party host but you may want to give the thought to using a service like Amazon's s3 if your servers are getting that many file requests. There's a plugin over on ringofblogs.com that cover theme files. Probably could figure out a method of moving over the javascripts over there as well.

    http://www.ringofblogs.com/2008/04/12/off-loading-wpmu-theme-files-to-amazon-s3/

    If you have a large number of plugins that add in their own css and/or javascripts, you may want to consider moving those over to a single static file and removing those function calls from the plugins. That will save a fair amount of processor power. At least it did with our sites. Clean things up as well within the outputted html. :)

  16. boonika
    Member
    Posted 13 years ago #

    @MrBrian and tdjcbe - Thanks for the info

  17. MrBrian
    Member
    Posted 13 years ago #

    The point of the plugin is to consolidate all the .js and .css includes into 1 single request which reduces the time the browser takes to view the page (great idea) - the problem is the plugin's method of finding these files to optimize. Recursively searching for files in the plugins and themes directory is intensive in the first place, not to mention the function for it is badly written. Add in the fact that it does this every page load and that's the huge performance hit which increases exponentially with the more plugins and themes you have. So for now, it's not worth the faster page load time.

  18. zappoman
    Member
    Posted 13 years ago #

    Has anyone implemented a fix to php speedy or a version of something similar that addresses the concern that Mr. Brian raises? I agree that calculating the compress/jumbo/minified files every time would make this a non-starter. Has anyone implemented a better solution that does the "compilation process" at the request of the server admin.

    Also, I haven't looked through the php speedy code enough to know this, but it seems like there must be some attempt to do this in the existing code, since it has a caching mechanism of some kind.

  19. tdjcbe
    Member
    Posted 13 years ago #

    We do but we just did it manually. Put all of the plugin css and javascripts on the public side into a single file (well two. One for each.) that gets called via a wp_head call. And then removed all those calls from the plugins.

About this Topic