Smush Background Optimization Lets You Step Back And Bulk Smush

Smush now frees up your time and your eyeballs while enhancing your image optimization experience further with Bulk Smush background optimization!

Got tons of images to compress and optimize on your web site? Now you can navigate away from the plugin or close the browser window while Smush works tirelessly in the background.

There’s no more staring and waiting in front of your screen while your images are being optimized, making your workflow more efficient.

In other words – the days of waiting on a page for image optimization are over! You can browse around elsewhere and opt for an email notification about when the optimization process is complete! Or, just check back at any time to see how it’s going.

This brief article will look at how simple it is to use. Plus, there are a few other new improvements that we’ll touch on.

Let’s get to it!

How Background Optimization Works

As you’ll see, there’s not a ton to do to get background optimization to function. It’s ready to go once you start a Bulk Smush!

Just begin by clicking Bulk Smush Now from Smush’s dashboard.

Bulk Smush
One-click gets Smush smushing.

When Smush starts Bulk Smushing, you’re free to close out of the area and continue working on more vital things rather than staying on this screen.

Bulk smush progress.
Leave Smush to do its work while you do yours.

If you want to be notified once Bulk Smush is completed, simply turn on email notifications. There are two ways of doing this. One is to enable email notifications under the Bulk Smush settings.

Where you enable email notifications.
Now you’ll know when Bulk Smush is done via email.

Also, you can click the Enable Notifications link on the notification during the Bulk Smush progress.

Link to enable email notifications.
You’ll see this link during Bulk Smush if email notifications are not enabled already.

The email gives you a glimpse of the total images analyzed, images smushed successfully, and any images that failed to smush.

Bulk Smush Email Notification
If you click on View Full Details, it will take you to the Smush dashboard.

Beyond an email, you can always check Smush’s dashboard for progress. When complete, it will show the percentage of images optimized, total savings (in KBs or MBs), and the number of images smushed.

Smush optimization dashboard.
As you can see, 100% of the images in the media library have been smushed.

And that’s really all there is! There’s nothing else to do or set up to implement background optimization. It’s a process that is essentially all set up for you – right out of the box!

Other Improvements

Beyond background optimization, Smush 3.12.0 has improved by eliminating its 50 images limit — so there’s continuous optimization without any stops.

Also, we replaced Google fonts with Bunny fonts for better GDPR compliance and added a filter on the Media Library page to view items without any errors.

We’ve Got Your Background Optimization

As an award-winning plugin with a 5-star rating, Smush not only has an impressive background, it now it stands out even more with its new background optimization feature and additional upgrades!

If you’re not using Smush already, what’s the wait? Smush is WordPress’s most popular image optimization plugin, with over a million active websites using it! Download the plugin for free and experience “hands-free” image optimization in just a few clicks.

The Wait is Over: New Smush Background Optimization Lets You Step Back And Bulk Smush

Smush 3.12.0 frees up your time and your eyeballs while enhancing your image optimization experience further with new Bulk Smush background optimization!

Got tons of images to compress and optimize on your web site? Now you can navigate away from the plugin or close the browser window while Smush works tirelessly in the background.

There’s no more staring and waiting in front of your screen while your images are being optimized, making your workflow more efficient.

In other words – the days of waiting on a page for image optimization are over! You can browse around elsewhere and opt for an email notification about when the optimization process is complete! Or, just check back at any time to see how it’s going.

This brief article will look at how simple it is to use. Plus, there are a few other new improvements that we’ll touch on.

Let’s get to it!

How Background Optimization Works

As you’ll see, there’s not a ton to do to get background optimization to function. It’s ready to go once you start a Bulk Smush!

Just begin by clicking Bulk Smush Now from Smush’s dashboard.

The bulk smush button.
One-click gets Smush smushing.

When Smush starts Bulk Smushing, you’re free to close out of the area and continue working on more vital things rather than staying on this screen.

Bulk smush progress.
Leave Smush to do its work while you do yours.

