WordPress Community Team Reconsiders Guidelines for In-Person Regional WordCamps

The pandemic has dramatically slashed the number of in-person WordPress events that volunteers are organizing and events have been slow to start up again. This has caused the WordPress Community Team to reconsider the guidelines for hosting regional WordCamps.

Historically, these guidelines have generated lengthy discussions, as many vocal opponents found them to be needlessly prohibitive. WordCamps began as local, city-based events, and organizers were not allowed to put together a regional WordCamp without jumping through a lot of extra requirements. These included having experienced event organizers that represent all WordPress communities in the region. The guidelines state:

Before applying to organize a regional WordCamp, there should be at least 3 cities in your region (but very possibly more) with a local group that meets monthly, and that have hosted at least one WordCamp. The size of your region (in geography and population) will affect the expected number of established communities.

In 2017, WordPress Community Support (WCS) shut down WordCamp Netherlands in favor of city-based WordCamps, sending the Dutch community into an uproar. The region, which is roughly the size of Maryland, had successfully held six editions of WordCamp Netherlands before WCS decided not to approve its application.

The camp was reinstated in 2018 after organizers agreed to meet additional requirements in the guidelines outlined above. This was not without a significant struggle, as the project moved to shed its “one-size-fits-all” approach to WordPress events. WordCamp Netherlands is once again on the schedule for 2022 as an in-person event.

In 2017, WordPress Community Manager Hugh Lashbrooke proposed the idea of micro-regional WordCamps, which makes exceptions to the meetup requirements for regional camps in situations where neighboring cities share meetup organization responsibilities. The idea received widespread support, as it makes sense in certain instances.

“Exception is the keyword here,” WordCamp Netherlands organizer Marcel Bootsman said at the time. “If these local communities are active and healthy, let them organize a WordCamp. Be happy with the fact that people want to organize.”

WordPress is slowly coming around to this idea – that volunteer-run events thrive better with more flexible guidelines that allow for cultural and geographical differences.

In 2020, the Community team relaxed a number of guidelines, including some for regional online WordCamps, in order to help keep communities connected during a difficult time.

“This resulted in a bunch of online regional WordCamps in CentroamericaGreeceFinlandIndiaItalyJapanSpain, and Taiwan, among others,” Community Team Representative Hari Shanker said. “These events were quite successful in bringing together local communities even despite the challenges of the COVID-19 pandemic.”

Now that WordPress events have taken a hard hit, the Community Team is considering loosening these restrictions for in-person regional events.

“Some local communities have also approached WordCamp Central, expressing their interest in organizing regional events,” Shanker said. “At this time, our organizers are still encouraged to plan smaller city-based WordCamps over larger regional events (especially in the light of COVID restrictions that are still in place in many regions). However, I strongly feel that the Community Team should revisit the existing guidelines for regional events due to a renewed interest in the same.”

Shanker is asking for feedback on the discussion before April 4, 2022. A few contributors and organizers have already weighed in.

“Switzerland is such a small country that having separate WordCamps for Geneva, Lausanne, Bern and Zurich seems to be unnecessarily complicated,” Mark Howells-Mead said. “By re-establishing WordCamp Switzerland – which takes place in a different city each time and which was organized as a regional event until 2015 – we can better ensure that the visibility of the event and repetitive work can be more efficiently organized.”

Marcel Bootsman once again called on the Community Team to use common sense as a guide when evaluating whether a region is fit to host a WordCamp.

“We’ve had quite a few discussions about regional WordCamps in The Netherlands,” Bootsman said. “Let me just say I’m happy WCNL is back on the agenda, and I hope regional/local (city based) WordCamps are evaluated according to the country geographical size, and the feedback of the people organizing them.”

New Plugin for Writing WordPress Theme JSON Files via YAML

I have a new favorite WordPress development-related plugin: Theme YAML. Sascha Paukner released it a mere day ago, and it may find its place in many theme developers’ toolboxes before long. It allows themers to write theme JSON in YAML format.

