<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gareth Gillman</title>
    <description>The latest articles on Forem by Gareth Gillman (@gillmangareth).</description>
    <link>https://forem.com/gillmangareth</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F428074%2F2509173a-634d-4ce6-b920-be789f1f44ec.jpg</url>
      <title>Forem: Gareth Gillman</title>
      <link>https://forem.com/gillmangareth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gillmangareth"/>
    <language>en</language>
    <item>
      <title>Creating a Gutenberg block using a function</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Thu, 13 Feb 2020 15:47:40 +0000</pubDate>
      <link>https://forem.com/gillmangareth/creating-a-gutenberg-block-using-a-function-1oio</link>
      <guid>https://forem.com/gillmangareth/creating-a-gutenberg-block-using-a-function-1oio</guid>
      <description>&lt;p&gt;I am working on a members style plugin and needed a front end login form, WP has a pretty simple function to include the login form ( &lt;code&gt;wp_login_form()&lt;/code&gt; ) which makes the process really easy but how do we get the form to show? WP has a lot of options including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the_content filter&lt;/li&gt;
&lt;li&gt;Use a page template&lt;/li&gt;
&lt;li&gt;Use a shortcode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If I am to fully embrace WP's adoption of Gutenberg, I should delve into the building a block to handle this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the plugin
&lt;/h2&gt;

&lt;p&gt;Add the following to the top of a blank file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="cd"&gt;/**
 * Plugin Name:       GB Login Block
 * Plugin URI:        https://example.com
 * Description:       My Gutenberg login block
**/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file as login-block.php&lt;/p&gt;

&lt;h2&gt;
  
  
  Register Our block (php)
&lt;/h2&gt;

&lt;p&gt;Next we need to register the block JS using the &lt;code&gt;enqueue_block_editor_assets&lt;/code&gt; action.&lt;/p&gt;

&lt;p&gt;Add the following to the plugin file above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;login_block_func&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;wp_enqueue_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"login-block"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nf"&gt;plugin_dir_url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;"block.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;"wp-blocks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;"wp-editor"&lt;/span&gt; &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;"enqueue_block_editor_assets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"register_block_func"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Registering our block (js)
&lt;/h2&gt;

&lt;p&gt;Next we need to register the block using javascript, copy the code below and save the file as block.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;__&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;registerBlockType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;registerBlockType&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nx"&gt;registerBlockType&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;block/login-block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Login Form&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shield-alt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;common&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;The login form will be displayed here when viewed on the page.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rendering our function
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;register_block_type&lt;/code&gt; we can render php into our block, add the following to the login-block.php file we created earlier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;register_block_type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'block/login-block'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'render_callback'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'login_block_render'&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;login_block_render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;$login_args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'echo'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// This line is important&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;wp_login_form&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$login_args&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Finish
&lt;/h2&gt;

&lt;p&gt;Zip up both files and upload the file to the wp admin and activate your new plugin. Create a new page and add a new block, under 'common' you will should see "login form". Add to the page and save. Now head to the page on the frontend to see your custom login form.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
      <category>gutenberg</category>
    </item>
    <item>
      <title>How I test a websites speed!</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Mon, 11 Nov 2019 22:00:50 +0000</pubDate>
      <link>https://forem.com/gillmangareth/how-i-test-a-websites-speed-3mo7</link>
      <guid>https://forem.com/gillmangareth/how-i-test-a-websites-speed-3mo7</guid>
      <description>&lt;p&gt;Having your website load quicker than the human eye is every website owners goal but how would you test this as accurately as possible? I will explain the tools I use to test websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding the issues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before I start optimising the website, I want to understand what problems I may be faced with. Understanding the cause of a problem is a the quickest way to understand how to fix the problem.&lt;/p&gt;

&lt;p&gt;I use a few different tools to get an understanding, these include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tools.pingdom.com"&gt;Pingdom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webpagetest.org/"&gt;Webpagetest&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the above are websites / apps used to measure a websites load time but they all have different uses (for me).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Speed problems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some of the most common issues I come up against are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uncompressed images, css and js files&lt;/li&gt;
&lt;li&gt;no server and browser caching&lt;/li&gt;
&lt;li&gt;video files
= the website hasn't been compressed using Gzip or Brottli&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My main goal when optimising a website is to make the website as small as possible without changing the content. I am paid to make the clients website faster and in most cases they don't want to remove functionality from their site even though it may affect their speed website. This guide doesn't go into optimising the server for speed purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find out the pain points
&lt;/h2&gt;