If you want to be notified once Bulk Smush is completed, simply turn on email notifications. There are two ways of doing this. One is to enable email notifications under the Bulk Smush settings.

Where you enable email notifications.
Now you’ll know when Bulk Smush is done via email.

Also, you can click the Enable Notifications link on the notification during the Bulk Smush progress.

Link to enable email notifications.
You’ll see this link during Bulk Smush if email notifications are not enabled already.

The email gives you a glimpse of the total images analyzed, images smushed successfully, and any images that failed to smush.

The email you get for notifications.
If you click on View Full Details, it will take you to the Smush dashboard.

Beyond an email, you can always check Smush’s dashboard for progress. When complete, it will show the percentage of images optimized, total savings (in KBs or MBs), and the number of images smushed.

Smush optimization dashboard.
As you can see, 100% of the images in the media library have been smushed.

And that’s really all there is! There’s nothing else to do or set up to implement background optimization. It’s a process that is essentially all set up for you – right out of the box!

Other Improvements

Beyond background optimization, Smush 3.12.0 has improved by eliminating its 50 images limit — so there’s continuous optimization without any stops.

Also, we replaced Google fonts with Bunny fonts for better GDPR compliance and added a filter on the Media Library page to view items without any errors.

We’ve Got Your Background Optimization

As an award-winning plugin with a 5-star rating, Smush not only has an impressive background, it now it stands out even more with its new background optimization feature and additional upgrades!

If you’re not using Smush already, what’s the wait? Smush is WordPress’s most popular image optimization plugin, with over a million active websites – and it’s entirely free! If you’re not using Smush yet, download the plugin from wp.org and experience blazing speeds immediately in just a few clicks.

How To Check Competitor Keywords in 5 Simple Steps

Start checking your competitor’s keywords straight away with Semrush, our favorite tool for keyword research thanks to its great range of features and powerful analytics. Plus, right now, Semrush is offering Quick Sprout readers a free 7-day trial to try it for themselves

Understanding which keywords are performing in your industry is important for getting more clicks and conversions. And, a big part of knowing which keywords are working is to see what your competitors are doing. 

Luckily, there are now plenty of great tools that can help you assess which keywords your competitors are using, and which ones are, and are not, working for them. That way, you can better understand what your audience is looking for and save yourself time by only using keywords that get you results. In this article, we’ll break down how you can check your competitor’s keywords and the best tools out there to help you. 

Quicksprout.com - How to Check Competitor Keywords in 5 Easy Steps

The Top 5 Best Keyword Research Tools for Checking Competitor Keywords 

We’ve rigorously vetted the best tools out there right now for analyzing SEO and checking competitor keywords. Here are our top recommendations based on our research that’ll make it easier for you to see what your competitors are doing and whether it’s working: 

  • Semrush – Best for Competitor Analysis
  • Ahrefs – Best for SERP Analysis
  • WriterZen – Best Keyword Tool for Content Marketing
  • SEO PowerSuite – Best for Local Keyword Research
  • Mangools – Best for Generating Keyword Ideas

Check Competitor Keywords in 5 Easy Steps

It might seem like analyzing what your competitors are doing would be complicated, but, especially with the help of tools like Semrush, it’s surprisingly simple. Let’s walk through the steps you’ll need to take to see what your competition is doing: 

  1. Sign Up For Semrush 
  2. Make a List of Your Competitors 
  3. Look at Their Domain Overview 
  4. Use the Keyword Gap Tool 
  5. Analyze the Data 

We’re using Semrush for the purposes of this tutorial because they have a huge range of keyword features, they’re always up to date with the latest data, and they have a user-friendly dashboard. However, you can use another one of the tools we’ve recommended with similar steps and still see great results. 

Step 1: Sign Up For Semrush 

The first thing you’ll want to do is sign up for Semrush.

Although there are ways you can do some competitor keyword research on your own, it’s easier and faster to use a tool like Semrush. 

Once you head over to the homepage through our link and scroll down to the bottom, you’ll be able to sign up for your 7-day free trial

