Skip to content

Commit 3972166

Browse files
authored
Merge pull request #151 from brainstormforce/dev
Build Version 1.6.10
2 parents b5af592 + ed089c3 commit 3972166

File tree

8 files changed

+223
-74
lines changed

8 files changed

+223
-74
lines changed

Gruntfile.js

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,64 @@
1-
module.exports = function( grunt ) {
2-
3-
'use strict';
4-
5-
// Project configuration
6-
grunt.initConfig( {
7-
8-
pkg: grunt.file.readJSON( 'package.json' ),
9-
10-
addtextdomain: {
11-
options: {
12-
textdomain: 'all-in-one-schemaorg-rich-snippets',
13-
},
14-
update_all_domains: {
15-
options: {
16-
updateDomains: true
17-
},
18-
src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ]
19-
}
20-
},
21-
22-
wp_readme_to_markdown: {
23-
your_target: {
24-
files: {
25-
'README.md': 'readme.txt'
26-
}
27-
},
28-
},
29-
30-
makepot: {
31-
target: {
32-
options: {
33-
domainPath: '/languages',
34-
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
35-
mainFile: 'index.php',
36-
potFilename: 'all-in-one-schemaorg-rich-snippets.pot',
37-
potHeaders: {
38-
poedit: true,
39-
'x-poedit-keywordslist': true
40-
},
41-
type: 'wp-plugin',
42-
updateTimestamp: true
43-
}
44-
}
45-
},
46-
} );
47-
48-
grunt.loadNpmTasks( 'grunt-wp-i18n' );
49-
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
50-
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
51-
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
52-
53-
grunt.util.linefeed = '\n';
1+
module.exports = function(grunt) {
542

3+
'use strict';
4+
5+
// Project configuration
6+
grunt.initConfig({
7+
8+
pkg: grunt.file.readJSON('package.json'),
9+
10+
addtextdomain: {
11+
options: {
12+
textdomain: 'all-in-one-schemaorg-rich-snippets',
13+
},
14+
update_all_domains: {
15+
options: {
16+
updateDomains: true
17+
},
18+
src: ['*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*']
19+
}
20+
},
21+
22+
wp_readme_to_markdown: {
23+
your_target: {
24+
files: {
25+
'README.md': 'readme.txt'
26+
}
27+
},
28+
},
29+
30+
makepot: {
31+
target: {
32+
options: {
33+
domainPath: '/languages',
34+
exclude: ['\.git/*', 'bin/*', 'node_modules/*', 'tests/*'],
35+
mainFile: 'index.php',
36+
potFilename: 'all-in-one-schemaorg-rich-snippets.pot',
37+
potHeaders: {
38+
poedit: true,
39+
'x-poedit-keywordslist': true
40+
},
41+
type: 'wp-plugin',
42+
updateTimestamp: true
43+
}
44+
}
45+
},
46+
47+
zip: {
48+
'release': {
49+
src: ['**/*', '!node_modules/**', '!tests/**', '!bin/**', '!**/*.zip'], // Exclude certain folders and existing zip files
50+
dest: 'all-in-one-schemaorg-rich-snippets.zip'
51+
}
52+
},
53+
});
54+
55+
grunt.loadNpmTasks('grunt-wp-i18n');
56+
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
57+
grunt.loadNpmTasks('grunt-zip'); // Use grunt-zip instead
58+
59+
grunt.registerTask('i18n', ['addtextdomain', 'makepot']);
60+
grunt.registerTask('readme', ['wp_readme_to_markdown']);
61+
grunt.registerTask('release', ['zip:release']); // Add release command
62+
63+
grunt.util.linefeed = '\n';
5564
};

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Tags:** schema markup, structured data, rich snippets, schema.org, Microdata, schema
55
**Requires at least:** 3.7
66
**Tested up to:** 6.6
7-
**Stable tag:** 1.6.9
7+
**Stable tag:** 1.6.10
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010
Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
@@ -80,6 +80,10 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
8080

8181
## Changelog ##
8282

83+
### 1.6.10 ###
84+
- Fixed: Corrected the uploadDate format as per ISO 8601 standards with timezone.
85+
- Fixed: Resolved url redirect issue for Test Rich Snippets button.
86+
8387
### 1.6.9 ###
8488
- Improvement: Improved plugin codebase for better security.
8589

