Coder Social home page Coder Social logo

yoast / wordpress-seo Goto Github PK

View Code? Open in Web Editor NEW
1.7K 148.0 872.0 912.35 MB

Yoast SEO for WordPress

Home Page: https://yoast.com/wordpress/plugins/seo/

License: Other

JavaScript 53.82% PHP 33.33% CSS 0.55% XSLT 0.02% Shell 0.04% HTML 12.21% TypeScript 0.01% MDX 0.03%
wordpress php seo yoast plugin metadata opengraph xml-sitemap yoast-seo breadcrumbs

wordpress-seo's Introduction

Yoast SEO

CS Lint LintJS TestJS Test Deployment Coverage Status

Stable Version License

Welcome to the Yoast SEO GitHub repository

While the documentation for the Yoast SEO plugin can be found on Yoast.com, here you can browse the source of the project, find and discuss open issues and even contribute yourself.

Installation

Here's a guide on how to install Yoast SEO in your WordPress site.

Want to contribute to Yoast SEO?

Prerequisites

At Yoast, we make use a specific toolset to develop our code. Please ensure you have the following tools installed before contributing.

Getting started

After installing the aforementioned tools, you can use the steps below to acquire a development version of Yoast SEO. Please note that this will download the latest development version of Yoast SEO. While this version is usually stable, it is not recommended for use in a production environment.

Within your WordPress installation, navigate to wp-content/plugins and run the following commands:

git clone https://github.com/Yoast/wordpress-seo.git
cd wordpress-seo

To install all the necessary dependencies, run the following commands:

composer install
yarn
grunt build

During development, you could run grunt build:dev instead of grunt build, to save yourself downloading some dependencies that are only needed for a production environment.

Please note that if you change anything in the JavaScript or CSS, you'll have to run grunt build:js or grunt build:css, respectively.

For active development, you could run grunt watch to keep the build up-to-date and run checks right away.

For JavaScript only, a webpack development server is available. To enable the dev-server, you'll have to add this to your WordPress install's config.php:

define( 'YOAST_SEO_DEV_SERVER', true );

and you can start it by running yarn start in the wordpress-seo folder.

Another JavaScript alternative is grunt webpack:watch, this command will keep the JS files up-to-date. You'll have to refresh the page yourself since this does not run a development server.

This repository uses the Yoast grunt tasks plugin.

Testing packages

To run tests for js packages, run the following command from packages/js folder:

yarn test

Support

This is a developer's portal for Yoast SEO and should not be used for support. Please visit the support forums.

Reporting bugs

If you find an issue, let us know here! Please follow these guidelines on how to write a good bug report.

It may help us a lot if you can provide a backtrace of the error encountered. You can use code in this gist to enable the backtrace in your website's configuration.

Contributions

Anyone is welcome to contribute to Yoast SEO. Please read the guidelines for contributing to this repository.

There are various ways you can contribute:

wordpress-seo's People

Contributors

abotteram avatar afercia avatar agnieszkaszuba avatar atimmer avatar bintzandt avatar boblinthorst avatar enricobattocchi avatar famarfuaty avatar hansjovis avatar hdvos avatar igorschoester avatar iolandasequino avatar irenestr avatar jcomack avatar johannadevos avatar jrfnl avatar karlijnbok avatar leonidasmi avatar maartenleenders avatar manuelaugustin avatar mhkuu avatar moorscode avatar nataliashitova avatar nolledgeable avatar omarreiss avatar pls78 avatar rarst avatar terw-dan avatar thijsoo avatar vraja-pro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-seo's Issues

Page analysis keyword check

Page analysis first paragraph keyword check does a naive search based on substring

// First Paragraph Test
if ( stripos( $firstp, $job["keyword"] ) === false && stripos( $firstp, $job["keyword_folded"] ) === false ) {
    $this->save_score_result( $results, 3, $scoreFirstParagraphLow, 'keyword_first_paragraph' );
} else {
    $this->save_score_result( $results, 9, $scoreFirstParagraphHigh, 'keyword_first_paragraph' );
}

This means a keyword check for 'mass' and 'sign' will pass as well as nonword substrings like 'lish' in the paragraph below.

Final Fantasy XI is a massively multiplayer online role-playing game (MMORPG), developed and published by Square as part of the Final Fantasy. Designed and produced by Hiromichi Tanaka, it was released in Japan on May 16, 2002 for Sony's PlayStation 2, and for Microsoft Windows-based personal computers in November of that year.

Google reporting error in sitemap lastmod date

Google Webmaster Tools reporting an error in author-sitemap.xml lastmod date (line 5 in xml):

An invalid date was found. Please fix the date or formatting before resubmitting.

The data

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.socazpainting.com/wp-content/plugins/wordpress-seo/css/xml-sitemap-xsl.php"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.socazpainting.com/author/wpadmin/</loc>
<lastmod>2013-06-27T03:07:55+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
<!-- XML Sitemap generated by Yoast WordPress SEO -->

bgdcbfba

Duplicate og:image meta tag on home page

There are two og:image meta ttag on my home page. One is from the Social -> Facebbok settings and one is from the actual page. If I set a featured image for my home page, the duplicate still will be there.

Here is the site's facebook debug:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fpremiumwp.hu%2F

I don't want to use the second (http://premiumwp.hu/wp-content/uploads/2012/03/premium-sablonok.png) image as og:image. How can I remove it? How can I set it properly?

User profile URL's should have their own sub sitemap

In preparation for BuddyPress and BBPress support, one thing is glaringly obvious: user profile URLs, in normal WP /author/admin etc. are currently not in any XML sitemap.

They should be. Two things need doing for that:

  • building some way of keeping a last updated timestamp for the profile page, which should "flip" when theme changes or the user profile is updated.
  • the addition of the URLs and that date to the XML sitemap (simple).

RTL CSS

From Hassan as well:

Because I was testing this on an Arabic installation of WordPress, I noticed something... the layout of the plugin pages is a mess! There was no RTL support and the settings pages were just unusable, so I took a stab at that. Mainly, most of the CSS issues where coming from the file /css/yst_plugin_tools.css, fixing those was easy; here are the RTL-specific styles you need. You can put them in a separate CSS file and load it conditionally with the WP function is_rtl() -- just like how core is doing it. I have tested it and can confirm it's working great. Comparison screenshot

WP 3.6 Strict Standards bug

WordPress 3.6 beta enforces strict standards, and thus throws this warning:

Strict Standards: Declaration of Sitemap_Walker::end_el() should be compatible with Walker::end_el(&$output, $object, $depth = 0, $args = Array) in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/wordpress-seo/inc/class-sitemap-walker.php on line 81

CSS is defined incorrectly

If the columns Focus KW and Meta Desc. are activated (in screen options) and you filter custom post types on drafts or pending posts, and you hover over Focus KW or Meta Desc., the column gets widened (top and bottom).

This is not the case with SEO.

This happens with post statusses pending and draft and on page 3 (and higher) on all/published.

I tested the same on another site which uses the same plugin. It also occurs there, with all post statusses, not just pending/draft.

It seems to be caused by the arrow which appears next to it when hovering...
130523-focus1
130523-focus2

Custom post types and taxonomies aren't recognized by breadcrumb feature

This was proposed by a customer:

yoastbreadcrumbs.php line 228
if (is_single() && $opt['singlecatprefix']) {
$tax = get_object_taxonomies(get_post(), 'objects');
$cats = get_the_category();
$cat = $cats[0];
if ( is_object($cat) ) {
if ($cat->parent != 0) {
$output .= get_category_parents($cat->term_id, true, " ".$opt['sep']." ");
} else {
$output .= ''.$cat->name.' '.$opt['sep'].' ';
}
}
elseif (is_array($tax))
{
reset($tax);
$first_key = key($tax);
$terms = wp_get_post_terms(get_the_ID(),$tax[$first_key]->slug);
$terms = array_reverse($terms);
foreach($terms as $term){
$output .= ''.$term->name.' '.$opt['sep'].' ';
}
}

They say it should work like this ;)

Ampersand in sitetitle in Title Templates loading as &amp;

It appears that if a blog has an ampersand (&) in their site title, (ie Dogs & Cats), and the sitetitle is called or if it's manually entered as "Dogs & Cats" in the SEO -> Titles & Meta -> Posts -> Title Templates text field, during a New Post action the default SEO title field will say Dogs & amp ; Cats. (without spaces, basically the entity name of the &)

i18n issues