Get started with Semrush today - start your free trial
You can start your free 7-day trial by clicking on the link on Semrush’s homepage.

Click on the link and create an account using your email and password. You’ll be asked for some payment information to sign up for the trial, but you’ll only be charged if you decide to stay past seven days. You’ll then get access to your dashboard. 

Semrush - Project dashboard
Semrush offers several features to help you analyze your competitors’ keywords.

You can see right away that one of the first features Semrush offers is to look at your competitors’ SEO using the projects tool. And, if you look at your dashboard, you can see that there are lots of tools under the Competitive Research tab to help you analyze your competitors. 

We’ll be diving into those tools in a second, but once you’ve set up your account, move on to Step 2. 

Step 2: Make a List of Your Competitors 

Once you’ve created your Semrush account, it’s time to make a list of all your competitors. 

Not only will you need to know who your competitors are to be able to see which keywords they’re using – you’ll need to know the URLs of their websites, and even of the specific pages on their sites that you’re hoping to rank against. 

This is an easy step, but it can be a little time-consuming. 

What you’ll need to do is make a list, preferably an updatable document like a spreadsheet, that includes the names of all the competitors you want to analyze. Then you want to add the URLs of their sites next to each name, and any specific pages you want to see keywords for. 

If you’re not sure who your competitors are, it can be as easy as typing in your specific niche on Google and taking down the names of the first few businesses that show up in search results. 

You can also use Semrush’s competitor tools by going into your dashboard, adding your domain, and then selecting competitors. This will give you a view of some of your top competitors and you can then use this to add to your list. 

It’s better if you can find local competitors or similar-sized businesses. The bigger the business the easier it’ll rank on Google, and you don’t want to end up trying to compete for keywords with companies that are above your domain authority. 

Once you have a list of at least 5 competitors to look at, you can move on to Step 3. 

Step 3: Look at Their Domain Overview 

The next step is to get an overview of which keywords are working for your competitors. 

If you go to your dashboard menu to the left side, click on SEO. Under the list of options for Competitive Research, you’ll see an option for Domain Overview. Click on it. 

Semrush - SEO and domain overview
Use the DOmain Overview feature to add your competitors’ domains in the search bar.

You can then add a domain from one of your competitors in the search bar. This will bring up a lot of results including their traffic numbers and backlink information but you can ignore that. If you scroll down a little, you’ll get to what we’re looking for: Top Organic Keywords

Organic search traffic data example.
Semrush will show your competitors’ top organic keywords as well as each keyword’s search volume.

Here, you’ll see which keywords your competitors are ranking highest for without the help of paid advertising. This will help you see what your target audience is interested in, what’s working in your industry, and whether you have a chance of ranking for those words yourself. 

If you click on View Details, you can see different metrics like the search volume for each keyword or phrase and the KPI (which will tell you how easy or how hard it is to rank for those words based on your domain authority). 

View details - search volume for keyword or phrase and KPI metric
Semrush provides in-depth analysis of your competitors’ keywords.

You can see that when we use the Quick Sprout blog as an example, many of the keywords have very high competition, meaning that you’d need a high domain authority to stand a chance of competing. 

But, if you are a newer website, you now know which words to avoid because you can’t compete with them. Instead, you could look for similar searches that are longer tail keywords with less competition that can boost your chances of being found by your audience. 

Put in the domain for each competitor you have in your spreadsheet, add the top 10 keywords they’re ranking for, and add the search volume and the keyword difficulty to your notes.  

Keep in mind that this step works best for the main site domain, and isn’t really for URLs for specific pages. Once you’ve filled out your spreadsheet and added the keywords, you can move on to Step 4. 

Step 4: Use the Keyword Gap Tool 

If you head back out into your dashboard, you’ll see an option that says Keyword Gap in the Competitive Research menu. Click on it. 

Semrush - Keyword Gap tool
Semrus’s Keyword Gap Tool gives you a full analysis of your competitors’ keywords.

