Beyond Sessions: Centering Users in Mobile App Observability

Observability providers often group periods of activity into sessions as the primary way to model a user’s experience within a mobile app. Each session represents a contiguous chunk of time during which telemetry about the app is gathered, and it usually coincides with a user actively using the app. Therefore, sessions and their associated telemetry are a good way to represent user experience in discrete blocks. 

But is this really enough? Is there a better way to understand the intersection of users, app behavior, and the business impact of app performance?

The Keyword-Driven Test Automation Framework With JSON Format for REST API Testing

First, I’d like to get back a little bit of this framework’s architecture overview.

Test execution progress
Test Execution Progress

As the above image and the previous story mentioned, the test suites/cases/steps are formed in a JSON file, and the framework will load and map these JSON files to the list of test suites/cases objects. Then, action steps are executed based on the class and method (keyword) that are specified in each test step (use the reflection technique to invoke the keyword — method). Our responsibility is to write the autotest script inside each keyword.

Building Better on AWS With the Enhanced AWS Well-Architected Framework

The cloud has revolutionized how businesses operate, and AWS, a pioneer in the field, continues to refine its offerings to empower users. A core component of this mission is the ever-evolving AWS Well-Architected Framework. This framework provides a prescriptive approach to building secure, high-performing, resilient, and cost-optimized cloud architectures.

This blog dives into the recent enhancements to the AWS Well-Architected Framework, exploring how these updates can empower you to build even better on AWS.

Google Workspace vs Office 365 Comparison – Which One Is Better?

Trying to decide between Google Workspace vs. Office 365 for your business email and productivity suite?

Google Workspace and Office 365 both offer impressive suites of productivity software and services. If you are not experienced with either side, then you might be looking at the right option to streamline your business operations.

In this guide, we will compare Google Workspace vs. Office 365 to help you decide which one is better for your business.

Google Workspace vs Microsoft 365

What Are Google Workspace and Office 365?

After you make a website, the next step is usually to get a professional business email address.

Unlike your @gmail.com or @outlook.com email, a professional business email address is branded with your company name: name@yourbusiness.com

While most WordPress hosting companies offer a free business email address, they can’t compete with the powerful business tools that Google Workspace and Office 365 provide. These platforms have more reliable emails, file storage, documents, spreadsheets, calendars, notes, video conferencing tools, etc.

Google Workspace includes Gmail, Google Drive, Google Docs, Sheets, Slides, Calendar, Keep, Hangouts, and other Google apps that you probably already use and love.

Google Workspace

They also have unique offerings such as Apps Script and AppSheet for building custom solutions without coding and Jamboard for whiteboard brainstorming.

Microsoft’s Office 365 includes Outlook, OneDrive, Word, Excel, PowerPoint, One Note, Skype, and other Microsoft apps.

Microsoft 365

Using cloud productivity suites allows you to save money on maintaining software licenses and installations, running an IT department, and more.

All your data is stored in the cloud, which makes it easier to access files from anywhere using any device. This is great if you are running a remote company or traveling while managing your WordPress blog.

Google Workspace vs. Office 365 Comparison Chart

It can be confusing to evaluate both productivity suites unless you can visually see the differences. That’s why we’ve put together a side-by-side comparison for a quicker overview.

FeaturesGoogle WorkspaceOffice 365
PricingStarter – $6 / user / month
Standard – $12 / user / month
Plus – $18 / user / month
Microsoft 365 Business Basic – $6 /user / month
Microsoft 365 Business Standard – $12.50 /user / month
Microsoft 365 Business Premium – $22 / user / month
Microsoft 365 Apps for Business – $8.25 /user / month
Cloud StorageBusiness Starter – 30GB per user
Business Standard – 2TB per user
Business Plus – 5TB per user
1 TB for all plans
50 GB email storage
Apps Docs, Sheets, Slides, Keep, Sites, Google Drive, Calendar, Meet, Gmail, ChatWord, Excel, PowerPoint, OneDrive, Teams, Outlook, Exchange, SharePoint
Ease of UseBetter admin controls
Better web and mobile apps
Better Desktop Apps
CollaborationLive multi-user editing
Hangouts for video conferencing
Google Voice for phone calls and SMS
Live multi-user editing
Skype for Business (available only with Business Premium or Enterprise plans)
Security and Support– Data encryption
– Data loss prevention
– Google cloud security protection
– Two-step verification
– Built-in spam, phishing and unusual activity detection
– 99.9% application availability guarantee
– Data encryption
– Data loss prevention
– Microsoft cloud security technology
– Multi-factor authentication
– Built-in spam, malware and unusual activity detection
– 99.9% financially backed uptime guarantee
Customer SupportStandard Support (paid upgrade to Enhanced Support)Round-the-clock phone and online support
Get StartedBuy Google WorkspaceBuy Office 365

Why Do You Need Google Workspace or Office 365?

Just about every type of business could benefit from Google Workspace or Office 365, whether you run a small business website, local business, or online store.

Here’s just a handful of reasons to use productivity suites:

  • Collaboration: Team efficiency comes down to collaboration. Important decisions are made through collaboration tools such as sharing files, instant messaging, and video and audio conferencing.
  • Cloud-based file storage: Files are arguably the backbone of any organization. Documents, PDFs, spreadsheets, and other files help run the operations of a business. There’s nothing wrong with legacy apps, but transferring files elsewhere can be difficult, which is why cloud-based options are better.
  • Business email: Every business needs an email to connect with their customers, partners, and employees. While you could go with a free ‘@gmail.com’ option, it’s better to have your domain name in your email so it looks more professional.

That said, both suites offer a ton of features that allow you to run your business efficiently and grow. Let’s take a look at those features and see how Office 365 and Google Workspace stack up.

Feel free to jump forward to any section that you’re most interested in:

Google Workspace vs. Office 365 Pricing

Every business has a lot of expenses, including software tools, which is why pricing is an important factor to consider. You want to choose a solution that fits your budget.

Let’s compare the pricing of Google Workspace and Office 365 to find out which one offers the most value for your money.

Google Workspace Pricing

Google Workspace pricing

Google Workspace comes with three simple pricing plans.

  • Business Starter – $6 per user per month for 30 GB cloud storage per user.
  • Business Standard – $12 per user per month for 2 TB cloud storage per user.
  • Business Plus – $18 per user per month for 5 TB cloud storage per user.

That said, all users get a free trial for their first 14 days.

Once you reach the Business Plus plan, you get access to enhanced security and management tools. For example, Google Vault lets you easily search, manage, and export an organization’s email, chats, and other data. Beyond that, there’s advanced threat protection to protect sensitive data from malicious attacks and malware.

Office 365 Pricing

Microsoft 365 pricing

Office 365 comes with three different pricing plans for medium and small businesses.

  • Microsoft 365 Business Basic – $6 per month per user
  • Microsoft 365 Business Standard – $12.50 per month per user
  • Business 365 Business Premium – $22 per month per user
  • Microsoft 365 Apps for business – $8.25 per use per month