&lt;p&gt;My first step is to build a list of the issues I need to look at, I will fire up each of the tools above to build my list of things to do.&lt;/p&gt;

&lt;p&gt;My first test is using Pingdom, I don't recommend it's speed score but I use it for the UI of showing assets and page size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1fXFrvhd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Xxk86k9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1fXFrvhd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Xxk86k9.jpg" alt="Pingdom test 1"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_qIAj42s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qRm05UD.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_qIAj42s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qRm05UD.jpg" alt="Pingdom test 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above are my results, I found out the following from the test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the website is a beastly 3mb in size and has 165 assets&lt;/li&gt;
&lt;li&gt;there is no minification or combining going on with the css and js&lt;/li&gt;
&lt;li&gt;the website has external assets (facebook, twitter etc) which can be &lt;a href="https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/"&gt;preloaded&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;the websites images have been compressed quite well&lt;/li&gt;
&lt;li&gt;the website has no &lt;a href="https://gtmetrix.com/leverage-browser-caching.html"&gt;browser caching&lt;/a&gt; enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other test I use is webpagetest which is one of the most accurate speed tests available, it has tons of features from selecting location, connection speed and browser used. By default it does 3 concurrent tests to get a realistic speed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---GtkPjwu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qmO970d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---GtkPjwu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/qmO970d.jpg" alt="Webpagetest result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see we get a median of the 3 tests and I had 6.5 seconds load time for document complete and 9.6 seconds for fully loaded.&lt;/p&gt;

&lt;p&gt;Google defines these terms as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Document Complete: The metrics grouped together under the Document Complete heading are the metrics collected up until the browser considered the page loaded (onLoad event for those familiar with the javascript events).  This usually happens after all of the images content have loaded but may not include content that is triggered by javascript execution.&lt;/p&gt;

&lt;p&gt;Fully Loaded: The metrics grouped together under the Fully Loaded heading are the metrics collected up until there was 2 seconds of no network activity after Document Complete.  This will usually include any activity that is triggered by javascript after the main page loads. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Optimising the website
&lt;/h2&gt;

&lt;p&gt;I use both results as a guide, I will complete 1 task (such as minifying css) and run both test again to see what impact the task had on the results from a speed and statistic view. My main aim is to make the website faster but also leaner, the smaller a website is, the quicker it is to load especially on mobile devices. Depending on the website I would aim for the following statistics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less than 3 seconds document load time&lt;/li&gt;
&lt;li&gt;Less than 1.5mb page weight&lt;/li&gt;
&lt;li&gt;Less than 80 combined assets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But how do I make the changes you ask? I will go into that next time, hopefully this quick guide has given you an understanding on how to test your website and what to look for when using testing tools.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>How I structure my CSS</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Tue, 08 Oct 2019 13:05:24 +0000</pubDate>
      <link>https://forem.com/gillmangareth/how-i-structure-my-css-4hoe</link>
      <guid>https://forem.com/gillmangareth/how-i-structure-my-css-4hoe</guid>
      <description>&lt;p&gt;I am a "clean freak" and this goes for my code, everything has it's place, all of my css is built off a foundation which I then layer. This allows me to know where everything is when I need it or I need to show someone else how to amend my code.&lt;/p&gt;

&lt;p&gt;I use SASS/SCSS, I am a relative newbie to it after being pushed by a work colleague but it's made my code much easier to manage, I now realise I was an idiot for not embracing it a long time ago.&lt;/p&gt;

&lt;h3&gt;
  
  
  Folders
&lt;/h3&gt;

&lt;p&gt;My folder structure is quite simple, my scss folder has 3 folders and 1 scss file, each additional scss file I create would go into one of these folders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zi9nW6mF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dr0clzpz8ii6ncw86rfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zi9nW6mF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dr0clzpz8ii6ncw86rfq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Abstracts holds the pre-design CSS such as @font-face, body styling, mixins and variables. &lt;/p&gt;