You’ll then be taken to a page where you can add up to five competitors’ domains and compare the keywords between them. The tool will help you see which keywords you share with your competitors, and also which keywords they’re ranking for that you aren’t. 

Especially if you have a similar or even better domain authority than your competitors, this is a great way to identify any keywords that you could easily rank for but are currently missing out on. 

You’ll also be able to go through a chart of where each of your competitors ranks for specific keywords, and you’ll get a list of which keywords you are missing and where your rankings are weakest. 

Semrush - Keyword gap tool showing top opportunities for missing keywords
Discover your top missing opportunities to help you plan which keywords you should focus on next.

This will then allow you to see where your strategy needs to change and where you should refocus your SEO plan in order to get more traffic. 

Again, update your spreadsheet with the words that your competitors are using that you aren’t, and make some notes about which keywords you have that are weak and where you want to change your strategy. 

You can also download a report of the Keyword Gap results directly in Semrush by clicking on Export. Once you’ve updated your spreadsheet with all your keywords, you can move on to Step 5. 

Export function of keyword data
Semrush makes keyword planning easy by providing downloadable reports of your keyword gap results.

Step 5: Analyze the Data 

Once you’ve actually finished going through and recording the keywords your competitors are using, it’s time to put that information into action. 

There’s no point doing the research if you don’t use what you’ve learned to help you build a stronger SEO plan. Through your research, you should have been able to identify which keywords your competitors are ranking for that you’re not, which words you have better domain authority for, and which words you are missing. 

Using the keywords you’ve found, update your SEO plan by: 

  • Planning content that uses the keywords you could rank for but aren’t using 
  • Remove any keywords that Semrush identified as weak and update any existing content with better keywords 
  • Looking for other keywords closely related to the ones your competitors are ranking highest for 
  • Plan content around the topics that are getting your competitors the most traffic 

The more you improve your keyword use, the better your overall domain authority and SEO will be, and the easier it will be for you to compete with your competitors as time goes on. 

You can repeat the process as many times as you like with as many competitors as you want, and you can also use the above steps as a way to generate content ideas to help you get traffic.   

Final Thoughts About Checking Competitor Keywords 

If you follow the above steps often, you can drastically improve your SEO and you’ll find it much easier to connect with your audience and drive traffic to your site. You’ll also be able to generate relevant content ideas more easily and potentially even get yourself on the first page of Google Search.

Using a tool like Semrush will also help you with market research, and other ways to optimize your SEO. If you combine this guide with all the other features it offers, you’ll be on your way to ranking on page one of Google in no time. 

Some Things I Took Away From An Event Apart 2022 in Denver

An Event Apart 2022 Denver wrapped up yesterday. And while I was unable to make it to all three days this time, I did catch yesterday’s action — and it was awesome. I’m not very social or outgoing, but this was the first conference I’ve been to in at least a couple of years, and seeing folks in person was incredibly refreshing.

I took notes, of course! I thought I’d post ’em here because sharing is caring. At least, that’s what my six-year-old told me the other day when asking for a bite of my dessert last night.

I’ll break this down by speaker. Fair warning: I’m all about handwritten notes and a pretty visual fella, so my notes tend to be less… structured than most. And these notes are just things that stood out to me. They may not even be the presenter’s main idea, but they caught my attention!

Chris Coyier: Websites Are Good Now

High-resolution

Chris has given this talk before (we linked it up just last week), but this time expanded it substantially, particularly with details on container relative units which, when combined with clamp(), make for more accurate responsiveness because the values are relative to the container rather than the viewport. So, you know how we often use viewport width (vh) units for fluid type?

font-size: clamp(1rem, 1rem + 2vw, 2rem);

Well, we can use a container relative unit like container query inline-size (cqi) instead, where 1cqi is equal to 1% of the container’s inline size (here’s the draft spec on that):

font-size: clamp(1rem, 1rem + 1cqi, 2rem);

