<?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: Mohammad</title>
    <description>The latest articles on DEV Community by Mohammad (@m7d).</description>
    <link>https://dev.to/m7d</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%2F223752%2F63c99d6d-c81c-4665-accb-b7bcf8d3395a.jpg</url>
      <title>DEV Community: Mohammad</title>
      <link>https://dev.to/m7d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m7d"/>
    <language>en</language>
    <item>
      <title>damaged ZIP file during WordPress export</title>
      <dc:creator>Mohammad</dc:creator>
      <pubDate>Sun, 30 Mar 2025 19:57:35 +0000</pubDate>
      <link>https://dev.to/m7d/damaged-zip-file-during-wordpress-export-2iej</link>
      <guid>https://dev.to/m7d/damaged-zip-file-during-wordpress-export-2iej</guid>
      <description>&lt;p&gt;The issue of a damaged ZIP file during WordPress export, caused by extra empty lines after the ?&amp;gt; closing PHP tag in theme files, arises because PHP's closing tag can inadvertently output whitespace or blank lines. Here's a breakdown of why this happens and how to fix it:&lt;/p&gt;

&lt;p&gt;Why Does This Happen?&lt;br&gt;
Output Issues: When a PHP script ends with ?&amp;gt;, any whitespace or new lines following it will be sent to the browser/output. This can corrupt the format of exported data (such as JSON or XML used in WordPress exports).&lt;br&gt;
WordPress Exporter: The WordPress export process heavily relies on properly structured XML. Any unexpected whitespace or characters can corrupt the resulting file, rendering it unreadable or "damaged."&lt;br&gt;
Best Practices to Avoid This Issue&lt;br&gt;
Omit the PHP Closing Tag: In PHP files that contain purely PHP code (no mixed HTML), do not include the ?&amp;gt; closing tag. This is a widely accepted practice to prevent accidental output of whitespace or other characters.&lt;br&gt;
php&lt;br&gt;
Copy code&lt;br&gt;
&amp;lt;?php&lt;br&gt;
// Your PHP code here&lt;/p&gt;

&lt;p&gt;// No closing PHP tag needed&lt;br&gt;
Check for Trailing Whitespaces: If you do include the ?&amp;gt; closing tag, ensure there are no extra lines, spaces, or characters after it. This can be verified by:&lt;br&gt;
Manually checking the end of your files.&lt;br&gt;
Using an IDE or text editor that highlights trailing spaces or blank lines.&lt;br&gt;
Automated Tools:&lt;br&gt;
Use linters like PHP CodeSniffer with WordPress coding standards to identify unnecessary closing tags and trailing whitespaces.&lt;br&gt;
Configure your IDE or text editor (like VS Code, PHPStorm) to automatically trim trailing whitespace on save.&lt;br&gt;
Fix for Damaged Export Files&lt;br&gt;
If you already have a damaged ZIP file:&lt;/p&gt;

&lt;p&gt;Correct the issue in your theme files by removing trailing whitespaces or closing tags where applicable.&lt;br&gt;
Re-run the export process in WordPress.&lt;br&gt;
Example&lt;br&gt;
Bad practice:&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="c1"&gt;// Some PHP code&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good practice:&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="c1"&gt;// Some PHP code&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following these practices, you can prevent issues with WordPress export files and ensure compatibility with various tools and processes.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to run nodejs on android tablet using termux (full guide)</title>
      <dc:creator>Mohammad</dc:creator>
      <pubDate>Tue, 16 Jan 2024 19:54:32 +0000</pubDate>
      <link>https://dev.to/m7d/how-to-run-nodejs-on-android-tablet-using-termux-full-guide-3g6m</link>
      <guid>https://dev.to/m7d/how-to-run-nodejs-on-android-tablet-using-termux-full-guide-3g6m</guid>
      <description>&lt;p&gt;to run nodejs server on android tablet you need to download termux, then run&lt;/p&gt;

&lt;p&gt;the first issue how to install and setup nodejs environment&lt;/p&gt;

&lt;h3&gt;
  
  
  step 1
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pkg upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  step 2
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;nodejs &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pkg &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nodejs &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  the second issue how to create folder and edit files in it
&lt;/h2&gt;

&lt;p&gt;in termux write&lt;/p&gt;

&lt;h3&gt;
  
  
  first cd the default folder in termux
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  make directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;react-on-android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q-g8q8c2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9bqsqbbfjgp3hz1xkfp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q-g8q8c2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9bqsqbbfjgp3hz1xkfp.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  clone project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone %url%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;install packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;start server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Or create new project
&lt;/h2&gt;

&lt;p&gt;initialize npm project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;install npm package (react)&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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;create 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-react-app my-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to run server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  how to open project in code editor
&lt;/h2&gt;

&lt;p&gt;am using acode&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BiafvWFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tn3xmmqih1hiw9lu2lyl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BiafvWFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tn3xmmqih1hiw9lu2lyl.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add path&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ufGVl950--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3xyqm42srhyqkzepv8e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ufGVl950--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3xyqm42srhyqkzepv8e.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select folder&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bDwmB3ls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvyq5fjwc0i1mwmuuset.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bDwmB3ls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvyq5fjwc0i1mwmuuset.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lmJUJ_UF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lg4b5v0cnfmm2wzoyjxc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lmJUJ_UF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lg4b5v0cnfmm2wzoyjxc.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select termux&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TBHZm9gg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04d1vjs9752alwa4a7v6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TBHZm9gg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04d1vjs9752alwa4a7v6.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6KZlsnnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9rhuzj5elmb3rxjlcnd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6KZlsnnq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9rhuzj5elmb3rxjlcnd.jpg" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>run python code in html files</title>
      <dc:creator>Mohammad</dc:creator>
      <pubDate>Wed, 04 May 2022 16:33:16 +0000</pubDate>
      <link>https://dev.to/m7d/run-python-code-in-html-files-c8n</link>
      <guid>https://dev.to/m7d/run-python-code-in-html-files-c8n</guid>
      <description>&lt;p&gt;new framework let you run python codes in html tags&lt;br&gt;
it is helpful for many usages maybe include a big python's libraries to use it in html files&lt;/p&gt;




&lt;h2&gt;
  
  
  Use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;work with cdn link&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;py-script&amp;gt; put python code in &amp;lt;/py-script&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;






&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IB4tE_mG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tiomlkq22h5c55zyjqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IB4tE_mG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tiomlkq22h5c55zyjqb.png" alt="Image description" width="880" height="354"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pyscript.net"&gt;https://pyscript.net&lt;/a&gt; &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
