Wordpress Plugin Broke My Site & Cant Figure Out How To Resolve? - php

Ok so long and short of this is, I built a custom plugin for a Wordpress site and was working on a small update. Think perhaps I have a small typo error in the code but after saving the update my site is now showing a 500 error.
I have already attempted the following usual methods without success:
1: renamed the plugin and plugins directories to attempt to both disable individual/all plugins.
2: disabled all plugins via db.
Now the change itself was made via the wp back end, which updated the file. However I cannot see this change via FTP. This baffles me. I would assume somehow the database updated the file somewhere within itself which is perhaps overriding the original file? I haven't seen Wordpress do this before.
I'm not sure but would like to be able to figure out why this happened and if it's fixable.
For now I am just going to do a rollback. Any thoughts on this would be most welcome.

I suggest you try:
restoring the database. If you can’t see which file changed probably means that the database was changed and not a specific file. A popular plug-in for back up and restoration is updraft plus which enables you to select files, the database, or themes. Assuming you don’t have a restore plugin installed you could contact your hosting provider who may be able to restore the database to an earlier version. This functionality may also be available through the control panel on the Domain and Hosting. If this works then at least you know where the trouble lies with your dog and development.

Related

Theme related WSOD in backend for other users

After trying out all typical solutions for wordpress wsods, I am out of ideas.
I migrated my website from wordpress.com to a self-hosted solution using all-in-one-wp-migration, which looked to work fine, until a coworker wanted to use the backend and got wsod.
After going through all the suggestions for fixing wsods and a few of my own, namely:
checking every single plugin used
checking memory (980m should be enough?)
deleting and reinstating all saved accounts
scrubbing the database off of old wordpress.com entries or deprecated urls
running debug mode and not getting any logs from the wsod
I of course landed on my self made theme as the issue. I went over the functions.php file to remove and clean up all custom additions that are not necessary for functionality. I used a theme check plugin to help me weed out most of the issues that come from being a beginner at this, but nothing looks to be related at all to backend.
Especially irritating is the part where it works fine for me while using my pc, but any other device, like smartphone, tablet or other pcs can't seem to get into the wp-admin version of the site while my theme is activated.
P.S.: while the theme is active, backend functionalities like searching for new plugins or changing settings seem to not work right or lead to wsod even for me.
For anyone running into a simillar issue, the solution given by online guides always mentions making sure the END of the functions.php file does not have any empty space there, but they neglect to mention that there can't be any empty line anywhere in the whole file, even within the code.

Code changes not taking effect on Drupal site

I'm sure this has been asked a dozen times here, but nothing I've found online or on here has helped. There's something strange about the Drupal site I'm currently working on - I've worked on 10+ other sites at this company with no problem - in that none of the code changes I make seem to have any effect. Anything I do through the admin backend appears immediately, but when I try to change the text in a custom page template and push it live, nothing happens.
What I know/did:
I know I'm pushing correctly because when I go in the file manager on the live server and look at the files I pushed, the changes are present.
I am sure that I am changing the correct file because when I try it locally and on our staging server, the corresponding pages update immediately.
I cleared out the site's cache in the admin menu, in Configuration -> Development -> Performance -> Clear all caches.
I asked the hosting company if there was a cache to clear on their end, they said no.
I deleted the uploaded theme from the server completely. The theming is still present, though the images are broken links. So the site theming is still cached somewhere. (I then replaced the theme folder)
I then contemplated quitting web development and opening an orphanage in Pakistan
What I did not do:
I did not run root/update.php. I figured this would recache the database and that wouldn't affect text in a custom page template (I also searched for that original text in the database to make sure).
Does anyone have any other ideas I could try?
It could be nginx cache on the server. Or PHP opcache could prevent you from seeing PHP code changes.
But if you still see deleted Drupal theme, it is rather some proxy or maybe something right in your browser instead of the server.

Wordpress Admin doesn't load css files and images

I'm having a serious problem. I have wordpress 3.9 installed on my server. the problem is that my website front end loads good, but my back end just loads text :
I have updated/reinstalled wordpress but nothing has happend. What should I do?
Thanks for help.
I'm 100% sure that if you simply do the following, you'll figure out what's wrong and fix it.
Deactivate all plugins without use of your WP-Admin.
Activate them, 2 or 3 at a time, and determine which plugin is the culprit
If none of these plugins are the culprit, go to the WordPress site and download WordPress. With an FTP utility such as FileZilla or another client if you already have one, then upload the entire wp-admin folder to your server, overwriting older files.
Your WordPress admin will be fine after these steps. And of course, never alter any core WordPress files -- ever. The only files you should ever tinker with are files in your child theme, which is something you should be using.
Would be great to have a bit more information about this topic. First of all: Is this a new problem respectively did the admin run without errors before? (3.9 sounds like the page is not a new clean install).
Usually I would start debugging the page via e.g. firebug => Check the Stats of the CSS-Files.
If they load correctly (200) check if they are empty or incomplete (Incompleteness can be checked via diff against the original file ... most IDEs will handle that for you)! If they aren't you have probably just diabled CSS in your browser for the URL of the admin-panel.
If they don't load, try to check why! If the files exist its most probably an error in your .htaccess (wrong rewrite, blocked directory, etc.).