All Microsoft 365 plans are paid on an annual basis. That said, there is a one-month free trial to see if it’s a good fit.

Microsoft 365 comes with 1 TB of cloud storage on their basic plan, with access to all of the main apps and a custom business email. The Business Standard comes with more advanced programs, such as the ability to run webinars and even new video editing and design tools with Microsoft Clipchamp.

Their Business Premium Plan is where you get advanced cyber threat protection against phishing attacks and viruses.

Winner: Tie. Both Google Workspace and Office 365 are priced competitively. Depending on which apps your business needs, one may tip the scales over the other. For example, Google offers unique apps like Sites, which is a page builder tool, while Office 365 has a video editing software called ClipChamp.

Professional Business Email

Both Google Workspace and Office 365 allow you to create professional business email accounts using your own domain name. Besides a custom domain, professional email offers enhanced security and features to scale your business, like more storage and a number of users.

Google Workspace – Gmail for Business

Google-workspace-business-email

Google Workspace allows you to register a domain name or use your existing domain name to create email accounts. You can also create up to 30 email aliases for each user.

Gmail is best if you’re looking for collaborative and time-saving features. For example, it’ll automatically send notifications to you when you’re tagged in another Google app, making it easy for teams to work on documents, projects, and presentations.

There are also dynamic emails in Gmail, allowing the recipient to complete an action directly in the email, like responding to a comment or question, replying to an RSVP to an event or meeting, and browsing a catalog.

Overall, the entire interface feels more modern and much easier to navigate, making Gmail easier to use. One of the best features is the AI-driven option that suggests phrases and words as you type and a convenient snooze button so you can delay incoming messages.

If you’re interested in setting one up, read our tutorial on how to set up a professional email address with Gmail and Workspace.

Office 365 – Outlook for Business

office 365

Office 365 also allows you to easily create professional email addresses with your own domain name. It offers 400 email aliases for each user.

Outlook is great for people who prefer a desktop email client. Logging online to access your email can be a distraction, which is why having a full-featured desktop version is helpful.

However, Outlook does seem to struggle with search accuracy as well. If, for example, you were looking for a specific email in a chain, Outlook may bring up other emails in that chain as well, making it harder to find.

In addition, the ads are placed to the side of the email app on the Office 365 Business Basic plan.

Office 365 ads in emails

From an aesthetic standpoint, it’s more distracting for users to deal with, which can slightly hurt the user experience. You’ll need to upgrade to the Business Standard plan for an ad-free experience, while Gmail includes no ads on all plans.

Verdict: Google Workspace, since they offer a better user experience. With the tagged collaboration, no ads, and better searchability, Gmail makes handling emails much easier.

Cloud File Storage and Sharing

One of the main reasons for using a cloud productivity suite is file storage. You can save all your files in the cloud so that you can access them anywhere, using any device, and share them easily.

Both Google Workspace and Office 365 make file storage and sharing easy.

Google Workspace – Google Drive Cloud Storage

Google Workspace Drive

Google Workspace gives each user 30 GB of cloud storage with the Starter plan. When you upgrade to the Standard plan, you get 2 TB of storage per user, and with the Plus plan, you get 5 TB of storage per user.

It uses Google Drive to store and manage files. It comes with apps that you can download on your mobile devices, tablets, or desktop. This allows you to easily access files stored in the Drive and even make them available offline.

Google Drive also makes it super easy to share files with your colleagues or anyone else. You can share by email, allow others to just view or edit a file, and even allow others to download them.

Many WordPress backup plugins also allow you to store your website backups on Google Drive. If you have unlimited storage, then you can safely store all your website backups on the cloud.

At WPBeginner, we recommend backing up your entire WordPress site to Google Drive so that you’re prepared for the worst-case scenario.

Office 365 – OneDrive Cloud Storage

OneDrive

Office 365 offers 1 TB of cloud storage for each user with all their plans. This is a lot of storage, but it is not unlimited. Each user also gets 50 GB of email storage, which is separate from your OneDrive storage limit.

It uses OneDrive to store and manage files, and it also comes with desktop, mobile, and web apps. Similar to Google Drive, you can sync files using OneDrive and easily share them.

While Office 365 doesn’t offer unlimited cloud storage like Google Workspace, you probably won’t need that much space. 1TB is a lot for cloud storage for a single user, which many people won’t come anywhere near using, anyway.

Verdict: Google Workspace has more total storage if you upgrade to the Business Standard plan or above. That said, Office 365 offers more storage at a lower price point.

Productivity Apps

Productivity apps are the backbone of most small businesses. It’s where teams collaborate on projects, streamline workflows, and manage data. Both Google Workspace and Office 365 come with the essentials you need, like documents, spreadsheets, presentations, and more.

Let’s take a look at the apps offered by both platforms and how they compare to each other.

Apps in Google Workspace

Apps in Workspace

Google Workspace comes with popular Google apps like Gmail, Google Docs, Sheets and Slides, Google Calendar, Keep, Hangouts, and a lot more.

Google focuses on simplicity and live collaboration. Collaborating with team members is seamless. They also offer real-time co-authoring so that individuals can work on the same document at the same time. That means you can comment, suggest, review changes, and make notes with ease.

These apps work best in a desktop browser on all operating systems. Google also has mobile apps for both Android and iOS. If you are already using an Android phone, then their mobile versions may come pre-installed with your phone.

Google also has offline versions of some apps that would work in your browser. However, their offline functionality is quite limited, and you will have to individually make a file available for offline editing.

Unlike Microsoft’s productivity suite, which includes both web and desktop versions, Google’s tools are exclusively web-based. That said, Google Workspace has a cleaner interface and is much easier to use.

Apps in Office 365

An Office 365 business subscription gives you access to Microsoft Office apps like Word, Excel, PowerPoint, Outlook, and OneNote. For desktop computers, these apps are still the most feature-rich and complete office application suite on the market.

All Word applications have a lot more pre-built templates than their Google counterparts.

Word templates

Word alone has 300 different business templates, compared to Google Docs, which only has 55 templates, including business, personal, and educational ones. Plus, Word has more chart types for embedding into documents.

This extends to other apps as well. Excel offers over 80 different templates for different types of budgets, while Google Sheets has 19 templates in total.

Some apps have more advanced functionality than Google as well. For instance, PowerPoint has a QuickStarter feature, which helps you quickly build a beautiful presentation in minutes. Just type in a topic, and it sources facts and research findings for you. It will also suggest layouts, themes, and images to use.

Powerpoint Quick Starter Feature

All in all, Office 365’s desktop apps set a very high standard that no web or mobile app has been able to compete with.

Verdict: Tie. Google Workspace is better for ease of use and collaboration. However, Office Workspace excels in templates and has more advanced functionality.

Collaboration Tools

With remote work becoming the new norm, collaboration tools are more important than ever. Team members need video conferencing, chat, messaging, and shared spaces to facilitate internal discussions.