To use, theme authors only need to create a new theme.yaml file and begin adding their custom configuration in the human-friendly YAML format. The plugin will convert it into JSON and save it to the theme.json file.

As someone who has had his fair share of headaches writing directly in JSON, I have never been happier to look at the following in my code editor:

Atom code editor opened to a theme.yaml file with settings that will be converted to JSON.

That is pretty.

I just wish I had thought of this plugin idea first. I routinely work with YAML files when dealing with other systems and convert the data to PHP and JSON. It just made sense as soon as I saw the plugin description.

JSON is not the easiest-to-write format when dealing with configuration files, which is what the theme.json file is. It works well for cross-language data storage, but I sometimes cringe when opening a JSON file to type in, especially if it has 100s or 1,000s of lines. Plus, you cannot leave inline comments to remind yourself or others why a particular decision was made or a setting configured.

Is YAML better? It has its pros and cons, and in my experience, parts of the syntax can become complex for the unfamiliar. However, supporting inline comments alone is worth it.

The plugin’s documentation was bare-bones at best. It said nothing about how it worked under the hood. I had questions. Is there a setting for the conversion? Is it automatic? Does it happen on every page load?

I peaked under the hood so that you do not have to. The plugin automatically searches for a theme.yaml file in the active theme’s root folder when a page is loaded. If found, it will check its last modified time and store the value in the database. If there are new modifications, the plugin parses theme.yaml, converts it to JSON, and writes it to the theme.json file.

If the active theme is a child, it will also automatically run through this process for its parent.

The downside to the plugin is that it leaves the resulting JSON minified, which is tough to read. This is OK when you have the theme.yaml file on hand. However, when submitting to the WordPress.org theme directory, this “build” file would typically be something a theme author would not bundle in their theme ZIP.

I firmly believe in shipping code that is readable and editable to whoever receives a copy. There are a couple of options for theme authors to do this. They can ship both the theme.json and theme.yaml files or change the following code in the plugin’s main file:

$themeJson = json_encode($themeObject, JSON_UNESCAPED_SLASHES);

We merely need to toggle on the JSON_PRETTY_PRINT flag for the json_encode() function:

$themeJson = json_encode($themeObject, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);

I hope the plugin developer will consider this change in a future version or allow theme authors to filter it.

There are other solutions for theme authors who shy away from theme.json. I have split my JSON into manageable chunks across multiple files in the past. Then, I used a webpack plugin for merging them during my watch/build process.

I recommend using the JS YAML Parser or a similar package for those who prefer YAML but want integration with their build system.

Optimizing SVG Patterns to Their Smallest Size

I recently created a brick wall pattern as part of my #PetitePatterns series, a challenge where I create organic-looking patterns or textures in SVG within 560 bytes (or approximately the size of two tweets). To fit this constraint, I have gone through a journey that has taught me some radical ways of optimizing SVG patterns so that they contain as little code as possible without affecting the overall image quality.

I want to walk you through the process and show you how we can take an SVG pattern that starts at 197 bytes all the way down to a mere 44 bytes — a whopping 77.7% reduction!

The SVG pattern

This is what’s called a “running bond” brick pattern. It’s the most common brick pattern out there, and one you’ve surely seen before: each row of bricks is offset by one half the length of a brick, creating a repeating staggered pattern. The arrangement is pretty simple, making SVG’s <pattern> element a perfect fit to reproduce it in code.

The SVG <pattern> element uses a pre-defined graphic object which can be replicated (or “tiled”) at fixed intervals along the horizontal and vertical axes. Essentially, we define a rectangular tile pattern and it gets repeated to paint the fill area.

First, let’s set the dimensions of a brick and the gap between each brick. For the sake of simplicity, let’s use clean, round numbers: a width of 100 and a height of 30 for the brick, and 10 for the horizontal and vertical gaps between them.

