<?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: dottxado</title>
    <description>The latest articles on DEV Community by dottxado (@dottxado).</description>
    <link>https://dev.to/dottxado</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%2F481024%2F334084e1-046c-41d2-b69d-f65d3d0caff2.jpeg</url>
      <title>DEV Community: dottxado</title>
      <link>https://dev.to/dottxado</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dottxado"/>
    <language>en</language>
    <item>
      <title>Manage your WordPress plugin without knowing SVN</title>
      <dc:creator>dottxado</dc:creator>
      <pubDate>Mon, 22 Nov 2021 14:42:30 +0000</pubDate>
      <link>https://dev.to/dottxado/manage-your-wordpress-plugin-without-knowing-svn-1kgg</link>
      <guid>https://dev.to/dottxado/manage-your-wordpress-plugin-without-knowing-svn-1kgg</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;Despite I started my web developer career using SVN, I changed job in 2 years and moved from SVN to git without returning back. I use daily git, both with a GUI and on the cli, but SVN...well, I have to use it only when I want to release the plugins that I have published on the WordPress repository (...so rarely!).&lt;br&gt;
So, when I finally have will&amp;amp;time to work on my plugins, I also have to remember how to manage the SVN repository, what cli commands use, where I parked the SVN managed code, and usually I have to install it because in the mean time I have played with my OS.&lt;/p&gt;

&lt;p&gt;I know, I know...you can say "SVN is easy", "The commands you need to remember are just 2", "You are complaining too much".&lt;br&gt;
No, my answer is: I want a smarter way to manage my SVN repositories.&lt;/p&gt;

&lt;p&gt;After the last OS change, I finally decided that came the time to find this smarter way and found a lot of GitHub Actions that I can use to deploy my plugin on the SVN repository starting from the GitHub repository...Fantastic, in this way I don't need to install SVN locally and host the repository to commit new versions to it, but we are missing a step for the final smart solution.&lt;/p&gt;

&lt;p&gt;As a background information, you need to know that the WordPress SVN repository is meant to be a &lt;strong&gt;release&lt;/strong&gt; repository, not a versioning repository, so you are warmly invited to remove the old tags and maintain inside the SVN only the current release.&lt;/p&gt;

&lt;p&gt;The actions that I found only commit to SVN the new tag, but don't manage the removal of the old tags, leaving this step to be done locally, hosting the repository and committing the deletion of the old tags.&lt;/p&gt;

&lt;p&gt;Here I introduce you the final housekeeping step for your SVN repository, my GitHub Action "WordPress SVN tag cleaner".&lt;/p&gt;

&lt;p&gt;I can finally manage my plugins without ever knowing what is SVN!&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Maintainer Must-Haves&lt;/p&gt;
&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;

&lt;p&gt;You can already find an example workflow in the readme of the Action.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dottxado"&gt;
        dottxado
      &lt;/a&gt; / &lt;a href="https://github.com/dottxado/action-wordpress-svn-tag-cleaner"&gt;
        action-wordpress-svn-tag-cleaner
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Take care of your plugin SVN repository cleaning the old tags with this GitHub Action
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
WordPress SVN tag cleaner&lt;/h1&gt;
&lt;p&gt;This GitHub Action deletes a specified folder tag from your WordPress SVN plugin repository.&lt;/p&gt;
&lt;h2&gt;
Configuration&lt;/h2&gt;
&lt;h3&gt;
Required secrets&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SVN_USERNAME&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SVN_PASSWORD&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Set these secrets in the repository settings.&lt;/p&gt;
&lt;h3&gt;
Required inputs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Tag to remove (&lt;code&gt;tag-to-remove&lt;/code&gt;): please require this input in your workflow&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Optional environment variables&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SLUG&lt;/code&gt;: the WordPress repository slug. It defaults to the GitHub repository name&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Example workflow&lt;/h3&gt;
&lt;p&gt;This example demonstrate a simple manual workflow&lt;/p&gt;
&lt;div class="highlight highlight-source-yaml position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-ent"&gt;name&lt;/span&gt;: &lt;span class="pl-s"&gt;Remove old tags from SVN&lt;/span&gt;
&lt;span class="pl-ent"&gt;on&lt;/span&gt;:
  &lt;span class="pl-ent"&gt;workflow_dispatch&lt;/span&gt;:
    &lt;span class="pl-ent"&gt;inputs&lt;/span&gt;:
      &lt;span class="pl-ent"&gt;tag-to-remove&lt;/span&gt;:
        &lt;span class="pl-ent"&gt;description&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;Tag to remove&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
        &lt;span class="pl-ent"&gt;required&lt;/span&gt;: &lt;span class="pl-c1"&gt;true&lt;/span&gt;