&lt;p&gt;Components holds the CSS which builds elements of the design such as header, footer etc&lt;/p&gt;

&lt;p&gt;Layouts holds the rest of the CSS such as page styles.&lt;/p&gt;

&lt;p&gt;My theme-styles.scss file contains the following:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Abstracts&lt;br&gt;
@import "abstracts/&lt;strong&gt;abstracts";&lt;br&gt;
// Components&lt;br&gt;
@import "components/&lt;/strong&gt;components";&lt;br&gt;
// Layouts&lt;br&gt;
@import "layouts/__layouts";&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Files&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;I have a base set of files I use in every project, hopefully every file is explanatory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hPaumg-_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6rabgfdyzxfywqgmajfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hPaumg-_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6rabgfdyzxfywqgmajfl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use @import to add the files from each folder to the respective template file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3NFdbf2g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v1mf81khgq9ssspq0hjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3NFdbf2g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v1mf81khgq9ssspq0hjd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Structure
&lt;/h2&gt;

&lt;p&gt;My CSS is organised in 3 parts:&lt;/p&gt;

&lt;p&gt;1: the classes are in order of how they appear in the html&lt;br&gt;
2: the css statements are ordered in alphabetical order&lt;br&gt;
3: media queries are at the bottom of the file (while following the above rules)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pes3tAcl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tfvaf59kedbzxw384bm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pes3tAcl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tfvaf59kedbzxw384bm3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully the above has given you some ideas on how to improve your project structures.&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Why PluginVulnerabilities(.com) is harming the WordPress eco-system!</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Fri, 19 Apr 2019 15:28:54 +0000</pubDate>
      <link>https://forem.com/gillmangareth/why-pluginvulnerabilities-com-is-harming-the-wordpress-eco-system-275d</link>
      <guid>https://forem.com/gillmangareth/why-pluginvulnerabilities-com-is-harming-the-wordpress-eco-system-275d</guid>
      <description>&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; In this article I am talking about WordPress.org, the open source version of WordPress, not the hosted WordPress.com.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is this about?
&lt;/h2&gt;

&lt;p&gt;PluginVulnerabilities (PV) is a WordPress security service which (for a price) will check WordPress plugins for security vulnerabilities with prices starting from $250. I have no issue with this, this is a service which is needed to make sure products released into the public are as secure as they can be. PV do a great job of finding security issues in plugins but how PV are disclosing them, is where the issues start.&lt;/p&gt;

&lt;h2&gt;
  
  
  What have they done?
&lt;/h2&gt;

&lt;p&gt;When PV find a security issue in a plugin (without being paid to do the review) they would go on the WordPress.org forums and post the security vulnerability on the very public forums while also promoting their review service. They ultimately got banned by the WordPress.org forum management team for spamming and not disclosing security issues responsibly. After having their main account banned, they kept up their methods by creating hundreds of new usernames to publish security vulnerabilities on the forums. This method ultimately got them banned permanently from the forums.&lt;/p&gt;

&lt;h2&gt;
  
  
  Responsible Disclosure
&lt;/h2&gt;

&lt;p&gt;When a security reviewer finds an issue in software, they would either contact the developers directly or use a service like HackerOne (HO lets you get paid for disclosing security issues). This is called 'responsible disclosure' which lets the developers of the software release a fix before the issue can be used by persons with ill intent. Unfortunately PV have no intention of doing their disclosures responsibly so were using these security issues to promote their service(s).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the problem?
&lt;/h2&gt;

&lt;p&gt;WordPress itself runs roughly 75 million websites, each website can install any plugin they like, a plugin could be in use on millions of websites. If a security issue is made public before it can be fixed, this can lead to potentially millions of websites left vulnerable to those with ill intent to take control of websites to steal data, inject malware or redirect users to nefarious websites. The implications of this could be huge for a company who uses Woocommerce to run their ecommerce store or run a high traffic website.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are PV doing wrong?
&lt;/h2&gt;

