WordPress 4.4 and missing images

December 11, 2015 at 4:11 pm | Programming, web, Wordpress.

If you have upgraded your WordPress to 4.4 and have a secure HTTPS URL, you might be experiencing image problems due to a mixed content URL message in the browser. Some browsers will display the content and give you a message that it is mixed and some will block the content all together.

The new WordPress responsive sourceset image addition could be the problem.

The image itself is coming from the HTTPS secure URL, but the alternate image sizes in the image sourceset tag might be coming from HTTP if your config.php URLs are set a certain way.

This will cause image problems.

define('WP_SITEURL',     'http://www.NAMEOFYOURSITE.com/');
define('WP_HOME',        'http://www.NAMEOFYOURSITE.com/');
define('WP_CONTENT_URL', 'http://www.NAMEOFYOURSITE.com/wp-content');

This will fix it.

define('WP_SITEURL',     'https://www.NAMEOFYOURSITE.com/');
define('WP_HOME',        'https://www.NAMEOFYOURSITE.com/');
define('WP_CONTENT_URL', 'https://www.NAMEOFYOURSITE.com/wp-content');

If you want to be able to have your local dev site without https in those variables you can just do a switch statement in the config.php based on the URL.

switch ($_SERVER['HTTP_HOST'])
{
	case 'NAMEOFYOURSITE.com.dev':
                 define('WP_SITEURL',     'http://www.NAMEOFYOURSITE.com/');
                 define('WP_HOME',        'http://www.NAMEOFYOURSITE.com/');
                 define('WP_CONTENT_URL', 'http://www.NAMEOFYOURSITE.com/wp-content');
		break;
	case 'www.NAMEOFYOURSITE.com':
		define('WP_SITEURL',     'https://www.NAMEOFYOURSITE.com/');
                define('WP_HOME',        'https://www.NAMEOFYOURSITE.com/');
                define('WP_CONTENT_URL', 'https://www.NAMEOFYOURSITE.com/wp-content');
		break;	
}

Magic Mouse keeps disconnecting from bluetooth – FIX

July 31, 2015 at 3:19 pm | Apple, Apps.

F**king MOUSE!

If you have been having trouble with your Apple Magic Mouse or keyboard and it has been driving you bonkers like these people. https://discussions.apple.com/thread/2217770?tstart=0  You might start to look at the other devices and Apps around you that might be causing the problem.

My Apple Magic Mouse had been working perfectly fine for years when all of a sudden everyone in the office started to have the same problem. People on the internet kept saying it was the “Size of the batteries” or “the battery connectors”. If there was a crazy crackpot way to fix it, I tried it. But it didn’t work and I Knew that it wouldn’t. My reasoning was that this problem was something new since my mouse had been running fine for years before this. Software update?

It drove me CRAZY.

Along comes a knock on the door

It wasn’t until my office neighbor knocked on my door did I figure it out. My neighbor asks if there is a person named “Bob” (name changed to protect the guilty) here. I say he’s not here today but yes, Bob is in my office. They proceed to tell me that Bob’s computer is constantly screwing with their bluetooth mouse and it’s driving them crazy. How can this be? He is not even here.

Turn’s out “Bob” has installed a cool little App that unlocks in login screen when ever he is close by using Bluetooth and proximity. Kinda like this. http://nearlock.me/

What the App is doing is constantly looking for the iPhone App to see if it can unlock the computer. EVEN in sleep mode. Which means that even though “Bob” is not here, his computer is still screwing with everyone’s bluetooth peripherals.

Inbox and Authenticator App

December 16, 2014 at 11:46 pm | Apple, Apps.

Kinda strange that the Google Authenticator app can copy a code from it’s iPhone App but the new Inbox App for iPhone can’t paste that code into the 2 part authentication screen.

hmm shouldn’t these work better together?

Mobile first or age before beauty

December 10, 2014 at 11:36 pm | Design, SASS, web.

Mobile first for email. Oh course. Right?

There are more mobile devices accessing your content, why wouldn’t it be mobile first? Well because mobile doesn’t need any help. It is the faster more nimble sibling to it’s slower desktop and browser based elders.

Mobile first means that the styles in the head are for desktop. If gmail or other older email clients can’t parse or strip the styles in the head of the email, then the email will of course look bad in desktop or older clients. That doesn’t work.

The ramps on the sidewalk are not there because teenagers need help getting across the street, they are there for the older less able people. The desktop and browser based siblings of mobile email who need a little help crossing the street.

Go ahead and take a look at the list of email clients and the css media queries they are able to use and you will probably reach the same conclusion. Mobile email clients are better able to deal with modern css/html based email much better than most browser based or desktop based clients. Well at least with the exception of Gmail clients. They alone seem to have taken a page out of Outlooks book with things they will not do. Which is surprising considering how much Google did not want to be Microsoft.

