I’m optimizing my Meta Box plugin and I need a way to measure the project’s statistics such as complexity and maintainability. After searching on Google, I found PHPMetrics, a wonderful project that can help me understand lots of key metrics for a PHP project. The result is displayed in a HTML report with some graphs and table of metrics which are very easy to understand. I tried using it with the Meta Box plugin and here is the result:
There’s a question about regular expression on WPQuestions yesterday that received some interesting solutions. The question is replace all semicolons between
]]. I myself found a solution uses “e” modifier which I think interesting.
PHP has 2 types of comments: comment block (for long comments in many continuous lines) and short comment (for one line). When test code, if we don’t want to a block of code execute, we can disable it by turning them into comment blocks using
/* ... */, and when we want to execute it, just remove
*/ characters at the beginning and the end of code. This action is often repeated, and in this article, I want to share a small tip to make this process faster and easier.
There are various url shortener services on the Internet, you can use free services such as bit.ly, tinyURL or create your own url shortener using some open sources. In this article, I’ll show you how to create a simple page that shows short urls created by multiple url shortener services. I’ll use HTML5, CSS3 for styling as well as jQuery for working with Ajax.