There are a lot of tools to unpack, so we’ll cover what each suite offers.

Collaboration tools in Google Workspace

Workspace offers Google Meet, which is made up of Google Chat and Hangouts.

Google Meet excels in guest access. With this feature, team members can invite external guests to collaborate and join conversations without having a Google account. On the flip side, Microsoft Teams requires guests to have a Microsoft account or be part of an organization.

Another advantage is that Google Meet allows more participants to join in a room for the Plus and Enterprise plans. Up to 500 people can be in a single room.

Workspace collaboration tools

Comparatively, Microsoft Teams only limits you to 300 participants for all plans.

While it’s not a huge deal, the scales do tip in favor of Google Meet.

Microsoft Teams

However, Google Meet’s main advantage is simply its user experience. It easily syncs within Google’s ecosystem of apps. With its call quality adjustments powered by AI, rest assured that your meetings should run smoothly without audio or visual issues.

That said, Google Chat, the messaging platform, isn’t as easy to use for creating specific channels as Microsoft Teams.

In addition, Workspace has Google Voice, a VOIP service provider that allows you to make cloud-based phone calls. Google Voice is more advanced than Microsoft Team Phone because it offers more advanced features. These include AI-driven automatic voicemail transcriptions for better data management.

Collaboration tools in Office 365

Office 365 features Microsoft Teams as its primary collaboration tool. It works similarly to Slack, where you can communicate in different channels or message individuals directly so that all chats are siloed appropriately.

Microsoft Teams instant messaging chat

Also, within each channel, you can further segment by topic or department to help organize communication with your company. The messaging app has tabs where you can attach files or connect third-party services.

Beyond that, Microsoft Teams has a built-in calendar and conferencing within their program. That way, you don’t have to go back and forth to Outlook to figure out when your meetings are.

Microsoft Teams Calendar

Then, you can click on the event scheduled in the calendar to join a video or audio conference. The conferencing tool comes with all the features you’d expect, such as recording meetings and sharing screens.

What’s great about Microsoft Teams is that you can use the search box to type in topics, names, or commands to find what you’re looking for.

Microsoft Team search feature

Beyond the chat and conferencing tool, they also have Microsoft Teams Phone, which allows you to make internal calls. That said, you’ll need to pay for a specific domestic calling plan, an international calling plan, or a pay-as-you-go plan.

In comparison, Google Voice offers free calls to the US and Canada.

Verdict: Google Workspace because it’s intuitive and has more AI-driven features in Hangouts.

Security Measures

Security is one of the major concerns for small businesses when using cloud applications. Let’s see how Google Workspace and Office 365 protect the data you store on their cloud platforms.

Google Workspace Security Features

Google Workspace is built on top of Google’s cloud infrastructure and uses the same levels of security as Google itself. This includes automatic detection of suspicious activity, phishing attempts, and other hacking attempts.

As an administrator, Google allows you to set different policies to prevent unauthorized access to your admin console or any of the user accounts. You can use two-factor authentication and enforce it for all your users.

It also comes with a data leak protection feature where you can set keywords to block any outgoing communication. Google Workspace has built-in spam, virus, and malware detection, which scans all documents and attachments.

Office 365 Security Features

Microsoft security

Office 365 features Microsoft Defender, a security app for the entire productivity suite.

It allows you to enable multiple-factor authentication for all user passwords. With multi-factor authentication, users need to provide more forms of authentication before accessing their accounts, compared to the two-factor option that Google Workspace offers.

The most common options are prompts via text message, mobile app notification, or authenticator app.

It also uses its own AI tools to learn each user’s work habits, detect suspicious activities, and flag them if something looks out of place. With the business plan, you get access to Microsoft Defender, a premium security solution that keeps your data secure.

Microsoft also offers extended support towards email authentication protocols such as 365 DMARC. This solution specifically protects against inbound phishing emails sent to your business domain. You can specify to email servers how to respond to emails sent from your domain that fail the authentication checks.

It includes a data loss prevention tool to protect against data theft and leaks. Using the device management tool, your organization can also restrict user access to company-issued devices.

Office 365 also uses Microsoft’s spam, virus, and malware detection tools to scan all documents, emails, and attachments.

Verdict: Office 365 because they offer multi-factor authentication protocols and advanced security analytics in higher-tiered plans. It’s suitable for enterprise businesses with strict security needs or those operating within highly regulated industries.

Customer Support

Google Workspace Customer Support

Google Workspace support

Unfortunately, Google doesn’t have a great reputation for customer support. It’s extremely hard to connect to a real person to resolve or troubleshoot issues you’re having with their products or tools.

Beyond that, Google only offers web-based support through live chat, help center, and their community.

The main problem with web support is that you must have an internet connection to receive help. While you can purchase enhanced support with Google Workspace, it’s only in their Enterprise plan.

Office 365 Customer Support

On the other hand, Office 365 doesn’t withhold support channels from its users regardless of the pricing plan. All plans offer online and 24/7 phone support. In addition, you get access to technical support for troubleshooting and implementation.

Verdict: Office 365 is best because it also offers phone support, even for the lowest tiers of service.

Google Workspace vs Office 365 – Which One Is Better?

Google Workspace is the better option for most people, including small to medium businesses and startups. Even a complete beginner can master apps like Docs, Sheets, Meet, and Calendar. You can set up everything in just a few clicks, and it’s easy to collaborate with team members.

Office 365 is more suitable for enterprise-level businesses where all employees work from an office using a Windows PC. Their desktop apps are top-notch, especially if you are in a Windows ecosystem.

This comparison is similar to Mac vs. PC or Apple vs. Android. Office 365 provides better functionality in many cases, but it’s much harder to use and learn. Google Workspace is easy to understand and much faster to set up.

We hope this article helped you compare Google Workspace vs. Office 365 to find out which one is better. You may also want to see our list of top WordPress plugins and tools for business websites, along with the best free business tools 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 Google Workspace vs Office 365 Comparison – Which One Is Better? first appeared on WPBeginner.

Ordering Chaos: Arranging HTTP Request Testing in Spring

In this article, I would like to describe an approach to writing tests with a clear division into separate stages, each performing its specific role. This facilitates the creation of tests that are easier to read, understand, and maintain.

Donald Duck with file boxes

The discussion will focus on using the Arrange-Act-Assert methodology for integration testing in the Spring Framework with mocking of HTTP requests to external resources encountered during the execution of the tested code within the system behavior. The tests under consideration are written using the Spock Framework in the Groovy language. MockRestServiceServer will be used as the mocking mechanism. There will also be a few words about WireMock.

The Future of Mobile Observability Is OpenTelemetry

OpenTelemetry is built on the premise of transparent, portable, and extensible data collection. While these practices are changing the way development teams work for server-side infrastructure and application monitoring, these same principles have not been realized for the client-side layer, often labeled "RUM" in legacy terminology.

But that’s changing rapidly.

