PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Plugin not loading properly

s2Member Plugin. A Membership plugin for WordPress®.

Plugin not loading properly

Postby Guest » August 19th, 2010, 2:02 pm

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
Guest
Guest User
Guest User
 

Re: Plugin not loading properly

Postby dethier » August 20th, 2010, 9:13 pm

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">
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: Plugin not loading properly

Postby dethier » August 20th, 2010, 10:47 pm

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?
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: Plugin not loading properly

Postby dethier » August 20th, 2010, 10:55 pm

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.
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: Plugin not loading properly

Postby dethier » August 22nd, 2010, 10:19 pm

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...
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: Plugin not loading properly

Postby dethier » August 22nd, 2010, 11:25 pm

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.
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: Plugin not loading properly

Postby Jason Caldwell » August 27th, 2010, 1:41 pm

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" )
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Plugin not loading properly

Postby bjolley2 » November 22nd, 2010, 10:59 am

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.
User avatar
bjolley2
Registered User
Registered User
 
Posts: 8
Joined: November 17, 2010

Re: Plugin not loading properly

Postby crushthenet » November 22nd, 2010, 3:35 pm

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?
User avatar
crushthenet
Registered User
Registered User
 
Posts: 63
Joined: November 1, 2010

Re: Plugin not loading properly

Postby josefresco » November 24th, 2010, 4:04 pm

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?
User avatar
josefresco
Registered User
Registered User
 
Posts: 2
Joined: November 24, 2010

Re: Plugin not loading properly

Postby josefresco » November 24th, 2010, 4:11 pm

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.
User avatar
josefresco
Registered User
Registered User
 
Posts: 2
Joined: November 24, 2010

Re: Plugin not loading properly

Postby aliferis » January 24th, 2012, 1:06 pm

I had a file 'index.html' in my web root and this was breaking the css for the s2member options page !
User avatar
aliferis
Registered User
Registered User
 
Posts: 14
Joined: January 24, 2012

Re: Plugin not loading properly

Postby Eduan » January 24th, 2012, 5:40 pm

Thanks for letting us know aliferis!

I'm glad you were able to figure it out. :)
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron