<?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>DEV Community: Eddy Sims</title>
    <description>The latest articles on DEV Community by Eddy Sims (@eddysims).</description>
    <link>https://dev.to/eddysims</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%2F302234%2Fec703114-095c-4629-9d0d-dee16118c8ca.png</url>
      <title>DEV Community: Eddy Sims</title>
      <link>https://dev.to/eddysims</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eddysims"/>
    <language>en</language>
    <item>
      <title>Create a themed favicon for color modes</title>
      <dc:creator>Eddy Sims</dc:creator>
      <pubDate>Wed, 29 Sep 2021 23:21:23 +0000</pubDate>
      <link>https://dev.to/eddysims/create-a-themed-favicon-for-color-modes-2ok1</link>
      <guid>https://dev.to/eddysims/create-a-themed-favicon-for-color-modes-2ok1</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;There are 2 types of people in this world. Those who use dark mode and the other people.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm not sure about you, but I am basically a 100% user of dark mode on everything I do. There is nothing worse then sitting down at my desk to do some work or reading, opening a website and being hit with a solar flare from the bright white screen in front of me. However, this has caused me some issues when it comes to &lt;code&gt;favicons&lt;/code&gt; on the web. A favicon is the small icon that you see in your browser tab that allows you to navigate the madness of your many tabs. If your like me and prefer to save your eyes from the blinding brightness of light mode, you may have noticed that some of these &lt;code&gt;favicons&lt;/code&gt; are kind of hard to see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr0xzjta8n1l0ymazek95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr0xzjta8n1l0ymazek95.png" alt="The current favicon on my personal website" width="222" height="40"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post we will go over how to toggle your favicon based on whether the user has their settings on &lt;code&gt;dark mode&lt;/code&gt; or &lt;code&gt;light mode&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In this example I will be using a &lt;a href="https://nextjs.org/"&gt;NextJS&lt;/a&gt; website, however this will work in any React application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lets start
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create our project
&lt;/h3&gt;

&lt;p&gt;First thing we will do is create a new project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app themeable-favicons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create a custom hook
&lt;/h3&gt;

&lt;p&gt;Next, we are going to create a &lt;a href="https://reactjs.org/docs/hooks-intro.html"&gt;custom hook&lt;/a&gt; called &lt;code&gt;useSystemTheme&lt;/code&gt;. For our custom hook we are going to simply wrap an already created npm package. So lets install the package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-use-system-theme
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's create a new file called &lt;code&gt;useSystemTheme.js&lt;/code&gt; under a &lt;code&gt;hooks&lt;/code&gt; directory. Our directory structure should look something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;│   └── components
│   └── hooks
|       ├── useSystemTheme.js
│   └── pages
|       ├── index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside our &lt;code&gt;useSystemTheme.js&lt;/code&gt; file, we are going to import the &lt;code&gt;useTheme&lt;/code&gt; function from our &lt;code&gt;react-use-system-theme&lt;/code&gt; and return the value from it.&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="c1"&gt;// useSystemTheme.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;useTheme&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-use-system-theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;useSystemTheme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTheme&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;theme&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;p&gt;This is called "wrapping". The reason that we want to take this approach rather than just using the &lt;code&gt;useTheme&lt;/code&gt; function directly is that if in the future, we decide to re-write this hook or use a different package, we will only need to make the change in one place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create our favicons
&lt;/h3&gt;

&lt;p&gt;Next we want to create our favicons. I like to use &lt;a href="https://realfavicongenerator.net/"&gt;RealFaviconGenerator.net&lt;/a&gt; as I think that it gives you the most robust options for your favicons.&lt;/p&gt;