&lt;span class="pl-ent"&gt;jobs&lt;/span&gt;:
  &lt;span class="pl-ent"&gt;remove-tag&lt;/span&gt;:
    &lt;span class="pl-ent"&gt;runs-on&lt;/span&gt;: &lt;span class="pl-s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="pl-ent"&gt;name&lt;/span&gt;: &lt;span class="pl-s"&gt;Remove the tag&lt;/span&gt;
    &lt;span class="pl-ent"&gt;steps&lt;/span&gt;:
      - &lt;span class="pl-ent"&gt;uses&lt;/span&gt;: &lt;span class="pl-s"&gt;dottxado/action-wordpress-svn-tag-cleaner@1.0.0&lt;/span&gt;
        &lt;span class="pl-ent"&gt;with&lt;/span&gt;:
          &lt;span class="pl-ent"&gt;tag-to-remove&lt;/span&gt;: &lt;span class="pl-s"&gt;${{ github.event.inputs.tag-to-remove }}&lt;/span&gt;
        &lt;span class="pl-ent"&gt;env&lt;/span&gt;:
          &lt;span class="pl-ent"&gt;SVN_USERNAME&lt;/span&gt;: &lt;span class="pl-s"&gt;${{ secrets.SVN_USERNAME }}&lt;/span&gt;
          &lt;span class="pl-ent"&gt;SVN_PASSWORD&lt;/span&gt;: &lt;span class="pl-s"&gt;${{ secrets.SVN_PASSWORD }}&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dottxado/action-wordpress-svn-tag-cleaner"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&gt;
The action is not automatic on git hooks but requires as input the tag to remove.

&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;I use this workflow on my WooCommerce plugin, check it out here!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dottxado"&gt;
        dottxado
      &lt;/a&gt; / &lt;a href="https://github.com/dottxado/email-fields-for-woocommerce"&gt;
        email-fields-for-woocommerce
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      WordPress plugin to add or modify the Reply-to and Bcc addresses on WooCommerce emails.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Email Fields For WooCommerce&lt;/h1&gt;
&lt;p&gt;Add or modify the Reply-to and Bcc addresses on WooCommerce emails.&lt;/p&gt;
&lt;h2&gt;
Description&lt;/h2&gt;
&lt;p&gt;This plugin can be used to globally modify the Reply-to and/or Bcc addresses used by WooCommerce for all its emails.&lt;/p&gt;
&lt;h2&gt;
Configuration&lt;/h2&gt;
&lt;p&gt;In the WooCommerce settings, go to the "Emails" tab, and in the bottom of the page you will find two fields for the
Reply-to address, and one field for the Bcc address. Only if you configure these addresses, these will overwrite any
WooCommerce standard address. You can configure only the Reply-to or only the Bcc, but the Reply-to needs both it's
fields to be configured to work.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dottxado/email-fields-for-woocommerce"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>actionshackathon21</category>
    </item>
    <item>
      <title>How to replicate my WordPress/Symfony local development environment on MacOS</title>
      <dc:creator>dottxado</dc:creator>
      <pubDate>Sun, 13 Dec 2020 11:03:38 +0000</pubDate>
      <link>https://dev.to/dottxado/how-to-replicate-my-wordpress-symfony-local-development-environment-on-macos-1ol4</link>
      <guid>https://dev.to/dottxado/how-to-replicate-my-wordpress-symfony-local-development-environment-on-macos-1ol4</guid>
      <description>&lt;p&gt;As a part of my job, I develop custom WordPress plugins and themes. The other part of my job is to develop applications using Symfony, so for me is crucial to have a development environment that supports both my activities without compromises. I’ve found my perfect balance using these tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://brew.sh/index_it"&gt;Homebrew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://getcomposer.org/"&gt;Composer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://laravel.com/docs/master/valet"&gt;Laravel Valet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xdebug.org/"&gt;Xdebug&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mailhog/MailHog"&gt;MailHog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/squizlabs/PHP_CodeSniffer"&gt;PHP CodeSniffer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wp-cli.org/"&gt;WP CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a&gt;Symfony&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.jetbrains.com/phpstorm/"&gt;PHPStorm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will avoid to explain what are these tools, but I have added the links to let you go directly to each website.&lt;/p&gt;

