Skip to content

Instantly share code, notes, and snippets.

@sutlxwhx
sutlxwhx / schema.md
Last active August 21, 2018 17:32
Rich snippet with star rating in SERP for your website / article

Introduction

According to Google Introduction to Structured Data either schema.org or JSON-LD markup should be enough for Google to pickup structuted data on your website / article. I used them both. In my experince Google was able to pickup breadcrubs within JSON-LD faster while star rating with schema.org was easily to implement.

Installation

Because most of the code is not visible to visitors and it's ok you you split your breadcrumbs and star rating into different instances on the page I encourage you to set the rating data over the h1 tag. It's better if you use div itemprop="name" and it's bad if you will create 2 isntances of h1 tag just to fit my example.

  • h1 stands for your h1 tag
  • "ratingValue" determines the final rating of your article
@sutlxwhx
sutlxwhx / Checker.php
Last active August 24, 2018 23:14
Check if mysql database exists
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/
@sutlxwhx
sutlxwhx / Sizer.php
Last active August 24, 2018 23:15
Sort files in the folder by their file size and retrieve it as an array
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/
@sutlxwhx
sutlxwhx / Copier.php
Last active August 24, 2018 23:13
Copy specified files to the new directory
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/
@sutlxwhx
sutlxwhx / Renamer.php
Last active August 24, 2018 23:13
Rename all files in the current folder according to your list of file names
<?php
/**
* @author https://gist.github.com/sutlxwhx
*
* @version 0.2
*
* @license Apache License 2.0
*
*/