Oxide Computer: Revolutionizing Cloud Computing for the Modern Data Center

The Dawn of a New Era in Cloud Computing

The 56th IT Press Tour brought together industry leaders and innovators, and among them was Oxide Computer Company, a company that is redefining cloud computing for the modern data center. Co-founders Steve Tuck (CEO) and Brian Cantrill (CTO), along with Software Engineer Adam Leventhal, presented their groundbreaking solutions to the attendees, showcasing how Oxide Computer is revolutionizing the way organizations approach their IT infrastructure.

Addressing the Fractured On-Premises Ecosystem

Traditional data centers face numerous challenges, such as long setup and integration times, product boundaries that hamper performance and reliability, incoherent and proprietary software, and a lack of developer-friendly features.

Levelling Up: The Non-Technical Skills Every Aspiring Senior Engineer Needs

As a software developer, the path toward becoming a senior engineer can seem deceptively straightforward — keep learning new technologies, master coding languages, and dive deeper into software architecture and design patterns. However, the reality is that reaching the senior level requires more than just technical prowess. It demands a well-rounded skill set that extends far beyond coding abilities.

The Importance of Soft Skills

While technical competency is undoubtedly crucial, many experienced developers often overlook the significance of soft skills in their pursuit of career advancement. These non-technical abilities are the glue that holds teams together and enables effective collaboration, communication, and problem-solving.

Building an Internal TLS and SSL Certificate Monitoring Agent: From Concept to Deployment

Can you monitor your internal SSL certificates? This was a question we frequently heard from our clients. Many organizations keep their services (web, database, etc.) inaccessible on the public internet, for security, compliance, cost, and other reasons. At TrackSSL, we initially offered public SSL/TLS certificate monitoring, but we often received requests from customers for private SSL certificate monitoring. Thus, we needed to find a way to monitor certificates used on servers that are not typically accessible from the Internet.

In this article, we share our journey of developing a remote certificate monitoring service using an agent that runs on an organization's private network. We share the requirements we defined, the architecture we selected, and the solution we implemented.

How to Add the Ultimate SEO Dashboard in WordPress

Do you want to add an SEO dashboard to your WordPress admin area?

An SEO dashboard acts like your personal command center, giving you a clear view of your website’s SEO health. It allows you to track your SEO progress, identify areas for improvement, and ultimately drive more organic traffic to your site.

Here at WPBeginner, we’re all about making search engine optimization easy for everyone. And we’ve found a fantastic way to add a powerful SEO dashboard to WordPress in just a few minutes.

In this article, we will show you how to add the ultimate SEO dashboard to your WordPress website.

How to Add the Ultimate SEO Dashboard in WordPress

Why Add an SEO Dashboard to Your WordPress Website?

If you run a WordPress website, then you may want to add an SEO dashboard directly to your admin area. This means you don’t need to switch between different platforms, saving you plenty of time.

An SEO dashboard can provide valuable insights into your website’s health. It helps you understand how your website performs in search engine results pages (SERPs) so you can identify areas for improvement and improve visibility.

For eCommerce stores, an SEO dashboard can help you identify which product pages are ranking well and which ones need a boost. You can track keyword rankings for your most important products and optimize content to attract more potential customers.

Similarly, for lead generation, an SEO dashboard allows you to see how well your landing pages are optimized for their target keywords. This ensures they are SEO-friendly, maximizing their potential to bring in qualified leads.

Expert Tip: Prefer to leave your SEO to the experts? Our WPBeginner SEO Service can optimize your content for keywords, do a technical SEO audit, and help you get guest posts published on high-profile websites. That way, you just need to worry about running your business.

With all that in mind, let’s take a look at how to add an SEO dashboard in WordPress.

How to Set Up a WordPress SEO Dashboard With All in One SEO

We’ve experimented with various WordPress SEO tools, including the popular Yoast SEO plugin. But for accessing the ultimate SEO dashboard, our top pick is All in One SEO (AIOSEO).

There are two main reasons for this choice. First, AIOSEO is incredibly beginner-friendly. It is super easy to navigate its features, even for people new to WordPress SEO.

Second, this SEO plugin has comprehensive dashboards. You won’t just get a single snapshot of your website’s health. Instead, you’ll see a detailed breakdown of your links, be able to track your keyword rankings, and even monitor your SEO changes.

On top of that, AIOSEO offers a suite of other valuable SEO settings, including customizable XML sitemaps, schema markup support, 301 redirect setup, and more.

Note: We will be using the premium version of AIOSEO in this guide, as it unlocks all the dashboard features we need. That said, feel free to start with the free version to explore its capabilities before upgrading.

To set up AIOSEO, simply download the plugin from your AIOSEO account page and install it on your WordPress dashboard. You can read our step-by-step guide on how to install a WordPress plugin for more information.

Then, follow the setup wizard. By the end of it, you will need to activate your license key, which you should receive after purchasing a premium plan.

For a detailed installation walkthrough, you can read our guide on how to set up AIOSEO for WordPress.

Click let's get started AIOSEO setup wizard

With AIOSEO set up, you are ready to move on to the next section and explore the SEO dashboard features. You can use the quick links below to skip to your preferred topic:

Check Your TruSEO and SEO Site Scores

The main AIOSEO dashboard is located at All in One SEO » Dashboard. This is where you’ll find a clear overview of your SEO performance.

This dashboard features two key widgets: ‘AIOSEO Overview’ and ‘SEO Site Score.’

The All in One SEO (AIOSEO) plugin for WordPress

The AIOSEO Overview showcases your TruSEO scores for all published posts and pages. TruSEO is AIOSEO’s way of providing personalized recommendations to enhance your content’s on-page SEO.

These include things like the existence and length of meta titles and descriptions, content readability, and the use of a focus keyphrase.

The TruSEO scores fall into five categories: Needs Improvement, Okay, Good, and Without a Focus Keyphrase.

Ideally, you want most of your posts, pages, and custom post types to get a ‘Good’ score. You can check the score for each post type by using the ‘Choose a Post Type’ dropdown menu.

The AIOSEO Overview score

Moving on, the SEO Site Score provides a broader picture of your website’s performance, not just individual pages and posts.

This score takes into account various technical aspects, including site speed, sitemaps, and the use of HTTPS. AIOSEO recommends aiming for a score of 70 or above.

The AIOSEO Site Score

The widget breaks down the scoring into three parts: Important Issues (critical problems requiring immediate attention), Recommended Improvements (areas for enhancement), and Good Results (areas performing well).

If you click on ‘Complete Site Audit Checklist,’ you will get a more detailed breakdown, which we’ll explore in a later section.

Check Your Website’s Ranking Stats

Staying on top of your website’s rankings in search engines is super important for any SEO strategy. Understanding how your content is performing in search results can help you find areas to improve your keyword research and drive more organic traffic.

AIOSEO provides an easy way to check your website’s ranking stats directly within your WordPress dashboard. What you need to do is head over to All in One SEO » Search Statistics in your admin sidebar.

