PHP’s is_numeric function

PHP is_numeric function

I’ve been wanting to write about PHP’s is_numeric() built-in function partly because I forgot all about it one day while validating one of my forms.

I get super anal about form validation because if it’s anything that’ll make or break your web application it’s security. Something dirty gets through your form it’s game over – or just bad data, bad quality. This means bad user experience – see how this kind of thing can trickle down through your application you worked so hard on?

Continue reading “PHP’s is_numeric function”

Expandable / Collapsible Text using jQuery

Expandable / Collapsible Text using jQuery

I’d like to first talk about my relationship with Javascript before I get into jQuery. I’ve known Javascript since the 90s, back when I was a young lad, Javascript freaked me out – I’ll admit I was really intimidated by Javascript more than I was with PHP. I mean they even have a modern looking official site for Javascript now that’s not so daunting.

Continue reading “Expandable / Collapsible Text using jQuery”

The PHP 7 Story

The PHP 7 Story - Rasmus Lerdorf

I’ve been craving me some PHP lately, not PHP code per se – I code in PHP on the daily. PHP was my first programming language – I fell for PHP the moment I saw it’s power, its force.

So this post is titled “The PHP 7 Story”, it sounded so cool. I’d like to give ALL the credit to Zeev Suraski for inspiring me to write this post. Yeah I didn’t know who this dude was either. I mean you probably know who “Rasmus Lerdorf” is if you’ve been programming in PHP a long while. So if Rasmus is the god of PHP, Zeev would be the demi god of PHP. Zeev gave a speech in Barcelona back in 2015 – yeah I’m so late to the conference attending game. My friends tell me I should get out and travel, makes me feel like a sheltered programmer but being a programmer is unlike any other profession or craft. Programming is within itself a traveling experience – yeah even time travel, anything is possible in the virtual world. Whoa I just felt like Neo from the matrix.

Continue reading “The PHP 7 Story”

React Fundamentals – ReactJS

React Fundamentals – ReactJS

I didn’t know what to title this post – I’ve got tons of thoughts about ReactJS. At the time of this post, ReactJS has taken single page apps to another level, well I shouldn’t say another level – it just sounded cool. Yeah there are others out there – I actually like Vue.js, it’s a much lighter version compared to react. And Angular(what version is out now) – I make mention of this framework with a little snark because I’ve wrestled with it many times in the past. At the moment I’m not really a big fan of Angular, sorry Angular but there’s just way too much stuff going on with you. Maybe things will change.

I wanted to make another post dedicated to just my thoughts on ReactJS but then I’ll be overthinking it and then I’ll end up going in circles. So let’s just get on with it.

Continue reading “React Fundamentals – ReactJS”

Using jQuery to automatically download a PDF file

Window Location Href in Javascript

I’ve been working through one of those client requests that isn’t use too often. They wanted a PDF be automatically downloaded after submitting their email (the only field on the form).

I started thinking about different scenarios, particularly this one:

If a visitor successfully completes the form and hits submit, should the PDF open on a new window tab or should it be automatically be downloaded?

Continue reading “Using jQuery to automatically download a PDF file”

WordPress – Advanced Custom Fields

WordPress – Advanced Custom Fields

Advanced Custom Fields (Official Site), this plugin is way too awesome not to mention. I’ve run into this WordPress Plugin (Plugin Page) over a dozen times in the course of my development work – I started realizing how powerful, flexible and stable this Plugin really is.

If you’re looking to add “Advanced”, “Custom”, “Fields” to your pages as the name suggests you’ll find a slick easy to use interface. Simply add the fields you want for your pages.

WordPress (backend) – Advanced Custom Fields Options

I myself thought I was all done – In this second step you’ll have to get your hands dirty with some PHP. Yeah this might be a little daunting if you aren’t tech savvy but you’ll be thankful you did, this all sounds cliche but for real practice makes perfect.

Continue reading “WordPress – Advanced Custom Fields”

WordPress AMP Plugin Errors due to New Relic Javascript Injection

Wordpress AMP Plugin Errors due to New Relic Javascript Injection

I was working on a high profile website under a big name and they had me implement the AMP plugin a couple months ago.

Pages were working great on mobile thanks to the WordPress AMP Plugin. Then after three months that’s when a bunch of errors started showing up on the Google AMP console and I later learned that these errors were very common.

Continue reading “WordPress AMP Plugin Errors due to New Relic Javascript Injection”

Big Commerce – Adding rel attributes to pagination

BigCommerce Adding Rel Attributes to Pagination

I was working on a BigCommerce site that needed rel attributes added to its pagination links. I’ve worked with BigCommerce sites in the past and I was curious if their backend had changed since then.

The rel=”next” and rel=”prev” link attributes are used to tell Google that each page in the series are unique – this eliminates duplicate content. This is similar to the rel=”canonical” attribute.

I dove right in – everything looked pretty much the same which was good, I needed that extra time to get familiarized again with where their template files were. I’m a big fan of BigCommerce – their backend is super slick. They’re working hard over there at BigCommerce.

Continue reading “Big Commerce – Adding rel attributes to pagination”

WordPress links with hashes and disabling a links normal behavior

WordPress allows for the creation of custom links within the Menu’s area. I like this feature, it has been around for years.

I use it sometimes to create internal and external links but there are cases where I wanted them disabled. In this case and as you may have experienced – a custom link requires a value. It’s pretty common to just put a hash “#” as a value.

Something like href=”#”. This however will cause the element to behave normally as it should – there’s nothing wrong with that except it will cause your page to “jump” back up to the top of the page which can be annoying for visitors.

Continue reading “WordPress links with hashes and disabling a links normal behavior”