<?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 MohammadReza Keikaavousi on Medium]]></title>
        <description><![CDATA[Stories by MohammadReza Keikaavousi on Medium]]></description>
        <link>https://medium.com/@keikaavousi?source=rss-a857b28d0697------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*kgArXhaEXA2L4vWey2FBrA.jpeg</url>
            <title>Stories by MohammadReza Keikaavousi on Medium</title>
            <link>https://medium.com/@keikaavousi?source=rss-a857b28d0697------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:48:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@keikaavousi/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[Web Design Accessibility]]></title>
            <link>https://keikaavousi.medium.com/accessibility-308df0f7528a?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/308df0f7528a</guid>
            <category><![CDATA[web-accessibility]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Mon, 03 May 2021 19:05:14 GMT</pubDate>
            <atom:updated>2021-05-03T19:06:55.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*FfGGpmFXFmtVLyhvQt9SAA.jpeg" /></figure><p>Accessibility generally means “the ability to access information on a website or software for anyone, even those with a particular disability or problem.”</p><p>Everyone uses services and applications on a daily basis to meet their daily needs. But the point is that many of these people have disabilities and certainly many of the services and websites available to these people are not usable.</p><p>Website optimization is important for better accessibility than SEO and search engine optimization. It is interesting to know that Google has recently ranked higher in its search results websites that have better principles of accessibility.</p><h3>The need for accessibility on websites</h3><h4>Vision problems</h4><p>Imagine a situation where a person with color blindness wants to get services from an online service. People with color blindness often cannot distinguish red from green. Now suppose you have a button that has a green background with red text! This button is the same color as the inside text for such people and practically does not allow diagnosis for the person. Or consider a blind person who wants to use a Screen Reader to read your business or online service website. If the coding of your page is not standard and you have not used semantic tags, you will definitely confuse the page reader and practically this person can not use your website.</p><h4>Cognitive problems</h4><p>consider someone who has dyslexia or dyslexia. People who are depressed usually have a slow reading speed. Poor spelling and dictation are other characteristics of these people. Even if the words are meaningless, they will have trouble reading them. So if your website has texts that cause problems for these people, it is practically impossible to use it. It is better for the texts of the website for these people to be written in an orderly and legible manner and to include images related to the subject. Others have poor short-term memory or cognitive impairment. Building complex processes in software confuses these people. A simple activity in the software should not be done after going through several pages and clicking on several items. People with cognitive impairments can hardly communicate with such software.</p><h4>Hearing problems</h4><p>If your website has a video playback section and this video has a narration. You should definitely include subtitles for the film or a readable alternative for the deaf. On the other hand, software alerts will be useless for these people if they are only audio.</p><h4>Other problems</h4><p>Accessibility must be observed even in the use of physical services of online services. If you offer a service to people in person from the web, you should definitely give priority to people with disabilities. For example, an online taxi that sends cars for people with disabilities that can carry a wheelchair, or the driver does not make a voice call if the person chooses the deaf option.</p><h4>Conclusion</h4><p>Nowadays, optimizing a website for people with disabilities is no longer a privilege for the website, but a basic necessity. Especially when your service is used by people on a daily basis or is a public system that a person is forced to use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=308df0f7528a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to override wooCommerce default template]]></title>
            <link>https://keikaavousi.medium.com/how-to-override-woocommerce-default-template-4ca72dbcb9ab?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ca72dbcb9ab</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[wordpress-development]]></category>
            <category><![CDATA[woocommerce-development]]></category>
            <category><![CDATA[woocommerce-themes]]></category>
            <category><![CDATA[woocommerce]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Fri, 30 Apr 2021 08:29:01 GMT</pubDate>
            <atom:updated>2021-04-30T08:30:24.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SxffGNB1a75VytSwMK8SpA.jpeg" /></figure><p>If you are creating an e-commerce website using Woocommerce, you definitely need to override the Woocommerce default page templates to use your own design. follow these steps to easily integrate your styles:</p><p><strong>1-</strong> first of all in your <strong><em>functions.php</em></strong> file add this lines of code:</p><pre>function mytheme_add_woocommerce_support() {</pre><pre>   add_theme_support( &#39;woocommerce&#39; );</pre><pre>}</pre><pre>add_action( &#39;after_setup_theme&#39;, &#39;mytheme_add_woocommerce_support&#39;);</pre><p><strong>2- </strong>Then you need to create a folder inside your theme directory folder name woocommerce (<strong><em> wp-content/themes/your-theme/woocommerce</em></strong>) and then copy entire the <strong><em>wp-content/plugins/woocommerce/template</em></strong> directory in the folder you already created if you want to override all files or just copy the desired files you want to override.</p><p><strong>3-</strong> in your <strong><em>header.php</em></strong> file remember to add <strong>wp_head(); </strong>to automatically inject css and js needed for wooocmmerce.</p><p><strong>4- </strong>💡<strong> </strong>It’s important that if you want to use woocommerce css file, you need to wrap your page or body with “woocommerce” class name. so it can be apply to your page elemnets. <strong>body class=”woocommerce”. </strong>otherwise you just have woocommerce based classes and no css apply to your page.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ca72dbcb9ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Copy to clipboard using javascript]]></title>
            <link>https://keikaavousi.medium.com/copy-to-clipboard-using-javascript-8e52a2bd7661?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e52a2bd7661</guid>
            <category><![CDATA[browser-api]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[html5]]></category>
            <category><![CDATA[html5-api]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Fri, 30 Apr 2021 07:56:01 GMT</pubDate>
            <atom:updated>2021-04-30T07:56:01.567Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1Ib3dbLpBKX2PTQymRZaQ.jpeg" /></figure><p>HTML5 browser API is amazing which empowers you to do lots of things without any third-party libraries. One of them is clipboard copy with simple JS code. <br>you just need to call the navigator and then call the writeText clipboard method. It’s an async function and you need to use a promise to handle the success or error returned.</p><h3>Copy to clipboard</h3><p>The HTML code could be like this:</p><pre>&lt;p id=&quot;text&quot;&gt;This is a sample text to copy to clipboard&lt;/p&gt;<br>&lt;button id=&quot;copyBtn&quot;&gt;copy to clipboard!&lt;/button&gt;</pre><p>and then in your JS code we first define the elements:</p><pre>const text = document.getElementById(&quot;text&quot;)</pre><pre>const copyBtn = document.getElementById(&quot;copyBtn&quot;)</pre><p>and then handle the the event listener like this:</p><pre>copyBtn.addEventListener(&quot;click&quot;, () =&gt; {</pre><pre>   navigator.clipboard.writeText(text.innerText)</pre><pre>   .then(() =&gt; copyBtn.innerText = &#39;text copied!&#39;)</pre><pre>   .catch(<em>err</em> =&gt; console.log(<em>err</em>))</pre><pre>})</pre><p>it works like a charm! you can check your clipboard by pasting it anywhere you want.</p><h3>Paste from clipboard</h3><p>Also navigator support Pasting function. Imagine we have another button for paste from clipboard:</p><pre>&lt;button id=&quot;pasteBtn&quot;&gt;paste from clipboard!&lt;/button&gt;</pre><p>and then in your JS code:</p><pre>pasteBtn.addEventListener(&quot;click&quot;, () =&gt; {</pre><pre>   navigator.clipboard.readText()</pre><pre>  .then((<em>result</em>) =&gt; alert(<em>result</em>))</pre><pre>  .catch(<em>err</em> =&gt; console.log(<em>err</em>))</pre><pre>})</pre><p>here we just alert the result. you can append it in any element you want.</p><p>enjoy it ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e52a2bd7661" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a custom popup submit message in contact form 7]]></title>
            <link>https://keikaavousi.medium.com/how-to-create-a-custom-popup-submit-message-in-contact-form-7-e3846a37990d?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3846a37990d</guid>
            <category><![CDATA[contact-form-7]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[wordpress-development]]></category>
            <category><![CDATA[wordpress-plugin-design]]></category>
            <category><![CDATA[wordpress-plugins]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Thu, 23 Apr 2020 20:20:19 GMT</pubDate>
            <atom:updated>2020-04-23T20:20:19.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SnUo0xrvc1gGtcA19rNcQ.png" /></figure><p>When you work with <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, you probably want to display your custom message with unique styles differ from plugin’s default style, or you want to redirect the user to another page after submitting happen.<br>Here is the simplest solution without using any plugin or complicated configuration!</p><p>after you create your form and add its shortcode to your page, then open your browser console and inspect form element like picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*os6M0kHt0vuhbbBrLmyNgw.png" /><figcaption>get form hash with inspect element</figcaption></figure><p>as you see, the action attribute of the form contains a URL which data will submit there. This URL contains that <strong>page URL + hash statement</strong>. In fact, after you submit the form, the page will refresh, and a hash will bind to the address of that page (you can try it and see the browser’s address bar).</p><p>So just write this code below to your page template.</p><p>important: replace your form hash with the hash you see in code below:</p><pre>if(window.location.hash == ‘#wpcf7-w243-a90-o2’){<br>  alert(‘your message sent successfully!’)<br>}</pre><p>or you can redirect the user to another page with:</p><pre>if(window.location.hash == ‘#wpcf7-w243-a90-o2’){<br>  window.location.href=&#39;/&#39;<br>}</pre><p>Also you may want to hide the default message box of the contact form. So add this style to your stylesheet:</p><pre>div.wpcf7-mail-sent-ok{<br>  display:none !important;<br>}</pre><p>enjoy it:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3846a37990d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NodeJs Authentication with JWT and Cookies]]></title>
            <link>https://keikaavousi.medium.com/nodejs-authentication-with-jwt-and-cookies-3fb1c8c739ba?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fb1c8c739ba</guid>
            <category><![CDATA[express]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[cookies]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Wed, 08 Apr 2020 20:59:23 GMT</pubDate>
            <atom:updated>2020-04-08T21:21:43.223Z</atom:updated>
            <content:encoded><![CDATA[<h3>NodeJs Authentication using JWT and Cookies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mRAvLyrwOZvaH0iPYzY8w.jpeg" /></figure><p>JWT (JSON Web Tokens) is a great solution for API and SPA authentication which works using tokens and helps you to completely handle the authorization and authentication of your app . but there is a problem that many developers struggle with. where to store JWT token!?</p><p>you have 3 options but 2 of them is failed!</p><ul><li>localStorage</li><li>sessionStorage</li><li>Cookies</li></ul><p>if you save your sensitive data like auth token in localStorage or sessionStorage, every javascript code in your browser can access this storage in the client-side and get this login token (XSS attacks)</p><p>so it is very important to store login token in a safe place. “Cookie” is the best option to do this for you. because it can’t be reached in front-end and it sends automatically to the server with each request.</p><p>here is an example to create a NodeJs (express) server app with JWT authentication and cookies:</p><h4>1. Install the necessary packages:</h4><pre>npm i express body-parser cookie-parser jsonwebtoken nodemon</pre><h4>2. Create an app.js file like this:</h4><pre><em>const</em> express = require(&quot;express&quot;);</pre><pre><em>const</em> app = express();</pre><pre><em>const</em> bodyParser = require(&quot;body-parser&quot;);</pre><pre><em>const</em> cookieParser = require(&#39;cookie-parser&#39;)</pre><pre><em>const</em> jwt = require(&quot;jsonwebtoken&quot;);</pre><pre>//middlewares</pre><pre>app.use(bodyParser.urlencoded({extended:true}))</pre><pre>app.use(bodyParser.json())</pre><pre>app.use(cookieParser())</pre><pre><br>//listen</pre><pre>app.listen(9000, () <em>=&gt;</em> {</pre><pre><strong>console</strong>.log(&quot;connected!&quot;);</pre><pre>});</pre><h4>3. Run app</h4><pre>nodemon app</pre><p>so it will run on port 9000.</p><h4>4. Add login middleware</h4><p>you may write login function in controller file (if you follow MVC pattern). here for simplicity I add all my functions to app.js.</p><pre><strong>app.post(&#39;/auth/login&#39;, (req,res)=&gt;{</strong><br></pre><pre>//get username from request&#39;s body, eg. from login form</pre><pre><strong>let username = req.body.username</strong></pre><pre>/*<br>check username and password correctness here,<br>if they matched then:<br>/*</pre><pre>//create jwt token</pre><pre><strong><em>const</em> token = jwt.sign({user:username},&#39;secret_key&#39;)</strong><br></pre><pre>//save token in cookie</pre><pre><strong>res.cookie(&#39;authcookie&#39;,token,{maxAge:900000,httpOnly:true}) </strong></pre><pre><strong>})</strong></pre><p>so, we set a cookie named ‘<strong>authcookie</strong>’ with the value of our <strong>token</strong> generated from JWT, the expiration time of 900000 sec and <strong>httpOnly:true</strong> to secure it.</p><p>then each request from client to the server has this token.</p><p>we should check this token when user needs access to sensitive data (eg. admin panel)</p><h4>5. Authorize user token</h4><p>you should set authorization level in middleware you want to protect. for example, we want to protect our <strong>/api</strong> route.</p><p>first, we should write a function which checks cookie:</p><pre><strong>function checkToken (req, res) {</strong><br></pre><pre><em>//get authcookie from request</em></pre><pre><strong><em>const</em> authcookie = req.cookies.authcookie</strong></pre><pre><br>//verify token which is in cookie value</pre><pre><strong>jwt.verify(authcookie,&quot;secret_key&quot;,(err,data)<em>=&gt;</em>{</strong></pre><pre><strong><em> if</em>(err){</strong></pre><pre><strong>   res.sendStatus(403)</strong></pre><pre><strong> } <br> <em>else</em> <em>if</em>(data.user){</strong></pre><pre><strong>  req.user = data.user</strong></pre><pre><strong>   next()</strong></pre><pre><strong>}</strong></pre><pre><strong>}</strong></pre><p>then in <strong>‘/api’</strong> middleware call the function:</p><pre>app.get(&#39;/api&#39;, checkToken , (req,res)=&gt;{</pre><pre>/*if checkToken function succeed, api reach this block<br>you can do whatever you want, also you can access to req.user      which sent from checkToken function<br>*/</pre><pre>})</pre><p>enjoy it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fb1c8c739ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Fake Store API — dummy data for your shopping web application]]></title>
            <link>https://keikaavousi.medium.com/introduction-to-fake-store-api-dummy-data-for-your-shopping-web-application-a759ad53f3e?source=rss-a857b28d0697------2</link>
            <guid isPermaLink="false">https://medium.com/p/a759ad53f3e</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[fake-shop-api]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[shop]]></category>
            <dc:creator><![CDATA[MohammadReza Keikaavousi]]></dc:creator>
            <pubDate>Sat, 04 Apr 2020 19:38:58 GMT</pubDate>
            <atom:updated>2020-04-04T19:38:58.559Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Fake Store API — dummy data for your shopping web application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dgKuXkCYJCHAa50IlseeMg.png" /></figure><p>It must have happened to you that you want to design a shopping website or web application or in tutorials, you want some fake data to put in your prototype.</p><p>Also, you know Lorem Epsom is used over the years, but it isn’t efficient for shopping websites. because you need some data like image, category, price and etc, which isn’t included in lorem ipsum data.</p><h3>What did we do before?</h3><p>Imagine that you want to fetch data from external resources to your React or Vue web application. the first thing that comes to our mind is to create a JSON file and write our own shopping dummy data. then fetch these data in our application for the test.</p><p>this process is very time-consuming because you need to find pictures, write lots of descriptions from lorem ipsum also! and at the end, you have some fake lorem ipsum data which is not like any other shopping website you viewed before!</p><p>Also, Jsonplaceholder doesn’t have any shopping API yet.</p><h3>so, what should I do now?!</h3><p><a href="https://fakestoreapi.com/">FakeStoreAPI</a> comes to solve this problem! this website helps you to skip this concern and focus on your design. This provides you these resources:</p><ul><li>products</li><li>carts</li><li>users</li></ul><p>also, it supports all types of HTTP methods (GET, POST, PUT, PATCH, DELETE) and you can access it with any type of project.</p><p>methods other than ‘GET’ make it possible to use this service when you developing an admin panel or CMS for your shopping web application. because for example you can post a new product or create a new user without inserting any real data to the database and get a response from the server! awesome!</p><p>Routes that <strong>FakeStoreApi</strong> provides:</p><p><strong>GET</strong>:</p><ul><li>/products (get all products)</li><li>/products/1 (get specific product based on id)</li><li>/products?limit=5 (limit return results )</li><li>/products?sort=desc (asc|desc get products in ascending or descending orders (default to asc))</li><li>/products/category/jewelery (get all products in specific category)</li><li>/products/category/jewelery?sort=desc (asc|desc get products in ascending or descending orders (default to asc))</li><li>/carts (get all carts)</li><li>/carts/1 (get specific cart based on id)</li><li>/carts?startdate=2020–10–03&amp;enddate=2020–12–12 (get carts in date range)</li><li>/carts/user/1 (get a user cart)</li><li>/carts/user/1?startdate=2020–10–03&amp;enddate=2020–12–12 (get user carts in date range)</li><li>/carts?limit=5 (limit return results )</li><li>/carts?sort=desc (asc|desc get carts in ascending or descending orders (default to asc))</li><li>/users (get all users)</li><li>/users/1 (get specific user based on id)</li><li>/users?limit=5 (limit return results )</li><li>/users?sort=desc (asc|desc get users in ascending or descending orders (default to asc))</li></ul><p><strong>POST:</strong></p><ul><li>/products</li><li>/carts</li><li>/users</li></ul><p><strong>PUT, PATCH:</strong></p><ul><li>/products/1</li><li>/carts/1</li><li>/users/1</li></ul><p><strong>DELETE:</strong></p><ul><li>/products/1</li><li>/carts/1</li><li>/users/1</li></ul><p>for example, you can get all products with this simple code below:</p><pre>fetch(&#39;https://fakestoreapi.com/products&#39;)</pre><pre>.then(res=&gt;res.json())</pre><pre>.then(json=&gt;console.log(json))</pre><p>you can read more details in <a href="https://fakestoreapi.com/">project website</a> or <a href="https://github.com/keikaavousi/fake-store-api">project GitHub page</a> .</p><p>please let me know if there is any problem or need more features.</p><p>enjoy it! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a759ad53f3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>