Got an email from one of our translators (Hassan) who'd gone through the core rather meticulously, please address all these small issues:

  • class-metabox.php
    • The string "Pick the main keyword or keyphrase that this post/page is about.

      Read %sthis post%s for more info." inside the file /admin/class-metabox.php at line 265
    • The three strings for keyword usage check introduced in v1.4.5 in file /admin/class-metabox.php at lines 1232, 1234, and 1236
    • The string "SEO" and the "Check" link text in the Publish metabox both in file /admin/class-metabox.php at line 137
    • The "index" and "noindex" strings in file /admin/class-metabox.php at lines 329 and 330
    • The string "All SEO Scores" of the filter dropdown in file /admin/class-metabox.php at line 775
    • The word "Google+" in the file /admin/class-admin.php at line 307 (Yes, some brand names need to be translated for specific languages, e.g. Arabic)
    • The SEO score strings (i.e. bad, poor, etc.) which appear when hovering over the colored circle image in various areas (in Publish metabox, table listings, admin bar). I think the code for those is scattered across a coupe of files? Not sure though, because sometimes they are capitalized (e.g. "Poor") and other times they are just small caps (e.g. "poor")
    • I'm not sure where do these come from, but all the strings in the post edit metabox under the Focus Keyword field where it says "You focus keyword was found in: Article Heading: Yes (1), Page Title: No, etc." <-- all of these are not translatable. Can't find them in the source code.
  • /admin/pages/metas.php
    • The string "Don't show" in the author dropdown in file /admin/pages/metas.php at line 93
  • /admin/pages/xml-sitemaps.php
    • The string "XML Sitemaps" which is the page header in file /admin/pages/xml-sitemaps.php at line 13
  • /admin/pages/rss.php
    • The string "RSS" which is the page header in file /admin/pages/rss.php at line 14
  • /admin/pages/files.php
    • The string "Files" which is the page header in file /admin/pages/files.php at line 46 (btw, I think you should rename that header to "Edit Files" instead , not just "Files"-- so as to match the naming of the page in the admin menu)
  • /admin/pages/import.php
    • The string "Import" which is the page header in file /admin/pages/import.php at line 256 (btw, I think you should rename that header to "Import & Export" instead, not just "Import"-- so as to match the naming of the page in the admin menu)
  • General
    • Not directly related to i18n, but I think you should fix all instances of the string "OpenGraph". I believe the correct name is "Open Graph" <-- without a space. References here and here.

Meta boxes is not saved on "media post"

I dont know when it changed of if it have ever been like that, but when you edit a media file, then the meta boxes are there from the plugin, but it is not saved because you are using

add_action( 'wp_insert_post', array( $this, 'save_postdata' ) );
in file class-metabox.php

So if you just add this below
add_action( 'edit_attachment', array( $this, 'save_postdata' ) );

It all works again.

Fatal in sitemap walker

On my localhost:

Fatal error: Call-time pass-by-reference has been removed in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/wordpress-seo/inc/class-sitemap-walker.php on line 78

Add apply_filters to all frontend output

apply_filters should be used whenever things are output on the frontend. It's used in some areas and not in others, ie:

echo '<meta name="twitter:card" content="' . apply_filters( 'wpseo_twitter_card_type', 'summary' ) . '"/>' . "\n";

That's great! This is not:

echo '<meta name="twitter:site" content="@' . trim( $this->options['twitter_site'] ) . '"/>' . "\n";

echo '<meta name="twitter:creator" content="@' . $twitter . '"/>' . "\n";

I'm running into this issue specifically with Twitter card markup but it exists in other areas as well.

Focus Keyword doesn't get 'counted' if defined by template

On my site I use custom post types and for these posts I use a standard template description, so if I don't define one, something is still used as description

I use this format: All available info about %%title%%
Often I use a keyword from the title.
If I don't define a title, the displayed title is the one which is defined in the settings, but this doesn't happen for meta description.

Now the keyword is counted in the title part but not in the description part.
If the defined description from the settings would also be displayed, like with title, it would also get a YES on meta description when searching for the keyword.

130523-meta-desc-yoast

As you can see I defined freeride as focus keyword.
The title displays the title according to settings, and gets counted twice.

The description I defined for meta in the settings includes the title of the post (the name of the event) and thus the word freeride, but it doesn't get counted.

Prevent output before XML Sitemap output

Every other week we'll get emails from people who have an issue because the XML sitemap throws an error. When you look at their XML sitemap, the issue is some other plugin or their theme outputs a line of whitespace and that means the XML opening tag isn't on the first line, causing issues.

I was wondering whether it'd be possible to do an output buffer from a very early stage, as early as we can detect we're going to output an XML sitemap, and then flush that buffer empty before we start outputting the XML sitemap, so this can't happen. Could you research?

Option to disable only the comments feed

Hi, on the Titles & Metas > General page, there's an option to "Hide RSS Links".

