Igor's Blog

Updating the FlatPress PostViews plugin to use a tracking pixel
FlatPress has a great plugin called PostViews that counts the number of times a blog post has been viewed. One of the issues I had with this plugin is it stopped tracking the number of views when I turned on HTML caching at my CloudFlare front end. Naturally the HTML was cached for most requests and therefore the plugin was never executed. The solution to this was to use a tracking pixel and set CloudFlare to disable caching on the tracking pixel itself so that I could capture each of the views.
CVE-2015-4399 Manipulation that targets missing input validation in SEO Metatag Info plugin for FlatPress
This is a description of a vulnerability I found in the SEO Metatag Info Plugin for FlatPress that allows an attacker to fill up the target web servers disk by issuing repetitive GET requests in a specific format. The download link to the plugin has now been removed from the user contributed plugin list.
Make FlatPress generate meta tags without the use of the SEO Metatag Info plugin
Meta tags are still very important for SEO (Search Engine Optimisation) and posting to social media. For example if you don't have the description meta tag for your blog post, Facebook doesn't show the page description. This makes these tags crucial for any blog. If you use FlatPress, there is the SEO Metatag Info available to generate these tags for you automatically, however, recently I've noticed that there is a security issue with this plugin which allows anyone to write arbitrary files to your server and I quickly disabled the plugin and came up with an alternative to generating the meta tags I needed.
SSL enabling FlatPress
Now that my blog is finally moved to a new host and SSL is fully set up, here's a quick note on how to make FlatPress work over HTTPS. By default, even if you change the Blog URL in the Options screen, FlatPress will not use that in all cases, the changes need to be done in the actual code too.
Blog activity graph for FlatPress
Here's a small addition to FlatPress. It's a blog activity graph that displays the number of blog posts per month over the past number of months. I got this idea when looking at the Cobertura home page and seeing their commit activity graph.
Add a URL shortener plugin to FlatPress
Ever since I've started sharing my blog posts on Twitter, I've wanted to have my own URL shortener. There was no such feature with FlatPress out-of-the-box, so I went ahead and made my own plugin. This post shows how to write a shortener plugin for FlatPress and then how to configure it to redirect from the short to real URLs.
'More on this blog' plugin for FlatPress
This plugin creates a box with a number of links to other posts on the same blog. The look and feel is configurable via CSS. By default it displays 4 random posts, but that can be changed via code. I created this plugin to expose readers to more content and also to create more internal linking.
Use URL parameters to dynamically set the FlatPress theme for testing
I've been trying to make some major changes to the theme on my blog recently and doing this on the live website is not a great idea, so I started looking into the FlatPress code to see how I could dynamically change the theme that it loads by specifying a URL parameter. The changes are straight forward, but do require modification of the core files.
Add metadata to Flatpress blog home and static pages using SEO Metatag Info Plugin
The SEO Metatag Info plugin for FlatPress makes it easy to add metadata to blog posts (entries) using the HTML meta tag, however the static and blog pages do not seem to have the same functionality out of the box. Looking at the code reveals that these pages can also have metadata stored and added to when they are displayed. Adding this is a more manual task compared to blog posts, but it is possible.
SEO Metadata Plugin removing quotes, punctuation characters
I've been noticing that the SEO Metadata Plugin for FlatPress has been removing quotes and other punctuation characters from the metadata. This makes any blog snippets on social media sites (Facebook, Google Plus, etc) appear unprofessional. The plugin can already preserve these characters, it just needs to be configured.
Adding Google search to a FlatPress theme
Although FlatPress includes a search feature, I found it to be quite limited, so I had a look at adding Google search to a theme in FlatPress and found that to be quite easy to do. There is some tinkering with the FlatPress code itself, however the end result is a fully working search for FlatPress that is backed by the power of Google.
Add FlatPress static page links to the sitemap.php site map generator
This question has been asked several times so I thought it was about time I've addressed it. Here's a bit of code that will add all of the static pages that are defined in FlatPress to the site map generator output.
Page view statistics generator for FlatPress
The PostViews plugin for FlatPress is useful and captures how many times a blog post has been viewed, what I felt it was missing was a way to show this information across all of the pages. To fill that gap, I wrote a small script that uses data that PostViews generates to visualise a histogram of all of the blog's pages and posts and views per post.
Flatpress is not Twitter Bootstrap friendly
I've been using Twitter Bootstrap quite a bit lately and am quite amazed how easy it makes to create good looking web pages, so I thought that I would update the theme on my blog to match it. I found out the hard way that Flatpress is not Bootstrap friendly at all and requires many hacks and edits to make it look right.
A better way to place AdSense ads in a FlatPress theme
In a previous post I talked about placing Google AdSense ads into FlatPress themes without violating Google policy. In this post I will talk about a better way to achieve the same effect: basically this comes down to making sure that a single ad unit is only shown once per page.
Download Counter BBCode Plugin for FlatPress
This is a plugin for FlatPress that adds a BBCode 'download' tag with a link to the file to download and a counter for how many times the file has been downloaded.
Adding microdata to FlatPress themes so Google can create rich snippets for a blog entry
Rich snippets provide a way for Google to display search results in a more structured way and give the user an idea of what is on the site with a quick glance of the search result. There is an overview on how to do this using microdata, which is non-intrusive to the web page and quite easy to get started with.
Adding a permalink to each FlatPress blog entry
Most blogs provide a permalink option for every blog entry, this is something I've noticed was missing from the FlatPress themes I've tried.
Adding Google AdSense ads to FlatPress without violating Google policy
When I started modifying the FlatPress theme I am using to include AdSense content, I wanted to be able to have the main blog page not displaying any ads within the entry, but when viewing a single entry, I wanted additional ads shown inline with the entry itself.
Adding the number of views to the FlatPress LastEntries plugin
One of the things I wanted to have on this blog was the ability to see how many views there were for the entries in one quick glance. The LastEntries plugin gives the list of last 10 entries, but does not show how many times each one has been viewed.
Adding a Google compatible sitemap to FlatPress
I could not find a FlatPress sitemap generator, the one that was available previously seems to be down now, so I've decided to write my own based on some of the SQL export code on the FlatPress wiki.

Previous Post

Next Post

Programming, DIY, Games, Hacks, Tech and more.
Follow me on...
Current and Past Projects
See my Resume


RSS Feed

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer

Recent Blog Posts

Handling visibility of mobile only pop-over DIVs on a responsive web site

WebLogic package-name element classpath generator script

Using Jersey 2.x as a shared library on WebLogic 12.1.2

Google DFP with AdSense fallback is causing infinite scroll pages to go haywire

Workaround for Mobile Safari scrollTop() not updating during scroll

Skipping execution of Maven plugins that do not have a native skip option

Unmarshalling an XML fragment representing a JAXB object without XmlRootElement

Injecting a ContainerRequestContext into a Jersey entity provider class

Obfuscating PHP source code with Maven and YAK Pro PO

Making use of corner shelves with easy to make slide out draws

Recent Galleries

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

Good Friday Electronics fun Easter Bunny LED PCB Kit IBEABU-01.0

Top Categories

Blogs I follow

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth


RAWS Parts Online
Alpha Dimensions Hosting
Kristensen Photography
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Follow me on... 
...or subscribe for updates!

Don't show this again