Chris also talked quite a bit about the performance benefits of hosting at the edge. Probably no surprise because he’s written about it here more than a few times. Even as someone who had already read those articles, I honestly didn’t realize the complete concept of computing at the edge.

The idea is deceptively simple: global CDNs can serve assets quickly because they host them geographically close to the user. That’s pretty standard practice for serving raster images. But it has extended to static files, such as the same HTML, CSS, and JavaScript files that power a site — build them in advance and serve the already compiled and optimized files from the speedy global CDN. That’s the whole Jamstack concept!

But what if you still require a server response from it? That ain’t very edge-y, is it? Well, now we have handlers capable of running on a single URL fetching data in advance, and injecting it ahead of render — directly from the CDN. Sure, there’s extra work happening in the background. Still, the fact that we can dynamically fetch data, inject it, pre-build it, serve it statically on demand, and have it run geographically closer to the user makes this blazingly fast.

Tolu Adegbite: How to Win at ARIA and Influence Web Accessibility

High resolution

Good gosh was this an excellent presentation! Tolu Adegbite schooled me so hard on WAI-ARIA that I had a hard time jotting down all the gems she shared — Roles! States! Labeling! Descriptions! Everything was extraordinarily well-covered, and stuff that I know I’ll be coming back to time and again.

But one specific thing that caught my attention is the accessibility of inline SVG. Even though SVG is related to other types of design assets, the fact that it is markup at the end of the day sets it apart because it isn’t always identified as an image.

<!-- Image tag is easily recognized as an image -->
<img src="cat.svg" alt="An illustrated brown and white tabby kitten looking lovingly into the camera.">

<!-- Could be an image, maybe not? -->
<svg viewBox="0 0 100 100">
  <!-- etc. -->
</svg>

Assistive tech is more likely to read inline SVG as an image by giving it a proper accessible role and label:

<svg 
  role="image" 
  aria-label="An illustrated brown and white tabby kitten looking lovingly into the camera."
  viewBox="0 0 100 100"
>
  <!-- etc. -->
</svg>

Miriam Suzanne: Cascading Layers of !mportance

High resolution

Hey, another CSS-Tricks alum! Miriam has been spending a bunch of time and effort on the Cascade Layers specification. She also wrote a big ol’ guide about them here at CSS-Tricks and talked about them at An Event Apart.

What has stuck with me most is how big of a mental shift this is. The concept isn’t complicated, per se. Declare @layer at the top of the CSS document, list the layers in order of specificity, then write styles in those layers. But for an old dinosaur like me who has been writing CSS for a while, I’m going to have to get used to the fact that Cascade Layers make it possible for a simple class selector to beat out something that usually wields a higher specificity, like an ID.

🤯

Miriam also reminded the room that Cascade Layers are just one tool we have in our specificity-managing toolbelt, in addition to selectors that affect specificity (e.g., :is(), :where(), and :has()).

Oh, and this is an interesting tidbit. As Miriam walked through the history of specificity in CSS, she recalled that !important was initially designed as a tool for users to override user agent and author styles. But somewhere down the line, we’ve adopted it to force author styles to the top. Cascade Layers help remove the excuse need to use !important because they provide us the power to “prioritize layers and protect inheritance.”

That is beautifully said, Miriam!

Dave Rupert: Unblocking Your Accessibility Backlog

High resolution

Imagine waking up one day to hundreds of GitHub notifications about reported issues on your site. Where do you even begin? Maybe close your laptop and get a root canal instead? That happened to Dave! An automated accessibility audit returned a massive pile of errors and assigned them as tickets for Dave to fix.

But he noticed a pattern after taking an Excel spreadsheet of those issues, moving them to Notion for a better view, hiding unnecessary columns, categorizing everything, and displaying the results in logical groups. Many of the reported issues were the same issue repeated on multiple pages. Just because an automated test returns a handful of errors doesn’t mean they’re all unique. That reduced a nice chunk of the tickets.

He went on to show how — with relatively little effort — the backlog of issues dwindled by nearly 50%.