Here, we will focus on the ‘Dashboard’ tab. To see data in this section, you’ll need to connect your website with Google Search Console.

For step-by-step instructions, check out our guide on how to add your WordPress website to Google Search Console.

AIOSEO search statistics dashboard

The Dashboard tab offers a quick overview of how your website is performing for rankings and click-through rates (CTRs).

At the top, you can conveniently set the timeframe for the data you want to see (Last 7 days, Last 28 days, Last 3 months, or custom).

Changing the dates in the Search Statistics dashboard in AIOSEO

The Dashboard has 5 key areas.

First is SEO Statistics. This section provides graphs to help you visualize your website’s visibility in search engine results pages (SERPs) and the number of people who clicked through to it.

The SEO Statistics graph in AIOSEO

It includes:

  • Search Impressions: The total number of times your website appeared in search results within the selected timeframe.
  • Total Clicks: The total number of clicks your website received from search results during that period.
  • Average CTR: The average click-through rate of your content in search results.
  • Average Position: This graph shows the average keyword position of your content in search results for the selected timeframe.

Additionally, hovering over each graph allows you to see specific numbers for any date within the timeframe.

For example, in the screenshot below, hovering over the ‘Total Clicks’ graph on May 7, 2024, shows that our demo website received 1.1k clicks that day.

Seeing how many clicks a website has gotten on a particular date in AIOSEO

You can also hover over the number that shows an increase or decrease to see more details about what happened to the data compared to the previous period.

Like so:

Hovering over the search impressions graph in AIOSEO

You can click on the ‘Open Report’ button for a more detailed breakdown of this data.

Next is ‘Keyword Positions.’ This section uses a line graph to illustrate how your keyword positions fluctuate over time using color codes.

Here’s how to interpret the data:

  • Blue: Shows how much of your content ranks in the top 3 positions.
  • Green: Content ranking between positions 4-10.
  • Yellow: Content ranking between positions 11-50.
  • Red: Content ranking between positions 50-100.

In the screenshot below, the graph shows a high concentration in the yellow zone.

This indicates most of our content falls within the 11-50 keyword position range. You can also hover over the graph to see the exact dates when your keyword positions decreased or increased.

Checking pages' keyword positions in AIOSEO

Scrolling down, you will see ‘Keyword Rankings’ and ‘Post Optimizations.’

Similar to the AIOSEO Overview tab in the main dashboard, the ‘Post Optimizations’ section shows your TruSEO scores for all published posts and pages.

keywords overview

On the other hand, the ‘Keyword Rankings’ widget shows what keyphrases your content is ranking for and how they are performing.

There are two tabs here. The ‘Top Keywords’ tab lists your highest-ranking keywords and the clicks you have received from them.

On the other hand, the ‘Winning/Losing’ tab highlights keywords gaining or losing ranking positions.

If you hover over any of the keywords in this tab, then you can get information on how much your rankings have increased or decreased compared to the previous period.

The Keyword Rankings list in AIOSEO

Finally, there is ‘Content Performance.’

This section focuses on which individual posts and pages perform the best.

AIOSEO's Content Performance feature

The performance is based on a combination of factors:

  • TruSEO score
  • Indexed status (whether Google has indexed the page)
  • Clicks
  • Impressions
  • Position
  • Differences in ranking over time

There are three tabs here:

  • Top Pages: Shows your best-performing pages.
  • Top Losing: Highlights pages that are losing ranking positions.
  • Top Winning: Identifies pages gaining ranking positions.

All in all, the Search Statistics tab is a pretty powerful AIOSEO feature. Check out these articles to see how you can make the most of it:

Look For On-Page SEO Audit Opportunities

Next, head over to All in One SEO » SEO Analysis and navigate to the ‘SEO Audit Checklist’ tab. This section offers an in-depth look at your overall SEO health.

At the top, you’ll see your SEO Site Score, just like before.

Here, a very good score falls between 50 and 75, but ideally, you should aim for 70 or above. This score is based on various criteria, which will be shown as you scroll down the ‘Complete SEO Checklist’ section.

The SEO Audit Checklist dashboard in AIOSEO

The Complete SEO Checklist is divided into four categories: Basic SEO, Advanced SEO, Performance, and Security.

Basic SEO tackles fundamental on-page SEO elements and checks if they’re already implemented on your website. These include SEO page titles, meta descriptions, heading tags, image alt text, and internal links.

The Basic SEO analysis in AIOSEO

If an element is missing, simply click the arrow button next to it. A button will appear, allowing you to address the issue immediately.

For example, a missing meta description can be fixed by clicking the ‘Edit Meta Description’ button. This will take you directly to the block editor for your homepage, where you can add one.

Adding a missing meta description in AIOSEO

The Advanced SEO report dives deeper into technical SEO. Here, AIOSEO checks things like:

Here’s what it looks like:

The Advanced SEO analysis in AIOSEO

Similar to Basic SEO, if an element is missing, you can click the arrow button next to the issue for more information.

A button will be available to help you address the problem.

Adding missing Open Graph tags in AIOSEO

‘Performance’ focuses on website speed. AIOSEO will identify any speed issues or areas where your website excels.

In our case, AIOSEO found that the page size is small enough to load quickly, generates few requests, and boasts a response time under 0.2 seconds. However, unminified JavaScript and CSS files are slowing things down.

Performance analysis in AIOSEO

AIOSEO isn’t a dedicated speed optimization plugin, so it can’t help you address these problems.

However, clicking the arrow next to the issue will provide information on how to tackle it.

You can also check out our ultimate guide to boost WordPress speed and performance for more information.

Performance issue found by AIOSEO

Pro Tip: Want to speed up your website with no effort? Our WPBeginner Pro Services offer a site speed optimization service that takes care of all the technical details.

Let our team of experts analyze and speed up your website so you can sit back and focus on growing your business.

WordPress security is all about safety and user experience, such as checking your website for malware and verifying whether it uses HTTPS encryption.

Security analysis by AIOSEO

If you go to the top of the Complete SEO Checklist section, then you can click on ‘Important Issues’ to view only the most urgent problems you need to address.

On the other hand, ‘Recommended Improvements’ are issues that are not as urgent but should be considered.

Once you have made improvements to your website, you can click the ‘Refresh Results’ button to see if AIOSEO can detect those changes.

The Complete SEO Checklist tabs in AIOSEO

Monitor Your External and Internal Linking

The next dashboard we will check out is at All in One SEO » Link Assistant. The dashboard is in the ‘Overview’ tab, which shows information about the links on your site.

The Link Assistant dashboard in AIOSEO

Search engines discover new content by following links. Broken or poorly structured links can prevent search engine crawlers from efficiently indexing your website, which can hurt your rankings.

Plus, well-maintained links ensure a smooth user experience for your visitors. Broken links lead to dead ends, frustrating users and potentially damaging your website’s credibility.

