Cannot modify header information – headers already sent by… WordPress Issue

When running script, I am getting several errors like this:

Warning: Cannot modify header information – headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23

 

Possible solutions

  1. header("Location: $location", true, $status);

    with

    echo "<meta http-equiv='refresh' content='0;url=$location' />";
  2. Most of this trouble comes up because of undesirable whitespace(s) somewhere before the first "<?" and after the last "?>" in a php script. Use Notepad2 or something to edit code and better try to use in-built on-line theme editor in the admin console. Try to find and eliminate all undesidrable whitespaces in every theme’s php file and resave those files.
  3. The long term answer is that all output from your PHP scripts should be buffered in variables. This includes headers and body output. Then at the end of your scripts do any output you need.

    The very quick fix for your problem will be to add

  4.  
    <?php
      ob_start();
    
      // code 
    
     ob_end_flush();
    ?> 

cast_sender.js console error

Recently I have started seeing cast_sender.js console errors in one of the websites.

Issue here was It’s the JavaScript code inside the YouTube iframe polls for the extensions it could interoperate with in case they were installed (likely to determine if the extension is installed).

cast_sender.jschrome-extension://boadgeojelhgndaghl…
cast_sender.jschrome-extension://dliochdbjfkdbacpmh…
cast_sender.jschrome-extension://enhhojjnijigcajfph…
cast_sender.jschrome-extension://fmfcbgogabcbclcofg…
cast_sender.jschrome-extension://pkedcjkdefgpdelpbc…
cast_sender.jschrome-extension://fjhoaacokmgbjemofl…

A simple solution – To stop seeing those cast_sender.js errors, edit the youtube link in the iframe src and change embedto v

E.g. If you have a link ” https://www.youtube.com/embed/pw6wBn1pgA8 ” Just replace to look like ” https://www.youtube.com/v/pw6wBn1pgA8 “

How to Remove line breaks _x000D_ from Excel data sheet

1 – Select the cell(s) that contain line breaks you wish to remove

2 – Press CTRL + H on your keyboard. This opens up the “Find and Replace” dialog box.

3 – In the field “Find what” where you would normally type the word/text you want to replace, you need to enter the following : ALT + 010
>>> Keep the ALT key pressed, while typing 010 using the number keypad of your keyboard (problem if you’re working on a laptop, keyboard doesn’t include number pad). You should then see a dot appear briefly then disappear in the field “Find what”.

4 – In the field “Replace with”, just enter a space (a normal blank space using your keyboard space bar)

5 – Hit “Replace All”, and all your line breaks should be gone.

Excel formula: Get percentage discount

percentage discount

If you have a discounted price and an original price, and you want to know the discount as a percentage, you can calculate the percentage discount using a formula that divides the discounted price by the original price and then subtracts the result from one.

Generic formula
= 1 - (discount_price / original_price)

How the formula works In the example?

Excel first divides the discounted price by the original price in to get value, which is then subtracted from 1: =1-(59.5/70) =1-0.85 =0.15

Note that the result is a decimal version of the percent, and must be formatted using the Percentage number format in Excel to display as a percentage.

How to Block lifehacĸer.com and o-o-8-o-o.com Google Analytics Referral Spam

spam-in-google-analytics

A Russian referrer spammer has registered various domains that use special figures – with those special figures the spammer is able to register domains like lifehacĸer.com and  hxxp://o-o-8-o-o.com/

The spammer uses the following URLs in the spam run (this is just a small portion):

  • hxxp://o-o-8-o-o.com/
  • hxxp://lifehacĸer.com/new-revolutionary-shell-from-lifehacĸer.com/

If you want to filter the spam run from your analytics data, then simply use the following steps:

fake-lifehacker-site-lifehacker-com_

Create an Exclude Filter

1. Open your Google Analytics account and go to the Admin tab> Cick Filters on the right side in the VIEW section.

2. Click the + ADD FILTER button to create a new exclude filter.

3. Add lifehacĸer.com or something you can easily remember as the Filter Name.

4. Select the Custom Filter Type.

5. In Filter Field, find and select Campaign Source in the list. In the Filter Pattern text box, add lifehacĸer.com and click the blue Save button on the bottom of the webpage. To add multiple URLs to the same filter you can make a Filter Pattern similar to this with a | between each URL: Example.com | Example\.com | lifehacĸer.com | o-o-8-o-o.com

referal-spam-itechengine

 

How to block Lifehacĸer.com referrer spam using your .htaccess file?

If you are aware of a way to access your .htaccess file, you will just have to write the code below in there…

## SITE REFERRER BANNING

RewriteCond %{HTTP_REFERER} Lifehacĸer.com [NC,OR]

RewriteCond %{HTTP_REFERER} Lifehacĸer.com

RewriteRule .* – [F]