&lt;h2&gt;
  
  
  The easy part with Homebrew
&lt;/h2&gt;

&lt;p&gt;Using Homebrew I can install pretty everything, except for the Symfony binary. If it can be useful to you, here is my Brewfile (search for “brew bundle”, it is an easy way to let Homebrew know what to install following a list into a file).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tap "exolnet/deprecated"
tap "garethlawson/php"
brew "node"
brew "composer"
brew "dnsmasq", restart_service: true
brew "git"
brew "imagemagick"
brew "mailhog", restart_service: true
brew "mysql@5.7", restart_service: true, link: true
brew "nginx", restart_service: true
brew "php", link: false
brew "php-code-sniffer"
brew "php@7.2", restart_service: true, link: true
brew "php@7.3"
brew "pkg-config"
brew "postgresql"
brew "wp-cli"
brew "exolnet/deprecated/php@7.0"
brew "exolnet/deprecated/php@7.1"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So let’s start and install PHP, Composer and Laravel Valet following the &lt;a href="https://laravel.com/docs/master/valet#installation"&gt;guide on the Valet website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it’s time to install the database you can continue to follow the guide or, for example, you can install in the same manner PostgreSql.&lt;/p&gt;

&lt;p&gt;If you know that you are going to develop on WordPress multisites, you need to add to Valet a &lt;a href="https://github.com/fewagency/best-practices/blob/master/Wordpress/WordPressMultisiteValetDriver.php"&gt;custom driver&lt;/a&gt; to manage the multisite: I’m currently using this and it has never failed, just follow the one-line instruction on top for installation &lt;/p&gt;

&lt;p&gt;Continuing with the things you can install with Homebrew, proceed installing Mailhog, PHP Code Sniffer and WP CLI.&lt;br&gt;
This is also the moment when I install the Symfony binary.&lt;/p&gt;

&lt;p&gt;You can test Valet, WP CLI and the database, but not the others. Now it’s time to finish some configurations.&lt;/p&gt;
&lt;h2&gt;
  
  
  Finishing the configuration of PHP Code Sniffer
&lt;/h2&gt;

&lt;p&gt;PHP Code Sniffer needs to have the sniffs configured. It come with a basic set of sniffs, but you can add the WordPress ones &lt;a href="https://github.com/WordPress/WordPress-Coding-Standards#standalone"&gt;following the documentation here&lt;/a&gt; (I prefer the standalone version) &lt;br&gt;
Depending on your IDE setup, you would have to setup all from the command line, or you can have your IDE to manage the sniffs. In my case, with PHPStorm I need only to setup the PHP Code Sniffer path and the rules to follow at the beginning of the project.&lt;/p&gt;
&lt;h2&gt;
  
  
  Tweaking Valet
