Plugins not working -- frustrated

I’m not sure if this is due to poor plugin development and not adhering to standards (what I’m thinking is the case) or if there’s something I’m just not understanding: I’m using Bedrock with Roots and everything is going smoothly until I tried to use a certain plugin: http://ghozylab.com/

I’m getting a 500 error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) e.g: http://mysite.com/app/plugins/easy-media-gallery-pro/includes/dynamic-style.php

Is this the fault of the plugin developer or am I missing something? I don’t expect you guys to troubleshoot this for me, but I’m imagining that if all my other plugins and site resources are working fine, the fact that this one doesn’t work means that it’s just bad coding on the plugin developer’s part.

These guys offer support too for this paid plugin and all they can tell me is that I don’t have a standard WordPress installation, install a fresh copy of WordPress and use their plugin.

I’d hate to have to worry about stuff like this going forward because I love using Roots and Bedrock so much now, going back to vanilla WP seems like a terrible proposition…

Update apparently it’s because they are referencing wp-load.php (that’s why the support person is telling me anyway, though it’s not making much sense to me) wondering if maybe there is a workaround.

Another update – I was able to get this working by using
require_once('/var/www/site/wp/wp-load.php');

Is there a way to use ABSPATH or something like that to take care of the /var/www/site/wp part? I tried ABSPATH and also just /wp but no go…

That plugin is doing a terrible practice of loading wp-load.php outside of WP on its own.

Ref: http://plugins.svn.wordpress.org/easy-media-gallery/trunk/includes/easyloader.php

error_reporting(0);ini_set('display_errors', 0);
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );

This is so bad it should be a joke :frowning:

See http://ottopress.com/2010/dont-include-wp-load-please/

Unfortunately you will run into more issues running Bedrock than you would otherwise. The good news is you’ll find out right away which plugins aren’t coded properly. I can say with almost 100% certainty that if a plugin doesn’t work with Bedrock, it’s their fault.

edit: ABSPATH doesn’t work because they’re just including wp-load.php outside of WP without loading the config or anything.

1 Like

Thanks Scott - I figured this was the case and put a little code band-aid in the file… I can’t even believe they are charging money for a “pro” version of this plugin when ignoring best practices published 4 years ago.

I guess I shouldn’t be complaining though, learning a lot! I can fix this myself and disable updates for the client for that plugin. Thanks for the feedback