&lt;p&gt;What PV are doing isn't illegal but it's immoral, they are releasing security vulnerabilities to the public domain to embarass plugin developers into using their review service. By releasing the vulnerabilities before giving the developers time to fix the issue, they are giving developers no time to protect their users websites. On the 21st March, PV released a security vulnerability on their blog, within a few hours sites were being attacked using the methods in their post, they are actively giving people with ill intent access to attack WordPress websites. On the bottom of their "disclosure" they use the following wording:&lt;/p&gt;

&lt;p&gt;*To make sure a plugin you are using or considering using has been properly secured you get a complete security review of it from us."&lt;/p&gt;

&lt;p&gt;They are using security issues within open source plugins to promote their paid services while allowing innocent website owners to potentially lose their livelyhoods and be prosecuted by law enforcement because PV don't want to followi recommended 'responsible disclosure'.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is there a solution?
&lt;/h2&gt;

&lt;p&gt;Ultimately no, you can mitigate risks of security issues by installing a firewall (either through your webhost or a separate security company), a firewall can prevent attacks and be an extra layer of protection but unless the firewall knows of the attack method, it may not be able to block everything. There are WordPress security plugins which actively monitor and protect websites from new attacks, such as Sucuri and Wordfence but even these aren't 100% safe. Until every developer can code to not make mistakes in their code, vulnerabilities will happen.&lt;/p&gt;

&lt;p&gt;PV would actually be giving themselves a better reputation if they responsibly disclosed their findings, plugin developers would be more interested in using a service from a company who has actively helped them secure their code. Because of their stance on how they disclose vulnerabilites, PV have and will be vilified for the way they act in the name of promoting their service(s). PV offer something the WordPress eco-system needs and plugin developers would use but they are doing the worst possible job of getting users on board.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>security</category>
    </item>
    <item>
      <title>Gutenberg - love or hate it, it's here to stay</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Sat, 13 Apr 2019 18:21:30 +0000</pubDate>
      <link>https://forem.com/gillmangareth/gutenberg-love-or-hate-it-it-s-here-to-stay-4gcb</link>
      <guid>https://forem.com/gillmangareth/gutenberg-love-or-hate-it-it-s-here-to-stay-4gcb</guid>
      <description>&lt;h2&gt;
  
  
  What is Gutenberg?
&lt;/h2&gt;

&lt;p&gt;Gutenberg is the new post editor for WordPress websites released in V5, it totally replaced the old editing experience with a brand new, drag and drop editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do developers seem to hate it?
&lt;/h2&gt;

&lt;p&gt;There can be a couple of reasons for this and the most obvious is the feeling among developers is the new editor was forced on them, some developers felt the old editor was perfect and didn't need replacing. Gutenberg also uses react, which means a lot of WordPress developers needed to learn a whole new code base to customise the new editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why was Gutenberg introduced?
&lt;/h2&gt;

&lt;p&gt;Gutenberg was created to make editing your WordPress content easier, the old editor was based on TinyMCE which had a limited editing experience for users. WordPress competitors such as Medium and Wix had much better editing experiences, WordPress was lagging behind massively.&lt;/p&gt;

&lt;h2&gt;
  
  
  My thoughts
&lt;/h2&gt;

&lt;p&gt;As a developer, it was scary to learn a new language, a new editor and having to teach my clients a whole new editing experience but overall the editor has massively improved my clients editing experience with WP, they now have an easy to use editor which has it's faults but overall they enjoy using Gutenberg far more than the old editor. They rely on me less to help them update their website content and they have much more control on how their content looks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The future
&lt;/h2&gt;

&lt;p&gt;Gutenberg will continue to grow, the editing experience will get better and more users will begin to use it. More developers will get on board with it to expand it's functionality and ultimately both users and developers will wonder why it took so long for WP to replace the old editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you think?
&lt;/h2&gt;

&lt;p&gt;Have you used Gutenberg? Did you enjoy the experience? What would you like to see from Gutenberg in the near future?&lt;/p&gt;