Let’s go through each section of this dashboard one by one. On top is a bar that shows the numbers for your Posts Crawled, Orphaned Posts, External Links, Internal Links, and Affiliate Links.

‘Posts Crawled’ indicates how many posts and pages Link Assistant has scanned so far.

Depending on the number of links, you may see a percentage indicator at the top right corner that tells you how many links have been scanned.

If all links have been scanned, then you won’t see the percentage indicator.

The Posts Crawled information graph in AIOSEO

Next up is ‘Orphaned Posts,’ which are posts or pages lacking internal links from other parts of your website. By finding and addressing orphaned content, you can help search engines properly discover and index all your pages.

External Links are links directing visitors to websites other than yours. Including external links to relevant and authoritative sources can enhance your content’s credibility and user experience.

On the other hand, Internal Links connect your website’s different pages and posts. They help search engines understand your website’s structure and improve user navigation.

You can use internal linking plugins to improve your linking strategy.

If you participate in affiliate marketing programs, then the Overview displays the number of Affiliate Links on your website.

Right below this bar, you will see a graph called Internal vs External vs Affiliate Links.

This visual representation helps you maintain a healthy balance of link types on your website. Too many external links can send visitors away from your content, while a lack of internal linking can hurt navigation and SEO.

You can check out the entire report by clicking on the ‘See a Full Links Report’ button.

The Internal vs External vs Affiliate Links graph in AIOSEO

Additionally, you’ll see a chart that shows your Most Linked to Domains. This information is handy if you want to review your outbound linking strategy.

For instance, are you linking to relevant and authoritative websites? Are there any competitors you’re linking to excessively?

For a more detailed look at this, you can click the ‘See a Full Domains Report’ button.

The Most Linked To Domains graph in AIOSEO

Finally, you will find the Linking Opportunities graph. It has two tabs: Inbound Suggestions and Outbound Suggestions.

The first tab highlights pages or posts that could benefit from having more internal links pointing to them. Meanwhile, the second points out pages or posts that should include more internal links to other relevant pages.

The ‘Count’ column shows how many inbound or outbound links you can add.

To see the full list, you can click on the ‘See All Linking Opportunities’ button.

You can also read our ultimate guide on internal linking for SEO for more information.

The Linking Opportunities list in AIOSEO

Bonus Tip: Add a Google Analytics Dashboard to WordPress

AIOSEO gives you a great SEO dashboard inside WordPress, but you can take things a step further with Google Analytics and MonsterInsights.

MonsterInsights makes it super easy to connect your WordPress site to Google Analytics in just a few clicks. This unlocks a ton of info and metrics about your website, like how many people visit and which pages are the most popular.

Dashboard widget stats

Plus, you can add notes directly to these reports to remind yourself about any changes you make to your website.

For example, if you give your site a makeover, then you can jot down a note and then see if it affects the number of visitors in the following weeks.

View your site notes under the report

Ever wonder if more people find your site through social media, search engines, or maybe even ads?

The MonsterInsights Traffic reports show you exactly where your visitors come from. This helps you figure out where to put most of your effort to get even more blog traffic.

Traffic details report

MonsterInsights also has a Site Speed report. While this doesn’t directly affect the number of people who visit your site, it’s still important for optimizing Core Web Vitals and keeping your visitors happy.

Faster loading times mean people are more likely to stick around and explore what you have to offer.

Site Speed in MonsterInsights

If you want to learn more, you can read our tutorial on how to add a stats dashboard in WordPress.

We hope this article helped you learn how to add the ultimate SEO dashboard in WordPress. You may also want to check out our ultimate guide to WooCommerce SEO and our expert pick of the best SEO rank tracker tools.

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.

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 Add the Ultimate SEO Dashboard in WordPress first appeared on WPBeginner.

Automated Regression Testing Tools: A Beginner’s Guide

Any software cannot run in a completely similar way all the time. Software development activity is always a part of it, where small and substantial changes continue in different phases.

Reinventing products with new features and functions is the only way to sustain in today’s business environment and meet the emerging requirements of the market. Software change brings reinvention.

Essential Guide To Testing SaaS Products: Tools, Tips, and Techniques

Did you know that the SaaS industry market size has grown 16 times since 2015? In SaaS-powered workplaces, 96% of the apps used are SaaS-based.

SaaS is an acronym for Software as a Service. It refers to a software application that can be accessed over the Internet without downloading it on a local system. SaaS is one of the three major categories of cloud computing, which represents the way of delivering applications over the Internet. They are also sometimes referred to as web-based or on-demand software. 

What Are CSS Container Style Queries Good For?

We’ve relied on media queries for a long time in the responsive world of CSS but they have their share of limitations and have shifted focus more towards accessibility than responsiveness alone. This is where CSS Container Queries come in. They completely change how we approach responsiveness, shifting the paradigm away from a viewport-based mentality to one that is more considerate of a component’s context, such as its size or inline-size.

Querying elements by their dimensions is one of the two things that CSS Container Queries can do, and, in fact, we call these container size queries to help distinguish them from their ability to query against a component’s current styles. We call these container style queries.

Existing container query coverage has been largely focused on container size queries, which enjoy 90% global browser support at the time of this writing. Style queries, on the other hand, are only available behind a feature flag in Chrome 111+ and Safari Technology Preview.

The first question that comes to mind is What are these style query things? followed immediately by How do they work?. There are some nice primers on them that others have written, and they are worth checking out.

But the more interesting question about CSS Container Style Queries might actually be Why we should use them? The answer, as always, is nuanced and could simply be it depends. But I want to poke at style queries a little more deeply, not at the syntax level, but what exactly they are solving and what sort of use cases we would find ourselves reaching for them in our work if and when they gain browser support.

Why Container Queries

Talking purely about responsive design, media queries have simply fallen short in some aspects, but I think the main one is that they are context-agnostic in the sense that they only consider the viewport size when applying styles without involving the size or dimensions of an element’s parent or the content it contains.

This usually isn’t a problem since we only have a main element that doesn’t share space with others along the x-axis, so we can style our content depending on the viewport’s dimensions. However, if we stuff an element into a smaller parent and maintain the same viewport, the media query doesn’t kick in when the content becomes cramped. This forces us to write and manage an entire set of media queries that target super-specific content breakpoints.

Container queries break this limitation and allow us to query much more than the viewport’s dimensions.

How Container Queries Generally Work

Container size queries work similarly to media queries but allow us to apply styles depending on the container’s properties and computed values. In short, they allow us to make style changes based on an element’s computed width or height regardless of the viewport. This sort of thing was once only possible with JavaScript or the ol’ jQuery, as this example shows.

As noted earlier, though, container queries can query an element’s styles in addition to its dimensions. In other words, container style queries can look at and track an element’s properties and apply styles to other elements when those properties meet certain conditions, such as when the element’s background-color is set to hsl(0 50% 50%).