&lt;p&gt;Once you have created your two favicon packages (one for your dark mode and one for your light mode), you will want to rename the files in them from &lt;code&gt;favicon.ico&lt;/code&gt; -&amp;gt; &lt;code&gt;favicon-dark.ico&lt;/code&gt; etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;│   └── public
|       ├── favicon-dark-16x16.png
|       ├── favicon-dark-32x32.png
|       ├── favicon-dark.ico
|       ├── favicon-light-16x16.png
|       ├── favicon-light-32x32.png
|       ├── favicon-light.ico
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use our hook to toggle favicons
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This step will be very specific to how NextJS works. However, you can do the same thing in any project that has a &lt;code&gt;favicon&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;By default, NextJS adds a favicon to our &lt;code&gt;pages/index.js&lt;/code&gt; file. We will want to go in and remove this, as we are going to move the favicon to our &lt;code&gt;pages/_app.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Next, in our &lt;code&gt;pages/_app.js&lt;/code&gt; file we will want to include our &lt;code&gt;favicon&lt;/code&gt;. To do this, we are going to import the &lt;code&gt;Head&lt;/code&gt; component from &lt;code&gt;next/head&lt;/code&gt;. This will allow us to add to our &lt;code&gt;html&lt;/code&gt; &lt;code&gt;head&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Inside of our &lt;code&gt;Head&lt;/code&gt; component, we will want to add our &lt;code&gt;favicon&lt;/code&gt; that we removed from our &lt;code&gt;pages/index.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Head&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/head&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../styles/globals.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&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="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/favicon-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.ico`&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we want to import and use our hook to toggle between the two &lt;code&gt;favicons&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Head&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/head&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useSystemTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../hooks/useSystemTheme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../styles/globals.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSystemTheme&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`/favicon-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.ico`&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see in the code above that I am including the &lt;code&gt;favicon&lt;/code&gt; with &lt;code&gt;favicon-${theme}.ico&lt;/code&gt;. This will use the dark favicon that we created earlier on.&lt;/p&gt;

&lt;p&gt;Now, when we switch our system theme from light mode, to the more appropriate dark mode, we will be able to toggle our favicon with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some extra notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;While this technique works for system preferences, it can also be used with different color themes if you use something like &lt;a href="https://theme-ui.com/"&gt;Theme UI&lt;/a&gt; or &lt;a href="https://chakra-ui.com/"&gt;Chakra UI&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You can find an example repo of this working &lt;a href="https://github.com/eddysims/color-themed-favicons"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You can find a working demo &lt;a href="https://themed-favicons.netlify.app/"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You can find this content in video form &lt;a href="https://www.youtube.com/watch?v=kDl2dU4D8kg&amp;amp;t=18s"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>reacthooks</category>
      <category>npm</category>
    </item>
    <item>
      <title>My first WordPress Plugin. Why? How? What I Learned.</title>
      <dc:creator>Eddy Sims</dc:creator>
      <pubDate>Fri, 03 Jan 2020 19:12:28 +0000</pubDate>
      <link>https://dev.to/eddysims/my-first-wordpress-plugin-why-how-what-i-learned-1ocm</link>
      <guid>https://dev.to/eddysims/my-first-wordpress-plugin-why-how-what-i-learned-1ocm</guid>
      <description>&lt;p&gt;Over the last year I have had the responsibility of maintaining and updating our company website. It's a pretty simple WordPress website with a few hundred pages and a few dozen editors. In April of 2019, I made the brave move of updating to WordPress 5 and embarking on a journey of moving our content over to custom &lt;a href="https://wordpress.org/gutenberg/"&gt;Gutenberg&lt;/a&gt; blocks.&lt;/p&gt;

&lt;p&gt;At that time, I'll admit, I knew nothing about Gutenberg. I found [an article] about how ACF worked with Gutenberg, read through it and created our first block, then our second, then our third, and before I knew it we had quite a few pages fully moved over. It wasn't until a few months in that I realized that ACF with Gutenberg was a good starting point, but really wasn't the best user experience for our editors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OCMw0tZK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/c5hjpj6eqk0e074uxia2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OCMw0tZK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/c5hjpj6eqk0e074uxia2.png" width="258" height="586"&gt;&lt;/a&gt;&lt;br&gt;An actual screenshot from our site.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built a WordPress plugin.
&lt;/h2&gt;

&lt;p&gt;As a team, we decided to ditch ACF, move over to &lt;a href="https://parceljs.org/"&gt;ParcelJS&lt;/a&gt; and start building custom blocks that are a nice experience for our users &lt;em&gt;and&lt;/em&gt; our editors.&lt;/p&gt;

&lt;p&gt;This however presented new issues. We had new, better, stronger, faster blocks going out, but there was no way for us to know where the ACF blocks were used for us to replace them. &lt;/p&gt;

&lt;p&gt;I got fed up with these types of issues so I spent some time working on a simple function that gave us a &lt;a href="https://developer.wordpress.org/rest-api/"&gt;WP rest endpoint&lt;/a&gt; that showed what pages a block was used on. From there we could be sure that when updating a block, we had found all the instances in which it was used.&lt;/p&gt;

&lt;p&gt;This proved to be way more helpful then I could have imagined. Issues went down, QA became much easier, and I was a 🙂 🏕️er. A co-worker of mine mentioned that we couldn't be the only ones having this issue, and this would probably be useful for others as well.&lt;/p&gt;