&lt;/h2&gt;

&lt;p&gt;After 2 years I’ve collected 2 setups to apply to the servers: more timeout for MySQL and more timeout for Valet.&lt;/p&gt;

&lt;p&gt;For MySQL, add these rows in the file &lt;code&gt;/usr/local/etc/my.cnf&lt;/code&gt; (and tweak them to your use cases)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interactive_timeout = 1000
wait_timeout = 1000
max_allowed_packet=160M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Valet &lt;a href="https://andresa.dev/en/solved-valet-nginx-error-504-gateway-time-out/"&gt;follow this guide&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage a lot of PHP versions
&lt;/h2&gt;

&lt;p&gt;I develop on a lot of different applications, and I need all the PHP minor versions of the 7. I have found how to install them via Homebrew (look at my Brewfile), and I need that the PHP version used by the web server is the same used by the command line. To achieve that, I have my precious &lt;code&gt;.zshrc&lt;/code&gt; file to setup the global &lt;code&gt;PATH&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export VALET_PHP_70="/usr/local/Cellar/php@7.0/7.0.33/bin/"
export VALET_PHP_71="/usr/local/Cellar/php@7.1/7.1.33/bin/"
export VALET_PHP_72="/usr/local/Cellar/php@7.2/7.2.32/bin/"
export VALET_PHP_73="/usr/local/Cellar/php@7.3/7.3.23/bin/"
export VALET_PHP_74="/usr/local/Cellar/php/7.4.11/bin/"
export BREW_MYSQL="/usr/local/opt/mysql@5.7/bin"
export COMPOSER_PATH="$HOME/.composer/vendor/bin"
export SYMFONY="$HOME/.symfony/bin"
export PATH="$VALET_PHP_72:$BREW_MYSQL:$COMPOSER_PATH:$SYMFONY:$PATH"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time I change the version with Valet, I also link into the operating system’s path the right PHP version. As you can see, when I picked both the Brewfile and the .zshrc file I was working with PHP 7.2, and there is also the Symfony binary path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install XDebug
&lt;/h2&gt;

&lt;p&gt;I have always looked at the installation of XDebug like a pain, but frankly with this environment it is not. Just remember that if you (like me) need more PHP versions ready to work, you will have to repeat these steps for each version you linked in the &lt;code&gt;$PATH&lt;/code&gt; into the &lt;code&gt;.zshrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;First, instal XDebug with pecl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pecl install xdebug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then into the folder &lt;code&gt;/usr/local/etc/php/[YOUR PHP VERSION]/conf.d&lt;/code&gt; put a new ini file, let’s call it &lt;code&gt;xdebug.ini&lt;/code&gt; with the configurations to run it, for example mine is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_autostart=1
# I don't use anymore this last line, but I keep it in case of need
xdebug.idekey="PHPSTORM"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;…and that’s it. On PHPStorm I just check the XDebug port and hit the debug icon of the telephone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Mailhog
&lt;/h2&gt;

&lt;p&gt;Knowing that you are already here (&lt;code&gt;/usr/local/etc/php/[YOUR PHP VERSION]/conf.d&lt;/code&gt;) put another new .ini file, call it &lt;code&gt;mailhog.ini&lt;/code&gt; and add into it this line without changing anything (except the Mailhog version if needed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sendmail_path = /usr/local/Cellar/mailhog/1.0.0/bin/MailHog sendmail test@test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Image Magick
&lt;/h2&gt;

&lt;p&gt;If you need it, you have already installed something with Homebrew (see the Brewfile, there is pkg-config and imagemagick). If you don’t need it you can remove them from the installation with Homebrew, but if you need it you have to continue the installation with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pecl install imagick
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you have done for XDebug, this command needs also to be run for each PHP version you want to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you have read this article untill here…well, thank you! Let me know: what are you using for your local development environment? And what do you think I can change to improve mine?&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