There’s a lot to glean there, especially regarding how we process and organize our work. The biggest takeaway for me is when Dave said we have to emphasize individuals and interactions over processes and tools. Tools like the one scanning for accessibility errors are helpful, but they might not tell the entire story. Rather than take them at their words, it’s worth asking questions and gaining more context before diving into the mess.

As a bonus, reorganizing the issues in Notion allowed Dave to group issues in a way that clearly shows which impairments his product was actively discriminating against, giving him greater empathy for those misses and how to prioritize them.


One more virtual session by Hui Jing Chen capped the day, but admittedly, I missed about half of it because I was having a hallway conversation. The conversation was worth it, even though I am bummed I missed the presentation. I’ll be watching the video of it when it’s published!


Some Things I Took Away From An Event Apart 2022 in Denver originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

How To Implement Face Recognition in Vue.JS With FaceIO?

Nowadays the Web has become a platform where you can run all kinds of applications from e-learning, financial services, booking websites, and anything you could imagine. 

Because of that authenticating users on the web is a must. Actually, there are many ways to authenticate users one of which is using traditional email and password authentication. Another way to do this is simply using a third-party authentication provider like Facebook for example. 

Shortcodes Ultimate Plugin Patches CSRF Vulnerability in Version 5.12.1

The Shortcodes Ultimate plugin, used on more than 700,000 WordPress sites for creating things like tabs, buttons, and accordions, has patched a vulnerability in version 5.12.1. The plugin’s changelog simply says, “This update fixes a security vulnerability in the shortcode generator. To the author’s credit, the changelog clearly denotes it as a security update, although it doesn’t offer specific details.

The vulnerability was reported by researcher Dave Jong at Patchstack and is logged at the National Vulnerability Database (NVD) as a Cross-Site Request Forgery (CSRF) vulnerability leading to plugin preset settings change. It was patched two weeks ago and the NVD published the advisory this week.

At this time, the vulnerability is not known to have been exploited, but users are advised to update to the latest version. Based on WordPress.org stats, 46% of the plugin’s user base is running on versions older than 5.12.x. The Shortcodes Ultimate plugin author has since released version 5.12.2, which fixes an issue with the Shortcode Generator Presets that was introduced in the previous update.

Autoscale Azure Pipeline Agents With KEDA

If you are using Kubernetes solution as a platform to host containerized applications in any of the public clouds, Billing is one of those things that will hunt you sooner or later. Kubernetes billing largely depends on the number of nodes, and node count is decided by the number of workloads a cluster has. We know that autoscaling is one of the favorite features of Kubernetes. Hence, it would be wiser to scale down some of the workloads when there is no work at all and reduce the cloud cost.

When we talk about Kubernetes autoscaling features, Horizontal Pod Autoscaler (HPA) automatically comes to mind. By default, autoscaling can be achieved by HPA using basic metrics like CPU or RAM usage. However, in the event of complex and distributed applications which are integrating with different components outsides the Kubernetes cluster (Ex: Kafka topic lag, Redis Stream, Azure Pipeline Queue, Azure Service Bus, PubSub topic, etc.), HPA itself cannot scale the pods based on metrics from these components. 

How to Notify Users When Their Comment is Approved in WordPress

Do you want to notify users when their comment is approved in WordPress?

By default, WordPress doesn’t notify users when you publish their comment. This can leave visitors wondering whether you’ve received their comment, or whether you plan to publish it at all.

In this article, we will show you how to notify users when you approve their comment.

How to notify users when their comment is approved in WordPress

Why Notify Users When Their Comment is Approved in WordPress

Comments allow your website visitors to communicate with you and other readers.

They are a great way to get engagement and feedback, and can help build a community around your WordPress blog.

By default, WordPress puts all new comments into a moderation queue. You can see these comments in the admin area, but they won’t appear on your website until you approve them.

Approving comments in the WordPress admin area

Comment moderation is the best way to keep discussions safe and spam free. However, by default WordPress doesn’t notify users when you approve their comment.