That’s what we mean when talking about CSS Container Style Queries. It’s a proposed feature defined in the same CSS Containment Module Level 3 specification as CSS Container Size Queries — and one that’s currently unsupported by any major browser — so the difference between style and size queries can get a bit confusing as we’re technically talking about two related features under the same umbrella.

We’d do ourselves a favor to backtrack and first understand what a “container” is in the first place.

Containers

An element’s container is any ancestor with a containment context; it could be the element’s direct parent or perhaps a grandparent or great-grandparent.

A containment context means that a certain element can be used as a container for querying. Unofficially, you can say there are two types of containment context: size containment and style containment.

Size containment means we can query and track an element’s dimensions (i.e., aspect-ratio, block-size, height, inline-size, orientation, and width) with container size queries as long as it’s registered as a container. Tracking an element’s dimensions requires a little processing in the client. One or two elements are a breeze, but if we had to constantly track the dimensions of all elements — including resizing, scrolling, animations, and so on — it would be a huge performance hit. That’s why no element has size containment by default, and we have to manually register a size query with the CSS container-type property when we need it.

On the other hand, style containment lets us query and track the computed values of a container’s specific properties through container style queries. As it currently stands, we can only check for custom properties, e.g. --theme: dark, but soon we could check for an element’s computed background-color and display property values. Unlike size containment, we are checking for raw style properties before they are processed by the browser, alleviating performance and allowing all elements to have style containment by default.

Did you catch that? While size containment is something we manually register on an element, style containment is the default behavior of all elements. There’s no need to register a style container because all elements are style containers by default.

And how do we register a containment context? The easiest way is to use the container-type property. The container-type property will give an element a containment context and its three accepted values — normal, size, and inline-size — define which properties we can query from the container.

/* Size containment in the inline direction */
.parent {
  container-type: inline-size;
}

This example formally establishes a size containment. If we had done nothing at all, the .parent element is already a container with a style containment.

Size Containment

That last example illustrates size containment based on the element’s inline-size, which is a fancy way of saying its width. When we talk about normal document flow on the web, we’re talking about elements that flow in an inline direction and a block direction that corresponds to width and height, respectively, in a horizontal writing mode. If we were to rotate the writing mode so that it is vertical, then “inline” would refer to the height instead and “block” to the width.

Consider the following HTML:

<div class="cards-container">
  <ul class="cards">
    <li class="card"></li>
  </ul>
</div>

We could give the .cards-container element a containment context in the inline direction, allowing us to make changes to its descendants when its width becomes too small to properly display everything in the current layout. We keep the same syntax as in a normal media query but swap @media for @container

.cards-container {
  container-type: inline-size;
  }

  @container (width < 700px) {
  .cards {
    background-color: red;
  }
}

Container syntax works almost the same as media queries, so we can use the and, or, and not operators to chain different queries together to match multiple conditions.

@container (width < 700px) or (width > 1200px) {
  .cards {
    background-color: red;
  }
}

Elements in a size query look for the closest ancestor with size containment so we can apply changes to elements deeper in the DOM, like the .card element in our earlier example. If there is no size containment context, then the @container at-rule won’t have any effect.

/* 👎 
 * Apply styles based on the closest container, .cards-container
 */
@container (width < 700px) {
  .card {
    background-color: black;
  }
}

Just looking for the closest container is messy, so it’s good practice to name containers using the container-name property and then specifying which container we’re tracking in the container query just after the @container at-rule.

.cards-container {
  container-name: cardsContainer;
  container-type: inline-size;
}

@container cardsContainer (width < 700px) {
  .card {
    background-color: #000;
  }
}

We can use the shorthand container property to set the container name and type in a single declaration:

.cards-container {
  container: cardsContainer / inline-size;

  /* Equivalent to: */
  container-name: cardsContainer;
  container-type: inline-size;
}

The other container-type we can set is size, which works exactly like inline-size — only the containment context is both the inline and block directions. That means we can also query the container’s height sizing in addition to its width sizing.

/* When container is less than 700px wide */
@container (width < 700px) {
  .card {
    background-color: black;
  }
}

/* When container is less than 900px tall */
@container (height < 900px) {
  .card {
    background-color: white;
  }
}

And it’s worth noting here that if two separate (not chained) container rules match, the most specific selector wins, true to how the CSS Cascade works.

So far, we’ve touched on the concept of CSS Container Queries at its most basic. We define the type of containment we want on an element (we looked specifically at size containment) and then query that container accordingly.

Container Style Queries

The third value that is accepted by the container-type property is normal, and it sets style containment on an element. Both inline-size and size are stable across all major browsers, but normal is newer and only has modest support at the moment.

I consider normal a bit of an oddball because we don’t have to explicitly declare it on an element since all elements are style containers with style containment right out of the box. It’s possible you’ll never write it out yourself or see it in the wild.

.parent {
  /* Unnecessary */
  container-type: normal;
}

If you do write it or see it, it’s likely to undo size containment declared somewhere else. But even then, it’s possible to reset containment with the global initial or revert keywords.

.parent {
  /* All of these (re)set style containment */
  container-type: normal;
  container-type: initial;
  container-type: revert;
}

Let’s look at a simple and somewhat contrived example to get the point across. We can define a custom property in a container, say a --theme.

.cards-container {
  --theme: dark;
}

From here, we can check if the container has that desired property and, if it does, apply styles to its descendant elements. We can’t directly style the container since it could unleash an infinite loop of changing the styles and querying the styles.

.cards-container {
  --theme: dark;
}

@container style(--theme: dark) {
  .cards {
    background-color: black;
  }
}

See that style() function? In the future, we may want to check if an element has a max-width: 400px through a style query instead of checking if the element’s computed value is bigger than 400px in a size query. That’s why we use the style() wrapper to differentiate style queries from size queries.

/* Size query */
@container (width > 60ch) {
  .cards {
    flex-direction: column;
  }
}

/* Style query */
@container style(--theme: dark) {
  .cards {
    background-color: black;
  }
}

Both types of container queries look for the closest ancestor with a corresponding containment-type. In a style() query, it will always be the parent since all elements have style containment by default. In this case, the direct parent of the .cards element in our ongoing example is the .cards-container element. If we want to query non-direct parents, we will need the container-name property to differentiate between containers when making a query.

.cards-container {
  container-name: cardsContainer;
  --theme: dark;
}

@container cardsContainer style(--theme: dark) {
  .card {
    color: white;
  }
}
Weird and Confusing Things About Container Style Queries

Style queries are completely new and bring something never seen in CSS, so they are bound to have some confusing qualities as we wrap our heads around them — some that are completely intentional and well thought-out and some that are perhaps unintentional and may be updated in future versions of the specification.

Style and Size Containment Aren’t Mutually Exclusive

One intentional perk, for example, is that a container can have both size and style containment. No one would fault you for expecting that size and style containment are mutually exclusive concerns, so setting an element to something like container-type: inline-size would make all style queries useless.

However, another funny thing about container queries is that elements have style containment by default, and there isn’t really a way to remove it. Check out this next example:

.cards-container {
  container-type: inline-size;
  --theme: dark;
}

@container style(--theme: dark) {
  .card {
    background-color: black;
  }
}

@container (width < 700px) {
  .card {
    background-color: red;
  }
}

See that? We can still query the elements by style even when we explicitly set the container-type to inline-size. This seems contradictory at first, but it does make sense, considering that style and size queries are computed independently. It’s better this way since both queries don’t necessarily conflict with each other; a style query could change the colors in an element depending on a custom property, while a container query changes an element’s flex-direction when it gets too small for its contents.

But We Can Achieve the Same Thing With CSS Classes and IDs

Most container query guides and tutorials I’ve seen use similar examples to demonstrate the general concept, but I can’t stop thinking no matter how cool style queries are, we can achieve the same result using classes or IDs and with less boilerplate. Instead of passing the state as an inline style, we could simply add it as a class.

<ol>
  <li class="item first">
    <img src="..." alt="Roi's avatar" />
    <h2>Roi</h2>
  </li>
  <li class="item second"><!-- etc. --></li>
  <li class="item third"><!-- etc. --></li>
  <li class="item"><!-- etc. --></li>
  <li class="item"><!-- etc. --></li>
</ol>

Alternatively, we could add the position number directly inside an id so we don’t have to convert the number into a string:

<ol>
  <li class="item" id="item-1">
    <img src="..." alt="Roi's avatar" />
    <h2>Roi</h2>
  </li>
  <li class="item" id="item-2"><!-- etc. --></li>
  <li class="item" id="item-3"><!-- etc. --></li>
  <li class="item" id="item-4"><!-- etc. --></li>
  <li class="item" id="item-5"><!-- etc. --></li>
</ol>

Both of these approaches leave us with cleaner HTML than the container queries approach. With style queries, we have to wrap our elements inside a container — even if we don’t semantically need it — because of the fact that containers (rightly) are unable to style themselves.

We also have less boilerplate-y code on the CSS side:

#item-1 {
  background: linear-gradient(45deg, yellow, orange); 
}

#item-2 {
  background: linear-gradient(45deg, grey, white);
}

#item-3 {
  background: linear-gradient(45deg, brown, peru);
}

See the Pen Style Queries Use Case Replaced with Classes [forked] by Monknow.

As an aside, I know that using IDs as styling hooks is often viewed as a no-no, but that’s only because IDs must be unique in the sense that no two instances of the same ID are on the page at the same time. In this instance, there will never be more than one first-place, second-place, or third-place player on the page, making IDs a safe and appropriate choice in this situation. But, yes, we could also use some other type of selector, say a data-* attribute.

There is something that could add a lot of value to style queries: a range syntax for querying styles. This is an open feature that Miriam Suzanne proposed in 2023, the idea being that it queries numerical values using range comparisons just like size queries.

Imagine if we wanted to apply a light purple background color to the rest of the top ten players in the leaderboard example. Instead of adding a query for each position from four to ten, we could add a query that checks a range of values. The syntax is obviously not in the spec at this time, but let’s say it looks something like this just to push the point across:

/* Do not try this at home! */
@container leaderboard style(4 >= --position <= 10) {
  .item {
    background: linear-gradient(45deg, purple, fuchsia);
  }
}

In this fictional and hypothetical example, we’re:

  • Tracking a container called leaderboard,
  • Making a style() query against the container,
  • Evaluating the --position custom property,
  • Looking for a condition where the custom property is set to a value equal to a number that is greater than or equal to 4 and less than or equal to 10.
  • If the custom property is a value within that range, we set a player’s background color to a linear-gradient() that goes from purple to fuschia.

This is very cool, but if this kind of behavior is likely to be done using components in modern frameworks, like React or Vue, we could also set up a range in JavaScript and toggle on a .top-ten class when the condition is met.

See the Pen Style Ranged Queries Use Case Replaced with Classes [forked] by Monknow.

Sure, it’s great to see that we can do this sort of thing directly in CSS, but it’s also something with an existing well-established solution.

Separating Style Logic From Logic Logic

So far, style queries don’t seem to be the most convenient solution for the leaderboard use case we looked at, but I wouldn’t deem them useless solely because we can achieve the same thing with JavaScript. I am a big advocate of reaching for JavaScript only when necessary and only in sprinkles, but style queries, the ones where we can only check for custom properties, are most likely to be useful when paired with a UI framework where we can easily reach for JavaScript within a component. I have been using Astro an awful lot lately, and in that context, I don’t see why I would choose a style query over programmatically changing a class or ID.

However, a case can be made that implementing style logic inside a component is messy. Maybe we should keep the logic regarding styles in the CSS away from the rest of the logic logic, i.e., the stateful changes inside a component like conditional rendering or functions like useState and useEffect in React. The style logic would be the conditional checks we do to add or remove class names or IDs in order to change styles.

If we backtrack to our leaderboard example, checking a player’s position to apply different styles would be style logic. We could indeed check that a player’s leaderboard position is between four and ten using JavaScript to programmatically add a .top-ten class, but it would mean leaking our style logic into our component. In React (for familiarity, but it would be similar to other frameworks), the component may look like this:

const LeaderboardItem = ({position}) => {
  <li className={item ${position &gt;= 4 && position &lt;= 10 ? "top-ten" : ""}} id={item-${position}}>
    <img src="..." alt="Roi's avatar" />
    <h2>Roi</h2>
  </li>;
};

Besides this being ugly-looking code, adding the style logic in JSX can get messy. Meanwhile, style queries can pass the --position value to the styles and handle the logic directly in the CSS where it is being used.

const LeaderboardItem = ({position}) => {
  <li className="item" style={{"--position": position}}>
    <img src="..." alt="Roi's avatar" />
    <h2>Roi</h2>
  </li>;
};

Much cleaner, and I think this is closer to the value proposition of style queries. But at the same time, this example makes a large leap of assumption that we will get a range syntax for style queries at some point, which is not a done deal.

Conclusion

There are lots of teams working on making modern CSS better, and not all features have to be groundbreaking miraculous additions.

Size queries are definitely an upgrade from media queries for responsive design, but style queries appear to be more of a solution looking for a problem.

It simply doesn’t solve any specific issue or is better enough to replace other approaches, at least as far as I am aware.

Even if, in the future, style queries will be able to check for any property, that introduces a whole new can of worms where styles are capable of reacting to other styles. This seems exciting at first, but I can’t shake the feeling it would be unnecessary and even chaotic: styles reacting to styles, reacting to styles, and so on with an unnecessary side of boilerplate. I’d argue that a more prudent approach is to write all your styles declaratively together in one place.

Maybe it would be useful for web extensions (like Dark Reader) so they can better check styles in third-party websites? I can’t clearly see it. If you have any suggestions on how CSS Container Style Queries can be used to write better CSS that I may have overlooked, please let me know in the comments! I’d love to know how you’re thinking about them and the sorts of ways you imagine yourself using them in your work.