WordPress stuck in maintenance mode

, , , , , , ,

Sometimes WordPress may get stuck in maintenance mode and there is nothing you can do about it except this. Here is how to fix it.

Maintenance mode is on
Site will be available soon. Thank you for your patience.

Go to your server files where you have installed your WordPress site and find .maintenance file. Delete that file. That’s it.

If you have no access to these files you need to contact your support. Ask them to delete that file, so they don’t have to search for errors what might have caused this. Sometimes it just happens. There is nothing you can do about it.

WordPress jää jumiin huoltotilaan

Kun verkkosivustolle tulee ilmoitus:

Verkkosivuston aikataulutettu ylläpito on käynnissä.
Pahoittelemme häiriötä. Tule takaisin hiukan myöhemmin, olemme pian valmiita!

Jos sivusto jää jumiin ylläpitotilaan, toimi seuraavasti:

Mene serverillä hakemiston juureen, johon WordPress on asennettuna, ja poista sieltä tiedosto .maintenance

Jos olet pelkkä käyttäjä, eikä sinulla ole pääsyä tiedostoihin, ota yhteyttä palveluntarjoajaasi, tai sivuston ylläpidosta huolehtivaan henkilöön. Pyydä heitä poistamaan kyseinen tiedosto niin säästät ehkäpä kukkarosi nyörejäkin.

How to show variation prices in Woocommerce

, , ,

I’ve run into this thing many times and I lost the site where instructions are. So, I put it here – again. This is what it would look like after you make next changes.

Find functions.php from your template files and place this code at the end:

//Add prices to variations
add_filter( ’woocommerce_variation_option_name’, ’display_price_in_variation_option_name’ );

function display_price_in_variation_option_name( $term ) {
global $wpdb, $product;

$result = $wpdb->get_col( ”SELECT slug FROM {$wpdb->prefix}terms WHERE name = ’$term'” );

$term_slug = ( !empty( $result ) ) ? $result[0] : $term;

$query = ”SELECT postmeta.post_id AS product_id
FROM {$wpdb->prefix}postmeta AS postmeta
LEFT JOIN {$wpdb->prefix}posts AS products ON ( products.ID = postmeta.post_id )
WHERE postmeta.meta_key LIKE ’attribute_%’
AND postmeta.meta_value = ’$term_slug’
AND products.post_parent = $product->id”;

$variation_id = $wpdb->get_col( $query );

$parent = wp_get_post_parent_id( $variation_id[0] );

if ( $parent > 0 ) {
$_product = new WC_Product_Variation( $variation_id[0] );

$itemPrice = strip_tags (woocommerce_price( $_product->get_price() ));
//this is where you can actually customize how the price is displayed
return $term . ’ (’ . $itemPrice . ’)’;
}
return $term;

}

It’s better to show your customers price of the product right away than before variation is selected. Or maybe I just think it that way. Anyway, I wanted my customers to see no hidden prices.

Quick fix for WordPress white screen of death

, , , ,

Don’t you just hate it if you needed one simple answer and then you’ll have to read loads of text to get your answer or watch 10 minute video? Me too! So here is one of solutions how to fix white screen of death in WordPress sites. This really happens a lot also to me, too. There’s no need to remember everything. Just find solution for it very quick.

You need access to your file system. Find wp_config.php file from WordPress document root and edit it.

Insert this code to after a line that says:
/* Add any custom values between this line and the ”stop editing” line. */
(around line 84)

Insert next code:
define( ’WP_MEMORY_LIMIT’, ’256M’ );
Then save your file.
Problem should be solved! If not, you need to continue searching for another solution.

Can’t login as admin to Prestashop 1.7.8.6

, , ,

First of all, it is very important to keep you shop engine up to date exept if there are serious vulnerabilities in that version what you are going to upgrade into. When you reach the version that is stable, maybe it’s better to wait couple of versions before upgrading to newest version, just in case. This way you’ll know if new versions have any problems before you upgrade your online shop. It might save you from lot of trouble. I’m glad I have just done that, because one of the Prestashop versions was vulnerable to malicious injection. This Prestashop version was 1.7.8.6.

I run WHM controlled server and I get messages (tweaks) if something strange is happening in the server files. There is great plugin installed called Imunify what detects malware and viruses from server files. What a great thing! And this morning I had one of those messages in my mailbox waiting when I woke up. Message said something about malicious activity on some server, so I checked it out as soon as I could. (NOTE: not anything that was online)

Imunify is great because it shows what files are infected. And it really was one Prestashop version which is not online. I had upgraded it a while ago. It still got infected. Very strange. Even when the shop is not online anymore. So I just entered file system and checked these files.

It was not hard to detect malicious code that was injected into the file. It looked like this:

(Injected code in red highlighted area)

Malware code was located at the end of the file and I just deleted it and saved the file. What this code does is that it hijacks your shop. Meaning that admins can’t log into the Back Office, not even superadmin. Originally there were a lot more infected files than this. Luckily all infected files were found and there was also newer version available. Upgrading to new version overwrited (replaced) all infected files. Luckily next versions of Prestashop did not have that ”feature” and for now all shops are safe from this malware. At this point, newest version of Prestashop 1.7. is 1.7.8.8.

If you are merchant and you don’t have access to shop file system or WHM, you need to ask your technical support to upgrade your Prestashop and that will repair your shop. It will help.

Miksi et pääse kirjautumaan Prestashop 1.7.8.6 kauppiaspaneliin?

Ensinnäkin on erittäin tärkeää, että kauppaohjelmisto on ajan tasalla, jollei tiedossa ole haavoittuvaisuutta uusien versioiden kohdalla. Kun asennettuna on stabiili versio, on ehkäpä hyvä pysyä siinä hetken aikaa ennen kuin päivittää käynnissä olevan verkkokaupan uusimpaan versioon, jota ei ole välttämättä testattu uhkilta. Odottamalla hetken, ainakin uhkat tulevat ilmi, ja saatat välttyä niiltä.

Onneksi olin tehnyt näin, koska yhdessä Prestashopin versiossa oli suuremman luokan ongelma, nimittäin kaupan adminit eivät päässeet kirjautumaan kauppiaspaneeliin sisälle. Prestashoppiin oli asentunut jostakin malware joka kaappasi kaupan haltuunsa. Tämä haavoittuvainen versio oli Prestashop 1.7.8.6.

Pidä aina testikauppaa jossa voit testata vaikkapa uusia moduleita ja kokeilla kaikkia pikku muokkauksia.

How to enable Prestashop DEV mode from file system (FTP)

, ,

Prestashop version: 1.7.7.0-1.7.8.8.

This is about Prestashop ecommerce solution if you need debugging.

DEV mode shows errors that might occur in your shop. It is also recomended that php setting show errors. (File in root of the shop directory php.ini). Only Prestashop site admins are able to see errors when logged in into the shop.

display_errors = On

Open server files and go to:
/shop_directory/config/defines.inc.php
replace false with true
define(’PS_MODE_DEV’, true);
Save file

I had this situation that I upgraded my Prestashop from 1.7.8.5 to 1.7.8.8. Of course I upgraded one version forward at the time. But one of these versions did something to my shop and I couldn’t log in as admin to my shop. This is where I wanted to see if DEV mode would help. But I couldn’t log in. So I found this file in server where you can manually turn DEV mode on or off.

Scroll to Top