functions.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,35 @@ function display_rich_snippet( $content ) {
890890
$video .= '<meta itemprop="embedURL" content="' . esc_attr( $video_emb_url ) . '">';
891891
}
892892
if ( '' != trim( $video_duration ) ) {
893-
$video .= '<meta itemprop="duration" content="' . esc_attr( $video_duration ) . '">';
893+
$duration_parts = explode( ':', $video_duration );
894+
895+
// Build the ISO 8601 format.
896+
$hours = isset( $duration_parts[0] ) ? $duration_parts[0] : 0;
897+
$minutes = isset( $duration_parts[1] ) ? $duration_parts[1] : 0;
898+
$seconds = isset( $duration_parts[2] ) ? $duration_parts[2] : 0;
899+
900+
// Construct the ISO 8601 duration string.
901+
$iso_duration = 'PT' . ( $hours > 0 ? $hours . 'H' : '' ) . ( $minutes > 0 ? $minutes . 'M' : '' ) . ( $seconds > 0 ? $seconds . 'S' : '' );
902+
903+
// Add the meta tag with the correct duration format.
904+
$video .= '<meta itemprop="duration" content="' . esc_attr( $iso_duration ) . '">';
894905
}
895906
if ( '' != trim( $video_date ) ) {
896-
$video .= '<meta itemprop="uploadDate" content="' . esc_attr( $video_date ) . '">';
907+
try {
908+
// Get the server's timezone.
909+
$timezone = date_default_timezone_get();
910+
911+
// Create a DateTime object from the $video_date string.
912+
$datetime = new DateTime( $video_date, new DateTimeZone( $timezone ) ); // Set the timezone to the server's timezone.
913+
914+
// Format the date to ISO 8601 with timezone.
915+
$iso_date = $datetime->format( DateTime::ATOM ); // Outputs ISO 8601 with timezone info.
916+
917+
// Add the uploadDate field to the $video string.
918+
$video .= '<meta itemprop="uploadDate" content="' . esc_attr( $iso_date ) . '">';
919+
} catch ( Exception $e ) {
920+
return;
921+
}
897922
}
898923
$video .= '</div>
899924
</div></div><div class="snippet-clear"></div>';

index.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Author: Brainstorm Force
66
* Author URI: https://www.brainstormforce.com
77
* 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.
8-
* Version: 1.6.9
8+
* Version: 1.6.10
99
* Text Domain: rich-snippets
1010
* License: GPL2
1111
*
@@ -68,15 +68,14 @@ public function define_constants() {
6868
define( 'AIOSRS_PRO_BASE', plugin_basename( AIOSRS_PRO_FILE ) );
6969
define( 'AIOSRS_PRO_DIR', plugin_dir_path( AIOSRS_PRO_FILE ) );
7070
define( 'AIOSRS_PRO_URI', plugins_url( '/', AIOSRS_PRO_FILE ) );
71-
define( 'AIOSRS_PRO_VER', '1.6.9' );
71+
define( 'AIOSRS_PRO_VER', '1.6.10' );
7272
}
7373

7474
/**
7575
* Admin bar menu.
7676
*/
7777
public function aiosrs_admin_bar() {
7878
global $wp_admin_bar;
79-
$actual_link = esc_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" );
8079
if ( ! is_super_admin() || ! is_admin_bar_showing() ) {
8180
return;
8281
}
@@ -85,7 +84,7 @@ public function aiosrs_admin_bar() {
8584
array(
8685
'id' => 'aiosrs',
8786
'title' => 'Test Rich Snippets',
88-
'href' => 'https://search.google.com/structured-data/testing-tool#url=' . $actual_link,
87+
'href' => 'https://validator.schema.org/',
8988
'meta' => array( 'target' => '_blank' ),
9089
)
9190
);

languages/all-in-one-schemaorg-rich-snippets.pot

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# This file is distributed under the GPL2.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.9\n"
5+
"Project-Id-Version: Schema - All In One Schema Rich Snippets 1.6.10\n"
66
"Report-Msgid-Bugs-To: "
77
"https://wordpress.org/support/plugin/all-in-one-schemaorg-rich-snippets\n"
8-
"POT-Creation-Date: 2024-07-18 05:47:27+00:00\n"
8+
"POT-Creation-Date: 2024-09-19 08:31:10+00:00\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=utf-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
@@ -616,35 +616,35 @@ msgstr ""
616616
msgid "Your Query in Brief:"
617617
msgstr ""
618618

619-
#: functions.php:1241
619+
#: functions.php:1269
620620
msgid "Error adding your rating"
621621
msgstr ""
622622

623-
#: functions.php:1241
623+
#: functions.php:1269
624624
msgid "Ratings added successfully !"
625625
msgstr ""
626626

627-
#: functions.php:1271
627+
#: functions.php:1299
628628
msgid "Error updating your rating"
629629
msgstr ""
630630

631-
#: functions.php:1271
631+
#: functions.php:1299
632632
msgid "Ratings updated successfully !"
633633
msgstr ""
634634

635-
#: index.php:318
635+
#: index.php:317
636636
msgid "Thank you!"
637637
msgstr ""
638638

639-
#: index.php:318
639+
#: index.php:317
640640
msgid "Something went wrong!"
641641
msgstr ""
642642

643-
#: index.php:347
643+
#: index.php:346
644644
msgid "Settings saved !"
645645
msgstr ""
646646

647-
#: index.php:347
647+
#: index.php:346
648648
msgid "Error occured. Settings were not saved !"
649649
msgstr ""
650650

0 commit comments

Comments
 (0)