Showing a highlighted portion of a brick wall pattern, which is the example we are using for optimizing SVG patterns.

Next, we have to identify our “base” tile. And by “tile” I’m talking about pattern tiles rather than physical tiles, not to be confused with the bricks. Let’s use the highlighted part of the image above as our pattern tile: two whole bricks in the first row, and one whole sandwiched between two half bricks in the second row. Notice how and where the gaps are included, because those need to be included in the repeated pattern tile.

When using <pattern>, we have to define the pattern’s width and height, which correspond to the width and height of the base tile. To get the dimensions, we need a little math:

Tile Width  = 2(Brick Width) + 2(Gap) = 2(100) + 2(10) = 220
Tile Height = 2(Bright Height) + 2(Gap) = 2(30) + 2(10) = 80

Alright, so our pattern tile is 220✕80. We also have to set the patternUnits attribute, where the value userSpaceOnUse essentially means pixels. Finally, adding an id to the pattern is necessary so that it can be referenced when we are painting another element with it.

<pattern id="p" width="220" height="80" patternUnits="userSpaceOnUse">
  <!-- pattern content here -->
</pattern>

Now that we have established the tile dimensions, the challenge is to create the code for the tile in a way that renders the graphic with the smallest number of bytes possible. This is what we hope to end up with at the very end:

The bricks (in black) and gaps (in white) of the final running bond pattern

Initial markup (197 bytes)

The simplest and most declarative approach to recreate this pattern that comes to my mind is to draw five rectangles. By default, the fill of an SVG element is black and the stroke is transparent. This works well for optimizing SVG patterns, as we don’t have to explicitly declare those in the code.

Each line in the code below defines a rectangle. The width and height are always set, and the x and y positions are only set if a rectangle is offset from the 0 position.

<rect width="100" height="30"/>
<rect x="110" width="100" height="30"/>
<rect y="40" width="45" height="30"/>
<rect x="55" y="40" width="100" height="30"/>
<rect x="165" y="40" width="55" height="30"/>

The top row of the tile contained two full-width bricks, the second brick is positioned to x="110" allowing 10 pixels of gap before the brick. Similarly there’s 10 pixels of gap after, because the brick ends at 210 pixels (110 + 100 = 210) on the horizontal axis even though the <pattern> width is 220 pixels. We need that little bit of extra space; otherwise the second brick would merge with the first brick in the adjacent tile.

The bricks in the second (bottom) row are offset so the row contains two half bricks and one whole brick. In this case, we want the half-width bricks to merge so there’s no gap at the start or the end, allowing them to seamlessly flow with the bricks in adjoining pattern tiles. When offsetting these bricks, we also have to include half gaps, thus the x values are 55 and 165, respectively.

Element reuse, (-43B, 154B total)

It seems inefficient to define each brick so explicitly. Isn’t there some way to optimize SVG patterns by reusing the shapes instead?

I don’t think it’s widely known that SVG has a <use> element. You can reference another element with it and render that referenced element wherever <use> is used. This saves quite a few bytes because we can omit specifying the widths and heights of each brick, except for the first one.

That said, <use> does come with a little price. That is, we have to add an id for the element we want to reuse.

<rect id="b" width="100" height="30"/>
<use href="#b" x="110"/>
<use href="#b" x="-55" y="40"/>
<use href="#b" x="55" y="40"/>
<use href="#b" x="165" y="40"/>

The shortest id possible is one character, so I chose “b” for brick. The <use> element can be positioned similarly to <rect>, with the x and y attributes as offsets. Since each brick is full-width now that we’ve switched to <use> (remember, we explicitly halved the bricks in the second row of the pattern tile), we have to use a negative x value in the second row, then make sure the last brick overflows from the tile for that seamless connection between bricks. These are okay, though, because anything that falls outside of the pattern tile is automatically cut off.