Instead, visitors would need to keep checking your site to see whether their comment has appeared. Most commenters will forget to do that. Sometimes, visitors may even assume that you’ve rejected their comment if they don’t get a notification.

By confirming that you’ve published their comment, you can encourage visitors to come back to your WordPress website. This is great for engagement and can create a more interesting and lively discussion.

With that being said, let’s see how to notify users when you approve their comment.

How to Notify Users When Their Comment Is Approved in WordPress

The easiest way to notify people when you publish their comment is by using Comment Approved Notifier Extended. This plugin is simple to set up and lets you send a custom email to your users.

First, you’ll need to install and activate the plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, the plugin works automatically. Every time you approve a comment, WordPress will send a notification to that person’s email address.

A comment approval notification email

If you want to change the email’s content, then simply click on Comment Approved in the WordPress dashboard.

You will now see the default email and all of the different pieces of shortcode that you can use in your message.

How to notify users when their comment is approved in WordPress

When it creates an email, Comment Approver Notification will replace the shortcode with real information. For example, it will replace [commentauthor] with the name the person typed into your WordPress website.

You can either type or paste any shortcode into the small email editor. You can also type in plain text, as you can see in the following image.

Adding shortcode to a comment approval email

When you’re happy with how the email looks, you can simply go ahead and click on the ‘Update’ button.

Now Comment Approver Notification will send the new email to your users.

Email is an important way to communicate with your visitors, users, and customers. With that in mind, it’s a good idea to use an SMTP plugin to improve email deliverability and keep your comment notifications out of the spam folder.

WP Mail SMTP is the best WordPress SMTP plugin on the market. It allows you to easily use any SMTP server to send WordPress emails safely and reliably.

To learn more, see our guide on how to fix WordPress not sending emails.

We hope this article helped you learn how to notify users when their comment is approved in WordPress. You can also go through our guide on how to create an email newsletter and our expert pick of the best live chat software for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Notify Users When Their Comment is Approved in WordPress first appeared on WPBeginner.

Collective #733




New patterns for amazing apps

Dive into a fantastic collection of new patterns for amazing apps, including clipboard patterns, file patterns, and advanced app patterns. By Thomas Steiner.

Read it















Satori

In case you didn’t know about it: a library to convert HTML and CSS to SVG.

Check it out




How Many Levels Deep Do Xml SItemaps Go ?

Hiya,

I need to know something.
First I thought Sitemap Xml files will list all .html and .hml and .shtm and .shtml files. All pages of the website.
But now I see, Sitemap xml files also list other xml files. Check this one out for what I mean:
https://www.rocktherankings.com/sitemap_index.xml

So that means, I got to program my web crawler to go one level deep to find the site links (html files).
Question is: Does this happen more than one level deep ?
I mean does it do this ....
I go to a Sitemap xml file.
I see further xml files. I clickover to an xml file. Thus go one level deep.
I see more xml files listed. I clickover to an xml file. Thus go two level deep.

How many levels deep can a site go like this to list their html files ?
I need to know this to program my crawler how many levels it should check before giving up. Do not want to be going in an endless loop and get my crawler get into a trap.

A Pure CSS Gallery Focus Effect with :not

Oftentimes in the past, I needed to figure out how to add styles to all elements inside the container but not the hovered one.

Animated GIF of a mouse cursor hovering over elements. The element the mouse cursor enters remains visible and the other elements fade.
Demo of the expected “fade-out” effect on siblings to let users “focus” on a particular element.

This effect requires selecting the siblings of a hovered element. I used to apply JavaScript for this, adding or removing the class that defined the proper CSS rules on mouseenter and mouseleave events, similar to this:

Although the code does the trick, my gut feeling always told me that there must be some pure-CSS way to achieve the same result. A few years ago, while working on a certain slider for my company, I came up with a solution similar to how Chris Geelhoed recreated the famous Netflix homepage animation and I understood that I didn’t need JavaScript for this anymore.

