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