&lt;p&gt;From there I took a few weeks of my spare time and wrote a plugin — &lt;a href="https://wordpress.org/plugins/find-my-blocks/"&gt;Find My Blocks&lt;/a&gt;, re-wrote the plugin, submitted it to WordPress and the rest is history!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P-p1XHpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ps.w.org/find-my-blocks/assets/banner-1544x500.jpg%3Frev%3D2208303" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P-p1XHpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ps.w.org/find-my-blocks/assets/banner-1544x500.jpg%3Frev%3D2208303" alt="Find My Blocks" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I built a WordPress plugin.
&lt;/h2&gt;

&lt;p&gt;As I mentioned, I had originally written an endpoint that did 90% of the work already. From here is was quite simple, take that endpoint, clean it up, consume it by some frontend library, and display a bunch of content. It made sense to me to make a small &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt; app, as Gutenberg is written in the same thing. So my decisions were made and I was off.&lt;/p&gt;

&lt;p&gt;I won't get into too much detail about the code. If you would like to take a look you can do so on &lt;a href="https://github.com/eddysims/find-my-blocks"&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned building a WordPress plugin.
&lt;/h2&gt;

&lt;p&gt;I believe that you everything you do is a learning opportunity, and this was no exception. Besides the obvious "How to build a WordPress plugin" there was a tonne of learning from this project.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. React and WordPress work nicely together.
&lt;/h4&gt;

&lt;p&gt;This was a surprise to me, although I don't know why. At first I thought that setting up a React app on a WordPress plugin would be a pain. The truth is that it was as easy as setting up a React app anywhere. All I needed was a &lt;code&gt;&amp;lt;div id="find-my-blocks"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;, and the rest was very straight forward.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Getting a WordPress plugin into the Plugin Repository is easier than expected.
&lt;/h4&gt;

&lt;p&gt;I have built plenty of WordPress sites, and I have used plenty of WordPress plugins. I always thought that the people who develop plugins are some type of star developer and that getting a plugin into WordPress was super challenging. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Spoiler: It's not.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are tonnes of guides that show exactly what you need to do. I followed &lt;a href="https://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/"&gt;this one&lt;/a&gt; in combination of the &lt;a href="https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/"&gt;WordPress Guidelines&lt;/a&gt; and found this process to be way easier then I expected.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. If you build it, they will not come.
&lt;/h4&gt;

&lt;p&gt;This is a lesson that I, and anyone who has released something has learned multiple times. &lt;/p&gt;

&lt;p&gt;On Dec 3, 2019 I received my email saying that my plugin was accepted. I screenshot it, sent it to everyone and bragged about how I proud I was! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DJ9U85_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/0gypwe7desr50zj9y39u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DJ9U85_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/0gypwe7desr50zj9y39u.png" alt="My Email" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Dec 5, 2019 my plugin had 1 active installation... My own... 😔&lt;/p&gt;

&lt;p&gt;I couldn't believe it! I had created something that was so useful to me! Why wasn't anyone using it?!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Answer: Because no one knew it existed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I took some action and sent a message to a few slack communities that I am part of, hoping that people would evangelize my great work.&lt;/p&gt;

&lt;p&gt;As of writing this line, my plugin has 87 all time downloads and I am very happy with that. I quickly learned unless I wanted to dedicate a large amount of time to this, I needed to not care about the numbers and just hope that my work is helping to make someone else's life easier.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Anyone can do it.
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://en.m.wikipedia.org/wiki/Impostor_syndrome"&gt;Imposter syndrome&lt;/a&gt; is real and it keeps a lot of people back from doing amazing things.&lt;/p&gt;

&lt;p&gt;I don't think I have created the greatest thing of all time, But I also never thought that I would have a project out in the wild. I hummed and hawed about whether I should submit my plugin, and I'm glad I did. Something so small was able to give me a confidence boost I needed to start my next, bigger project, and then hopefully another one after that, and another one after that. &lt;/p&gt;

&lt;p&gt;I realize now that people who put these projects out are not some sort of star developer. They are people who most likely started with something small, learned from it and let their ideas grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try my plugin?
&lt;/h2&gt;

&lt;p&gt;If you want to try out my plugin you can find it &lt;a href="https://wordpress.org/plugins/find-my-blocks"&gt;here&lt;/a&gt;. I would appreciate it if anyone wants to try it out and leave me feedback on their thoughts!&lt;/p&gt;

&lt;p&gt;If you have any questions, let me know in the comments and I will try to get back to everyone! &lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>react</category>
      <category>javascript</category>
      <category>career</category>
    </item>
  </channel>
</rss>