Wordpress blank page after activating theme, but works in other server

I'm trying to activate a Wordpress theme but all I got is a blank page, also the admin page goes blank.
Version of WP is 3.9.1, Mysql 5.1 compatible and PHP 5.2.4 compatible too with WP. The theme in question is MH Magazine and I have it in another server with the same configuration and is working ok.
Even I tried to do a backup of the working site and place it in the production server and still goes blank.
I tried uploading the max_memory_limit in php and no luck. Error log and show php errors doesnt show anything, when I check only says the site name HTTP 1.1 500 - If I set wp_debug to true says HTTP 1.1 200.
File permissions are ok too.
A SIMPLE FIX FOR NON TECHIES (Like me really)
Loads of forums recommend various code changes and things to try, non of which worked, so I logically worked through the process more simply and solved it myself (in my case). White screen for everything, including front end and Admin. I tried everything going!
Essentially I'd asked Wordpress to link to a theme, which it did, but now I can't change it back. As it wouldn't automatically switch back to default themes, as suggested by others as a result of simply deleting the theme folder via ftp, I would have to force that myself. Without access to the admin panel, how would I change the link (easily)?. Well I can't, so instead I need to force the change of what it links to instead!
In the end I basically logged in via FTP, went to the wp-content folder, then to themes, located my list of theme folders and changed the theme folder name of the one recently selected and causing the issue, by just adding an x at the end (random letter). Then I changed the theme folder 'default' to the name of the theme which was causing the issue, then refreshed my site in the other window, at which point it displayed again. So the hard coded link never changed, but the basic files it links to now have.
The site was now back up, thank god! I then logged into the Wordpress admin panel and updated my version of Wordpress, as to be honest it had been a while and it was a little out of date, so a likely culprit for the cause of the error. Once updated, I then went back into the FTP window, renamed the folder back to 'default', and then removed the 'x' character from the end of the actual theme folder that I wanted to use. And ta dah, it now works beautifully with the theme I wanted! Without any fancy code changes or messing around with reinstalling or removing etc. BOSH!!
Hope this helps a few people out. (obviously it's different strokes for different folks)
To get this out of comments --- this is a community wiki answer.
Are your two servers running on the same platform (Linux? Win?) or different ones?
Do you have the same collection of plugins on both platforms?
Here are some things to try.
do View Source on your white screen of death and see if there's anything in the source view that can help you diagnose your problem.
deactivate all your plugins, then try the theme.
if it doesn't work, then this theme is broken on this server setup.
reactivate the plugins one by one. One of them will probably give you the white screen of death. Then you know that plugin is incompatible with that theme.

Identify pages which refreshes automatically in my site

I have a site which uses wordpress. For some reason, some of my pages keep refreshing continuously. I am not able to replicate the issue continuously. However, in random I have seen some pages keep refreshing automatically. When I retry the same pages after few mins, it is working fine. My users also experiencing the same problem. When they report me the issue with a url and if I check that page it is working fine. So, I am sure the issue is there but unable to replicate the problem or troubleshoot the issue.
This is not a browser or system issue. The issue occurs with registered and unregistered users.
So, I need your help on this to troubleshoot this problem. Is there anyway to find out whether the page is keep refreshing by adding some code in wordpress theme php files like writing some sort of logs, etc.? So that I can try to troubleshoot the problem.
The same theme with plugins works fine in another site with other hosting provider. I have also checked with my hosting provider. They replied back and said they are not able to find any issues on their side and cannot help further, as the issue occurs in random.
Thanks in advance :)
This sounds like your site may have been hacked. Check the page source (View Source or Ctrl + u) for <script> tags that you don't recognize. If you are unsure, try disabling all of your plugins and use the default theme. If the issue persists, then it is most likely an issue with your site being hacked, and you should reinstall WordPress from scratch, and do fresh installs of all plugins and themes. If you are using a custom theme, upload a version that you know was working. Also, be sure to change passwords for your dashboard and hosting account.
If disabling a plugin or using the default theme makes the issue go away, then it's a bug with that particular theme/plugin. In this case, report the bug to the appropriate party (person/company responsible for the particular plugin/theme that's causing the issue).
How to Debug
Try to find a way that you can consistently test for the problem. For example, if you can refresh 20 times, and it happens twice every time, then you have your test to use. It sounds like it won't be as simple as this, but that's the basic idea... find the minimum number of times it takes to come across the issue on a regular basis, and test for it 3 times for each plugin you disable (and when you turn the main theme back on).

Categories