Could you kindly expand this setting to allow us to chose which RSS link specifically to hide?

I mean this: WordPress includes two RSS feeds - the main feed and the comments feed. I would like to be able to hide only the comments feed, but not the main feed. This is because I have disabled comments completely on my website - I don't need or want comments - but the (empty) comments feed link still exists in the 'head' section anyway, and therefore appears in the address bar of some browsers like Firefox etc.

So it would be great if this plugin would allow me to only disable that one feed but not the main feed. :)

Thanks!

Metabox html code

From Hassan:

Consider removing line 104 in file /admin/class-metabox.php which starts with

echo '<div class="misc-pub-section

because it is outputting a redundant/duplicate top-border in the Publish metabox. I don't believe there is any use for it anyway, correct? Also consider adding the CSS rule

vertical-align: bottom;

for the div with class wpseo_score_img in file /css/metabox-tabs.css which starts at line 278 to fix the alignment of the colored score image. Comparison screenshot

SEO Title length calculated wrong

if you put in

Gas Turbines Service: Alba Power, Olympus and Avon Turbine Specialists

says 0 chars left

Add 1 more char it jumps to -10

Author sitemap uses too much memory

Generating the author sitemap on a site with a lot of users creates an enormous memory leak, this came in from a user (removed user specific stuff):

Today we have more than 30.000 posts and more than 50.000 users.

I had to increase the PHP memory from 256M to 1024M to create the sitemap, with only posts and users/authors checked (about 80.000 lines as total) to make it work.

Otherwise was giving me 500 error ([Mon Jun 24 14:18:16 2013] [error] [client 24.233.162.52] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /redacted/wp-includes/meta.php on line 574, referer: http://example.com/wp-admin/admin.php?page=wpseo_xml)

As we cannot set the PHP to 1024M, I decided to uncheck the users/authors and set the PHP with 256M and sitemapping only the posts. That way, everything worked fine.

About the home page title and description

i just want to know the where i can change the title , Meta description , Meta keywords for the home page. if i have selected the any costume page for the home page then i have the option for updating those setting but in case if all the post is showing on the home page and no home page is selected in the setting --> reading setting in word-press admin. then i am not able to find that option.

Add welcome screen

I want to add a welcome screen for when people update and install the plugin, like the WordPress one:

/wp-admin/about.php?updated

I'd want a specific one for updates and for installs. If you add the basic functionality I'll add the content :)

This would replace the introduction tour we currently have that's bothering quite a few people and include the tracking request we currently do, so basically we'd deprecate class-pointer.php with this...

Small style changes

Both from Hassan too:

  • Consider adding two
    tags in file /admin/pages/import.php after lines 269 and 275 for better aesthetics (spacing) around the Import buttons. Comparison screenshot
  • You have this CSS declaration:
#pointer-primary { margin: 0 5px 0 0; } 

in file /admin/class-pointers.php starting at line 193, you need to keep it as it is plus duplicate a "flipped" version below it, that is

#pointer-primary { margin: 0 0 0 5px; } 

for better spacing when in RTL mode. You need to just write it in the same file after performing a is_rtl() check. Comparison screenshot

Bug on Permalink Settings stripped the Category Base from Category URLs.

Problem:
Within the Permalink Settings I have stripped the Category Base from Category URLs.
Now within a category the first page is working fine without the category base. When I want to view the second page I get an 404 error. When I add the category base to the url, I can view the second page
More detail I find here:
http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-permalinks-category-base-problem
Solution for now:
Uncheck the 'category base checkbox', save, check the 'category base checkbox' again, save. Now it should work again.

Just found this bug today after adding a category template for my theme, hope it's usefull :)
Wp version 3.5.1
plugin version 1.4.7

Enable advanced tab on edit post for admins on Multisite

On Multisite, Admins have no edit_users capability, so it should be changed to a capability, that admins have. The manage_options capability is good for this job.

I have made the change in the class-metabox.php and sending the pull request.

Disabling SEO Page Analysis can break post edit save

Hi,

If you disable Page Analysis with help of the filter

add_filter( 'wpseo_use_page_analysis', '__return_false' ); 

Saving of custom post types do fail.

Error log:

/// PHP Fatal error:  Class 'Yoast_TextStatistics' not found in ... /wp-content/plugins/wordpress-seo/admin/class-metabox.php

The last fix suggested here: http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-php-fatal-error-with-wpseo_use_page_analysis-set-to-false-for-posts-with-focuskw
works very well.

Would be good to include this to your code base.

Many thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.