Page 1 of 1

Plugin not loading properly

PostPosted: August 19th, 2010, 2:02 pm
by Guest
Hey folks ... has anyone seen when you are trying to install the plugin that it loads, but when you go to the options portion of the plugin, it hasn't loaded properly? What happens is normally all the categories and features are in a collapsed state and you can minimize and maximize those options. What is happening to me, is none of them are grouping, thus I can not do anything.

I have uninstalled the plugin, have reinstalled wordpress, but still no luck.

Any ideas?

Cheers

Re: Plugin not loading properly

PostPosted: August 20th, 2010, 9:13 pm
by dethier
I'm having the same problem. The .js is not loading properly and browser console is showing errors.

I just got through trying re-installing the plugin manually in case there was a glitch with the WordPress auto-install. Still getting the problem. Guess I'm going to have to bug-fix the code :(

Here's the errors I'm getting in my browser console (both in firefox and chrome -> these messages are from firefox)

Code: Select all
Error: The stylesheet http://organizeseries.com/wordpress/?ws_plugin__s2member_menu_pages_css=1&ver=1.01282357156 was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://organizeseries.com/wordpress/wp-admin/admin.php?page=ws-plugin--s2member-options
Line: 0


And the second one:
Code: Select all
Error: syntax error
Source File: http://organizeseries.com/wordpress/?ws_plugin__s2member_menu_pages_js=1&ver=1.01282357156
Line: 1
Source Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

Re: Plugin not loading properly

PostPosted: August 20th, 2010, 10:47 pm
by dethier
I see from looking at the code that you have it setup so that the plugin will check for a $_GET['ws_plugin__s2member_menu_pages_js'] and then output the relevant css/js location (depending on the GET send. Something isn't working though and the GET is getting intercepted somewhere so that the correct substitution isn't happening. Why don't you just directly reference the files in the wp_enqueue_script/style hook instead of adding an extra layer?

Re: Plugin not loading properly

PostPosted: August 20th, 2010, 10:55 pm
by dethier
I fixed it by editing the file menu-pages.inc.php:

On line 199 I added '/wp-admin/' before '/?ws_plugin...etc.' resulting in this:

Code: Select all
wp_enqueue_script ("ws-plugin--s2member-menu-pages", get_bloginfo ("wpurl") . "/wp-admin/?ws_plugin__s2member_menu_pages_js=1", array ("jquery", "thickbox", "media-upload"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);


On line 222 I did the same resulting in this:
Code: Select all
wp_enqueue_style ("ws-plugin--s2member-menu-pages", get_bloginfo ("wpurl") . "/wp-admin/?ws_plugin__s2member_menu_pages_css=1", array ("thickbox"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");


Everything gets loaded correctly for me now.

Re: Plugin not loading properly

PostPosted: August 22nd, 2010, 10:19 pm
by dethier
I've had to go through all the plugin files and anywhere there is a
Code: Select all
get_bloginfo("wpurl")
reference that does not actually point to something in the "wpurl" directory I've had to add "/wp-admin/" before the "?ws_plugin..." in order to get everything working.

For some reason, the default setup pointing to my "wordpress" directory (which is what all my wordpress files are installed in - i.e. http://mywebsite.com/wordpress/) will end up displaying the contents of my wordpress directory. I know I'm probably missing something simple here that will fix it but in the meantime I find having everything point to "wordpress/wp-admin/" seems to have fixed it...

Re: Plugin not loading properly

PostPosted: August 22nd, 2010, 11:25 pm
by dethier
Finally, figured out the source of the problem. And as I thought it was something simple. It has been my habit when keeping all the WordPress files in a subdirectory to MOVE the index.php file in the /wordpress/ directory to the root directory of the web folder and modify it so that WordPress loads with http://mywebsite.com. This is a carry-over from the days when you needed to do this with WordPress for these kind of setups. What I didn't realize is that index.php is NEEDED in the WordPress directory so that WordPress will load and s2member can do the necessary redirects depending on the variables passed in the $_GET array.

I copied back the index.php file into my /wordpress/ directory (modified to original contents) and left my modified index.php in the root directory. I reinstalled s2member and everything is now working as expected.

If anybody else stumbles across this problem make sure you have the original index.php file in your whatever sub-directory is hosting your WordPress files.

Re: Plugin not loading properly

PostPosted: August 27th, 2010, 1:41 pm
by Jason Caldwell
dethier wrote:Finally, figured out the source of the problem. And as I thought it was something simple. It has been my habit when keeping all the WordPress files in a subdirectory to MOVE the index.php file in the /wordpress/ directory to the root directory of the web folder and modify it so that WordPress loads with http://mywebsite.com. This is a carry-over from the days when you needed to do this with WordPress for these kind of setups. What I didn't realize is that index.php is NEEDED in the WordPress directory so that WordPress will load and s2member can do the necessary redirects depending on the variables passed in the $_GET array.

I copied back the index.php file into my /wordpress/ directory (modified to original contents) and left my modified index.php in the root directory. I reinstalled s2member and everything is now working as expected.

If anybody else stumbles across this problem make sure you have the original index.php file in your whatever sub-directory is hosting your WordPress files.

Awesome work. Thank you VERY much for reporting this important issue, along with a fix!
~ Excellent. ( promoting you to "Experienced" )

Re: Plugin not loading properly

PostPosted: November 22nd, 2010, 10:59 am
by bjolley2
This is the exact same problem I am having. I am unclear how to locate and move the index.php file like you explained above. I have access to my files via ftp. When I look into my wp-content folder the index.php file is there. Please help, thanks.

Re: Plugin not loading properly

PostPosted: November 22nd, 2010, 3:35 pm
by crushthenet
I don't think he's talking about the index.php in wp-content, he's talking about the one a folder up, in the root of wordpress. How is your WP installed, is it in a sub-directory or the root folder? Have you moved the root index.php file?

Re: Plugin not loading properly

PostPosted: November 24th, 2010, 4:04 pm
by josefresco
I have the same problem, however my Wordpress install is not in a sub directory and I haven't done anything funny with my index.php file. I've also disabled all other plugins, and have removed any custom code I had in functions.php related to user fields.

The plugin installs (I've tried several fresh installs) but the General Options page shows as one giant page/form without each section collapsed as I see in the videos, and much of the functionality does not work specifically adding custom user fields.

I tried the solutions above but still was unable to get the General Options screen to load with the JS needed to function.

Any ideas?

Re: Plugin not loading properly

PostPosted: November 24th, 2010, 4:11 pm
by josefresco
Disregard my post. I did in fact have an issue with my index.php file which I resolved.

Time to take a break and clear my head.

Re: Plugin not loading properly

PostPosted: January 24th, 2012, 1:06 pm
by aliferis
I had a file 'index.html' in my web root and this was breaking the css for the s2member options page !

Re: Plugin not loading properly

PostPosted: January 24th, 2012, 5:40 pm
by Eduan
Thanks for letting us know aliferis!

I'm glad you were able to figure it out. :)