One Plug in is creating havoc in my .htaccess file.

Hi there

I have 7 e-book titles I was listing separately as Products.

My site was disappearing and I was getting 500 Internal Server Error messages when trying to enter Products, so my site was disappearing.

I was using a copy plugin which I have now removed - but the issue is still occuring.

I contacted my host (Hostmonster) who found that a plug in is putting this over and over in the .htaccess file.

Can someone please look at my site and advise if the Products plugin is causing this and how to fix it - or another plugin.

Suggestions welcome!

This is the text that is repeated many times in my .htaccess file in case it means something to you:

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

# END WordPress

Thanks.
Karen

I will organise access now.

    Vinod Dalvi

    Hi Karen,

    Thanks for posting on the forums.

    We can't predict just from the .htaccess which plugin / theme is causing this.

    Are you facing this issue recently?

    If yes then have you added / updated / deleted anything recently that caused this issue?

    You can just try on your development site deactivating all other plugins and using default WordPress theme like Twenty Thirteen as displayed in the flowchart on the following page to know which theme/ plugin is causing it.

    https://premium.wpmudev.org/manuals/getting-support/

    The 500—Internal Server Error occurs when the Web server (running the Web Site) encountered an unexpected condition that prevented it from fulfilling the request by the client for access to the requested URL.

    Could you please check the answers provided on the following pages helps you to fix the Internal Server Error?

    http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/
    http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm

    Kind Regards,
    Vinod Dalvi

    Vaughan

    Hi @karen,

    Do you mean the ss are being added to the htaccess file?

    Can you send your details using the following contact form (select i have a different question from the dropdown.)

    https://premium.wpmudev.org/contact/

    Mark for attn: Vaughan
    Include a ref URL to this thread.

    Please include site login details (super-admin if on multisite)
    Also include FTP login details so I can take a look at the files.

    Thanks

    Karen

    Vaughan

    I have just emailed you as per instructions above and also noted what was happening at the time.

    ***
    Attn Vaughan

    https://premium.wpmudev.org/forums/topic/one-plug-in-is-creating-havoc-in-my-htaccess-file

    It is still happening today.

    Several different things appear to be added to the .htaccess file.

    [login details removed]

    First it was the "s" and "ss" being added after the normal code in the .htaccess file.

    Then it was "?" and the code being repeated endlessly.

    Now the code has changed to:

    # BEGIN WordPre<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    versus

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    Over to you.

    Good luck as it is driving me mad - every time I try and load a page it goes to 500 error.

    ***
    My thoughts (for what they are worth).

    1. I first noticed that several plugins had deactivated themselves. (Most worrying was Snapshot which was set to daily back up but hadn't since May 20 or so - I used to check it and it was fine so assumed it was just doing its thing).

    2. Appointments+ deactivated itself (this plugin seems to have a lot of issues with not showing properly and is the one most likely to not work on any given day) - FYI.

    3. I bought the LearnDash LMS - as I need to list courses on the site. That seemed fine.

    4. I was copying pages using a plug in designed for that (I deactivated it as I wondered if it was causing the problem) - I copied already-created Product pages (I have 7 ebooks I want to list) - and it seems to have happened after I copied pages. As I tried to look at them I was started to get errors and trouble with the pages appearing.

    I removed the Copy Post plugin as noted, but the problem has remained and seems to have infected any pages I want to work on.

    The 7 e-books are going to have 7 e-courses associated with them so I need to be able to copy products. I am now using the copy feature that is there (there wasn't one when I installed the copy post plugin).

    I hope that all gives some clue.

    I'll open access to you as well as it might have expired by now.

    GOOD LUCK! Here's hoping you can fix it for me. Many thanks.

    Karen

    Karen

    Vaughan

    One interesting thing I just noticed about the "s" and "ss" (I didn't look at the top to see it was part of something else at the time).

    I think something is inserting the <IfModule.......> to </ifModule> to REPLACE the proper code. If you look you will see the "ss" is from the end of the WordPress word.

    I suspect the "s" removed was from the same truncation.

    Something is fiddling with my .htaccess code.

    ***

    # BEGIN WordPre<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    Karen

    Vaughan

    I just got advised via email that there is a new WP version auto updated.

    I am wondering if this will fix the .htaccess issue???

    ***
    Howdy! Your site at https://www.publicaffairsjobs.com.au has been updated automatically to WordPress 3.9.2.

    No further action is needed on your part. For more on version 3.9.2, see the About WordPress screen:
    https://www.publicaffairsjobs.com.au/wp-admin/about.php

    If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.
    https://wordpress.org/support/

    You also have some plugins or themes with updates available. Update them now:
    https://www.publicaffairsjobs.com.au/wp-admin/

    The WordPress Team
    ***

    Timothy Bowers

    Hey there,

    Site runs a painfully slow but I see you have a fair few plugins running there which is probably the reason. A number of them are fairly large plugins too.

    I note you have a number of fatal errors on your site relating to this plugin:

    google-analytics-dashboard-for-wp

    The error is PHP Fatal error: Cannot redeclare class Google_Utils

    You also had another error Uncaught exception 'Mijireh_Exception' with message 'Access key required to view checkout preview'

    I checked on them but they seem to have been removed since then so shouldn't be the issue now.

    I see the reason you get the WSOD sperodically, you need more memory:

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 34948 bytes) in /home1/profetb3/public_html/publicaffairsjobs/wp-includes/functions.php on line 275

    The more code you run, the more people hitting the site the more memory you will need.

    I see your site is on Hostmonster, even if you get unlimited space/bandwidth (which isn't true), you don't get unlimited resources and it's resources what you need here. They should let you up the memory but if you continued to use to many resources they will eventually ask you to get something more powerful.

    I didn't experience any issues with htaccess, you could remove the write permissions and set it to 444.

    Hostmonster have an article on memory:

    https://my.hostmonster.com/cgi/help/php-memory

    If your PHP supports then you can edit your wp-config.php file and add the following line:

    define('WP_MEMORY_LIMIT', '96MB');

    You would change the memory in those to whatever it is you require.

    If you are not sure how or have further issues then it would be best to ask your host to help you out with this one.

    Because I didn't experience any issues with the htaccess file, your site loads slow and you have a lot of plugins you would need to continue debugging that by disabling plugins. Try to note a pattern to when it happens like saving a page, navigating somewhere specific, that kind of thing.

    Take care.

    Karen

    Timothy

    Brilliant - thanks. The memory area is something I have not had to venture into but I am about to load up some e-books and e-courses so I dare say I will need more.

    I will work my way through your advice.

    But the WSOD info is DEFINITELY useful - could not figure that out. Where is that message appearing?

    I DO have a lot of plugins - but I am building a site with capacity to do a number of things and the solution to every problem appears to be "try this plugin to prevent that" so you end up with them even if you don't want more.

    The issue appears to be the e-course (LMS) that I added - it is not working as intended.

    I was going to post separately, but how do I give them access to check the behaviour of their plug in (the site works fine with the plug in disabled which isn't really helpful as I need it for my courses!) - is there away to give temporary Admin access while keeping my own Admin access?

    Thanks for looking into it for me.

    regards,
    Karen

    Karen

    I just tried the php hostmonster link and it loses me at one of the Install Master PHP file as the screen and what exists now are vastly different and I am on php 5.4 - the latest anyway - FYI.

    .htaccess - I have removed the LMS plugin so I don't think you would be seeing the .htaccess issues. FYI.

    I am not sure about this:

    I checked on them but they seem to have been removed since then so shouldn't be the issue now.

    I was having issues with Google Analytics on my http://www.geelongstreet.com.au site but not this one.

    Re

    I see your site is on Hostmonster, even if you get unlimited space/bandwidth (which isn't true), you don't get unlimited resources and it's resources what you need here. They should let you up the memory but if you continued to use to many resources they will eventually ask you to get something more powerful.

    you're right - I need to talk to them as it i beyond me now.

    Thanks.

    Timothy Bowers

    Hey again.

    But the WSOD info is DEFINITELY useful - could not figure that out. Where is that message appearing?

    I enabled the WP_DEBUG whilst looking for issues, currently you suppress it so it wasn't clear what was happening.

    The LMS plugin is fair size as well, I don't know about functionality as I don't use it myself but the more code you run the slower and more problematic things can be.

    I was going to post separately, but how do I give them access to check the behaviour of their plug in (the site works fine with the plug in disabled which isn't really helpful as I need it for my courses!) - is there away to give temporary Admin access while keeping my own Admin access?

    They'd most likely want to look at code so they'd need FTP, and they're also probably want admin access to see inside the site.

    I don't really know this company so I can't vouch for their credibility but as a general warning I'd be careful with handing out access unless you have faith and trust in those other parties. If you do then always grab a backup first.

    Another option although more complex is to clone the site and environment and give them access to a different install rather than your live production one. It's a lot of messing around but in general when developing you should have a sandbox website where all changes are tested before pushing live. If you do have a sandbox install and the issue happens there you could give them access to this instead.

    Yesterday I popped your htaccess onto 444, this removes the write permissions. It will mean that if WordPress needs to rewrite (very rare) then it won't be able to but it should also mean that nothing else can write to it either so you shouldn't have this issue.

    With regards to issue you mentioned you're not sure about (where I checked something) it's fine, the errors related to plugins no longer on your install. I only mentioned them just incase they coincided with the htaccess problem you kept getting.

    Take care.

    Karen

    Tim

    What is the best way to clone the site? I would prefer to be doing that than working on the live site.

    Does that also mean that you can do updates to WPMU plugins and themes on that site first to make sure it works and doesn't WSOD you?

    Do I have to give them my OWN Admin access or is there a way to create another Admin Access with a different password for THIRD parties to use?

    I am going to talk to Hostmonster about what I am planning to do - bring traffic to purchase e-books and e-courses and see what they suggest I do.

    Thanks for your help.
    Karen

    Timothy Bowers

    Hey Karen

    What is the best way to clone the site? I would prefer to be doing that than working on the live site.

    You could use something like snapshot to move from one to another.

    There are other options but they can get more complex like creating and running a bash script.

    Does that also mean that you can do updates to WPMU plugins and themes on that site first to make sure it works and doesn't WSOD you?

    I don't totally understand what you mean here?

    If you're asking about installing our plugins/themes through the dash then yes you can.

    Do I have to give them my OWN Admin access or is there a way to create another Admin Access with a different password for THIRD parties to use?

    I'd never give anyone a password you continue to use either here or elsewhere. Unless of course you plan to change it once their done.

    But with regards to the account it doesn't matter if it's another account or your main one, they still have the same access.

    Take care.

    Timothy Bowers

    Can you enable the WP_DEBUG again within your wp-config.php file, also enable it so it displays the errors.

    Then check what's being given on those white pages now.

    512 should be more than enough.

    Can you also create a php file and enter this:

    <?php
    phpinfo();
    ?>

    Then pop it into your public_html, navigate to it through the browser and check what you have for memory_limit just to be sure it's being set correctly.

    Take care.

    Karen

    Tim?

    As part of an exercise to see if a new plugin was working, I removed all the plugins and changed the theme to 2014 to test it.

    After changing back to my BP Fun theme and moving all my plugins back, I have lost my widgets which I am putting back.

    BUT the site is EVEN slower after I changed the php.ini to 512MB - it now takes 22 seconds and a refresh to get anything to appear as the first attempt at loading gets you just WSOD.

    Can you/someone please check why the loading is taking so long?

    Of course people are trying to access my site in the meantime. I'd like to get it working again.

    Many thanks.

    Karen

    Hostmonster has looked at it.

    Their technical person advised:

    "I was able to see the white screen, however I have not yet determined what the exact issue is since there are no updated errors in the php error_log.

    What I did for testing was to deactivate all of your plugins, since you had 38 active, and I increased the max_input_vars for your wordpress site. I have been unable to duplicate the white screen since I made these changes. So you should activate your plugins one at a time for testing to determine which one is breaking your site.

    Also, in the chat, it was specified the site's memory had been increased to 256M, I actually didn't see those changes in the php.ini so I updated those for the publicaffairsjobs.com.au site as well. I hope this is helpful!"

    Unfortunately I activated them all before I realised so I will have to deactivate them. Funnily I thought that I had to move the plugins - not just deactivate them from within the site...that would have saved me a lot of activity in the past. Sigh.

    FYI.

    Timothy Bowers

    "I was able to see the white screen, however I have not yet determined what the exact issue is since there are no updated errors in the php error_log.

    They're the host they control the level of error_logging.

    Funnily I thought that I had to move the plugins - not just deactivate them from within the site...that would have saved me a lot of activity in the past. Sigh.

    A method you can use so you don't have to deactivate in the admin is to move them out of the /plugins/ folder. Sometimes I'll create a new folder to move them over whilst quickly testing.

    Reading their message it implies the memory wasn't increased at first. I wonder why.

    You can use something like yslow:

    https://developer.yahoo.com/yslow/

    That should help you check for items slowing the site down. Could also be an issue with connection to the DB.

    Take care.

    Karen

    Tim

    Thanks.

    A method you can use so you don't have to deactivate in the admin is to move them out of the /plugins/ folder. Sometimes I'll create a new folder to move them over whilst quickly testing.

    This is what I normally do...but I found all my widgets went and I had to reinstate them. If I just had to deactivate them, then that is much quicker....and I don't lose all the widgets.

    Jack Kitterhing

    Hi there Karen,

    Hope you're well today!

    This is what I normally do...but I found all my widgets went and I had to reinstate them. If I just had to deactivate them, then that is much quicker....and I don't lose all the widgets.

    Did you visit the plugins page in your WordPress admin? If you use the method Tim suggested make sure you don't visit the plugin page in the admin area, this could mean deactivation scripts are triggered on some plugins (none of ours do this).

    Thanks!

    Kind Regards
    Jack.

    Karen

    Jack

    Not quite understanding this:

    Did you visit the plugins page in your WordPress admin?

    I was going to hostmonster and creating a plugins/OLD folder and moved them all over to that and then moved them back one by one when testing.

    That seems to be what Tim suggested (and thinking about it, I learned it from the hostmonster people). I didn't even think to deactivate them all from within the WP dashboard.

    I found when doing the last move between OLD and current plugin folders in the Hostmonster site, that when they were moved back, the widgets etc and other things were not working and had to be reinstated and some things were automatically deactivated.

    I won't do it that way anymore now I know I can do it within WP.

    If you use the method Tim suggested make sure you don't visit the plugin page in the admin area, this could mean deactivation scripts are triggered on some plugins (none of ours do this).

    I am not sure what this means. If I use Tim's method I am in hostmonster so I am - ergo - NOT in the admin area of the site.

    Am I missing something?

    Thanks for trying to clarify.

    regards,
    Karen

    Jack Kitterhing

    Hi there @Karen,

    Hope you're well today!

    Sorry about the confusion here, I can confirm you was using Tim's method correctly.

    Just if used Tim's method, then logged into the admin and went to http://www.yourdomain.com/wp-admin/plugins.php they would still technically be deactivated, which would result in the loss of data, if they run deactivation scripts, to delete the data from the database tables.

    Thanks!

    Kind Regards
    Jack.

    Jack Kitterhing

    Hiya Karen,

    Just wanted to add some additional clarification.

    I just wanted to be clear that most plugins/themes don't work that way upon deactivation, a few do, but most don't. It's bad practice for a plugin/theme to delete it's settings upon deactivation.

    If you have any questions or issues, please don't hesitate to ask, we're here to help.

    Hope you have a great weekend!

    Kind Regards
    Jack.

    Karen

    Jack many thanks for that.

    Just so I am clear:

    If I am in Hostmonster and move the plugins to the OLD folder and introduce one by one to test...I am OK if I do not go anywhere near the website Admin.

    I usually just have the website up - moving around the pages of the website to see what is working / not working.

    I don't activate them from the website admin side.

    It didn't occur to me to mix the two.

    So if I do that I am ok? right?

    Thanks again.
    Karen

    Vinod Dalvi

    Hi Karen,

    Yes it's ok.

    In short if you want to remove the functionality provided by any WordPress plugin from your site without deactivating it then just move the plugin folder out of wp-content/plugins folder and don't visit the plugins page http://yoursite.com/wp-admin/plugins.php in the admin area as it will deactivate the plugin.

    Then again if you want to add the functionality provided by WordPress plugin in your site then again restore the moved plugin folder in to the plugins folder wp-content/plugins

    Please advise if you have more questions.

    Regards,
    Vinod Dalvi