npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@elderjs/plugin-seo-check

v1.3.10

Published

Easily check your Elder.js site for common SEO issues.

Downloads

304

Readme

Elder.js Plugin: SEO Check

Checks the generated HTML for more than 50 common SEO issues along with tips on fixing them.

Works in single page mode and site wide mode.

Pro users can easily use this plugin to fire off an email to the marketing/content team any time an SEO issue is encountered.

SEO Checks

This plugin is very opinionated based on years of Nick Reese's experience running major SEO assets.

If you think the rules are too strict or opinionated this plugin supports adding your own rules.

Sitewide

These are only checked when Elder.js runs in build mode.

  • [x] check for orphaned pages (no incoming internal links)
  • [x] check for broken internal links.
  • [x] check for duplicate title tags
  • [x] check for duplicate meta descriptions

Canonical

  • [x] canonical tag exists
  • [x] canonical tag matches request.permalink
  • [x] there is only one canonical tag

Title Tag

  • [x] Title tag exists
  • [x] Title tag innerText and innerHTML are the same. (no html tags in your title tag)
  • [x] Only one title tag per page
  • [x] Title tag is less than 70 chars
  • [x] Title tag is more than 10 chars
  • [x] Title doesn't include common stopwords.
  • [x] Title tag doesn't have null
  • [x] Title tag doesn't have undefined
  • [x] checks for stop words.

Meta Description

  • [x] meta description exists
  • [x] only one meta description tag per page
  • [x] Meta description doesn't have null
  • [x] Meta description doesn't have undefined
  • [x] Meta description is longer than 10 chars
  • [x] Meta description is less than than 120 chars
  • [x] Meta description is longer than 300 chars (sometimes things go REALLY wrong and this helps catch it.)
  • [x] Meta description includes at least one the keywords of the title tag.

HTags

  • [x] h1 Exists on page
  • [x] only a single h1 per page.
  • [x] h1 has at least one word from your title tag
  • [x] h1 is less than 70 chars
  • [x] h1 is more than than 10 chars
  • [x] H2 or H3 don't exist if an H1 is missing.
  • [x] H2 exists on the page
  • [x] h2 is less than 100 chars
  • [x] h2 is more than than 7 chars
  • [x] At least one of your h2s contains a single word from your title tag.
  • [x] h3 is less than 100 chars
  • [x] h3 is more than than 7 chars
  • [x] h4 is less than 100 chars
  • [x] h4 is more than than 7 chars
  • [x] If no h2s checks for h3s.
  • [x] If no h3s checks for h4s.
  • [x] If no h4s checks for h5s.
  • [x] If no h5s checks for h6s.

Images

  • [x] Checks images for alt tags.

Links

  • [x] Internal links are lowercase
  • [x] Internal links have trailing slash
  • [x] Internal links are not nofollow
  • [x] Notifies if there are more than 50 outbound links on the page.
  • [x] check for trailing index.html
  • [x] internal fully formed links include 'https'

Misc

  • [x] Checks for width=device-width, initial-scale=1.0 meta viewport.

Install

npm install --save @elderjs/plugin-seo-check

Config

Once installed, open your elder.config.js and configure the plugin by adding @elderjs/seo-check to your plugin object.

plugins: {
  '@elderjs/plugin-seo-check': {
    display: ['errors', 'warnings'], // what level of reporting would you like.
    handleSiteResults: async ({ meta, ...results }) => {
      // 'results' represents all of the issues found for the site wide build.
      // power users can use this async function to post the issues to an endpoint or send an email
      // so that the content or marketing team can address the issues.
      if (Object.keys(results).length > 0) {
        console.log(results);
      } else {
        console.log(`No SEO issues detected.`);
      }
    },
    preferences: [], // define your own preferences. See below.
    rules: [], // define your own rules. This overwrites existing rules. See below.
    // writeLocation: './report.json' // used to write a JSON report. Relative to the root.
  },
}

If things are too verbose for dev, try this:

plugins: {
  '@elderjs/plugin-seo-check': {
    display: process.NODE_ENV === 'production' ? ['errors', 'warnings']: [], // disables reporting unless you in production building.
    },
  },

}

For access to the default rules and preferences:

const { defaultPreferences, rules } = require('@elderjs/plugin-seo-check');

Contributing:

  • If you end up writing your own rules, if you want to write a how-to that would be great.