Can you spot some repeating strings that can be written more efficiently? Let’s work on those next.

Rewriting to path (-54B, 100B total)

<path> is probably the most powerful element in SVG. You can draw just about any shape with “commands” in its d attribute. There are 20 commands available, but we only need the simplest ones for rectangles.

Here’s where I landed with that:

<path d="M0 0h100v30h-100z
         M110 0h100v30h-100
         M0 40h45v30h-45z
         M55 40h100v30h-100z
         M165 40h55v30h-55z"/>

I know, super weird numbers and letters! They all have meaning, of course. Here’s what’s happening in this specific case:

  • M{x} {y}: Moves to a point based on coordinates.
  • z: Closes the current segment.
  • h{x}: Draws a horizontal line from the current point, with the length of x in the direction defined by the sign of x. Lowercase x indicates a relative coordinate.
  • v{y}: Draws a vertical line from the current point, with the length of y in the direction defined by the sign of y. Lowercase y indicates a relative coordinate.

This markup is much more terse than the previous one (line breaks and indentation whitespace is only for readability). And, hey, we’ve managed to cut out half of the initial size, arriving at 100 bytes. Still, something makes me feel like this could be smaller…

Tile revision (-38B, 62B total)

Doesn’t our pattern tile have repeating parts? It’s clear that in the first row a whole brick is repeated, but what about the second row? It’s a bit harder to see, but if we cut the middle brick in half it becomes obvious.

The left half preceding the red line is the same as the right side.

Well, the middle brick isn’t exactly cut in half. There’s a slight offset because we also have to account for the gap. Anyways, we just found a simpler base tile pattern, which means fewer bytes! This also means we have to halve the width of our <pattern> element from 220 to 110.

<pattern id="p" width="110" height="80" patternUnits="userSpaceOnUse">
  <!-- pattern content here -->
</pattern>

Now let’s see how the simplified tile is drawn with <path>:

<path d="M0 0h100v30h-100z
         M0 40h45v30h-45z
         M55 40h55v30h-55z"/>

The size is reduced to 62 bytes, which is already less than a third of the original size! But why stop here when there’s even more we can do!

Shortening path commands (-9B, 53B total)

It’s worth getting a little deeper into the <path> element because it provides more hints for optimizing SVG patterns. One misconception I’ve had when working with <path> is regarding how the fill attribute works. Having played a lot with MS Paint in my childhood, I’ve learned that any shape I want to fill with a solid color has to be closed, i.e. have no open points. Otherwise, the paint will leak out of the shape and spill over everything.

In SVG, however, this is not true. Let me quote the spec itself:

The fill operation fills open subpaths by performing the fill operation as if an additional “closepath” command were added to the path to connect the last point of the subpath with the first point of the subpath.

This means we can omit the close path commands (z), because the subpaths are considered automatically closed when filled.

Another useful thing to know about path commands is that they come in uppercase and lowercase variations. Lowercase letters mean that relative coordinates are used; uppercase letters mean absolute coordinates are used instead.

It’s a little trickier than that with the H and V commands because they only include one coordinate. Here’s how I would describe these two commands:

  • H{x}: Draws a horizontal line from the current point to coordinate x.
  • V{y}: Draws a vertical line from the current point to coordinate y.

When we are drawing the first brick in the pattern tile, we start from the (0,0) coordinates. We then draw a horizontal line to (100,0) and a vertical line to (100,30), and finally, draw a horizontal line to (0,30). We used the h-100 command in the last line, but it is the equivalent of H0, which is two bytes instead of five. We can replace two similar occurrences and pare the code of our <path> down to this:

<path d="M0 0h100v30H0
         M0 40h45v30H0
         M55 40h55v30H55"/>

Another 9 bytes shaved off — how much smaller can we go?

Bridging (-5B, 48B total)

The longest commands standing in our way of a fully-optimized SVG pattern are the “move to” commands which take up 4, 5, and 6 bytes, respectively. One constraint we have is that:

A path data segment (if there is one) must begin with a “moveto” command.

But that’s okay. The first one is the shortest anyways. If we swap the rows, we can come up with a path definition where we only have to move either horizontally or vertically between the bricks. What if we could use the h and v commands there instead of M?

The path starts from the red dot in the top-left corner. Red are the path commands supported with arrows, black are the coordinates the arrows point to.

The above diagram shows how the three shapes can be drawn with a single path. Note that we are leveraging the fact that the fill operation automatically closes the open part between (110,0) and (0,0). With this rearrangement, we also moved the gap to the left of the full-width brick in the second row. Here’s how the code looks, still broken into one brick per line:

<path d="M0 0v30h50V0
         h10v30h50
         v10H10v30h100V0"/>

Surely, we’ve found the absolute smallest solution now that we’re down to 48 bytes, right?! Well…

Digit trimming (-4B, 44B total)

If you can be a bit flexible with the dimensions, there’s another little way we can optimize SVG patterns. We’ve been working with a brick width of 100 pixels, but that’s three bytes. Changing it to 90 means one less byte whenever we need to write it. Similarly, we used a gap of 10 pixels — but if we change it to 8 instead, we save a byte on each of those occurrences.

<path d="M0 0v30h45V0
         h8v30h45
         v8H8v30h90V0"/>

Of course, this also means we have to adjust the pattern dimensions accordingly. Here’s the final optimized SVG pattern code:

<pattern id="p" width="98" height="76" patternUnits="userSpaceOnUse">
  <path d="M0 0v30h45V0h8v30h45v8H8v30h90V0"/>
</pattern>

The second line in the above snippet — not counting the indentations — is 44 bytes. We got here from 197 bytes in six iterations. That’s a chunky 77.7% size reduction!

I’m wondering though… is this really the smallest size possible? Have we looked at all possible ways to optimize SVG patterns?

I invite you to try and further minify this code, or even experiment with alternative methods for optimizing SVG patterns. I would love to see if we could find the true global minimum with the wisdom of the crowd!

More on creating and optimizing SVG patterns

If you are interested to learn more about creating and optimizing SVG patterns, read my article about creating patterns with SVG filters. Or, if you want to check out a gallery of 60+ patterns, you can view the PetitePatterns CodePen Collection. Lastly, you’re welcome to watch my tutorials on YouTube to help you get even deeper into SVG patterns.


Optimizing SVG Patterns to Their Smallest Size originally published on CSS-Tricks. You should get the newsletter.

Serverless for Survival

When new technologies arise, we first adopt them for their technical value. If that value proves out, then we reach the magic “crossing the chasm” moment: when a technology jumps to widespread adoption through proven business value and goes mainstream. 

Some technologies, a very select few, make one more jump forward, however — from mainstream to existential imperative. 

Asynchronous API Calls: Spring Boot, Feign, and Spring @Async

The requirement was to hit an eternal web endpoint and fetch some data and apply some logic to it, but the external API was super slow and the response time grew linearly with the number of records fetched. This called for the need to parallelize the entire API call in chunks/pages and aggregate the data.

Our synchronous feign client:

How To Hire Remote Developers Successfully

There are many aspects to consider when you want to hire remote developers: the candidate’s technical and soft skills, the region where you hire, how to find a developer, hiring format, and many more. Here, we’ll talk about what a developer needs to work efficiently in the remote format, as well as how to check if this work is efficient. 

Ask an HR manager about what is important for a remote developer and most likely you will hear that this person should be independent, organized, self-disciplined, structured, etc. That sounds reasonable, but what hides behind these names in reality? Let’s take a thorough look at the candidate requirements from a practical perspective. 

Apache Kafka Landscape for Automotive and Manufacturing

