WordPress Error: Site Downloads PHP Files Moving to another host from BlueHost

Recently I had a client  on Dreamhost come to me with a problem where the wordpress files would download to their computer. I know this problem well, usually it’s a php handling error, basically php is not parsing the file and the file is being served as a download. The first place to look for something like this is the .htaccess (the client was running apache). I found the following code in the htaccess

AddHandler application/x-httpd-php70 .php

So removing this piece of code brought the site back up, but how did it get there?

After a bit of research and digging around I found that there was a plugin created by bluehost called Endurance PHP, I asked my client if the site in question was previously on bluehost and they confirmed. So the client built the site on Bluehost then transferred it to Dreamhost and a trigger of the permalink rewrite added the “AddHandler” code into the htaccess.

So to fix the issue all I had to do was remove the 3 files from


The files in question area


After removing the files you need to also delete .htaccess file and then go settings and save permalinks (generating a new .htaccess file)

This is why I always recommend a reputable host like Liquidweb!

Optima Express Yoast SEO integration

Recently a client came to me with a problem with a popular WordPress plugin called Optima Express by ihomefinder which looks like a great IDX plugin for real estate companies. The problem was that it did not support Yoast SEO. This is a huge problem considering Yoast is one of the biggest SEO plugins out there and it was basically passing no title tags to properties.

After inspecting the code I noticed Optima was forcing it’s own data onto a page post type and passing it as ID 0. This results in problems for Yoast or anything else using the post object because basically it was trying to find a title for an ID that did not exist.

To fix this we need to repass the title from the post object to the filters supplied by Yoast SEO. Here is the code, you can place this in your functions file or make a plugin for it.

WordPress Document Manager – How to send an email after download

Recently someone came to me with a problem, they needed to fire off an email from the popular wordpress plugin Smarty Pants Client Document Manager. The plugin did not have that default functionality but it does supply the hooks to do so.

To attack this issue we needed to find two hooks

“sp_download_file_after_query” Which fires after a user has downloaded a file

“sp_cdm_settings_email” which adds a system email to the settings page

In the email settings function we are just creating a simple email that is integrated into the smarty email editor.

In the function we created for the download you can see how we took the file array and from that array got information about the file owner, project owner and current user. With that information we can take the content from the email we created and do anything we want with it. In this instance I’m taking the file owner and sending them a notification that someone has downloaded a file.

Since we built this into the email manager you have full use of the email shortcodes, so that makes this method versatile to do pretty much anything from emailing to submitting information to 3rd party APIs. Check out the plugin here and the code below.

Retry WooCommerce Subscriptions gateway failed renewals

Recently I had a client come to me who had a gateway error, woocommerce subscriptions was not processing renewals correctly. So after a few days we fixed it but there was about 600 failed renewals for $5 each that needed to be re-entered. Since woocommerce doesn’t have a way to to do this I needed to create a script that would loop through failed and pending orders and try the renewal again. If you use this script just create a plugin file and navigate to ?retry=1  or use the funciton in your own file!


Restaurant Biller 2.0 Released (Restaurant Online Ordering application)