</description>
      <category>wordpress</category>
    </item>
    <item>
      <title>Simple WordPress Widget for your Dev.to Posts</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Sat, 13 Apr 2019 00:51:10 +0000</pubDate>
      <link>https://forem.com/gillmangareth/simple-wordpress-widget-for-your-dev-to-posts-5h8h</link>
      <guid>https://forem.com/gillmangareth/simple-wordpress-widget-for-your-dev-to-posts-5h8h</guid>
      <description>&lt;p&gt;I was bored and saw some posts of the users making use of the dev.to api so I threw together my own little project, a widget for your posts.&lt;/p&gt;

&lt;p&gt;It shows the latest 30 posts by using the following API call: &lt;a href="https://dev.to/api/articles?username=ben"&gt;https://dev.to/api/articles?username=ben&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A view of the widget admin, super simple: &lt;a href="https://imgur.com/a/r3bg67G"&gt;https://imgur.com/a/r3bg67G&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live view (showing Ben Halpen's posts) - The widget comes with no styling so uses the default styling from your theme.&lt;/p&gt;

&lt;p&gt;http:// wpthemes4u. co. uk/plugins/ (remove spaces)&lt;/p&gt;

&lt;p&gt;You can download the widget from &lt;a href="https://www.dropbox.com/s/ohkdmbk9arrzxoe/devto-widget.zip?dl=0"&gt;https://www.dropbox.com/s/ohkdmbk9arrzxoe/devto-widget.zip?dl=0&lt;/a&gt;, I will get it on Github when I get chance.&lt;/p&gt;

&lt;p&gt;The API has a lot of data I can use to make the widget more interesting, what would you like to see? things I have considered are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user card (with profile image, name, description &amp;amp; twitter url)&lt;/li&gt;
&lt;li&gt;limit posts to a user defined number in the widget settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know any ideas to improve the widget or other ideas for WordPress integrations for Dev.to&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Taking time out from freelancing</title>
      <dc:creator>Gareth Gillman</dc:creator>
      <pubDate>Fri, 12 Apr 2019 18:59:37 +0000</pubDate>
      <link>https://forem.com/gillmangareth/taking-time-out-from-freelancing-5fgg</link>
      <guid>https://forem.com/gillmangareth/taking-time-out-from-freelancing-5fgg</guid>
      <description>&lt;p&gt;6 weeks ago I took the step to look for a full time job, I have been freelancing for 10 years but needed a break from it, this post is my reasons why and how I feel i am fitting in.&lt;/p&gt;

&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;I am a WordPress developer in the uk, been freelancing for 10 years with hundreds of amazing projects completed.&lt;/p&gt;

&lt;h2&gt;
  
  
  My reasons
&lt;/h2&gt;

&lt;p&gt;There are too many to list but my top 3 are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Time - When you freelance your mind is always on work, it's hard to switch off and relax, you're either thinking about deadlines or chasing invoices, after 10 years I need a break to take some time out to not worry about work. You can't take time out for a holiday without a lot of planning and even then it will likely involve work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Money - Unless you have side business where recurring income happens, you're forever chasing the next pay cheque, always thinking about what work you have coming in to keep the pot of money full, when it gets low you have to work twice as hard to refill it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Learning - I felt I didn't have enough time in the day to handle all the work I had (fortunately was very busy) and to keep learning, I felt I was so far behind in where I wanted to be as a developer as I was concentrating on getting jobs completed and not improving myself.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The job
&lt;/h2&gt;

&lt;p&gt;I have taken a role as a front end developer which is WordPress focused, I am mainly building WP themes and plugins (which is what I enjoy). I work a standard 9-5 so I have time to myself at weekends and in the evenings, I have a constant pay cheque at the end of the month and only one week in I have already started using SASS, it had been on my todo list for over 2 years.&lt;/p&gt;

&lt;h2&gt;
  
  
  The future
&lt;/h2&gt;

&lt;p&gt;I am taking time out to enjoy life, I will finally have time to go to Wordcamps and other conferences, I can finally take a holiday next year without worrying about work, I will be able to save money a lot quicker to plan for the future.&lt;/p&gt;

&lt;p&gt;I haven't stopped all freelancing, I am still doing bits here and there but they are projects I really want to do and on my terms. Will i go back full time freelancing? I don't know, I am taking each day as it&lt;/p&gt;

</description>
      <category>career</category>
    </item>
  </channel>
</rss>