Before the Covid pandemic, I had the pleasure of visiting "Motor City" Detroit in November 2019. I met with several automotive companies, suppliers, startups, and cloud providers to discuss use cases and architectures around Apache Kafka. A lot has happened. Since then, I have also met several OEMs and suppliers in Europe and Asia. As I finally go back to Detroit this January 2022 to meet customers again, I thought it would be a good time to update the status quo of event streaming and Apache Kafka in the automotive and manufacturing industry.

Today, in 2022, Apache Kafka is the central nervous system of many applications in various areas related to the automotive and manufacturing industry for processing analytical and transactional data in motion across edge, hybrid, and multi-cloud deployments. This article explores the automotive event streaming landscape, including connected vehicles, smart manufacturing, supply chain optimization, aftersales, mobility services, and innovative new business models.

Environmental Impact of the Cloud: 5 Data-Based Insights and One Good Fix

Does using the cloud make your business sustainable? Research suggests that it’s a greener choice. 

By moving to the cloud, the e-commerce giant Etsy slashed its energy consumption by 13% (from 7330 MWh in 2018 to 6376 MWh in 2019), saving enough energy to power 450 households for a month.(1) However, migrating to the cloud doesn’t guarantee anything if you neglect to optimize your resource utilization over the long term. 

MQTT Messaging With Java and Raspberry Pi

In December 2021, I had the chance to write a three-post blog series for HiveMQ. They provide an MQTT compatible message broker you can install yourself, or through a cloud service they provide. That cloud service is free to connect up to 100 devices! Even for the most enthusiastic maker, that’s a lot of microcontrollers or computers! 

You can find example code for many programming languages on the HiveMQ site, but as a Java and Raspberry Pi fan, I wanted to add some extra examples. The full descriptions are available on the HiveMQ blog, so let me give you a short overview here on DZone to give you an idea of the possibilities.

Garbage Collection Tuning Success Story: Reducing Young Gen Size

When you tune Garbage collection performance, you are not only improving Garbage collection pause time but also the overall application’s response time and reducing cloud computing cost. Recently, we helped to tune the Garbage collection behavior of a popular application. Just by making a minor change, it resulted in a dramatic improvement. Let’s discuss this garbage collection tuning success story in this post.

Garbage Collection KPIs

There is a famous saying that "you can’t optimize something that you can’t measure." When it comes to garbage collection tuning, there are only 3 primary Key Performance Indicators (KPIs) that you should be focusing upon:

PwnKit, or How 12-Year-Old Code Can Give Root To Unprivileged Users

It looks like IT teams have no respite. Following all the hassles caused by Log4j (and its variants), there is a new high profile, high-risk vulnerability making the rounds. CVE-2021-4034, or PwnKit if you’re into fancy CVE nicknames, is a polkit vulnerability that lets unprivileged users gain root privileges on basically any Linux system out there that has polkit installed.

NOTE: Patches are now available for Centos6, Oracle6, CL6, Ubuntu16, and Centos8.4 with more to follow. You can track actual distribution support through a CVE dashboard here.

BPMN Workflows Version Management With Milestone Camunda Cawemo

This article contains a step-by-step guide on how to manage BPMN file versioning and avoid conflicts in Cawemo when multiple team members are working together. It will also help you to avoid overriding BPMN files while updating and tells you how to sync files between the repository and Cawemo. 

What Is Milestone?

  • This feature in the Cawemo tool is used to maintain Versioning in BPMN.
  • We can see all of the BPMN history, the creator’s name who has done the changes, and the Last Changed date.
  • We can upload the new version of BPMN without removing/deleting its older version.

Steps to Follow:

  • Create a new directory (e.g., Demo) in Cawemo for signed-off deployed BPMN files.
  • Upload working/developed and integrated BPMN (e.g., Demo_BPMN) from code repository/local to the newly created directory as follows.

Upload working/developed and integrated BPMN (e.g., Demo_BPMN) from code repository/local to the newly created directory