Skip to content

Commit

Permalink
Merge pull request #151 from brainstormforce/dev
Browse files Browse the repository at this point in the history
Build Version 1.6.10
  • Loading branch information
sushmak02 authored Sep 19, 2024
2 parents b5af592 + ed089c3 commit 3972166
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 74 deletions.
115 changes: 62 additions & 53 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,64 @@
module.exports = function( grunt ) {

'use strict';

// Project configuration
grunt.initConfig( {

pkg: grunt.file.readJSON( 'package.json' ),

addtextdomain: {
options: {
textdomain: 'all-in-one-schemaorg-rich-snippets',
},
update_all_domains: {
options: {
updateDomains: true
},
src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ]
}
},

wp_readme_to_markdown: {
your_target: {
files: {
'README.md': 'readme.txt'
}
},
},

makepot: {
target: {
options: {
domainPath: '/languages',
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
mainFile: 'index.php',
potFilename: 'all-in-one-schemaorg-rich-snippets.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
},
type: 'wp-plugin',
updateTimestamp: true
}
}
},
} );

grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );

grunt.util.linefeed = '\n';
module.exports = function(grunt) {

'use strict';

// Project configuration
grunt.initConfig({

pkg: grunt.file.readJSON('package.json'),

addtextdomain: {
options: {
textdomain: 'all-in-one-schemaorg-rich-snippets',
},
update_all_domains: {
options: {
updateDomains: true
},
src: ['*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*']
}
},

wp_readme_to_markdown: {
your_target: {
files: {
'README.md': 'readme.txt'
}
},
},

makepot: {
target: {
options: {
domainPath: '/languages',
exclude: ['\.git/*', 'bin/*', 'node_modules/*', 'tests/*'],
mainFile: 'index.php',
potFilename: 'all-in-one-schemaorg-rich-snippets.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
},
type: 'wp-plugin',
updateTimestamp: true
}
}
},

zip: {
'release': {
src: ['**/*', '!node_modules/**', '!tests/**', '!bin/**', '!**/*.zip'], // Exclude certain folders and existing zip files
dest: 'all-in-one-schemaorg-rich-snippets.zip'
}
},
});

grunt.loadNpmTasks('grunt-wp-i18n');
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
grunt.loadNpmTasks('grunt-zip'); // Use grunt-zip instead

grunt.registerTask('i18n', ['addtextdomain', 'makepot']);
grunt.registerTask('readme', ['wp_readme_to_markdown']);
grunt.registerTask('release', ['zip:release']); // Add release command

grunt.util.linefeed = '\n';
};
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** schema markup, structured data, rich snippets, schema.org, Microdata, schema
**Requires at least:** 3.7
**Tested up to:** 6.6
**Stable tag:** 1.6.9
**Stable tag:** 1.6.10
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
Expand Down Expand Up @@ -80,6 +80,10 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et

## Changelog ##

### 1.6.10 ###
- Fixed: Corrected the uploadDate format as per ISO 8601 standards with timezone.
- Fixed: Resolved url redirect issue for Test Rich Snippets button.

### 1.6.9 ###
- Improvement: Improved plugin codebase for better security.

