/** * Class containing utility static methods that other SEO tools are relying on. */ class Jetpack_SEO_Utils { /** * Site option name used to store front page meta description. */ const FRONT_PAGE_META_OPTION = 'advanced_seo_front_page_description'; /** * Old version of option name that was previously used under Free plan. */ const GRANDFATHERED_META_OPTION = 'seo_meta_description'; /** * Used to check whether SEO tools are enabled for given site. * * @param int $site_id Optional. Defaults to current blog id if not given. * * @return bool True if SEO tools are enabled, false otherwise. */ public static function is_enabled_jetpack_seo( $site_id = 0 ) { /** * Can be used by SEO plugin authors to disable the conflicting output of SEO Tools. * * @module seo-tools * * @since 5.0.0 * * @param bool True if SEO Tools should be disabled, false otherwise. */ if ( apply_filters( 'jetpack_disable_seo_tools', false ) ) { return false; } if ( function_exists( 'has_blog_sticker' ) ) { // For WPCOM sites if ( empty( $site_id ) ) { $site_id = get_current_blog_id(); } return has_blog_sticker( 'business-plan', $site_id ); } // For all Jetpack sites return true; } /** * Checks if this option was set while it was still available under free plan. * * @return bool True if we should enable grandfathering, false otherwise. */ public static function has_grandfathered_front_page_meta() { return ! self::is_enabled_jetpack_seo() && get_option( self::GRANDFATHERED_META_OPTION ); } /** * Returns front page meta description for current site. * * Since we allowed non-business users to set Front page meta description for some time, * before bundling it with other SEO tools features that require a business plan, * we are supporting grandfathering here. * * @return string Front page meta description string or empty string. */ public static function get_front_page_meta_description() { if ( self::is_enabled_jetpack_seo() ) { $front_page_meta = get_option( self::FRONT_PAGE_META_OPTION ); return $front_page_meta ? $front_page_meta : get_option( self::GRANDFATHERED_META_OPTION, '' ); } // Support grandfathering for non-business users. return get_option( self::GRANDFATHERED_META_OPTION, '' ); } /** * Updates the site option value for front page meta description. * * We are taking care to update the correct option, in case the value is grandfathered for current site. * * @param $value string New value for front page meta description. * * @return string Saved value, or empty string if no update was performed. */ public static function update_front_page_meta_description( $value ) { $front_page_description = sanitize_text_field( $value ); /** * Can be used to limit the lenght of front page meta description. * * @module seo-tools * * @since 4.4.0 * * @param int Maximum length of front page meta description. Defaults to 300. */ $description_max_length = apply_filters( 'jetpack_seo_front_page_description_max_length', 300 ); if ( function_exists( 'mb_substr' ) ) { $front_page_description = mb_substr( $front_page_description, 0, $description_max_length ); } else { $front_page_description = substr( $front_page_description, 0, $description_max_length ); } $can_set_meta = self::is_enabled_jetpack_seo(); $grandfathered_meta_option = get_option( self::GRANDFATHERED_META_OPTION ); $has_old_meta = ! empty( $grandfathered_meta_option ); $option_name = self::has_grandfathered_front_page_meta() ? self::GRANDFATHERED_META_OPTION : self::FRONT_PAGE_META_OPTION; $did_update = update_option( $option_name, $front_page_description ); if ( $did_update && $has_old_meta && $can_set_meta ) { // Delete grandfathered option if user has switched to Business plan and updated meta description. delete_option( 'seo_meta_description' ); } if ( $did_update ) { return $front_page_description; } return ''; } } /* * Each title format is an array of arrays containing two values: * - type * - value * * Possible values for type are: 'token' and 'string'. * Possible values for 'value' are: any string in case that 'type' is set * to 'string', or allowed token values for page type in case that 'type' * is set to 'token'. * * Examples of valid formats: * * [ * 'front_page' => [ * [ 'type' => 'string', 'value' => 'Front page title and site name:'], * [ 'type' => 'token', 'value' => 'site_name'] * ], * 'posts' => [ * [ 'type' => 'token', 'value' => 'site_name' ], * [ 'type' => 'string', 'value' => ' | ' ], * [ 'type' => 'token', 'value' => 'post_title' ] * ], * 'pages' => [], * 'groups' => [], * 'archives' => [] * ] * Custom title for given page type is created by concatenating all of the array 'value' parts. * Tokens are replaced with their corresponding values for current site. * Empty array signals that we are not overriding the default title for particular page type. */ /** * Class containing utility static methods for managing SEO custom title formats. */ class Jetpack_SEO_Titles { /** * Site option name used to store custom title formats. */ const TITLE_FORMATS_OPTION = 'advanced_seo_title_formats'; /** * Retrieves custom title formats from site option. * * @return array Array of custom title formats, or empty array. */ public static function get_custom_title_formats() { if( Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) { return get_option( self::TITLE_FORMATS_OPTION, array() ); } return array(); } /** * Returns tokens that are currently supported for each page type. * * @return array Array of allowed token strings. */ public static function get_allowed_tokens() { return array( 'front_page' => array( 'site_name', 'tagline' ), 'posts' => array( 'site_name', 'tagline', 'post_title' ), 'pages' => array( 'site_name', 'tagline', 'page_title' ), 'groups' => array( 'site_name', 'tagline', 'group_title' ), 'archives' => array( 'site_name', 'tagline', 'date' ), ); } /** * Used to modify the default title with custom SEO title. * * @param string $default_title Default title for current page. * * @return string Custom title with replaced tokens or default title. */ public static function get_custom_title( $default_title = '' ) { // Don't filter title for unsupported themes. if ( self::is_conflicted_theme() ) { return $default_title; } $page_type = self::get_page_type(); // Keep default title if invalid page type is supplied. if ( empty( $page_type ) ) { return $default_title; } $title_formats = self::get_custom_title_formats(); // Keep default title if user has not defined custom title for this page type. if ( empty( $title_formats[ $page_type ] ) ) { return $default_title; } if ( ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) { return $default_title; } $custom_title = ''; $format_array = $title_formats[ $page_type ]; foreach ( $format_array as $item ) { if ( 'token' == $item['type'] ) { $custom_title .= self::get_token_value( $item['value'] ); } else { $custom_title .= $item['value']; } } return esc_html( $custom_title ); } /** * Returns string value for given token. * * @param string $token_name The token name value that should be replaced. * * @return string Token replacement for current site, or empty string for unknown token name. */ public static function get_token_value( $token_name ) { switch ( $token_name ) { case 'site_name': return get_bloginfo( 'name' ); case 'tagline': return get_bloginfo( 'description' ); case 'post_title': case 'page_title': return get_the_title(); case 'group_title': return single_tag_title( '', false ); case 'date': return self::get_date_for_title(); default: return ''; } } /** * Returns page type for current page. We need this helper in order to determine what * user defined title format should be used for custom title. * * @return string|bool Type of current page or false if unsupported. */ public static function get_page_type() { if ( is_front_page() ) { return 'front_page'; } if ( is_category() || is_tag() ) { return 'groups'; } if ( is_archive() && ! is_author() ) { return 'archives'; } if ( is_page() ) { return 'pages'; } if ( is_singular() ) { return 'posts'; } return false; } /** * Returns the value that should be used as a replacement for the date token, * depending on the archive path specified. * * @return string Token replacement for a given date, or empty string if no date is specified. */ public static function get_date_for_title() { // If archive year, month, and day are specified. if ( is_day() ) { return get_the_date(); } // If archive year, and month are specified. if ( is_month() ) { return trim( single_month_title( ' ', false ) ); } // Only archive year is specified. if ( is_year() ) { return get_query_var( 'year' ); } return ''; } /** * Checks if current theme is defining custom title that won't work nicely * with our custom SEO title override. * * @return bool True if current theme sets custom title, false otherwise. */ public static function is_conflicted_theme() { /** * Can be used to specify a list of themes that use their own custom title format. * * If current site is using one of the themes listed as conflicting, * Jetpack SEO custom title formats will be disabled. * * @module seo-tools * * @since 4.4.0 * * @param array List of conflicted theme names. Defaults to empty array. */ $conflicted_themes = apply_filters( 'jetpack_seo_custom_title_conflicted_themes', array() ); return isset( $conflicted_themes[ get_option( 'template' ) ] ); } /** * Checks if a given format conforms to predefined SEO title templates. * * Every format type and token must be whitelisted. * @see get_allowed_tokens() * * @param array $title_formats Template of SEO title to check. * * @return bool True if the formats are valid, false otherwise. */ public static function are_valid_title_formats( $title_formats ) { $allowed_tokens = self::get_allowed_tokens(); if ( ! is_array( $title_formats ) ) { return false; } foreach ( $title_formats as $format_type => $format_array ) { if ( ! in_array( $format_type, array_keys( $allowed_tokens ) ) ) { return false; } if ( '' === $format_array ) { continue; } if ( ! is_array( $format_array ) ) { return false; } foreach ( $format_array as $item ) { if ( empty( $item['type'] ) || empty( $item['value'] ) ) { return false; } if ( 'token' == $item['type'] ) { if ( ! in_array( $item['value'], $allowed_tokens[ $format_type ] ) ) { return false; } } } } return true; } /** * Combines the previous values of title formats, stored as array in site options, * with the new values that are provided. * * @param array $new_formats Array containing new title formats. * * @return array $result Array of updated title formats, or empty array if no update was performed. */ public static function update_title_formats( $new_formats ) { // Empty array signals that custom title shouldn't be used. $empty_formats = array( 'front_page' => array(), 'posts' => array(), 'pages' => array(), 'groups' => array(), 'archives' => array(), ); $previous_formats = self::get_custom_title_formats(); $result = array_merge( $empty_formats, $previous_formats, $new_formats ); if ( update_option( self::TITLE_FORMATS_OPTION, $result ) ) { return $result; } return array(); } } /** * Class containing utility static methods for managing SEO custom descriptions for Posts and Pages. */ class Jetpack_SEO_Posts { /** * Key of the post meta value that will be used to store post custom description. */ const DESCRIPTION_META_KEY = 'advanced_seo_description'; /** * Build meta description for post SEO. * * @param WP_Post $post Source of data for custom description. * * @return string Post description or empty string. */ public static function get_post_description( $post ) { if ( empty( $post ) ) { return ''; } if ( post_password_required() || ! is_singular() ) { return ''; } // Business users can overwrite the description $custom_description = self::get_post_custom_description( $post ); if ( ! empty( $custom_description ) ) { return $custom_description; } if ( ! empty( $post->post_excerpt ) ) { return $post->post_excerpt; } return $post->post_content; } /** * Returns post's custom meta description if it is set, and if * SEO tools are enabled for current blog. * * @param WP_Post $post Source of data for custom description * * @return string Custom description or empty string */ public static function get_post_custom_description( $post ) { if ( empty( $post ) ) { return ''; } $custom_description = get_post_meta( $post->ID, self::DESCRIPTION_META_KEY, true ); if ( empty( $custom_description ) || ! Jetpack_SEO_Utils::is_enabled_jetpack_seo() ) { return ''; } return $custom_description; } } Uncategorized Archives | The Cunning Rustic

Category: Uncategorized

On Roses, Dragons and Saint George

Dragon Hill, near Uffington, Oxfordshire. The chalk shows where grass cannot grow. There, George slayed the Dragon.

  “And on my breast, a red,red rose, The flower of old England wherever she grows”

– John Kirkpatrick “Saint George”


Today is Saint George’s Day.  As I’ve mentioned in my St Patrick’s day post, I’m not a Christian, so as such, I don’t celebrate this as a religious festival, but as a recognition of my English heritage.  There are some Christians that would prefer England’s patron saint be an Englishman, perhaps St Edmund or St Alban, however I’m resolved that IF we should maintain a presence of this foreign faith in England, that St George be it’s representative.

“Whet the bright steel, Sons of the White Dragon! Kindle the torch, Daughter of Hengist!”

– Sir Walter Scott

We have a wonderful history of thin veneers of Christendom over the still beating heart of native faith in our isles.  Eire’s St Brigid is a perfect example, but for us, the legends of dragon slaying is strong.  From the continent, our Germanic ancestors brought tales of the Volsungs, and among our hills we had the tale of Beowulf penned, and by a monk no less!  So powerful are our stories that they cannot be denied!  England knew dragons…Monks feared they might burn their abbey’s, golden dragons were raised in battle,  red and white dragons fought in mystical dreams for the souls of a nation, yes, we know dragons…

The Cunning Rustic and the Rose of England

So today, as per the tradition,  I wear the red rose on my lapel.  close to my heart. The Rose is the united Tudor rose, masterful propaganda from the turn of the Renaissance, the rose is Lancaster and York. The rose is beauty personified, fed by English rain and English soil, and deep scarlet, the colour of blood. The rose is the island, and the thorns the water that protects it.  It is the English nation, haughty, hardy, beautiful, and prickly.  The rose is the blood of the dragon spilled, or the heart of Fafnir when Sigeweard devoured it, or the wounds of Beowulf left by the defeated wyrm.

I don’t care much for crosses, but I love to see St George’s cross fly today as an act of defiance and celebration.   Lo, may we see it replaced by the flag of the white wyrm!  Keep the spirit of dragon slayers in your heart always, and today, on your breast, the red, red rose.   May we gain the wisdom of our ancient forebears and may we all slay the dragons that stand before us.  May there forever be an England.

The White Dragon of England


On Saints, snakes and shamrocks.


I am no Papist, nor am I an Irishman.

St Patrick’s day brings a moment of consternation for the Pagan soul. Weren’t those ‘snakes’ an analogy for the druids? How much knowledge did we lose in the fifth century due to the missions and conversions of Patricius?  Would we have an unbroken living tradition of Celtic polytheism were it not for that man?

It’s true that the lack of snakes in the Emerald Isle has less to do with St Padraic and more to do with the ice age, but as with many legends, they grow around a person who had uncanny influence.  One such legend is that he spoke to mythic heroes of the Fianna, a warrior band of the mythic age, to convince them that real heroism lies in piety!

Despite the rancor that this raises among the modern Pagan and Heathen communities, i have found that this day more than any other raises an odd sort of self-righteousness.  Declarations against celebrating this particular day abound.  Indeed, if one would rather stay at home and engage in a day of prayer and worship to ancient forbears, I’m certain that the soul of St Patrick would ‘tut’ loudly, wherever he resides.

Here in the new world, where religion and irreligiousness are celebrated with equal zeal, this day is like no other.  As I wander the streets of my adopted American town, I see a wash of green. From stores and passing cars, the musical strains of The Chieftans or Dropkick Murphys can be heard.  Festivals, not celebrating St Patrick (or even mere Irish heritage) but rather Celtic heritage spring up everywhere. Bagpipes squeal and young lassies skip high in velvet dresses, never moving an arm.  I see this outpouring of connection to Celtic heritage from all the sons and daughters of Europe.  I see knotwork and green men on t-shirts. Corned beef and cabbage, sausage rolls and Irish soda bread abound!  I see people drinking, laughing, kissing and occasionally brawling. I can not for one second think that these folks are all Catholic.  Feasting and community are fundamental to our folkways, and  I’m sure the pubs are fuller than the churches. While they may not be Pagans of any stripe, at least they are celebrating a culture of music, poetry, art and wit, without even give a passing thought to old St Paddy, and after writing this, nor will I.

So play me some Pogues and pour me a glass for the Emerald Isle, to raise to Celtic folk and snake handlers everywhere, just don’t paint a green shamrock in it. Every man has to have standards.





Remember, remember…Guy Fawkes Foiled!

‘The Discovery of the Gunpowder Plot and the Taking of Guy Fawkes’ by Henry Perronet Briggs 1832

Remember, remember…

Guido ‘Guy’ Fawkes was not a hero from a comic, not a face to be worn by the anonymous.  He was a Papist.  In 1605 along with 13 conspirators he attempted to blow up King James I at his state opening at the Houses of Parliament.  Fawkes aimed to return England to the governance of Rome and the King of Spain.  Just 50 years earlier, 300 protestants had been burned to the death for heresy against the pope, during Queen Mary’s purge. No doubt the scourge of  ‘Bloody’ Mary was still strong in the minds of the English.

Bloody Mary lit a few bonfires of her own.

Bloody Mary lit a few bonfires of her own.

England had been thrown into conflict between Papists and Protestants since Henry VIII, but the fact remains, the Purges of Bloody Mary, against layman and commoners, deserved a heavy handed response.  The protestant reformation, as harsh as it was,  placed  the British Isles under British control and away from Europe.  The judgement against those who would have seen Britain bow to foreign masters sent a strong message.

Foiled in his plot, Fawkes was tortured, hanged and quartered, his parts being sent to the four corners of the land.

penny for the guy

Penny for the Guy

Now every fifth of November,  the British mark the occasion with ‘Bonfire night’.  Although the tradition of ‘A Penny For The Guy’ is waning, children still create a grotesque likeness of Fawkes and wheel him about the town, collecting money from those who would give it, before burning him atop the bonfire that evening.

As per tradition, folk will be lighting fireworks, eating and drinking, playing music and enjoying what would seem to all outside viewers to be a perfectly nice Pagan celebration.  Deep in our primordial souls, I believe we are happiest when celebrating around a fire with friends, and need little reason for it.  If one has to have a reason though, this is a good one.

Tonight,  across Albion, bonfires will be lit and effigies of Guy Fawkes burned. Let the story of Britain’s traitor be told, not in whispers, but with pride.  While children warm themselves in the glow,  let there be a chill in the spines of those who plot still.

Remember, remember…

Photograph © Andrew Dunn, 5 November 2005.

Photograph © Andrew Dunn, 5 November 2005.

Remember, remember!
The fifth of November,
The Gunpowder treason and plot;
I know of no reason
Why the Gunpowder treason
Should ever be forgot!
Guy Fawkes and his companions
Did the scheme contrive,
To blow the King and Parliament
All up alive.
Threescore barrels, laid below,
To prove old England’s overthrow.
But, by God’s providence, him they catch,
With a dark lantern, lighting a match!
A stick and a stake
For King James’s sake!
If you won’t give me one,
I’ll take two,
The better for me,
And the worse for you.
A rope, a rope, to hang the Pope,
A penn’orth of cheese to choke him,
A pint of beer to wash it down,
And a jolly good fire to burn him.
Holloa, boys! holloa, boys! make the bells ring!
Holloa, boys! holloa boys! God save the King!
Hip, hip, hooor-r-r-ray!









The Harvest Moon – Of Wheat and Waggons


The Harvest Moon by George Mason

 Harvest-Home Song

THE FROST will bite us soon;
His tooth is on the leaves:
Beneath the golden moon
We bear the golden sheaves:
We care not for the winter’s spite,
We keep our Harvest-home to-night.
Hurrah for the English yeoman!
Fill full, fill the cup!
Hurrah! he yields to no man!
Drink deep; drink it up!

The pleasure of a king
Is tasteless to the mirth
Of peasants when they bring
The harvest of the earth.
With pipe and tabor hither roam
All ye who love our Harvest-home.

The thresher with his flail,
The shepherd with his crook,
The milkmaid with her pail,
The reaper with his hook—
To-night the dullest blooded clods
Are kings and queens, are demigods.
Hurrah for the English yeoman!
Fill full; fill the cup!
Hurrah! he yields to no man!
Drink deep; drink it up!

John Davidson (1857–1909)

Today is the Harvest Moon, dear friends. Give a moment to the earth as we reap our rewards and plan for the winter.  Make merry, enjoy ciders and ales, pour a little to John Barleycorn and the spirit of autumn.

Perhaps you will make Corn Dollies this weekend.  Of course, our modern wheat, a short, pithy type, easily devoured by combine harvesters, is not the same as the long great staple that my ancestors enjoyed.  The type which made a tall figure on a cart when shaped and bundled, and brought into the town.  The type that made for a thick thatched roof to stave off the winter chill.  I am left to wonder if the sudden distaste for bread in our modern society, and many of the ills claimed by the ‘anti-glutenites’ (begging the pardon of the true Celiac sufferer) isn’t rather a case of poisoning by modern crop and processing.  Once one has enjoyed the warm fulfillment of a true traditional loaf,  it can scarcely be compared to the soggy brick we call ‘bread’ today.

Harvest home  follows the festival ‘Lammas’ from the Anglo-Saxon ‘Hlaf-Mass’, literally translated as ‘Loaf Mass’.    Indeed, bread was so important to the Saxon, that our very words ‘Lord’ and ‘Lady’ are derived from the Old English hlāfweard (Loaf-Ward) and hlǣfdige (Loaf-Maker).   It’s a shame to see moderns disparage the venerable old loaf, but I have seen a return to the old ways recently with a rise of ‘artisanal Breads’ and farm to table bakeries making a name for themselves.  For more on this,  watch Michael Pollan’s ‘Cooked’ episode on Bread.

Waggons decorated for the Harvest Home parade on September 14th 1864. The Order of Proceedings required men to have a bouquet of three ears of wheat on their left breast. The procession was headed by the oldest labourers and the "musical band".

Waggons decorated for the Harvest Home parade on September 14th 1864. The Order of Proceedings required men to have a bouquet of three ears of wheat on their left breast. The procession was headed by the oldest labourers and the “musical band”.   Credit: www.communityarchives.org.uk

In various parts of Europe, the last sheaf of wheat or corn (for we use the terms interchangeably in England, what my American brethren call ‘Corn’ we call ‘Maize’) is a matter for reverence.  In parts of Germany, it was left  uncut as fodder for Wotan’s horse.  In Devon, England, it was festooned with ribbons and held aloft before the reapers scythes to the cry of ‘THE NECK’!   It was then carried to the farmer’s house to replace the previous year’s neck, which was then offered to the farmer’s finest beast.  Many a wagon carried the golden corn-maid to the village and town, perhaps an echo of the ritual belonging to the ancient earth-Goddess, Nerthus.  The Roman historian, Tacitus wrote of Nerthus in his work ‘Germania’

“There is a sacred grove on an island in the Ocean, in which there is a consecrated chariot, draped with cloth, where the priest alone may touch. He perceives the presence of the goddess in the innermost shrine and with great reverence escorts her in her chariot, which is drawn by female cattle. There are days of rejoicing then and the countryside celebrates the festival, wherever she designs to visit and to accept hospitality. No one goes to war, no one takes up arms, all objects of iron are locked away, then and only then do they experience peace and quiet, only then do they prize them, until the goddess has had her fill of human society and the priest brings her back to her temple.”

the-wolves-pursuing-sol-and-maniWhether you celebrate with your kinfolk or alone this weekend as the Autumnal Equinox approaches, this is the perfect time to reflect on the past year.  Was your harvest a good one?  Have you sown deeds and reaped rewards?  Were the Gods beneficent or were you faced with trial? Have you given a gift for your gifts received?

Sunna is in her descent and the leaves will turn reds and golds in her honour.  This evening, celebrate and honour the earth and to the wights of the land. We will have a partial eclipse tonight as Hati the Mooncatcher throws a wolfish shadow across Mani.  For tonight, rest and raise a jug of ale, as we know that we have much work to do before the fated day, when that warg devours its prey.











© 2018 The Cunning Rustic

Theme by Anders NorenUp ↑