<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Usama Muneer on Medium]]></title>
        <description><![CDATA[Stories by Usama Muneer on Medium]]></description>
        <link>https://medium.com/@usama.muneer?source=rss-e078436a4d5f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tpX2ei7suVJj6f87jDzZuQ.png</url>
            <title>Stories by Usama Muneer on Medium</title>
            <link>https://medium.com/@usama.muneer?source=rss-e078436a4d5f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:52:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usama.muneer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Start a WordPress project with Timber using Pine CLI Tool]]></title>
            <link>https://medium.com/@usama.muneer/start-a-wordpress-project-with-timber-using-pine-cli-tool-f8542d1fa73?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8542d1fa73</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[wordpress-themes]]></category>
            <category><![CDATA[wordpress-development]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Mon, 19 Dec 2016 02:03:39 GMT</pubDate>
            <atom:updated>2016-12-19T02:03:39.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVomASoty8EBKnZAi_O1gA.png" /></figure><p>If you develop WordPress projects more often and if you‘re pretty familiar with using Timber Library to create and manage your WordPress themes then this tool will definitely enhance your productivity and saves you a bunch of time doing things repeatedly while creating a new theme.</p><p>Recently i came across this awesome tool called <strong>Pine</strong>, Its a CLI tool for creating and providing a perfect boilerplate for WordPress to start theming with Timber straight out of the box with just a single command. So let’s see how it works.</p><h3>Installing Pine</h3><p>First thing first, we have to install Pine globally in our machines to make it work and for that you gotta need Composer installed.</p><p>Make sure you have <strong>$HOME/.composer/vendor/bin/</strong> directory added in your environment variables.</p><p><strong>$ composer global require azi/pine</strong></p><p>Wait for it to install completely then move on to the next step.</p><h3>Running Pine</h3><p>Once its installed you can run the following command by typing in:</p><p><strong>$ pine new timberproject</strong></p><p>The above command will create a directory “<strong>timberproject</strong>”, other than that it downloads &amp; installs WordPress for you and creates a theme directory with the same name and most amazingly creates all the required directories inside your theme folder for you in no time.</p><h3>Tryout</h3><p>I’m excited to try out this awesome tool now, so let’s begin.</p><h4>Step 1: Installing Pine using Composer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xstN_CAFJW7hVHinPgJ91A.png" /><figcaption>installing pine using composer</figcaption></figure><h4>Step 2: Creating new WordPress Project using Pine</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulaLkyp16MNKTe71K7mnEA.png" /><figcaption>creating new WordPress project with Pine</figcaption></figure><p>So if you look closely, Pine downloads a fresh WordPress instance for you, pulling in a few dependencies including <strong>timber/timber</strong> and <strong>twig/twig</strong>.</p><h3>What’s Inside?</h3><p>Now It’s time we can peek inside of our newly created WordPress theme directory and what Pine has brought for us so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wtadkgj-WaeYsG9RYd7WVQ.png" /><figcaption>cd into my themes directory</figcaption></figure><p>Now if we list down the elements inside our theme directory, we can see a new theme directory namely “<strong>timberproject</strong>” has already been created for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZnJHpxueUrRnZpReB4Ui1w.png" /><figcaption>new directory timberproject</figcaption></figure><p>Now if we look inside of our newly created theme directory. It has already come up with a boilerplate and we should be good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hVGaOIHpxMiDgkAuRZzA.png" /></figure><p>As you can see, it creates every bunch of required file and directory for you to get started.</p><p>Simple Enough eh?</p><p>Now I’ll leave the rest for you. Go through every bit of it and activate your theme from your WordPress dashboard and build something awesome.</p><p>If you have any questions, leave me a comment below or you can ask straight to the Developer of Pine @azibaloch.</p><p>If you liked this tool and found it useful then don’t forget to leave a star on <a href="https://github.com/azeemhassni/pine">Github</a>.</p><p>Moreover if you liked this article, press the heart button and let me know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8542d1fa73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get rid of Composer Self-Update warnings — Windows Only]]></title>
            <link>https://medium.com/@usama.muneer/get-rid-of-composer-self-update-warnings-windows-only-2f154095bb4f?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f154095bb4f</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[dependencies]]></category>
            <category><![CDATA[composer]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Wed, 28 Sep 2016 10:11:12 GMT</pubDate>
            <atom:updated>2016-09-28T10:11:12.555Z</atom:updated>
            <content:encoded><![CDATA[<p>You guys might have noticed this little piece of warning while running composer in your command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*4NVtX0SXocQ6zA7YzkJQuw.png" /><figcaption>Composer Warning message</figcaption></figure><p>In this short yet useful article, I’ll teach you how to get rid of <strong>composer self-update</strong> warning on your windows machine by simply adding a task scheduler, that will update your composer every time period you specified.</p><p>Follow the simple steps below to get rid of this warning for like forever.</p><h3>Step # 01</h3><p>Open the <strong>Task Scheduler</strong> in your windows machine, and click on the Create Basic Task button on the right marked on the below screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*TJFe9kh2wQpp6erf-xbvgQ.png" /></figure><h3>Step # 02</h3><p>On the next screen, Enter the name and description of the Task and hit next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*VuXKdf3IUW1o2Xn0rG0B5w.png" /></figure><h3>Step # 03</h3><p>On the next step, select the time cycle for the task, I prefer to update composer every month, so i selected the monthly tab. but its totally up to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*i4Xr1zPFiMIvFa7frnp1Ow.png" /></figure><h3>Step # 04</h3><p>On the next step, specify your desired months to update your task and the date, on which you want your task to be performed. Hit next when you’re ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*DjPyBQvttc1qLijvRaQUuQ.png" /></figure><h3>Step # 05</h3><p>Click next to start the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*4JEyyfm1mbUp6bBQYh-AaQ.png" /></figure><h3>Step # 06</h3><p>In this next step, specify your <strong>composer.bat </strong>file path and hit next.</p><p>In case, you’re facing some issue in getting your composer’s path in your machine, you can simply type in your command line:</p><pre>$ <strong>where composer</strong></pre><p>like, in my case, its the following,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*amzUjqVUhvplXptsVTyNeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*inBqhNh6IK3NQhetpJ5Ntw.png" /></figure><h3>Step # 07</h3><p>In this last step, you’ll see a summary of your task, hit finish to complete your task and forget about running <strong>composer self-update</strong> every now and then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*paJn7Uhgi8BY37tbpXN6wQ.png" /></figure><h3>Conclusion</h3><p>That’ll be all for this article. If you liked my article, please don’t forget to click on the heart button below or if you have any questions, feel free to ask. You can also follow me on <a href="https://twitter.com/usamachaudhary"><strong>Twitter</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f154095bb4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Controlling the Mobile View-port for your web Applications]]></title>
            <link>https://medium.com/@usama.muneer/controlling-the-mobile-view-port-for-your-web-applications-647c0ba7db05?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/647c0ba7db05</guid>
            <category><![CDATA[fluid-design]]></category>
            <category><![CDATA[responsive-web-design]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[viewport]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Wed, 21 Sep 2016 12:28:30 GMT</pubDate>
            <atom:updated>2016-09-21T12:28:30.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*heqorsfgQOTzYzvaBMQyvw.png" /></figure><p>In this article, We are going to learn about how to control the <strong>Mobile view-ports</strong> and how your content should display on mobile screens in order to maintain a better responsive design for your website.</p><p>Perhaps the most confusing aspect of mobile displays is the concept of the <strong>Mobile view-ports</strong>.</p><p>To understand that, we first have to understand what the <strong>Mobile view-port</strong> is and how it relates to the mobile screen.</p><h3>A simple Example</h3><p>So, for your understanding, Let’s take an example of a smart phone of 320 x 480 pixels, meaning that the screen is 320 pixels wide when in portrait mode.So when we browse to a site that hasn’t been optimized for mobile screens, the entire site is scaled to fit itself into the 320 pixels worth of space, even though it was design for a much wider screen resolution. To read a site like this, the user needs to zoom up and then aim to the areas of the page that they want to read.</p><p><strong><em>So what’s going on here, and why is this the default approach for most mobile devices?</em></strong></p><p>But When we’re browsing on a desktop device, the concept of the <strong>view-port </strong>becomes a little more obvious, as any open browser window is defined as the <strong>view-port</strong>. Because the <strong>view-port </strong>is independent of the screen, we can resize it to whatever size we want. On mobile devices, the <strong>view-port </strong>functions in much the same way. It gives you a defined area to display web pages that is independent of the device’s screen. It’s simply not as obvious as the desktop <strong>view-port</strong>, and users don’t actually resize the <strong>view-port </strong>as much as they scale it up or down when they zoom in and out of web pages.</p><p>Since <strong>view-ports </strong>have a minimum scaling factor, users rarely ever see their edges as they do when they resize floating browser windows. Because of the small size of mobile screens, mobile <strong>view-ports </strong>are designed to be larger than the screen’s resolution.</p><h3>Another Example of Mobile Browsers</h3><p>For instance Mobile Safari has a <strong>view-port </strong>of 980 pixels, while Opera’s is around 850 pixels. When you compare that to an iPhone with a screen width of 320 pixels, you can see that the <strong>view-port </strong>is much larger than the actual screen itself. This is due to mobile <strong>view-ports </strong>having to display content that’s designed for much wider screens. Typically, mobile browsers will display a web page within the <strong>view-port </strong>and then shrink that <strong>view-port </strong>down until the content fits within the width of the screen itself. While this usually results in tiny pages, it does allow the user to see the page in its entirety and decide which areas of the page they’d like to zoom up to, and read. If mobile browsers didn’t behave this way, you’d only be able to see a small portion of most web pages.</p><p>This would be much more confusing as you’d have to pan around the page to explore its content without really knowing where anything was. This has been described as <strong>keyhole browsing</strong>, as it’s similar to viewing an entire room through a small keyhole. So, while the default <strong>view-port </strong>scaling is helpful for users browsing sites designed for larger screens, it can make it extremely frustrating when browsing pages that are designed specifically for mobile screen sizes.</p><h3>Let’s say that you’ve created a responsive design that has a mobile phone layout designed for 320 pixels.</h3><p>On an iPhone, the default mobile <strong>view-port </strong>is 980 pixels, so your 320-pixel layout is only going to occupy about a third of that. The <strong>view-port </strong>will then be scaled down to fit the 320-pixel screen, making your layout really tiny and defeating your carefully crafted 320-pixel layout. So, in order to build responsive sites that fit neatly within mobile screen sizes, you’ll need to know how to control both the <strong>view-port </strong>size and its initial scale factor.</p><p>Now that i’m pretty much sure that you have a clear picture of what the mobile <strong>view-port </strong>is, now we need to discuss how to control them.</p><p>So, without wasting more time, let’s discuss on how to control the mobile <strong>view-ports</strong>.</p><p>Generally, there are two mechanisms available for overriding the User Agent’s default <strong>view-ports</strong>, which are.</p><blockquote><strong>Viewport meta tag</strong></blockquote><blockquote><strong>@ view-port CSS Rule</strong></blockquote><p>Since they both use similar syntax, We are going to explore their code examples , and then describe their effects on the <strong>view-port</strong>.</p><h3>Viewport meta tag</h3><p>The meta <strong>view-ports </strong>tag appears in the head of your HTML, and has two basic parts: name, which is <strong>view-port </strong>, and content, which will contain the properties and values you wish to set for the <strong>view-port </strong>itself.</p><pre><strong>&lt;meta name=”viewport” content=”width=device-width, initial-scale=1.0&quot;&gt;</strong></pre><h3>@viewport CSS Rule</h3><p>The <strong>@viewport</strong> rule can appear anywhere in your CSS that you want, but since it can affect media queries, it’s recommended that you place it prior to any media queries in your styles. Most designers place it near the top of their styles. The syntax is similar to the meta <strong>view-port </strong>tag. You simply declare an @viewport rule and then populate it with the properties that you wish to control.</p><pre><strong>@viewport {<br>  &lt;group-rule-body&gt;<br>}</strong></pre><p>So, Now that we have the basics of the syntax down, let’s examine the individual properties that you can control.</p><h3>Let’s look at another Example, where we will see how a simple web page would look with and without the <strong>view-port</strong>.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*DOZg4d3Vyvyu5Pv4J-yHyQ.png" /><figcaption>without viewport</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*WWvnWqX3svgicW7O4cgidQ.png" /><figcaption>with viewport</figcaption></figure><p>As we have set the <strong>view-port </strong>properties, we’ll examine the site optimized for mobile screen sizes to see how the mobile browser reacts to changes to its default <strong>view-port</strong>.</p><h3>Syntax differences between both Approaches</h3><p>Note that in the <strong>view-port </strong>meta tag syntax, we don’t append PX to the pixel value, while in the <strong>@viewport </strong>CSS syntax you do. While a specific pixel value for width might be fine for some projects, remember that not all mobile screens are 320 pixels wide.</p><p>If your website is using a fluid layout, you’re going to want the layout to be based on the available screen width of the device and not limit the <strong>view-port </strong>to just one single size. To do that, we can use the property value<strong> device-width</strong>.</p><blockquote><strong>Using the meta tag</strong></blockquote><pre><strong>&lt;meta name=”viewport” content=”width=device-width”&gt;</strong></pre><blockquote><strong>Using the CSS rule</strong></blockquote><pre><strong>@viewport {<br> width: device-width;<br>}</strong></pre><p>This value instructs the browser to set the <strong>view-port </strong>to the exact size as the available screen pixels. Setting this will remove any initial <strong>view-port </strong>scaling and allows you to create fluid layout that will adapt to multiple devices.</p><p>As you can set width, you can also set the height of the <strong>view-port, </strong>to either a specific value or by using the value <strong>device-height </strong>using the similar approach.</p><p>You probably won’t need a control <strong>view-port </strong>height all that often, but you should know that the capability exists if you need it.</p><p>You can also set the<strong> initial-scale</strong> value for the property’s content as well. It’s easy to get this property confused with <strong>view-port </strong>width, so let’s talk about exactly what it does.</p><blockquote>What exactly is <strong>Initial-scale</strong> for?</blockquote><p><strong>Initial-scale</strong> controls the zoom factor of your content for the initial view of the page.Once the page has been viewed, the user is then free to scale the page at any factor they want.Now, it’s important to note that this is independent of the <strong>view-port </strong>width.</p><p>So if the <strong>initial-scale </strong>is set to 2, notice that our content is now scaled up to 200%, even though the width of the <strong>view-port </strong>remains unchanged. Setting the initial scale to 1 ensures that the content appears at 100%, regardless of the <strong>view-port </strong>width.</p><p>It’s quite common to see people set width to device width and then also set initial scale to 1, but in reality that’s not really necessary. If you set the <strong>view-port </strong>width to the device width, the browser automatically sets initial scale to 100%. So, it’s advisable to leave <strong>initial-scale</strong> off entirely unless you need to set the value other than 100%.</p><p>In terms of syntax,meta <strong>view-port </strong>tag use an integer to set the scaling factor, while @<strong>viewport </strong>uses zoom. The @<strong>viewport </strong>syntax currently also allows a percentage value as well, but since that may change in the future, you’re safer just using a number.</p><p>You can also control the range of scaling allowed by your site as well. Let’s say you want to allow people to zoom in and out on your page content, but you do want to control just how much zooming they can do. By using the <strong>minimum </strong>and <strong>maximum </strong>scale properties, you can do just that.</p><p>Now, if we set up the minimum scaling to 1 and the maximum scaling to 2. Now the user can scale up to 200% but can’t scale down pass 100%. In terms of syntax, there is a little bit of difference between the meta <strong>view-port </strong>tag and the @<strong>viewport </strong>syntax.</p><p>In the meta <strong>view-port </strong>tag, you’ll use the minimum and maximum scale properties and a positive numeric value, which indicates the scaling factor. In the @<strong>viewport </strong>syntax, you’ll use the minimum and maximum zoom properties, and can use either a positive number or a percentage value.</p><p>If you wish, you can turn scaling off entirely by using the <strong>user-scalable</strong> property. This allows you to either enable or disable user’s ability to zoom in and out on your page content, and is more commonly used actually for applications than websites.</p><p>For the meta <strong>view-port </strong>tag syntax, you’ll use <strong>user- scalable</strong> and values of either yes or no, and for @<strong>viewport</strong>, you’ll use the <strong>user-zoom</strong> property which will accept either the zoom or fixed values.</p><p>Keep in mind that users are accustomed to having the ability to zoom in and out of web content.If you disable this for your site, you should have a clear and compelling reason to do so. These are just a few of the properties you can control when overriding a browser’s default <strong>view-port</strong>.</p><h3>Conclusion</h3><p>Now, it’s important to note that support for the meta <strong>view-port </strong>tag is almost universal, while the @<strong>viewport </strong>syntax is still relatively new and largely unsupported for now. Existing support for the @<strong>viewport </strong>rule is also largely restricted to using vendor prefixes, so you’ll need to be mindful of that if you choose to use that syntax.</p><p>Adoption of @<strong>viewport </strong>is happening fairly rapidly, and the specification is maturing, so I expect we’ll see full support for it in the very near future. Once this happens, we’ll be able to choose exactly how we want to control user agent’s <strong>view-ports </strong>when creating responsive designs.</p><p>If you liked my article, please don’t forget to click on the heart button below or if you have any questions, feel free to ask. You can also follow me on <a href="https://twitter.com/usamachaudhary">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=647c0ba7db05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to the WordPress]]></title>
            <link>https://medium.com/@usama.muneer/introduction-to-the-wordpress-c4c4e7c50d68?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4c4e7c50d68</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[introduction]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Fri, 17 Jun 2016 04:42:32 GMT</pubDate>
            <atom:updated>2016-06-17T09:02:27.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hd8GYq-Oj2ir7iVT50bpgQ.jpeg" /></figure><p>When I start learning a new tool or an application, I find it useful to start with a clean slate, so before we talk of anything else, let’s first understand <strong>What WordPress is?</strong></p><p>WordPress is often perceived as a simple blogging application but in reality it’s so much more and it has grown into a full-fledged Content Management System, that powers millions of websites all over the world.In other words we can say that <strong>WordPress powers everything.</strong></p><blockquote>In other words, we can also say that WordPress is a simple yet useful <strong>web publishing tool</strong>.</blockquote><p>WordPress is free &amp; open-source, meaning it developed by the people who use it.WordPress is created in 2003 &amp; in its 13 years of history, over 170 featured updates have been <a href="https://wordpress.org/news/category/releases/">released</a>. According to the <a href="https://w3techs.com/technologies/details/cm-wordpress/all/all">Web Technology Survey</a>;</p><blockquote>WordPress is used by approximately 26.4 % of all the websites on the internet &amp; approx 59.5 % of some of the popular content Management systems</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*Nys3LOmXvNLkOlA26ynPKQ.jpeg" /></figure><p>So we can say that, WordPress is a popular Web Creation tool. To give you an idea of just how diverse the WordPress universe really is, take a look at some of the featured <a href="https://wordpress.org/showcase/">sites </a>running WordPress.</p><p>WordPress has become a popular platform for businesses because its easy to change the appearance of the site with few clicks. It’s also used by a lot of Educational Institutions as well, because WordPress allows so much flexibility within.</p><p>Now, i have seen this confusion among most of the beginners starting with WordPress, now before we get going, let me clear out this confusion between</p><blockquote>WordPress<br>WordPress.org<br>WordPress.com</blockquote><p>So, let’s start explaining from the top.</p><p><strong><em>WordPress </em></strong>is the application itself, it’s free, open-source and can be downloaded and installed on any standard web server</p><p><a href="https://wordpress.org/showcase/"><strong><em>WordPress.org</em></strong></a> is the website from which you can download WordPress, the application. This is also the place where you can find and download themes &amp; plugins, moreover the user forum and documentation on how to use WordPress.</p><p><a href="https://wordpress.com/"><strong><em>WordPress.com</em></strong></a> is the cloud hosted service that runs WordPress, where you can setup your free blog or website without having to worry about the web servers or updates and security. So if you’re looking for an hassle-free way to start blogging or to make a basic website, then this is the place to visit.</p><p>The term confusion I mentioned earlier comes when people say such as They have a WordPress.org site, but what they mean to say is they have a self-hosted WordPress site.</p><p>Choosing what option is right for you, a Self-Hosted WordPress site or one hosted on a Cloud Server is the matter of mapping out your needs for your site and where you want to take it in the future. But the great thing I like about WordPress is whatever decision you make does not has to be final. For instance you can build a site on WordPress.com and then move it to the Self-Hosted solution and vise-versa. WordPress is incredibly flexible in all aspects even when it comes to how its hosted.</p><p>Deciding what option is best for you depends upon the assessment of what you need and what’s available, but like I said you can always switch around if you feel like your original choice was not the right one.</p><p>In the next article, we’ll be moving forward to understand the WordPress’s environment more closely, so stay in touch.</p><p>If you liked my article, please don’t forget to click on the heart button below or if you have any questions, feel free to ask. You can also follow me on <a href="https://twitter.com/usamachaudhary">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4c4e7c50d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate your Workflow with Gulp JS]]></title>
            <link>https://medium.com/@usama.muneer/automate-your-workflow-with-gulp-js-b6670d1fb4b2?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6670d1fb4b2</guid>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[gulp]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Mon, 06 Jun 2016 20:58:51 GMT</pubDate>
            <atom:updated>2016-06-06T20:58:51.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPmAHiZx-ffB_3UmBlMPrA.png" /></figure><p>In this Article, I’ll walk you through the basic yet useful steps to help you setup Gulp workflow in your project’s directory, which will help you minify all of your Style &amp; Script files etc into single file, and boost up the total loading time of your web application with minimum number of HTTP requests to the server.<br>I am assuming that you might not familiar with the CLI (Command Line Interface) before, so I will take you through each step in detail to set up Gulp for your application, so Let’s get started from the very beginning.</p><h4>Installing Node JS</h4><p>To make use of any build tool, we’d require to have Node installed in our system. Now to install Node, head over to <a href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a> and download and install your respective build as per your OS (Operating System). Installing Node also includes <em>NPM</em> within, which is <em>Node’s Package Manager.</em> We will look how it works later on this article when we install Gulp and all of it Plugins.</p><h4>Testing Node and NPM</h4><blockquote><strong>If you’re familiar with Command-line interface before, you can skip this step.</strong></blockquote><p>Like I mentioned in the beginning, I’ve assumed that you might not be familiar of using Command-line interface before, which you can understand as your Terminal in OSX/ Linux and your Command Prompt in Windows. While there are some really useful tools that make use of command-line interface, such as: Git, Gulp, Sass, Composer etc.<br>You have now successfully installed Node in your system, but how should you test it, whether if it installed perfectly. Well, its simple, open your Command-line interface and type:</p><pre>$ node -v </pre><p>and to check whether <em>NPM </em>is working fine,</p><pre>$ npm -v</pre><p>These line of commands should return the version numbers on the next line. If you get any errors while executing these commands, then there must be some issues while installing, so go back to the previous step and install it again.</p><h4>Initiate NPM in your project’s Directory</h4><p>I hope you must have dealt with Command-line environment well so far must be ready to move on to the next step.<br>Now let’s navigate to your working project directory, so that we can setup everything. As I’m working on a Windows machine, yours could be different, but that doesn’t make any difference at all, logic of the context remains the same.</p><blockquote><strong>C:\xampp\htdocs\myproject\</strong></blockquote><p>Once in your project directory, run the following command in your CLI to initiate <em>package.json file, that will require all of your dependencies.</em></p><pre>$ npm init</pre><p>When you run this command, it will ask you some questions to setup your json file, these are totally optional and you can either leave them blank, they will inherit all the default values then,for example</p><blockquote>name: &lt;your package name&gt;<br>version: &lt;your package version &gt;<br>description: &lt;your package description&gt;<br>Entry Point: &lt;your entry js file&gt;<br>test Command: &lt;your package test command&gt;<br>Git Repository: &lt;your git repo &gt;<br>Keywords: &lt;basic keywords for your package&gt;<br>Author: &lt;package author name&gt;<br>License: &lt;your package license&gt;</blockquote><p>After all the information has been setup, you can see your <em>package.json </em>file with all the information you’ve entered.</p><h3>The Principle Phase: Installing Gulp</h3><p>Till now, we’ve seen how we can setup our Node and initiate our package manager in our project’s directory. This is now the time to install Gulp into our project’s directory.</p><pre>$ npm install -g gulp</pre><p>The above command will install <em>gulp </em>globally in your system, so that <em>gulp </em>command is accessible through out your system globally.<br>let’s understand what this command exactly does here,</p><blockquote><strong>npm install:</strong> It will install all the dependencies as in your package.json file.<br><strong>-g</strong>: this flag means to install the package globally in your system.<br><strong>gulp</strong>: this is the name of package to be installed.</blockquote><p>Once your system finishes installing Gulp, do exactly as you’ve done for node and <em>NPM</em> by running the command,</p><pre>$ gulp -v</pre><p>If its installed perfectly into your system, you’ll see the Gulp version in the next line.<br> I’m hoping that you’ve managed to get along with me through this point easily. Let’s move to the next step and installing Gulp and its plugins for our development build.</p><pre>$ npm install gulp --save-dev</pre><p>As you might have noticed, both install commands have just a single difference here, the — <strong><em>save-dev</em></strong> flag. You may be wondering now what this flag does? Well this is simple enough, this flag tells the <em>NPM</em> to add the dependency to our <strong>devDependencies</strong> list in our <em>package.json </em>file.<br>Dependencies help us organize our packages in the development and production environments. For further details, you can check the official <a href="https://docs.npmjs.com/files/package.json#dependencies">docs</a> of <em>NPM </em>dependencies.</p><p>Ok, we’ve come far now, and quite closer to what we want to achieve here.<br>Gulp is now installed, we need to give it some instructions so that what tasks we’d need to perform with this Gulp package. Let’s first decide what we want to do with our scripts and style files. Let me tell you my approach of work.</p><h4>Adding some more useful Plugins</h4><p>Now, to get the Gulp up and running, we need to update our <em>package.json file </em>a bit. The best way to do so is to add the dependencies through our very own CLI tool. Here, we are adding up the very basics, so let’s get going.</p><blockquote>gulp-concat<br>gulp-cssmin<br>gulp-rename<br>gulp-sass<br>gulp-uglify<br>streamqueue</blockquote><p>Let’s first go through each of these plugins one by one</p><p><strong><em>gulp-concat — </em></strong>concatenates and merge the source files into the defined file.</p><p><strong><em>gulp-cssmin — </em></strong>minifies CSS using Gulp.</p><p><strong><em>gulp-rename — </em></strong>provides simple files renaming methods.</p><p><strong><em>gulp-sass — </em></strong>plugin for compiling scss files, you can skip if not using SASS compiler for your styles.</p><p><strong><em>gulp-uglify — </em></strong>minify files using UglifyJS</p><p><strong><em>streamqueue — </em></strong>compiles the source files one by one in order to preserve their content order. (<strong>NOTE</strong>: <strong><em>its an alternative approach for queuing up your src files</em></strong>).</p><pre>$ npm install gulp-concat gulp-cssmin gulp-rename gulp-sass  gulp-uglify streamqueue --save-dev</pre><p>Now, run the above command, let your Command-line install all these plugins one by one. After the install is complete, you can open up your <em>package.json</em> file again &amp; see the changes made in your file. These dependencies will now be available to you in your project’s directory.</p><h3>The Big Next Step: creating the <em>Gulp file</em></h3><p>Now that we have setup everything necessary, create a file named <strong><em>gulpfile.js </em></strong>in your project’s root and start typing along, we will go step by step so nothing mix you up.</p><blockquote>Requiring the dependencies</blockquote><pre>var gulp = require(‘gulp’);<br>var sass = require(‘gulp-sass’);<br>var concat = require(‘gulp-concat’);<br>var rename = require(‘gulp-rename’);<br>var uglify = require(‘gulp-uglify’);<br>var streamqueue = require(‘streamqueue’);<br>var cssmin = require(‘gulp-cssmin’);</pre><p>Now we’ll setup gulp tasks one by one.Let’s start by our CSS files.</p><blockquote><strong>CSS Task</strong></blockquote><pre>gulp.task(‘css’, function ()<br>{<br> return gulp.src([‘css/app.css’,&#39;css/base.css&#39;])<br> .pipe(cssmin())<br> .pipe(concat(‘style.css’))<br> .pipe(rename({suffix: ‘.min’})) //optional<br> .pipe(gulp.dest(‘assets/css/’));<br>});</pre><p>Don’t get confused here, let me explain you what happening here.<br>Assume that you have a CSS directory in your project root, which contains some <em>.css </em>files within, that becomes your <em>src. </em>In the next step we are minifying the <em>src</em> files using <strong>cssmin(). </strong>Next we concat the minified <em>CSS </em>into file named <strong><em>style.css</em></strong> and rename it with the suffix of <em>.min. </em>Lastly we specify the desired destination to put up this file. In my case, it’s <strong><em>assets/css/style.min.css. </em></strong>Simple enough? eh? Let’s move onto the JS Task.</p><blockquote><strong>JS task</strong></blockquote><pre>gulp.task(‘js’, function ()<br>{<br> return streamqueue({objectMode: true},<br> gulp.src(‘libs/jquery.min.js’),<br> gulp.src(‘libs/jquery.bxslider.min.js’),<br> gulp.src(‘libs/pushy.js’),<br> gulp.src(‘libs/bootstrap.min.js’),<br> gulp.src(“libs/product-images.js”)<br> )<br> .pipe(concat(‘all.js’))<br> .pipe(uglify())<br> .pipe(gulp.dest(‘assets/js/’));<br>});</pre><p>Now as you might have noticed, there we’ve used <strong><em>streamqueue()</em></strong> instead of just arraying out in<strong><em> gulp.src()</em></strong>. It does almost the same as we’ve previously done with the <strong>CSS </strong>task, this is considered as the alternative way to keep an ordered compilation of files. You can use either of these approach. <br>The one new plugin used here is <strong><em>uglify()</em></strong>, which will minify your compiled JavaScript code and put it in the designated path. In this case it’s <strong><em>assets/js/all.js</em></strong></p><p>Now, in case if you wanted to have some <em>Real-time magic</em> that will perform all the changes to your compiled file while you made change in your code. <br>If yes, then you can add up this watcher Task into your <strong><em>gulpfile</em></strong> as well.</p><blockquote><strong>Watch Task</strong></blockquote><pre>gulp.task(‘watch’, function ()<br>{<br> gulp.watch(‘css/**/*.css’, [‘css’]);<br> gulp.watch(‘libs/*.js’, [‘js’]);<br>});</pre><p>Now we need a default task to end up our <strong><em>gulpfile</em></strong>, which is a must have in your <strong><em>gulpfile</em></strong>.</p><blockquote><strong>Default Task</strong></blockquote><pre>gulp.task(‘default’, [‘css’, ‘js’, ‘watch’]);</pre><p>Now, Your final <strong><em>gulpfile.js </em></strong>should look like this</p><pre>var gulp = require(‘gulp’);<br>var sass = require(‘gulp-sass’);<br>var concat = require(‘gulp-concat’);<br>var rename = require(‘gulp-rename’);<br>var uglify = require(‘gulp-uglify’);<br>var streamqueue = require(‘streamqueue’);<br>var cssmin = require(‘gulp-cssmin’);</pre><pre>gulp.task(‘css’, function ()<br>{<br> return gulp.src([‘css/app.css’,&#39;css/base.css&#39;])<br> .pipe(cssmin())<br> .pipe(concat(‘style.css’))<br> .pipe(rename({suffix: ‘.min’})) //optional<br> .pipe(gulp.dest(‘assets/css/’));<br>});</pre><pre>gulp.task(‘js’, function ()<br>{<br> return streamqueue({objectMode: true},<br> gulp.src(‘libs/jquery.min.js’),<br> gulp.src(‘libs/jquery.bxslider.min.js’),<br> gulp.src(‘libs/pushy.js’),<br> gulp.src(‘libs/bootstrap.min.js’),<br> gulp.src(“libs/product-images.js”)<br> )<br> .pipe(concat(‘all.js’))<br> .pipe(uglify())<br> .pipe(gulp.dest(‘assets/js/’));<br>});</pre><pre>gulp.task(‘watch’, function ()<br>{<br> gulp.watch(‘css/**/*.css’, [‘css’]);<br> gulp.watch(‘libs/*.js’, [‘js’]);<br>});</pre><pre>gulp.task(‘default’, [‘css’, ‘js’, ‘watch’]);</pre><p>If you’ve made the changes, then it’s time to move on and test out how this Gulp actually does make your life easier.</p><p>Open up your CLI and run the following command in your project’s root, you’ll see the tasks starting and then ending.</p><pre> $ gulp</pre><p>Alternatively, you can also run all of the Tasks separately.</p><pre>$ gulp css<br>$ gulp js<br>$ gulp watch </pre><p>Now head over to your file directories, you should see your minified files at the designated paths. If not then follow the steps again carefully.</p><p>Now you just need to include these single piece of files into your Headers to load all the assets.</p><p>I would recommend you to make this your practice in every single project, it’ll just take maximum of 5 minutes of your time but saves you a lot later on.</p><p>I hope you guys have enjoyed learning through this process of automating up your styles and scripts into more brief manner.<br>If you liked my article, take time to like it or leave me a comment. You can also follow me on <a href="https://twitter.com/usamachaudhary">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6670d1fb4b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel — How Eloquent save lives of most of PHP Developers]]></title>
            <link>https://medium.com/@usama.muneer/laravel-how-eloquent-save-lives-of-most-of-php-developers-93924b434deb?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/93924b434deb</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[laravel-eloquent]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Thu, 26 May 2016 00:58:37 GMT</pubDate>
            <atom:updated>2016-05-26T06:18:59.476Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*3jSsb0kaUKMe2hUlSoeH8Q.jpeg" /></figure><p>If you guys haven’t ever taste the aroma of <em>Laravel’s ORM</em> <strong><em>Eloquent</em></strong>, than this article is for you, believe me. I’ll take you through the crazy ride starting from building queries with full of hurdles as in the procedural PHP, bump into fetching data the OOP way and then move straight towards the awesomeness of <em>Eloquent</em> &amp; you’ll see why most of the developers fell in love with these piece of greatness which <em>Laravel</em> have brought in PHP.</p><p>So let’s get started with an assumption that you’ve already setup your database schema let’s say “<strong><em>testSchema</em></strong>” and it contains a table let’s say “<strong><em>products</em></strong>”. We’ll play around with this piece of information in each step.</p><p>If you’re reading this then I’m sure, most of you have at least some experience of working with PHP, as this is not for the very beginners.</p><p>Ok, so <em>How do you create a Database Connection in procedural PHP</em>? <br>you need to remember some compulsory PHP functions to create a connection and then make queries to the Database. Some of those functions include:</p><blockquote>mysqli_connect();<br>mysqli_query();<br>mysqli_fetch_assoc();<br>mysqli_connect_error();</blockquote><p>And all of there parameters, which is quite disturbing and frustrating for the most of the developers to remember. So let’s create a connection file and see how it looks like.</p><pre>&lt;?php <br>$server_name = &#39;localhost&#39;;</pre><pre>$username = &#39;root&#39;;<br>$password = &#39;root&#39;;<br>$db_name = &#39;testSchema&#39;;</pre><pre>$connection = mysqli_connect($server_name,$username,$password, $db_name);</pre><pre>//check if its connected</pre><pre>if(mysqli_connect_error()) {<br>  $logMessage = &#39;MYSQL Error: . mysqli_connect_error();<br>  die(&#39;could not connect to the Database&#39;);}</pre><pre>//if connection successful, <br>//query</pre><pre>$query = mysqli_query($connection,&quot;SELECT * FROM products WHERE ID = $ID&quot;);<br> <br>//fetch the information from the Database<br>$product = mysqli_fetch_assoc($query);<br>?&gt;</pre><p>Alright, this seems so complex to write these set of code each time you wanted to connect to a Database. So the next question arise in most of Developer’s mind is “<em>Will this thing gets easier with OOP?</em>” Well let’s find out ourselves.</p><pre>&lt;?php<br>class Product<br>{<br>    public function __construct( mysqli $connection )<br>    {<br>        $this<strong>-&gt;</strong>connection <strong>= </strong>$connection;<br>    }<br><br>    public function get( $id )<br>    {<br>        return $this<strong>-&gt;</strong>connection<br>            <strong>-&gt;</strong>query(&quot;SELECT * FROM products WHERE id = &quot; <strong>. </strong>$id)<br>            <strong>-&gt;</strong>fetch_assoc();<br>    }<br>}<br><br># Usage --&gt; Get Product by ID == $ID<br>$db = new mysqli(&#39;localhost&#39;,&#39;root&#39;,&#39;root&#39;,&#39;testSchema&#39;);</pre><pre>$product = new Product<strong>($db);<br>$product-&gt;</strong>get($ID);​</pre><p>I’m sure this ride is getting bumpier &amp; uneven as you have came along. But I assure you with this final reveal of how Eloquent fetches the Data from the Database will surely get you a relief.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*LOeWhs-GCCU51kxAF4tfzw.png" /></figure><p>Assume the connection has been setup already &amp; our Product model is configured in our Laravel’s application, if you’re somewhat familiar. We’ll just look through how we call it to fetch the required information.</p><pre>&lt;?php <br> <br>$product = App\Product::find($ID);</pre><p>Well That’s it, this is how easier it could be done with just a single line of code. This is the beauty of <em>Eloquent</em> ORM where each database table has a corresponding “<em>Model</em>” which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.</p><p>I hope you’ve enjoyed reading this article, if you want to know more about Laravel and it’s features, then I would recommend you to stay connected.<br>You can also follow me on <a href="https://twitter.com/usamachaudhary">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93924b434deb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP — Why do we need to use a Framework?]]></title>
            <link>https://medium.com/@usama.muneer/php-why-do-we-need-to-use-a-framework-2d7cf3a4519c?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d7cf3a4519c</guid>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Mon, 23 May 2016 13:14:39 GMT</pubDate>
            <atom:updated>2016-05-24T05:12:44.566Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*wDSVlBffXIC1h2Qo7gppCQ.jpeg" /></figure><p>As may you all know, PHP is one of the most popular server-side scripting languages in the world, and it has advanced a lot since its release.<br>In this era, where technology have moved beyond the basics, developers need to build complex websites and web applications, and above a certain complexity level, it can take too much time and energy to always start from the scratch, hence developers felt the need of some boilerplate to start their development with, therefore, several frameworks came into being to provide most of the adequate solutions to complex problems.</p><p>In this post, we’d look into the most basic benefits &amp; advantages we get while using the frameworks, instead of writing code the procedural way. So, let’s dive straight in.</p><h4>Code &amp; File Organization</h4><p>Just because you created an “<em>includes</em>” or “<em>libs</em>” folder &amp; made a “<em>functions.php</em>” file, doesn’t mean your code is organized. <br>But when you setup a PHP Framework, it already contains a certain folder structure &amp; Once you get used to this model, you’ll never want to go back to the procedural world.<br>Unfortunately, for some CLI champs, who still use VI, this could be a little tricky because they need to work with more files &amp; directories. On the other hand, when you use a decent modern Code Editor or some IDE, it’ll be like a breeze to browse through your application code base and find what you need and yes quickly.</p><h4>Utilities &amp; Libraries</h4><p>As we all know, PHP is a great language for web development &amp; provides countless number of tools and libraries. However, if you ever built a website using PHP without a framework, you might found yourself hunting down a lot of third party code and libraries, or might have to write them yourself. <br>But with any PHP Framework, they’re packed with certain <em>Helpers &amp; Libraries </em>that could help you with <em>Form Validation, I/O Filtering, Database Abstraction, Session &amp; Cookie Handling, Email Management, Calendar, Pagination </em>and so on. Not to mention, there are several third party <em>Plugins </em>provided by the community that you can add to your framework manually or using dependency manager.</p><h4><strong>The MVC Pattern</strong></h4><p>As PHP itself works like a template engine, however, when used irresponsibly, it leads to very ugly and UN-maintainable code, <em>MVC(Model View Controller) </em>comes to the rescue here, the way MVC Pattern applies to PHP Applications:</p><blockquote><strong>Models </strong>represents your data structure, usually by interfacing with the Database.</blockquote><blockquote><strong>View </strong>contains page templates and output data.</blockquote><blockquote><strong>Controller </strong>handles the HTTP requests between the user and the server and binds everything together.</blockquote><p>This kind of code separation leads to a more cleaner, readable and more maintainable structure of the application.</p><h4>Security</h4><p>Security is one of the major issues to resolve for developers. In PHP, you may find several I/O filtering functions to protect your application against certain attacks. However, manually using these functions can get a little tiring job to do &amp; you may forget about them in every once in a while.</p><p>Using some framework gets you cover here as well, they provide most of the solutions to your applications security out of the box, which is really helpful.</p><p>Let’s take <strong><em>Laravel </em></strong>for a example here,</p><blockquote>It uses <strong>Hash </strong>and <strong>Bcrypt </strong>functions for encryption and to store Sensitive information</blockquote><blockquote>The built-in <strong>Auth </strong>system helps to decide user boundaries within the application.</blockquote><blockquote>It provides an easy method to protect your application from<strong> cross site request forgeries</strong></blockquote><blockquote>It offers <strong>Database </strong>and <strong>Eloquent </strong>Authentication drivers out of the box.</blockquote><blockquote>It provides a basic <strong>HTTP authentication </strong>to authenticate users of your application without setting up a dedicated login page</blockquote><blockquote><strong>Blade </strong>Template engine helps prevent any <strong>XSS </strong>attacks.</blockquote><p>and the list goes on and on.</p><h4>Less Code &amp; Faster Development</h4><p>There is of course a learning curve for all PHP Frameworks, but once you get over this knob, you’ll enjoy the awesomeness of <em>Rapid Application Development. </em>You’ll write lesser code, which means less time spent typing, you’ll not have to chase down third party libraries all the time for every single project as most of them already includes in the framework.<br>Also, since you’re being more organized, it’ll be much faster to chase down bugs, maintain code &amp; make changes to existing code.</p><h4>Community Support</h4><p>All Popular PHP Frameworks have great active communities behind them. You can talk to other developers, get help, feedback and could also give something back to the community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*_Dgosz33vQmZemBRBCzyzw.jpeg" /></figure><h4>Performance Tools</h4><p>One of the main arguments from the negative audience comes in this subject. There is obviously a performance hit when you build a simple “<em>hello world</em>” application with a framework versus plain PHP code.<br>But those benchmarks are just bad examples. First of all, you should understand that <em>Developers are more expensive than the Servers</em>.<br>Saving time from development &amp; maintenance is likely to over weigh any extra money you need to spend on servers.</p><p>Putting all of that aside, you can actually gain performance benefits by using a PHP Framework. They come with tools, that will help you do <em>Caching, Benchmarks, profiling</em> etc. Moreover, Modern Frameworks have also great support for <em>Dynamic Loading </em>as they load code whenever needed</p><h4>And It’s FUN</h4><p>This might actually be the most important point of all, when you’ve fun doing your work, you’ll be more productive and happier in general.</p><h4>Conclusion</h4><p>So, if you’ve been using plain old PHP for years, and getting really bored with it, getting started with a framework could give you that crucial morale boost that you might lack. It’s like getting a new life, and a lot of toys to play with and to build cool things with it. At least that’s how I felt when I’ve moved to frameworks &amp; I’m sure many of the Web Developers have gone through similar Experiences.</p><p>In my next Article, I’ll discuss the differences, benefits and drawbacks of some of the Top PHP Frameworks, so stay Connected.<br>If you’ve any queries, please feel free to write it down in the comments or you can contact me on <a href="https://twitter.com/usamachaudhary">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d7cf3a4519c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WordPress Custom Post Types and Taxonomies: Introduction Redefined]]></title>
            <link>https://medium.com/@usama.muneer/wordpress-custom-post-types-and-taxonomies-introduction-redefined-bffaebe69157?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bffaebe69157</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[customposttypeandtaxonomy]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Mon, 23 May 2016 07:44:12 GMT</pubDate>
            <atom:updated>2016-05-23T07:44:12.501Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*wWVpirtaJJzqVQ2aG7kFWg.jpeg" /></figure><p>Out of the box, WordPress has several post types already defined and the most common ones we interact on the daily basis are <em>posts </em>and <em>pages. </em>So let’s first take a look at what <em>posts </em>and <em>pages </em>are, because this will be instructive when we create our own <em>custom post types.</em></p><p><strong><em>POSTS </em></strong>are what you normally create on WordPress, they are organized as reverse chronological order so that the last post goes first in the index and the rest you can see is below that. They are <em>non-hierarchical, </em>means that <em>posts</em> may not have a <em>parent/child relationship</em>. Instead <em>posts</em> are created and managed by the <strong><em>Authors</em></strong><em> &amp; </em>they have <strong><em>categories</em></strong><em> &amp; </em><strong><em>tags. </em></strong>In other words, Every post must have a category and some tags.</p><p>In contrast, <strong><em>PAGES </em></strong>are single individual items, that can be displayed in <em>parent/child relationship </em>&amp; we usually see this on the main menu, <em>pages </em>don’t have indexed pages and they don’t have <strong><em>categories</em></strong><em> &amp; </em><strong><em>tags. </em></strong>Only way to get to them is through a direct link that’s why they usually appear on the main menu.</p><p><strong><em>POSTS </em></strong>are normally used for some recently updated items, such as some <em>article or news update etc. </em>whereas, <strong><em>PAGES </em></strong>are static content, which rarely updates.</p><p>Now let’s dig into the <em>Custom Post types, </em>when you create a <em>custom post type, </em>you can make them act like either a <em>post </em>or a <em>page &amp; </em>which ever you choose, that <em>custom post type </em>will inherit all the features of it. They can be organized by <strong><em>categories</em></strong><em>, </em><strong><em>tags </em></strong><em>or </em><strong><em>custom taxonomies</em></strong><em>. </em>They have separate index page and can have custom index template. They can have all of, or a combination of, or none of the standard features. <em>custom post types </em>can be called anywhere using a <em>custom loop.</em></p><p>Before digging into the <em>custom post types, </em>let’s first understand what <em>Taxonomy </em>means.</p><blockquote>Taxonomy is the schema of classification. It could be defined as the organizational system that allows us to relate one item with another item with other similar items in hierarchical and non-hierarchical groups</blockquote><p>Let’s understand it by a simple real life example;</p><blockquote>Your Wardrobe, you have your shirts in one section, your jackets in another, your pants in another and so on. But whats the benefit of using this technique? Let’s say you want to find some pant, you just go to the section containing your pants only. Simple enough? These are <em>hierarchical system or categories</em>, a type of <em>taxonomy. </em>And every item have some <em>tag</em> on it, like its size, color and so on, these are named as <em>tags,</em> which are non-hierarchical.</blockquote><p>In WordPress, we have two default <em>taxonomies</em>, that you normally use all the time. The first one is <em>category, </em>every <em>post </em>must have a category, they are displayed as <em>hierarchical </em>system, so that means we can have <em>parent/child relationship. </em>Moreover categories are the main organizational method within WordPress.</p><p>On the other hand, <em>tags </em>are optional, you don’t have to use them, but you can use them whenever you want, they are <em>non-hierarchical, </em>meaning that they are not related to one another &amp; they are considered as the secondary organizational method in the WordPress.</p><p>When you’re creating <em>custom taxonomies, </em>you can either create hierarchical(category) or non-hierarchical(tags). These taxonomies can be applied to one or several post types including <em>posts. Custom taxonomies </em>can have custom index and archive template. These are usually displayed along-side categories &amp; other meta content. <em>Custom taxonomies </em>allows for more advanced organization of content.</p><p>So, When you’re creating a new <em>custom post type or taxonomy, </em>the very first question arises in your mind is where should you write your code in WordPress theme structure.<br>Well there are two options, one is to create a simple <em>plugin, &amp; </em>other is to write it into your <strong><em>functions.php. </em></strong>Now, there are benefits and drawbacks of both, such as,</p><blockquote><em>A Plugin can be turned on and off, and it could be specific to each theme you’ve created. This technique is used in most of the cases.</em></blockquote><blockquote>Whereas, on the other hand, if you write your <em>custom post type and taxonomy </em>code in your theme directly, it is only for custom builds &amp; its content is theme dependent &amp; allows for some advanced functionality.</blockquote><p>It’s completely one’s individual choice of how to use it in your theme. In the next article I’ll explain how to create <em>custom post type &amp; taxonomy </em>using both described techniques &amp; we’ll find out more about <em>custom post types and taxonomies.</em></p><p>If you have any questions, write me a comment below or find me at <a href="https://twitter.com/usamachaudhary">twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bffaebe69157" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximum function Nesting Level of 100 reached — Model Exception]]></title>
            <link>https://medium.com/@usama.muneer/maximum-function-nesting-level-of-100-reached-model-exception-dcbbe52157b1?source=rss-e078436a4d5f------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcbbe52157b1</guid>
            <category><![CDATA[xdebug]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Usama Muneer]]></dc:creator>
            <pubDate>Fri, 20 May 2016 14:21:16 GMT</pubDate>
            <atom:updated>2016-05-20T14:21:16.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*Wv2PdF6M2mBBVtAouO97HA.png" /></figure><p><em>Laravel </em>is of no doubt one of the great PHP Frameworks to work with, but sometimes it go crazy and through some ludicrous errors and warnings, which sometimes most of the developers has no idea of how to fix it.</p><p>Since I’ve been into Developing some cool stuff in Laravel, this is so far a rarely new Error to me, so like most of other people, i just googled the query and found some relative links, but still couldn’t find a proper solution. The common answer I found out which some people have suggested to just increase the nested level in <strong>php.ini.</strong></p><pre>xdebug.max_nesting_level = 300</pre><p>Which is not supposed to be the perfect solution what i was looking for.</p><p>I’ve found several people facing this problem even in the fresh installation of <em>Laravel Homestead </em>or Forge <em>Server.</em></p><p><em>Laravel Homestead</em> currently has a default <em>max_nesting_level </em>of 250.</p><p>Just to be clear, this is not a bug in <em>Laravel, Symfony</em> or anything else. It only occurs when<em> XDebug</em> is installed.</p><p>Although this particular problem could certainly be caused by some bad code.</p><p>But wait, before digging in deeper, let’s first understand what this <em>xDebug max_nesting_level</em> thing exactly is:</p><p><em>max_nesting_level=100</em> means that 100 or more functions are called recursively. This is not a high figure as such and later versions of XDebug (&gt;= 2.3.0) have raised this limit to 256. See here:</p><p><a href="http://bugs.xdebug.org/bug_view_page.php?bug_id=00001100">http://bugs.xdebug.org/bug_view_page.php?bug_id=00001100</a></p><p>But this probably not the <em>xDebug</em> issue at all, i found a simple solution to this.<br>just run the following command in your root directory, and this will wipe away this error for sure.</p><pre>composer update</pre><p>simple enough, eh?</p><p>If you liked my blog, do follow me on <a href="https://twitter.com/usamachaudhary">twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcbbe52157b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>