Expand Down
29 changes: 27 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,35 @@ function display_rich_snippet( $content ) {
$video .= '<meta itemprop="embedURL" content="' . esc_attr( $video_emb_url ) . '">';
}
if ( '' != trim( $video_duration ) ) {
$video .= '<meta itemprop="duration" content="' . esc_attr( $video_duration ) . '">';
$duration_parts = explode( ':', $video_duration );

// Build the ISO 8601 format.
$hours = isset( $duration_parts[0] ) ? $duration_parts[0] : 0;
$minutes = isset( $duration_parts[1] ) ? $duration_parts[1] : 0;
$seconds = isset( $duration_parts[2] ) ? $duration_parts[2] : 0;

// Construct the ISO 8601 duration string.
$iso_duration = 'PT' . ( $hours > 0 ? $hours . 'H' : '' ) . ( $minutes > 0 ? $minutes . 'M' : '' ) . ( $seconds > 0 ? $seconds . 'S' : '' );

// Add the meta tag with the correct duration format.
$video .= '<meta itemprop="duration" content="' . esc_attr( $iso_duration ) . '">';
}
if ( '' != trim( $video_date ) ) {
$video .= '<meta itemprop="uploadDate" content="' . esc_attr( $video_date ) . '">';
try {
// Get the server's timezone.
$timezone = date_default_timezone_get();

// Create a DateTime object from the $video_date string.
$datetime = new DateTime( $video_date, new DateTimeZone( $timezone ) ); // Set the timezone to the server's timezone.

// Format the date to ISO 8601 with timezone.
$iso_date = $datetime->format( DateTime::ATOM ); // Outputs ISO 8601 with timezone info.

// Add the uploadDate field to the $video string.
$video .= '<meta itemprop="uploadDate" content="' . esc_attr( $iso_date ) . '">';
} catch ( Exception $e ) {
return;
}
}
$video .= '</div>
</div></div><div class="snippet-clear"></div>';
Expand Down
7 changes: 3 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Brainstorm Force
* Author URI: https://www.brainstormforce.com
* Description: Welcome to the Schema - All In One Schema Rich Snippets! You can now easily add schema markup on various * pages and posts of your website. Implement schema types such as Review, Events, Recipes, Article, Products, Services * *etc.
* Version: 1.6.9
* Version: 1.6.10
* Text Domain: rich-snippets
* License: GPL2
*
Expand Down Expand Up @@ -68,15 +68,14 @@ public function define_constants() {
define( 'AIOSRS_PRO_BASE', plugin_basename( AIOSRS_PRO_FILE ) );
define( 'AIOSRS_PRO_DIR', plugin_dir_path( AIOSRS_PRO_FILE ) );
define( 'AIOSRS_PRO_URI', plugins_url( '/', AIOSRS_PRO_FILE ) );
define( 'AIOSRS_PRO_VER', '1.6.9' );
define( 'AIOSRS_PRO_VER', '1.6.10' );
}

/**
* Admin bar menu.
*/
public function aiosrs_admin_bar() {
global $wp_admin_bar;
$actual_link = esc_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" );
if ( ! is_super_admin() || ! is_admin_bar_showing() ) {
return;
}
Expand All @@ -85,7 +84,7 @@ public function aiosrs_admin_bar() {
array(
'id' => 'aiosrs',
'title' => 'Test Rich Snippets',
'href' => 'https://search.google.com/structured-data/testing-tool#url=' . $actual_link,
'href' => 'https://validator.schema.org/',
'meta' => array( 'target' => '_blank' ),
)
);
Expand Down
20 changes: 10 additions & 10 deletions languages/all-in-one-schemaorg-rich-snippets.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.9\n"
"Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.10\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/all-in-one-schemaorg-rich-snippets\n"
"POT-Creation-Date: 2024-07-18 05:47:27+00:00\n"
"POT-Creation-Date: 2024-09-19 08:31:10+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -616,35 +616,35 @@ msgstr ""
msgid "Your Query in Brief:"
msgstr ""

#: functions.php:1241
#: functions.php:1269
msgid "Error adding your rating"
msgstr ""

#: functions.php:1241
#: functions.php:1269
msgid "Ratings added successfully !"
msgstr ""

#: functions.php:1271
#: functions.php:1299
msgid "Error updating your rating"
msgstr ""

#: functions.php:1271
#: functions.php:1299
msgid "Ratings updated successfully !"
msgstr ""

#: index.php:318
#: index.php:317
msgid "Thank you!"
msgstr ""

#: index.php:318
#: index.php:317
msgid "Something went wrong!"
msgstr ""

#: index.php:347
#: index.php:346
msgid "Settings saved !"
msgstr ""

#: index.php:347
#: index.php:346
msgid "Error occured. Settings were not saved !"
msgstr ""

Expand Down
Loading

0 comments on commit 3972166

Please sign in to comment.