From 950ea81e913a60092dd13d3c2923c1b1b158ce8b Mon Sep 17 00:00:00 2001 From: Uttam Sharma Date: Fri, 30 Aug 2019 11:53:48 +0530 Subject: [PATCH 01/12] added filter to remove review date from review schema markup --- functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 2caf344..31fac72 100644 --- a/functions.php +++ b/functions.php @@ -79,11 +79,13 @@ function display_rich_snippet($content) { $review .= "
".esc_attr(stripslashes( $args_review['item_reviewer'] ) )."
"; $review .= "
".esc_attr( stripslashes( $reviewer ) )."
"; } - if(isset($args_review['review_date'])) - { - if( $args_review['review_date'] != "") - $review .= "
".esc_attr(stripslashes( $args_review['review_date'] ) ) ."
"; - $review .= "
"; + if ( apply_filters( 'aiosrs_review_time_enabled', true ) ) { + if(isset($args_review['review_date'])) + { + if( $args_review['review_date'] != "") + $review .= "
".esc_attr(stripslashes( $args_review['review_date'] ) ) ."
"; + $review .= "
"; + } } if(trim($item) != "") { From 697708126a859e29a1f09f05df9a9d8ff6108e3e Mon Sep 17 00:00:00 2001 From: Uttam Sharma Date: Fri, 13 Dec 2019 13:46:57 +0530 Subject: [PATCH 02/12] removed unwated tab CSS for admin file --- admin/css/admin.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/admin/css/admin.css b/admin/css/admin.css index 17f7607..13df197 100644 --- a/admin/css/admin.css +++ b/admin/css/admin.css @@ -1,10 +1,4 @@ html{ display:block !important;} -.etabs { margin: 0; padding: 0; } -.tab { display: inline-block; zoom:1; *display:inline; background: #fff; border: solid 1px #999; border-bottom: none; -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; font-weight:bold; } -.tab a { box-shadow: none; font-size: 14px; line-height: 2em; display: block; padding: 0 10px; outline: none; text-decoration:none; color:rgb(175, 175, 175); } -.tab a:hover { text-decoration: none; color:#0073aa; } -.tab a.active { font-weight: bold; text-decoration:none; color:#333; } -.tab.active a:hover { text-decoration: none; color:#0073aa; } .tab-container { width: 95%; } .get_in_touch { margin: 10px; font-size: 14px;cursor: pointer;} #bsf-postbox-container-2 {width: 65%;} From 5daba46ffe0429345fc4d315a124f1d898015dd4 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 11:34:22 +0530 Subject: [PATCH 03/12] added ISO 8601 format to video duration --- functions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index e8e16f5..33bbf04 100644 --- a/functions.php +++ b/functions.php @@ -284,6 +284,7 @@ function display_rich_snippet( $content ) { $review .= '
' . esc_attr( stripslashes( $item_video['video_date'] ) ) . '
'; } $review .= "
" . esc_attr( stripslashes( $item_video_date ) ) . '
'; + echo $item_video_date; } if ( '' != trim( $item_video_thumb ) ) { $review .= ''; @@ -890,10 +891,23 @@ function display_rich_snippet( $content ) { $video .= ''; } if ( '' != trim( $video_duration ) ) { - $video .= ''; - } + // Assuming $video_duration is in a human-readable format like "1:30:45" (H:M:S) + $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 .= ''; + } if ( '' != trim( $video_date ) ) { $video .= ''; + error_log(print_r($video_date, true)); } $video .= '
'; From b536743a7a50cfcf2eefdc6511bc671162cc8b55 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 12:24:20 +0530 Subject: [PATCH 04/12] minor changes --- functions.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/functions.php b/functions.php index 33bbf04..9953a4e 100644 --- a/functions.php +++ b/functions.php @@ -891,7 +891,6 @@ function display_rich_snippet( $content ) { $video .= ''; } if ( '' != trim( $video_duration ) ) { - // Assuming $video_duration is in a human-readable format like "1:30:45" (H:M:S) $duration_parts = explode( ':', $video_duration ); // Build the ISO 8601 format @@ -907,7 +906,6 @@ function display_rich_snippet( $content ) { } if ( '' != trim( $video_date ) ) { $video .= ''; - error_log(print_r($video_date, true)); } $video .= '
'; From 96179843e0bae913f13aba5c545216e663c13c69 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 12:59:31 +0530 Subject: [PATCH 05/12] added support for uploadDate with timezone warning --- functions.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 9953a4e..af1859e 100644 --- a/functions.php +++ b/functions.php @@ -905,7 +905,19 @@ function display_rich_snippet( $content ) { $video .= ''; } if ( '' != trim( $video_date ) ) { - $video .= ''; + try { + // Create a DateTime object from the $video_date string + $datetime = new DateTime($video_date, new DateTimeZone('UTC')); // Set the timezone, adjust as needed + + // 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 .= ''; + } catch (Exception $e) { + // Handle exceptions if the date format is invalid + error_log('Invalid date format for video upload date: ' . $video_date); + } } $video .= '
'; From 34ae6c9680424e3ad60a543f503b806ec04f9b77 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 13:03:27 +0530 Subject: [PATCH 06/12] added support for uploadDate --- functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index af1859e..9bdc61a 100644 --- a/functions.php +++ b/functions.php @@ -906,8 +906,11 @@ function display_rich_snippet( $content ) { } if ( '' != trim( $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('UTC')); // Set the timezone, adjust as needed + $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 From a1b2d08d832d64958466f11e5d181ad8df2bf3d2 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 13:08:52 +0530 Subject: [PATCH 07/12] Resolved url redirect issue for Test Rich Snippets button. --- index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.php b/index.php index f66e0e7..83e1eba 100644 --- a/index.php +++ b/index.php @@ -76,7 +76,6 @@ public function define_constants() { */ 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; } @@ -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' ), ) ); From d2015eb308e022f01e897fc40d70785095285efd Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 13:13:48 +0530 Subject: [PATCH 08/12] added changelog --- README.md | 4 ++++ readme.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 942e34d..c405b86 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,10 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et ## Changelog ## +### 1.6.10 ### +- Fixed: Added the uploadDate field to the $video string in the correct ISO 8601 format with timezone. +- Fixed: Resolved url redirect issue for Test Rich Snippets button. + ### 1.6.9 ### - Improvement: Improved plugin codebase for better security. diff --git a/readme.txt b/readme.txt index 5dce84d..839df37 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,10 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et == Changelog == += 1.6.10 = +- Fixed: Added the uploadDate field to the $video string in the correct ISO 8601 format with timezone. +- Fixed: Resolved url redirect issue for Test Rich Snippets button. + = 1.6.9 = - Improvement: Improved plugin codebase for better security. From b215789fb007fc5853e3139d997ee11b93445ba8 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 13:21:43 +0530 Subject: [PATCH 09/12] added release command for AIOSRS --- Gruntfile.js | 115 +++++++++++++++++++++++++--------------------- package-lock.json | 107 ++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 170 insertions(+), 53 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 867d13e..954482c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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'; }; diff --git a/package-lock.json b/package-lock.json index 38556a4..8045420 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "grunt": "^1.6.1", "grunt-wp-i18n": "^1.0.3", "grunt-wp-readme-to-markdown": "~2.0.1", + "grunt-zip": "^1.0.0", "js-yaml": ">=3.13.1", "minimist": ">=1.2.3" } @@ -158,6 +159,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -480,6 +487,15 @@ "node": ">= 8" } }, + "node_modules/grunt-retro": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/grunt-retro/-/grunt-retro-0.6.4.tgz", + "integrity": "sha512-kqnvNUAngOhkDckEQPYFDqNcRlculVp/Sy+gCe4ey7utM4BCaENVf2JfDeK488mj/0cgmAZyXwpW6w9l1OAxMg==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/grunt-wp-i18n": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/grunt-wp-i18n/-/grunt-wp-i18n-1.0.3.tgz", @@ -505,6 +521,22 @@ "grunt": ">=0.4.0" } }, + "node_modules/grunt-zip": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-zip/-/grunt-zip-1.0.0.tgz", + "integrity": "sha512-e5HOzf+BLFR6rXM67oGrFcVgfVbLDPBnv29YdWTupthwNg/1y91B0xXx667E6dKin8YvrwDShtQy48D1NRzn7g==", + "dev": true, + "dependencies": { + "grunt-retro": "~0.6.0", + "jszip": "^3.8.0" + }, + "bin": { + "grunt-zip": "bin/grunt-zip" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/grunt/node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -636,6 +668,12 @@ "node": ">=0.10.0" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -764,6 +802,12 @@ "node": ">=0.10.0" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -792,6 +836,42 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -801,6 +881,15 @@ "node": ">=0.10.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/liftup": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", @@ -1015,6 +1104,12 @@ "os-tmpdir": "^1.0.0" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, "node_modules/parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -1086,6 +1181,12 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "node_modules/readable-stream": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", @@ -1150,6 +1251,12 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", diff --git a/package.json b/package.json index 268d7c7..8ee9946 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "grunt": "^1.6.1", "grunt-wp-i18n": "^1.0.3", "grunt-wp-readme-to-markdown": "~2.0.1", + "grunt-zip": "^1.0.0", "js-yaml": ">=3.13.1", "minimist": ">=1.2.3" } From d22bd8316ca55ccaa1e2550781a524670ebf6177 Mon Sep 17 00:00:00 2001 From: Vijeta Raikar <110518282+vijetaR@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:41:17 +0530 Subject: [PATCH 10/12] Fix:phpcs --- functions.php | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/functions.php b/functions.php index 9bdc61a..90ad8ca 100644 --- a/functions.php +++ b/functions.php @@ -284,7 +284,6 @@ function display_rich_snippet( $content ) { $review .= '
' . esc_attr( stripslashes( $item_video['video_date'] ) ) . '
'; } $review .= "
" . esc_attr( stripslashes( $item_video_date ) ) . '
'; - echo $item_video_date; } if ( '' != trim( $item_video_thumb ) ) { $review .= ''; @@ -892,34 +891,36 @@ function display_rich_snippet( $content ) { } if ( '' != trim( $video_duration ) ) { $duration_parts = explode( ':', $video_duration ); - - // Build the ISO 8601 format - $hours = isset( $duration_parts[0] ) ? $duration_parts[0] : 0; + + // 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 + + // 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 + + // Add the meta tag with the correct duration format. $video .= ''; - } + } if ( '' != trim( $video_date ) ) { try { - // Get the server's timezone + // 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 .= ''; - } catch (Exception $e) { - // Handle exceptions if the date format is invalid - error_log('Invalid date format for video upload date: ' . $video_date); + + // 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 .= ''; + } catch ( Exception $e ) { + // Handle exceptions if the date format is invalid. + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + wp_die( 'Invalid date format for video upload date: ' . esc_html( $video_date ) ); + } } } $video .= ' From 827bf7e3bde54d0c061bffe566730ecf78ad9118 Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 14:02:36 +0530 Subject: [PATCH 11/12] pot file and version number updated --- README.md | 2 +- index.php | 4 ++-- .../all-in-one-schemaorg-rich-snippets.pot | 20 +++++++++---------- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c405b86..74afb60 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/index.php b/index.php index 83e1eba..dcc57bd 100644 --- a/index.php +++ b/index.php @@ -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 * @@ -68,7 +68,7 @@ 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' ); } /** diff --git a/languages/all-in-one-schemaorg-rich-snippets.pot b/languages/all-in-one-schemaorg-rich-snippets.pot index c8f4ba1..f100286 100644 --- a/languages/all-in-one-schemaorg-rich-snippets.pot +++ b/languages/all-in-one-schemaorg-rich-snippets.pot @@ -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" @@ -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 "" diff --git a/package-lock.json b/package-lock.json index 8045420..bb90427 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "all-in-one-schemaorg-rich-snippets", - "version": "1.6.9", + "version": "1.6.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "all-in-one-schemaorg-rich-snippets", - "version": "1.6.9", + "version": "1.6.10", "devDependencies": { "grunt": "^1.6.1", "grunt-wp-i18n": "^1.0.3", diff --git a/package.json b/package.json index 8ee9946..d9b36f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "all-in-one-schemaorg-rich-snippets", - "version": "1.6.9", + "version": "1.6.10", "main": "Gruntfile.js", "author": "Brainstorm Force", "devDependencies": { diff --git a/readme.txt b/readme.txt index 839df37..6294527 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce 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. From 7e780dfe09a124c5e620c80e5bb1139f655cb1bf Mon Sep 17 00:00:00 2001 From: Akshay Urankar Date: Thu, 19 Sep 2024 16:04:52 +0530 Subject: [PATCH 12/12] resolved pr feedback --- README.md | 2 +- functions.php | 5 +---- readme.txt | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 74afb60..acd79e3 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et ## Changelog ## ### 1.6.10 ### -- Fixed: Added the uploadDate field to the $video string in the correct ISO 8601 format with timezone. +- 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 ### diff --git a/functions.php b/functions.php index 90ad8ca..da9cf3d 100644 --- a/functions.php +++ b/functions.php @@ -917,10 +917,7 @@ function display_rich_snippet( $content ) { // Add the uploadDate field to the $video string. $video .= ''; } catch ( Exception $e ) { - // Handle exceptions if the date format is invalid. - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { - wp_die( 'Invalid date format for video upload date: ' . esc_html( $video_date ) ); - } + return; } } $video .= ' diff --git a/readme.txt b/readme.txt index 6294527..a79bdb1 100644 --- a/readme.txt +++ b/readme.txt @@ -81,7 +81,7 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et == Changelog == = 1.6.10 = -- Fixed: Added the uploadDate field to the $video string in the correct ISO 8601 format with timezone. +- 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 =