When is Wordpress Auto-Update Process started - wordpress

I wounder how and when wordpress starts the auto-update process (if configured). I think on a (hosted) Webserver you cannot create a task for checking and starting updates for your website. Also, wordpress uses auto-updates out of the box without additional configuration.
So how does it work? When and how does wordpress check if there is a new version available? Does this happen when anybody visits your website and the update-function is started or are there other possabilities e.g. the webserver always runs an open thread for checking for updates and processing them.
I hope you understand my question.

Firstly, you can create a task for checking and starting updates, most commonly used is a cron job.
In wordpress 3.7 the automatic updates feature was added.
To enable it you add this to wp-config.php:
define('WP_AUTO_UPDATE_CORE', true);
In default-filters.php you will find add_action( 'init', 'wp_cron' );
It runs wp-includes/cron.php on every page load from a user, which will auto-update it.
So long answer short it checks whenever a user loads the webpage.

I believe it uses a cron job to perform this. The only restriction is that these jobs can only be run when the website is accessed from the server ie. when people are visiting it.
I've noticed this a few times with local copies, that whenever I open them up to browse them (after not viewing them for a while), I get a local email saying my Wordpress installation has automatically been upgraded.

Related

I am not able to logout from my WordPress website

I run a local classified that runs on WordPress with the Classiera theme, due to user demand, I created a local language version of the site, to sync users between the native language and the English version so that it feels like they are on the same platform whenever they switch back and forth, I made the two sites share one database, cutting the long story short, all things work well for both i.e, user sync, plus the ability to automatically update the user roles and details whenever users do so.
That has been the case for the past 3yrs. And even now, jumping through the different platforms shows all is fine.
The problem I have is, an abrupt misbehaving was reported a few days back by one of the site's users that he wasn't able to log out from his account. Whenever he tries, it takes him to:
https://sitename.com/wp-login.phpaction=logout&redirect_to=https%3A%2F%2Fsitename.com&_wpnonce=5ae4ad7b7d
I suggested clearing browser data on his PC but in vain. I also suggested that he switches to the local language side so he can log out but still, the same would happen on the local language site.
So, I embarked on investigating the issue by trying the following:
deleted the .htaccess file and Saved changes in the site's general parmalinks settings,
Tried troubleshooting for incompatible plugins by renaming them via FTP,
Did the same for the theme,
added the following code;
// Redirect WordPress Logout to Home Page
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_safe_redirect( home_url() );
exit;
};
to the theme's functions.php file. All haven't resolved the issue.
The logout brings you to:
https://sitename.com/wp-login.phpaction=logout&redirect_to=https%3A%2F%2Fsitename.com&_wpnonce=5ae4ad7b7d
If you type the site's url in the browser bar and reload, it still shows am signed in.
What might be the problem?
Tried troubleshooting with the four steps mentioned above but failed to rectify the issue.

Wordpress takes several minutes to load

I have a WordPress install that was running perfectly for years - https://electrofx.com
no changes or updates were made and it has started taking several minutes to load a page.
I have tried debugging via the wp-config file method, no errors can be found there.
I have tried restoring to one of the old backups that I know was working, no change.
I have tried disabling all plugins and switching themes, no change.
I have tried setting up a test page that is not WordPress and can confirm my hosting server is OK.
At this point I am at a loss as to what else I can try, does anyone have any suggestions?
When I have had similar issues, I checked the following:
The status of the MySQL database: e.g., is the database full?
The hard disk space of the server
The PHP version of the server vs the required Wordpress version. If you have made no updates on PHP but have kept Wordpress up to date, this could cause processing issues
Inefficient plugins that may not have been updated
A query is taking a long time. You can check the slow query log to see. As an example, I had an e-commerce site that was super slow, due to an inefficient query for listing the products
Check Google Pagespeed or other page speed test, to see how long the server response time is
It's not clear from your question whether 'no updates' means no plugin or core wordpress updates, or if you mean you haven't changed text / content on the site but have updated it.

wordpress site page infected with malicuious code

