Fix “Failed to send your message. Please try later or contact administrator by other way.”

I am using Contact Form 7 on one of WP sites and after update (not sure which one) I started getting this error after user submitted the form:

‘Failed to send your message. Please try later or contact administrator by other way.’

As always, lots of way to complicated solutions on the net when, in my case, the solution was simple.

This is what I had before (CF7 admin):
wrong mail contact form 7

And this is the one that works (I just replaced data in the FROM field):
correct mail form 7

of course you need to replace domain.com with your domain.

I do not know why did it worked before and why it stopped working but this is how I solved it. Of course you cant just hit reply now because your email is REPLY email. To solve this you can try this :

Contact Form 7 has a field called “Additional headers:”. Enter (literally) Reply-To: [your-email] and save.

Where are Desktop Viber Avatars located on PC?

If you want to see all the avatars / photos that your Viber contacts use for avatars (even old ones) then you can find big sized images here (this is only for Windows):

DRIVE:\Users\YOUR WINDOWS PROFILE\AppData\Roaming\ViberPC\YOUR PHONE NUMBER\Avatars

so for example if your drive is C, your windwos profiel is FooUser and your phon is 555-55555 then you can find it here:

C:\Users\FooUser\AppData\Roaming\ViberPC\55555555\Avatars

Bootstrap xs, sm, md, lg breakpoints in pixels and devices

For some reason I keep forgetting these breakpoints and have to search them on the net.

Bootstrap breakpoints in pixels:

  • xs = 0-767 pixels
  • sm = 768-991 pixels
  • md = 992-1199 pixels
  • lg = 1200 pixels and up

In other words,

  • xs is for extra small devices (phones, less than 768px)
  • sm is for small devices (tablets, 768px and up)
  • md is for medium devices (desktops, 992px and up)
  • lg is for large devices (large desktops, 1200px and up)

WordPress not showing latest WP version available

I wanted to update one of my WordPress sites from 4.2.2 to the latest but WordPress did not show me there is a new version available even though WordPress is already on version 4.3.

If this happens to you the first thing you should check is to see if there is this line in your wp-config.php file :

define( 'AUTOMATIC_UPDATER_DISABLED', true);

In my case it was, so I set it to false however it sadly didn’t resolve the issue.

If the same thing happens to you then I suggest you to install this awesome plugin (just look at the ratings):

WordPress Fence

It immediately found out that WordPress code files were modified by cPanel (most probably if you installed WP via your hosts cPanel), which added few lines to core files that prevent WordPress to show updates (something with incompatibility). Word Fence then offered a bulk replace and replaced these modified files with the clean WordPress core files. Refresh and WP immediately offered and found update to latest WP.

Unity3D – MissingReferenceException: The object of type __ has been destroyed but you are still trying to access it

If you get this error:

"MissingReferenceException: The object of type __ has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object."

then the first thing you should do is to check if you have (additional) inspector window locked. Simply unlock it (you can see the small lock in top right corner of inspector window) and this error should go away.

unity3d inspector lock
I have no idea what is causing it (I am just starting out with Unity) but this solved it. Luckily I found the answer quite fast and did not need to debug and waste a lot of time checking the code when the code was completely fine.

Start Menu Search Remains Empty in Windows 10

I installed Windows 10 and after some time search in start menu stopped working. No matter what I typed in, the menu remained empty and the small dots going from left to right (search progress animation) just kept moving and nothing showed.

This is how to solve it: open Task manager (press CTRL + SHIFT + ESC), go to Details tab (If you don’t see it there then check Processes tab) and stop Cortana or SearchUI.exe. Just right click on the task then select End Task. After you end Cortana try searching again.

Get WordPress Post ID Outside the Loop

It is easy to get a post ID in WordPress. To echo it on screen we write:

 <?php the_ID(); ?>

To store the ID into variable we use something like this :

 $id = get_the_ID();

There is one caveat though: if you read the description on WordPress codex it says this in both cases: This tag must be within The Loop.

So if you ever wanted to retrieve or display the WordPress post ID in footer or header or outside of The Loop you might end up being disappointed because the ID returned is not the correct one (usually we always get the same id, most probably the last one?)

Now I am not going to go into technical details or why is that so here is the solution that worked for me. You

$post = $wp_query->post;
echo $post->ID;

There are some other ways with global variables and some other but it seem it doesn’t work for everyone. This one worked on the first try. Let me know in comments if it doesn’t work for you.

Turn On Error Reporting on WordPress Blank / White Screen of Death

There is nothing worse than getting blank screen when developing for WordPres – also ‘officially’ known as The White Screen of Death – because you have no idea what went wrong. No errors, nothing useful, just blank screen. It’s even worse when it just appears out of nowhere. This happened to me few times in the past and then just recently. Woke up in the morning and the entire site (not this one) displayed just blank white page.

First thing you should do is rename the plugins folder and see if it works. If yes then the problem is in one of the plugins so if your admin works start disabling plugins one by one. If admin doesn’t work then try renaming plugin folders via FTP. If this doesn’t help then rename the themes folder and see if the problem was caused by one of your theme.

This didn’t help in my case. So I went to WordPress site (link below) and insert the code they recommended! It STILL didn’t work and there were no errors displayed! So finally I modified the code a little and finally the error appeared! I don’k know why are they posting a solution that doesn’t display the errors.

Here is the code that started showing errors and I finally able to fix it. Still the mistery remains why did the blank screen start appearing when it was working just fine yesterday when I went to bed. Ah, the ‘joys’ of developing.

Open the wp-config.php file in the root directory of your worpress and insert this just above the /* That's all, stop editing! Happy blogging. */ comment. Refresh the WordPress and hopefully you will see PHP error telling you what went wrong.

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Enable display of errors and warnings 
define('WP_DEBUG_DISPLAY', true);
error_reporting(E_ALL);
@ini_set("display_errors", 1);

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);

After you fix the error don’t forget to remove or at least comment the added code.

In case it didn’t work, here are some more steps to try to fix it:

Common WordPress Errors and Debugging in WordPress

Redirect all requests for the domain root to a specific page

This is for WordPress but can be used in any site because it uses .htaccess.

I needed to redirect all visitors that visit the root URL (for example elcoderino.com) to specific subpage (eg elcoderino.com/subpage). WordPress allows you to create a static front page or select a custom page that will replace default front page content but in my case it just didn’t work. Maybe it was combination of Advanced Custom Fields or custom post types but it just kept messing up the front page.

So the solution is to add this to your .htaccess file:

RewriteEngine On
RewriteRule ^$ /subpage/ [R=301,L]  

if your .htaccess file already contains RewriteEngine On then simply just add RewriteRule ^$ /subpage/ [R=301,L] below it.

WordPress plugin Visual Editor Custom Buttons makes Visual Editor toolbar disapear

I wanted to add custom buttons to WordPress editor so I installed Visual Editor Custom Buttons, made a new button (it’s really easy and intuitive) but when I wanted to create new post or page I encountered a problem: Visual Editor toolbar completely disappeared.

Long story short, plugin creates a new javascript file (button-1-1.js, …) every time you add a new button. The javascript file is created in the plugins js folder (it will most probably be wp-content/plugins/visual-editor-custom-buttons/js). The problem was that plugin somehow fails to write (insufficient permissions) to this folder so it is unable to create these files. After you created a new button you should open the aforementioned js folder and check if there are files named similar to button-1-1.js. If not then this could be the problem. You will most probably need to delete and add the button again after you change the permissions of folder js to 777.

The solution was to simply change folder permissions to 777 with FTP program (FileZilla : right click on folder and select File Permissions… option)