For email it has always been, “Age before beauty”. Which means of course “Make it look good on older email clients first because the newer ones don’t have as many problems as the old ones. Kind of like the crosswalk. The ramps are not there for the younger more nimble people. They are there for the older or less able.

So what does desktop first email look like?

Desktop first email doesn’t look much different from mobile first email really. The exception is that the styles embedded inline in the email are for desktop and the media queries in the head of the email are for mobile clients. That is it. Since most mobile email clients will see and change the layout when they see the media queries in the email head, they are able to adapt. Unlike your aging parents/grandparents/uncles who need help understanding “The Twitter” and “The Facebook”.

Info at Litmus. https://litmus.com/blog/understanding-gmail-and-css-part-1

Great infinite Scroll in WordPress

December 4, 2014 at 11:11 pm | web, Wordpress.

If you are looking for a plugin to do infinite scroll in a WordPress category or author page in your site, look no further than infinitescroll.com

This plugin is everything that you will need. The surprisingly great plugin settings can control the id of the element that holds the post items among other things. And even setting a list of callback functions to run after the plugin has loaded new posts.

WordPress uploads folder permissions problem

at 11:06 pm | web, Wordpress.

If you are self hosting a WordPress blog install at some point you have run into a problem with permission or know someone who has.

Mostly it surrounds the uploads folder for your media. The internet is filled with threads about the problem. Do yourself a favor and don’t do as some people suggest and set the folder permission to 777 to fix the problem.

The first problem might be that the apache user that WordPress uses to create folders does not have permission to create the new folders. Usually the user is part of the www-data group. But not always. If you have the correct permissions you can update the owner of your uploads folder and subdirectories. su to the root user or use sudo on the commands.

Set ownership of uploads folders except .svn folders.
find /path/to/uploads ! -iregex .*\.svn.* | xargs chown -v webmaster:www-data

Next lets update any folder permissions in the uploads folder. Minus folders you don’t want to change. In this case .svn folders.

find /path/to/uploads ! -iregex .*\.svn.* -type d | xargs chmod -v 775

Now lets correct any permission problems with files in the uploads folders. Same thing with folder you don’t want to change like .svn

find /path/to/uploads ! -iregex .*\.svn.* -type f | xargs chmod -v 664

iOS Simulator in your App dock

May 6, 2014 at 10:24 am | Apple, web.

Where exactly is the iOS Simulator when you need it? Do you really need to open Xcode every time in order to just open the simulator? Why can’t you find it in finder or in Spotlight?

Here is a quick time to make the iOS Simulator easier to access.

1. xcode_package_contentsFind Xcode in your Applications folder and right click on the icon. Choose “Show Package Contents” (Apps are nothing more than folders that hide the contents)

2. Find the iOS Simulator App Alias in Contents>Applications and drag this icon to your App bar on your desktop. (An alias of an Alias)

ios_simulator_app

If you haven’t already notice, there is a handy way to debug pages in the iOS simulator that is installed with Xcode.

Once you open iOS Simulator you can then open Safari on your desktop and in the Develop > iPhone Simulator menu your can select the page you want to debug. Super handy!

Compass NilClass

March 5, 2014 at 1:54 pm | Programming, SASS, web.

Had some awesome fun with a compass sass –watch statement today. The problem that I ran into was related to image sprites.

A statement like this.
sass --watch --compass --sourcemap _css

Would get me this. And compass would quit on me.

NoMethodError: undefined method `parent' for nil:NilClass Use --trace for backtrace.

The problem, it turned out, was related to the name of the images that the sprite was building from. Compass does not like integers at the front of the images and will quit and not compile when it sees them.

Other people have seen this same error and it could be related to the image_dir name in the config file like here or here, but this is another problem that you might run into.

“You like integer named images in a compass sprite folder. Nil Class” – Russell from Fat Albert.

Bad svn no donut!

November 19, 2013 at 3:49 pm | Programming, web.

The following command line in subversion will get you the response “At Revision 1234”. What this should be doing is updating the file to a specific revision. But what it should really say is “There is no file, you crackhead.” since there is no file at that location in the file system. How exactly can nothing have a revision number?

svn up -r1234 /nodirectiry/nofile.html

Google utmz cookie values

September 24, 2013 at 9:40 am | blabbing.

When trying to get values from PPC campaigns into marketing automation or into form fields, it’s always helpful to know what fields inside the Google utmz cookie match to which fields. Here is a basic list of the variables in the cookie and how they match up.

utmcmd => Medium
utmccn => Campaign
utmctr => Keyword
utmcsr => Source