I have an issue with my WordPress site.
My website is generating adult pages which is not present on our website/database or server. It is showing in google search result like this for example siteurl.com/en/aarp-dating (around 500 pages google crawled) we have checked all our database and found around 30 new tables are automatically created and while we delete it after sometime it restore automatically.
How can I find the malicious code on my server/pages or what kind of problem is this?
Thanks in advance !!
Download the full installation, then compare the files' checksums with a clean backup or a fresh installation of the same WP + Plugins + Theme versions.
Most important: find out how they infected your site and close that hole or you will be back at square one in a short time after you've uploaded a clean backup. Check the Access Logs, filter out known IP addresses of you and your users, and look at the rest, especially POST requests. Also make sure to check the FTP-logs and (if you have ssh access to your host) auth logs to make sure that your/your coworkers' machines/passwords haven't been compromised.
Also make sure you don't miss any extra individual files or plugins that shouldn't be there.
You cannot trust what you see in the backend at this point, so check the database directly for new users you don't know and users with privileges they shouldn't have. Comparing with a recent backup can help.
Since it's not clear how long your site has been infected, I wouldn't trust recent backups (or any, really) either. Set up a fresh install after you found and fixed the entry point, then manually (or with a script, but be careful not to transfer back doors) transfer content to the clean install.
Use Wordfence Security Plugin & scan for infected core files of wordpress.
Use Sucuri plugin.
Also, desactivate ALL of your plugin and install a basic theme of wordpress before.

Restarting WordPress deployment on Google Compute Engine after prolonged instance stop

This one last shot before I delete my WordPress deployment installation on the Google Cloud Engine and start from scratch.
My WordPress site was working fine when first deployed about two months back. I then stopped the instance, as I didn't have time to work on it and didn't want to incur charges.
When it came to starting it last night, it seemingly starts ok, as per Google Developers console report, but the front end is everything, but ok. It is timing out, all I get is the index page (after a long time), but without any css and I can't get onto any other pages.
I can connect to the server using ssh command, I can even see the files via SFTP and I can't see anything obvious in phpmyadmin.
Does anybody have any pointers? What other info do you need? Sadly the documentation on Cloud Engine Wordpress deployment is very thin to offer much guidance beyond one click deployment.
Many thanks for any help.
ZONE
asia-east1-a
MACHINE TYPE
g1-small
IMAGE
wordpress-debian-7-wheezy-v20150127
WORDPRESS VERSION
4.1
HTTP traffic is allowed.
Update 26/03/2015:
As #Paolo P pointed out the problem was in the Google Compute Engine assigning an ephemeral address, which was replaced by a new one once the instance was restarted. To fix the issue I did:
login to phpmyadmin >wpdatabase > wp_options > edit siteurl and home with the new url.
edit wp-config.php > add (swap example.com for your new url):
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
at this stage your front end will be still unavailable, next
login to /wp-admin, which seems to update some settings in the background and voila, your front end is available at the new address.
comment out/delete the above code from wp-config.php once your site is back up and running again. If you don't, you won't have the ability to change the site urls within the WordPress content management end.
Some further info on changing site url is here. Note, I didn't have to touch functions.php to make it work https://codex.wordpress.org/Changing_The_Site_URL
If your instance had an ephemeral IP it could be changed after stopping it as documented here. After boot Wordpress internal configuration is still referring to a different IP and hence is not finding CSS and other page components.
Assign a static IP to instance and change WP configuration files accordingly. Note that some configurations may need to be updated inside DB data too.
Regards,
Paolo

Cannot see changes in Wordpress in FTP client and vice versa

I am having some problems with Wordpress 3.7. I think they may be related and have something to do with a file ownership/rights issue but I am completely stuck.
I am using the default theme and I have uploaded a new header image
several times through the WP admin interface. Now that I am happy
with the image, I want to delete the old images. Firebug tells me
they are in [my wp root]/wp-content/uploads/2014/01. However, in my
FTP client, this directory is not visible. I only see [my wp
root]/wp-content/uploads/2013
.
When I log into the Wordpress admin interface, it tells me I should upgrade to 3.8. When I tell it to go ahead and give it my FTP credentials, it begins but gets stuck at "Verifying the unpacked files…". I get no error messages and when I give up and leave the page, there are no reports about a failed update. It just keeps showing me the "please update" message.
I am using the default theme and want to change style.css. I cannot do this in the theme editor, it tells me I have to make the file writable first, even after I give all the theme files 777 access in my FTP client (which probably is not a good idea). If I edit the file offline instead and then upload it via FTP, this doesn't have any effect. I can even delete the entire file and still nothing changes at the frontend.
I have tried to create a child theme through the FTP client but it does not show up in the WP backend.
The site is on a shared hosting platform. I can't find the details at the moment but it's a fairly regular setup (Linux, Apache, MySQL). I am testing in Firefox and caching is turned off. If I log out, and log back in again: same problems.
It is almost as if I am FTP-ing the wrong computer but I am really not. What am I missing?
Problem solved. I finally asked my hosting provider and as it turns out they had adjusted a few settings, making them too restrictive.

Resources