Restaurant Biller 2.0 has been released and has moved out of beta, this new release includes features not seen in any online ordering application available on the market. With the help of existing clients recommending features  and the many hours put into to developing the code we have streamlined the whole Restaurant Ordering process. Below are the new  features listed.

    • Product and Category Images
  • Ability to re-order what you have ordered previously
  • Category and Product Images
  • Better templating system
  • Multi restaurant support with a special page to choose the restaurant you want
  • Multiple currency support.
  • Coupon manager
  • Delivery zone feature which allows you to add zones to each location, you can choose a delivery fee per zone.
  • Add a tip to the order in checkout by percentage
  • Billing addresses for users who have different information then the profile information
  • Categories now have the ability to have a display time (for instance if you would like your breakfast menu only to show up between 7am and 11am
  • Each restaurant logo can be managed through the config page
  • Blackout times for when your store is closed (If you are open 9-6  but you stop serving between 12-3)
  • Minimum order for delivery
  • Limit delivery area by zip codes
  • Full reporting and analytics center to show you your revenue, orders, popular products, popular pages, how many orders were delivered and how many orders picked up.
  • Enhancements to the order manager inside the admin panel, you can now see the order information better and logs more information. One minor set back to this is we removed the ability to set the store into “no-registration mod”
  • Site Document editor

That is about it as well as bug fixes and all around usability enhancements.  Check out this exciting new release at RestaurantBiller.com

Redirect mobile users to a mobile friendly page with php

After allot of trial and error I ended up coming up with some code that will redirect users to a mobile friendly page, this method won’t really be useful in about 5 years because modern browsers like safari allow full page viewing but this will get you by until then. Remember this code will have to change constantly if you want to stay up to date with the latest hand held devices and mime types.

To get started all you have to do is place the following code in the stop of your php page. If your loading an application you can post this below your application just don’t output any data before the code is executed. To get started making mobile friendly pages you can purchase your domain names and hosting by clicking here.

$mobile_browser = '0';if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i',

if((strpos(strtolower($_SERVER[‘HTTP_ACCEPT’]),’application/vnd.wap.xhtml+xml’)>0) or
((isset($_SERVER[‘HTTP_X_WAP_PROFILE’]) or isset($_SERVER[‘HTTP_PROFILE’])))){

$mobile_ua = strtolower(substr($_SERVER[‘HTTP_USER_AGENT’],0,4));
$mobile_agents = array(
‘w3c ‘,’acs-‘,’alav’,’alca’,’amoi’,’audi’,’avan’,’benq’,’bird’,’blac’,

if (strpos(strtolower($_SERVER[‘ALL_HTTP’]),’OperaMini’)>0) {
if (strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’windows’)>0) {


//change this to your mobile friendly page
header( “Location: http://www.yourwebsite.com/mobile/” ) ;
} else {
// do something else

if (stristr($ua, “Windows CE”) or stristr($ua, “AvantGo”) or stristr($ua,
“Mazingo”) or stristr($ua, “Mobile”) or stristr($ua, “T68”) or stristr($ua,
“Syncalot”) or stristr($ua, “Blazer”) or stristr($ua, “NetFront”))

//change this to your mobile friendly page
header( “Location: http://www.yourwebsite.com/mobile/” ) ;


Added Pizza Builder to Online Ordering Application

A new feature has been implemented into the pizza builder application, you can now build your own pizza using the new feature. This process has been simplified for ease of use. The pizza builder application is completely configurable in the administration section of the website. The admin section allows you to add different types of pizza, assign sizes, names, prices, toppings and topping prices. This feature also gives the pizza owner complete details of what the customer ordered.

To view a demo of the pizza builder click here

Online food ordering script “Restaurant Biller” released with pricing!


  • Easy AJAX powered checkout system
  • Receive the orders directly through email within 30 seconds of placed order
  • Easy customization for those who want to modify their site
  • Set the hours you would like your store open
  • Turn your store off and on through the administration panel
  • Enable Credit or disable credit cards
  • Enable or disable delivery and delivery fees
  • Modify your home page directly from a control panel
  • Add Edit and delete categories to your menu
  • Add Edit and delete menu items with extented features
  • Each site has a contact us page for customer questions
  • Edit the hours you would like your online store open
  • Add an addition cost for delivery, tax prices or order processing fees
  • Built In newsletter system
  • Free updates

Click here for a demo

Cubecart Mass (bulk) price changer

This module will change the product prices of all products or the categories you select. You can pick add/subtract and choose if you would like to use addition/subtraction or percentage.


  • Add or subtract an amount or percentage
  • Preview the changes before making any changes
  • Choose all products
  • Choose just a certain category
  • Complete product price updates painlessly and quick!

Price: $10

Ajax Cubecart custom category order 2.0

Hi there, here’s a little Christmas present from me to cubecartforum.org community.

I thought I would make a new post for this considering this is a full rewrite of my original category ordering mod. This version uses ajax for all the work. All you have to do is type the position number into the text box and ajax takes care of the rest! Works in real time!


Click here to download: category sorting mod