A couple of months ago I was trying to implement the same approach to a grid-based feed on my company website and — boom — it didn’t work because of the gap between the elements!

Luckily for me, it appeared that it doesn’t have to stay like this, and once again I didn’t need JavaScript for it.

Markup and base CSS

Let’s start coding by preparing the proper markup:

  • .grid is a grid-based <ul> list;
  • and .grid__child elements are <li> children that we want to interact with.

The markup looks like this:

<ul class="grid">
  <li class="grid__child"></li>
  <li class="grid__child"></li>
  <li class="grid__child"></li>
</ul>

The style should look like this:

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 15rem);
  grid-gap: 1rem;
}

.grid__child {
  background: rgba(0, 0, 0, .1);
  border-radius: .5rem;
  aspect-ratio: 1/1;
}

This example code will create three list items occupying three columns in a grid.

The power of CSS selectors

Now, let’s add some interactivity. The approach that I initially applied was based on two steps:

  1. hovering on the container should change the styles of all elements inside…  
  2. …except the one that cursor is hovering at the moment.

Let’s start with grabbing every child while the cursor is hovering over the container:

.grid:hover .grid__child {
  /* ... */
}

Secondly, let’s exclude the currently hovered item and reduce the opacity of any other child:

.grid:hover .grid__child:not(:hover) {
  opacity: 0.3;
}

And this would be perfectly enough for containers without gaps between the child elements:

Animated GIF of a mouse cursor interacting with elements that are not separated by any gaps.
Demo of a solution that works without gaps.

However, in my case, I couldn’t remove these gaps:

Animated GIF of a mouse cursor hovering over elements. However, when the mouse enters a gap between two elements, the effect ends as the mouse leaves the element.
Demo of the problem encountered when gaps are introduced.

When I was moving the mouse between the tiles all of the children elements were fading out.

Ignoring the gaps

We can assume that gaps are parts of the container that are not overlayed by its children. We don’t want to run the effect every time the cursor enters the container, but rather when it hovers over one of the elements inside. Can we ignore the cursor moving above the gaps then? 

Yes, we can, using pointer-events: none on the .grid container and bringing them back with pointer-events: auto on its children:

.grid {
  /* ... */
  pointer-events: none;
}

/* ... */

.grid__child {
  /* ... */
  pointer-events: auto;
}

Let’s just add some cool transition on opacity and we have a ready component:

It’s probably even cooler when we add more tiles and create a 2-dimensional layout:

The final CSS looks like this:

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 15rem);
  grid-gap: 3rem;
  pointer-events: none;
}

.grid:hover .grid__child:not(:hover) {
  opacity: 0.3;
}

.grid__child {
  background: rgba(0, 0, 0, .1);
  border-radius: .5rem;
  aspect-ratio: 1/1;
  pointer-events: auto;
  transition: opacity 300ms;
}

With only 2 additional lines of code we overcame the gap problem!

Possible issues

Although it’s a compact solution, there are some situations where it might require some workarounds.

Unfortunately, this trick won’t work when you want the container to be scrollable, e.g., like in some kind of horizontal slider. The pointer-events: none style would ignore not only the hover event but all the others, too. In such situations, you can wrap the .grid in another container, like this:

<div class="container">
  <ul class="grid">
    <li class="grid__child"></li>
    <li class="grid__child"></li>
    <li class="grid__child"></li>
    <li class="grid__child"></li>
    <li class="grid__child"></li>
    <li class="grid__child"></li>
    <li class="grid__child"></li>
  </ul>
</div>

Summary

I strongly encourage you to experiment and try to find a simpler and more native approach for tasks that are usually expected to have some level of complexity. Web technologies, like CSS, are getting more and more powerful and by using out-of-the-box native solutions you can achieve great results without the need of maintaining your code and cede it to browser vendors.

I hope that you liked this short tutorial and found it useful. Thanks!

The author selected the Tech Education to receive a donation as part of the Write for DOnations program.


A Pure CSS Gallery Focus Effect with :not originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.