auto-patch 748-dev-dev01-2024-06-08T22_32_58
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
# This file is distributed under the same license as the WooCommerce plugin.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WooCommerce 8.9.1\n"
|
||||
"Project-Id-Version: WooCommerce 8.9.2\n"
|
||||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-05-20T14:48:10+00:00\n"
|
||||
"POT-Creation-Date: 2024-05-30T15:21:08+00:00\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"X-Generator: WP-CLI 2.10.0\n"
|
||||
"X-Domain: woocommerce\n"
|
||||
@@ -22643,12 +22643,12 @@ msgstr ""
|
||||
msgid "Error: Delivery URL returned response code: %s"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-woocommerce.php:1090
|
||||
#: includes/class-woocommerce.php:1105
|
||||
msgid "You have installed a development version of WooCommerce which requires files to be built and minified. From the plugin directory, run <code>pnpm install</code> and then <code>pnpm --filter='@woocommerce/plugin-woocommerce' build</code> to build and minify assets."
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: URL of WordPress.org Repository 2: URL of the GitHub Repository release page
|
||||
#: includes/class-woocommerce.php:1093
|
||||
#: includes/class-woocommerce.php:1108
|
||||
msgid "Or you can download a pre-built version of the plugin from the <a href=\"%1$s\">WordPress.org repository</a> or by visiting <a href=\"%2$s\">the releases page in the GitHub repository</a>."
|
||||
msgstr ""
|
||||
|
||||
@@ -39417,7 +39417,7 @@ msgstr ""
|
||||
msgid "Order attribution field: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/Internal/Orders/OrderAttributionController.php:468
|
||||
#: src/Internal/Orders/OrderAttributionController.php:464
|
||||
#: templates/order/attribution-details.php:27
|
||||
msgid "Origin"
|
||||
msgstr ""
|
||||
|
||||
@@ -41,7 +41,7 @@ final class WooCommerce {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $version = '8.9.1';
|
||||
public $version = '8.9.2';
|
||||
|
||||
/**
|
||||
* WooCommerce Schema version.
|
||||
@@ -248,7 +248,9 @@ final class WooCommerce {
|
||||
add_action( 'init', array( 'WC_Emails', 'init_transactional_emails' ) );
|
||||
add_action( 'init', array( $this, 'add_image_sizes' ) );
|
||||
add_action( 'init', array( $this, 'load_rest_api' ) );
|
||||
add_action( 'init', array( 'WC_Site_Tracking', 'init' ) );
|
||||
if ( $this->is_request( 'admin' ) || ( $this->is_rest_api_request() && ! $this->is_store_api_request() ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
||||
add_action( 'init', array( 'WC_Site_Tracking', 'init' ) );
|
||||
}
|
||||
add_action( 'switch_blog', array( $this, 'wpdb_table_fix' ), 0 );
|
||||
add_action( 'activated_plugin', array( $this, 'activated_plugin' ) );
|
||||
add_action( 'deactivated_plugin', array( $this, 'deactivated_plugin' ) );
|
||||
@@ -461,6 +463,19 @@ final class WooCommerce {
|
||||
return apply_filters( 'woocommerce_is_rest_api_request', $is_rest_api_request );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the request is a store REST API request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_store_api_request() {
|
||||
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
|
||||
return false;
|
||||
}
|
||||
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
||||
return false !== strpos( $_SERVER['REQUEST_URI'], trailingslashit( rest_get_url_prefix() ) . 'wc/store/' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load REST API.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@ Tags: online store, ecommerce, shop, shopping cart, sell online, storefront, che
|
||||
Requires at least: 6.4
|
||||
Tested up to: 6.5
|
||||
Requires PHP: 7.4
|
||||
Stable tag: 8.8.3
|
||||
Stable tag: 8.9.1
|
||||
License: GPLv3
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
@@ -165,15 +165,11 @@ WooCommerce comes with some sample data you can use to see how products look; im
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 8.9.1 2024-05-21 =
|
||||
= 8.9.2 2024-06-04 =
|
||||
|
||||
**WooCommerce**
|
||||
|
||||
* Fix - Automated installation of the Legacy REST API plugin should only happen once. After that, it must be installed manually (if needed). [#47563](https://github.com/woocommerce/woocommerce/pull/47563)
|
||||
* Fix - Fixes a crash in the modal block editor when the Add button is clicked with Gutenberg 18.3.0 and later [#47561](https://github.com/woocommerce/woocommerce/pull/47561)
|
||||
* Fix - Fix warning when loading guest sessions from previous sessions. [#47514](https://github.com/woocommerce/woocommerce/pull/47514)
|
||||
* Fix - Prevent calling woocommerce.com on empty update-check and update-check-public payload. [#47507](https://github.com/woocommerce/woocommerce/pull/47507)
|
||||
|
||||
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
|
||||
|
||||
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/changelog.txt).
|
||||
/trunk/changelog.txt).
|
||||
|
||||
@@ -16,7 +16,6 @@ use WC_Customer;
|
||||
use WC_Log_Levels;
|
||||
use WC_Logger_Interface;
|
||||
use WC_Order;
|
||||
use WC_Tracks;
|
||||
|
||||
/**
|
||||
* Class OrderAttributionController
|
||||
@@ -437,12 +436,9 @@ class OrderAttributionController implements RegisterHooksInterface {
|
||||
'customer_registered' => $order->get_customer_id() ? 'yes' : 'no',
|
||||
);
|
||||
|
||||
$this->proxy->call_static(
|
||||
WC_Tracks::class,
|
||||
'record_event',
|
||||
'order_attribution',
|
||||
$tracks_data
|
||||
);
|
||||
if ( function_exists( 'wc_admin_record_tracks_event' ) ) {
|
||||
wc_admin_record_tracks_event( 'order_attribution', $tracks_data );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'woocommerce/woocommerce',
|
||||
'pretty_version' => '8.9.1',
|
||||
'version' => '8.9.1.0',
|
||||
'pretty_version' => '8.9.2',
|
||||
'version' => '8.9.2.0',
|
||||
'reference' => null,
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
@@ -167,8 +167,8 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'woocommerce/woocommerce' => array(
|
||||
'pretty_version' => '8.9.1',
|
||||
'version' => '8.9.1.0',
|
||||
'pretty_version' => '8.9.2',
|
||||
'version' => '8.9.2.0',
|
||||
'reference' => null,
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,15 +11,15 @@ return array(
|
||||
'path' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php'
|
||||
),
|
||||
'44e8414cd27982ecf86403af6e48f123' => array(
|
||||
'version' => '8.9.1.0',
|
||||
'version' => '8.9.2.0',
|
||||
'path' => $baseDir . '/src/StoreApi/deprecated.php'
|
||||
),
|
||||
'9ce98895d0a470c71998c4b530020d26' => array(
|
||||
'version' => '8.9.1.0',
|
||||
'version' => '8.9.2.0',
|
||||
'path' => $baseDir . '/src/StoreApi/functions.php'
|
||||
),
|
||||
'c379ea42c3f5964a973a7106b08c5ef0' => array(
|
||||
'version' => '8.9.1.0',
|
||||
'version' => '8.9.2.0',
|
||||
'path' => $baseDir . '/src/Blocks/Domain/Services/functions.php'
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: WooCommerce
|
||||
* Plugin URI: https://woocommerce.com/
|
||||
* Description: An ecommerce toolkit that helps you sell anything. Beautifully.
|
||||
* Version: 8.9.1
|
||||
* Version: 8.9.2
|
||||
* Author: Automattic
|
||||
* Author URI: https://woocommerce.com
|
||||
* Text Domain: woocommerce
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,9 @@
|
||||
v2.7.18
|
||||
# Improvement: Course schema - Updated course workload to ISO format.
|
||||
# Improvement: Product Schema - Added new fields hasMerchantReturnPolicy and shippingDetails under offers in merchant listings.
|
||||
# Improvement: Review Schema - Updated fields hasCourseInstance and offers when item type is course.
|
||||
# Fix: Review Schema - Throwing error related to shortcode returns the word 'array'.
|
||||
|
||||
v2.7.17
|
||||
# Improvement: Compatibility with WordPress version 6.5.
|
||||
# Improvement: Updated Course schema as per Google's new guidelines.
|
||||
|
||||
@@ -257,6 +257,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Markup' ) ) {
|
||||
}
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$rating = '';
|
||||
if ( ! empty( $rating_enabled ) ) {
|
||||
ob_start();
|
||||
|
||||
@@ -305,10 +306,14 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Markup' ) ) {
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$content .= ob_get_clean();
|
||||
$rating .= ob_get_clean();
|
||||
}
|
||||
|
||||
return $content;
|
||||
if(is_string( $content ) ) {
|
||||
return $content . $rating;
|
||||
} else {
|
||||
return $rating;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -677,12 +677,12 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
),
|
||||
'course-mode' => array(
|
||||
'label' => esc_html__( 'Course Mode', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'description' => esc_html__( 'The medium or means of delivery of the course instance or the mode of study, either as a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or as a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous )', 'wp-schema-pro' ),
|
||||
'course-mode' => array(
|
||||
'label' => esc_html__( 'Course Mode', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'custom-text',
|
||||
'dropdown-type' => 'course-attendance-mode',
|
||||
'required' => false,
|
||||
),
|
||||
'image' => array(
|
||||
'label' => esc_html__( 'Image', 'wp-schema-pro' ),
|
||||
@@ -697,15 +697,6 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'required' => true,
|
||||
'description' => esc_html__( 'The status of the Course Instance.', 'wp-schema-pro' ),
|
||||
|
||||
),
|
||||
'event-attendance-mode' => array(
|
||||
'label' => esc_html__( 'Course Attendance Mode', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'custom-text',
|
||||
'dropdown-type' => 'event-attendance-mode',
|
||||
'required' => false,
|
||||
'description' => esc_html__( 'The location of the Course Instance. There are different requirements depending on if the Course is happening online or at a physical location.', 'wp-schema-pro' ),
|
||||
|
||||
),
|
||||
'start-date' => array(
|
||||
'label' => esc_html__( 'Start Date', 'wp-schema-pro' ),
|
||||
@@ -736,7 +727,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
),
|
||||
'course-workload' => array(
|
||||
'label' => esc_html__( 'Course Workload', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'type' => 'time-duration',
|
||||
'required' => true,
|
||||
'default' => 'none',
|
||||
),
|
||||
@@ -1552,58 +1543,162 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'guideline-link' => empty( $doc_link ) ? 'https://wpschema.com/docs/add-a-schema-markup-for-a-product-page/' : 'https://developers.google.com/search/docs/data-types/products',
|
||||
'path' => BSF_AIOSRS_PRO_DIR . 'classes/schema/',
|
||||
'subkeys' => array(
|
||||
'name' => array(
|
||||
'name' => array(
|
||||
'label' => esc_html__( 'Product Name', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'post_title',
|
||||
'required' => true,
|
||||
),
|
||||
'brand-name' => array(
|
||||
'brand-name' => array(
|
||||
'label' => esc_html__( 'Product Brand', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
),
|
||||
'image' => array(
|
||||
'image' => array(
|
||||
'label' => esc_html__( 'Product Image', 'wp-schema-pro' ),
|
||||
'type' => 'image',
|
||||
'default' => 'featured_img',
|
||||
'required' => true,
|
||||
),
|
||||
'url' => array(
|
||||
'url' => array(
|
||||
'label' => esc_html__( 'Product URL', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'post_permalink',
|
||||
),
|
||||
'description' => array(
|
||||
'description' => array(
|
||||
'label' => esc_html__( 'Product Description', 'wp-schema-pro' ),
|
||||
'type' => 'textarea',
|
||||
'default' => 'post_content',
|
||||
),
|
||||
'sku' => array(
|
||||
'sku' => array(
|
||||
'label' => esc_html__( 'Product SKU', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'create-field',
|
||||
'description' => esc_html__( 'The Stock Keeping Unit (SKU) is a unique numerical identifying number that refers to a specific stock item in a retailers inventory or product catalog.', 'wp-schema-pro' ),
|
||||
'description' => esc_html__( 'The Stock Keeping Unit (SKU) is a unique numerical identifying number that refers to a specific stock item in a retailer\'s inventory or product catalog.', 'wp-schema-pro' ),
|
||||
),
|
||||
'mpn' => array(
|
||||
'mpn' => array(
|
||||
'label' => esc_html__( 'Product MPN', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'create-field',
|
||||
'description' => esc_html__( 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers. e.g. "925872"', 'wp-schema-pro' ),
|
||||
),
|
||||
'avail' => array(
|
||||
'avail' => array(
|
||||
'label' => esc_html__( 'Product Availability', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'availability',
|
||||
),
|
||||
'price-valid-until' => array(
|
||||
'merchant-return-policy' => array(
|
||||
'label' => esc_html__( 'Merchant Return Policy', 'wp-schema-pro' ),
|
||||
'type' => 'repeater',
|
||||
'fields' => array(
|
||||
'applicableCountry' => array(
|
||||
'label' => esc_html__( 'Applicable Country', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'US',
|
||||
),
|
||||
'returnPolicyCategory' => array(
|
||||
'label' => esc_html__( 'Return Policy Category', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'returnPolicyCategory',
|
||||
),
|
||||
'merchantReturnDays' => array(
|
||||
'label' => esc_html__( 'Merchant Return Days', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 30,
|
||||
),
|
||||
'returnFees' => array(
|
||||
'label' => esc_html__( 'Return Fees', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'returnFees',
|
||||
),
|
||||
'returnMethod' => array(
|
||||
'label' => esc_html__( 'Return Method', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'dropdown-type' => 'returnMethod',
|
||||
),
|
||||
'returnShippingFeesAmount' => array(
|
||||
'label' => esc_html__( 'Return Shipping Fees Amount', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'merchantCurrency' => array(
|
||||
'label' => esc_html__( 'Currency', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'currency',
|
||||
),
|
||||
),
|
||||
),
|
||||
'shippingDetails' => array(
|
||||
'label' => esc_html__( 'Shipping Details', 'wp-schema-pro' ),
|
||||
'type' => 'repeater',
|
||||
'fields' => array(
|
||||
'shippingDestination' => array(
|
||||
'label' => esc_html__( 'Shipping Destination', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'country',
|
||||
),
|
||||
'handlingTimeMinValue' => array(
|
||||
'label' => esc_html__( 'Min Handling Time', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'unitCode' => array(
|
||||
'label' => esc_html__( 'Unit Code', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'DAY',
|
||||
),
|
||||
'handlingTimeMaxValue' => array(
|
||||
'label' => esc_html__( 'Max Handling Time', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'transitTimeMinValue' => array(
|
||||
'label' => esc_html__( 'Min Transit Time', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'transitTimeMaxValue' => array(
|
||||
'label' => esc_html__( 'Max Transit Time', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'shippingRate' => array(
|
||||
'label' => esc_html__( 'Shipping Rate', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
),
|
||||
'shippingCurrency' => array(
|
||||
'label' => esc_html__( 'Currency', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'currency',
|
||||
),
|
||||
'shippingCost' => array(
|
||||
'label' => esc_html__( 'Shipping Cost', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
|
||||
),
|
||||
'shippingCurrency' => array(
|
||||
'label' => esc_html__( 'Currency', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'currency',
|
||||
),
|
||||
),
|
||||
),
|
||||
'price-valid-until' => array(
|
||||
'label' => esc_html__( 'Price Valid Until', 'wp-schema-pro' ),
|
||||
'type' => 'datetime-local',
|
||||
'default' => 'create-field',
|
||||
'description' => esc_html__( 'The date after which the price will no longer be available. e.g. "31/12/2021 09:00 AM"', 'wp-schema-pro' ),
|
||||
),
|
||||
'price' => array(
|
||||
'price' => array(
|
||||
'label' => esc_html__( 'Product Price', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
@@ -1612,13 +1707,13 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'step' => '0.01',
|
||||
),
|
||||
),
|
||||
'currency' => array(
|
||||
'currency' => array(
|
||||
'label' => esc_html__( 'Currency', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'currency',
|
||||
),
|
||||
'product-review' => array(
|
||||
'product-review' => array(
|
||||
'label' => esc_html__( 'Review', 'wp-schema-pro' ),
|
||||
'type' => 'repeater',
|
||||
'fields' => array(
|
||||
@@ -1649,50 +1744,18 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
),
|
||||
),
|
||||
),
|
||||
'rating' => array(
|
||||
'rating' => array(
|
||||
'label' => esc_html__( 'Rating', 'wp-schema-pro' ),
|
||||
'type' => 'rating',
|
||||
'default' => 'accept-user-rating',
|
||||
'description' => esc_html__( 'To maintain accurate product information, kindly provide at least one rating.', 'wp-schema-pro' ),
|
||||
),
|
||||
'review-count' => array(
|
||||
'review-count' => array(
|
||||
'label' => esc_html__( 'Review Count', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'description' => esc_html__( 'The count of total number of reviews. e.g. "11"', 'wp-schema-pro' ),
|
||||
),
|
||||
'product-review' => array(
|
||||
'label' => esc_html__( 'Review', 'wp-schema-pro' ),
|
||||
'type' => 'repeater',
|
||||
'description' => esc_html__( 'To ensure the accuracy of our product ratings, kindly provide at least one review.', 'wp-schema-pro' ),
|
||||
'fields' => array(
|
||||
'reviewer-type' => array(
|
||||
'label' => esc_html__( 'Reviewer Type', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'Person',
|
||||
'choices' => array(
|
||||
'Person' => esc_html__( 'Person', 'wp-schema-pro' ),
|
||||
'Organization' => esc_html__( 'Organization', 'wp-schema-pro' ),
|
||||
),
|
||||
),
|
||||
'reviewer-name' => array(
|
||||
'label' => esc_html__( 'Reviewer Name', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'author_name',
|
||||
'required' => true,
|
||||
),
|
||||
'product-rating' => array(
|
||||
'label' => esc_html__( 'Product Rating', 'wp-schema-pro' ),
|
||||
'type' => 'rating',
|
||||
'default' => 'none',
|
||||
),
|
||||
'review-body' => array(
|
||||
'label' => esc_html__( 'Review Body', 'wp-schema-pro' ),
|
||||
'type' => 'textarea',
|
||||
'default' => 'post_content',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'bsf-aiosrs-recipe' => array(
|
||||
@@ -2091,16 +2154,14 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'is_recommnded' => true,
|
||||
'fields' => array(
|
||||
'clip-name' => array(
|
||||
'label' => esc_html__( 'Clip Name', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'label' => esc_html__( 'Clip Name', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
),
|
||||
'clip-start-offset' => array(
|
||||
'label' => esc_html__( 'Clip Start Offset', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'description' => esc_html__( 'The start time of the clip expressed as the number of seconds from the beginning of the work.', 'wp-schema-pro' ),
|
||||
),
|
||||
'clip-end-offset' => array(
|
||||
@@ -2113,7 +2174,6 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'label' => esc_html__( 'Clip URL', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'description' => esc_html__( 'A URL that points to the start time of the clip.', 'wp-schema-pro' ),
|
||||
),
|
||||
),
|
||||
@@ -2131,9 +2191,10 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'description' => esc_html__( 'A URL that points to the start time of the clip.', 'wp-schema-pro' ),
|
||||
),
|
||||
'thumbnail-url' => array(
|
||||
'label' => esc_html__( 'Thumbnail URL', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'label' => esc_html__( 'Thumbnail URL', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
),
|
||||
'regions-allowed' => array(
|
||||
'label' => esc_html__( 'Regions Allowed', 'wp-schema-pro' ),
|
||||
@@ -2141,22 +2202,19 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'default' => 'none',
|
||||
),
|
||||
'is-live-broadcast' => array(
|
||||
'label' => esc_html__( 'Is Live Broadcast', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => false,
|
||||
'required' => true,
|
||||
'label' => esc_html__( 'Is Live Broadcast', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => false,
|
||||
),
|
||||
'start-date' => array(
|
||||
'label' => esc_html__( 'Live Broadcast Start Date', 'wp-schema-pro' ),
|
||||
'type' => 'datetime-local',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'label' => esc_html__( 'Live Broadcast Start Date', 'wp-schema-pro' ),
|
||||
'type' => 'datetime-local',
|
||||
'default' => 'none',
|
||||
),
|
||||
'end-date' => array(
|
||||
'label' => esc_html__( 'Live Broadcast End Date', 'wp-schema-pro' ),
|
||||
'type' => 'datetime-local',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
'label' => esc_html__( 'Live Broadcast End Date', 'wp-schema-pro' ),
|
||||
'type' => 'datetime-local',
|
||||
'default' => 'none',
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -2414,9 +2472,57 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'type' => 'text',
|
||||
'default' => 'blogname',
|
||||
),
|
||||
'course-instance' => array(
|
||||
'label' => esc_html__( 'Course Instance', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'course-instance',
|
||||
),
|
||||
'name' => array(
|
||||
'label' => esc_html__( 'Instance Name', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
),
|
||||
'description' => array(
|
||||
'label' => esc_html__( 'Instance Description', 'wp-schema-pro' ),
|
||||
'type' => 'textarea',
|
||||
'default' => 'none',
|
||||
'required' => true,
|
||||
),
|
||||
'category' => array(
|
||||
'label' => esc_html__( 'Category', 'wp-schema-pro' ),
|
||||
'type' => 'text',
|
||||
'label' => esc_html__( 'Offer Category', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'none',
|
||||
'dropdown-type' => 'offer-category',
|
||||
),
|
||||
'price' => array(
|
||||
'label' => esc_html__( 'Price', 'wp-schema-pro' ),
|
||||
'type' => 'number',
|
||||
'attrs' => array(
|
||||
'min' => '0',
|
||||
'step' => 'any',
|
||||
),
|
||||
),
|
||||
'courseMode' => array(
|
||||
'label' => esc_html__( 'Course Attendance Mode', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'custom-text',
|
||||
'dropdown-type' => 'course-attendance-mode',
|
||||
'required' => false,
|
||||
'description' => esc_html__( 'The location of the Course Instance. There are different requirements depending on if the Course is happening online or at a physical location.', 'wp-schema-pro' ),
|
||||
),
|
||||
'course-workload' => array(
|
||||
'label' => esc_html__( 'Course Workload', 'wp-schema-pro' ),
|
||||
'type' => 'time-duration',
|
||||
'required' => true,
|
||||
'default' => 'none',
|
||||
),
|
||||
'currency' => array(
|
||||
'label' => esc_html__( 'Currency', 'wp-schema-pro' ),
|
||||
'type' => 'dropdown',
|
||||
'default' => 'custom-text',
|
||||
'dropdown-type' => 'currency',
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -4010,17 +4116,65 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'course-instance':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_course_instance_options',
|
||||
array(
|
||||
'Yes' => __( 'Yes', 'wp-schema-pro' ),
|
||||
'No' => __( 'No', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'offer-category':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_offer_category_options',
|
||||
array(
|
||||
'Free' => __( 'Free', 'wp-schema-pro' ),
|
||||
'Free' => __( 'Free', 'wp-schema-pro' ),
|
||||
'PartiallyFree' => __( 'Partially Free', 'wp-schema-pro' ),
|
||||
'Subscription' => __( 'Subscription', 'wp-schema-pro' ),
|
||||
'Paid' => __( 'Paid', 'wp-schema-pro' ),
|
||||
'Subscription' => __( 'Subscription', 'wp-schema-pro' ),
|
||||
'Paid' => __( 'Paid', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
break;
|
||||
case 'hasmerchantreturnpolicy':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_has_merchant_return_policy_options',
|
||||
array(
|
||||
'Yes' => __( 'Yes', 'wp-schema-pro' ),
|
||||
'No' => __( 'No', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'returnPolicyCategory':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_return_policy_category_options',
|
||||
array(
|
||||
'https://schema.org/MerchantReturnFiniteReturnWindow' => __( 'Finite Return Window', 'wp-schema-pro' ),
|
||||
'https://schema.org/MerchantReturnNotPermitted' => __( 'Not Permitted', 'wp-schema-pro' ),
|
||||
'https://schema.org/MerchantReturnUnlimitedWindow' => __( 'Unlimited Window', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'returnFees':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_return_fees_options',
|
||||
array(
|
||||
'https://schema.org/FreeReturn' => __( 'Free Return', 'wp-schema-pro' ),
|
||||
'https://schema.org/ReturnFeesCustomerResponsibility' => __( 'Customer Responsibility', 'wp-schema-pro' ),
|
||||
'https://schema.org/ReturnShippingFees' => __( 'Return Shipping Fees', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'returnMethod':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_return_method_options',
|
||||
array(
|
||||
'https://schema.org/ReturnAtKiosk' => __( 'Return at Kiosk', 'wp-schema-pro' ),
|
||||
'https://schema.org/ReturnByMail' => __( 'Return by Mail', 'wp-schema-pro' ),
|
||||
'https://schema.org/ReturnInStore' => __( 'Return in Store', 'wp-schema-pro' ),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'event-status':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_event_status_options',
|
||||
@@ -4033,6 +4187,17 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'course-attendance-mode':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_course_attendance_mode_options',
|
||||
array(
|
||||
'Online' => __( 'Online', 'wp-schema-pro' ),
|
||||
'Onsite' => __( 'Physical Location', 'wp-schema-pro' ),
|
||||
'Blended' => __( 'Mix Of Online & Physical Locations', 'wp-schema-pro' ),
|
||||
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'event-attendance-mode':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_event_attendance_mode_options',
|
||||
@@ -4040,10 +4205,10 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
|
||||
'OfflineEventAttendanceMode' => __( 'Physical Location', 'wp-schema-pro' ),
|
||||
'OnlineEventAttendanceMode' => __( 'Online Event', 'wp-schema-pro' ),
|
||||
'MixedEventAttendanceMode' => __( 'Mix Of Online & Physical Locations', 'wp-schema-pro' ),
|
||||
|
||||
|
||||
)
|
||||
);
|
||||
break;
|
||||
break;
|
||||
case 'timezone':
|
||||
$return = apply_filters(
|
||||
'wp_schema_pro_event_timezone_options',
|
||||
|
||||
@@ -14,6 +14,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Product' ) ) {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class BSF_AIOSRS_Pro_Schema_Product {
|
||||
|
||||
|
||||
/**
|
||||
* Render Schema.
|
||||
@@ -49,6 +50,116 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Product' ) ) {
|
||||
$schema['aggregateRating']['ratingValue'] = ! empty( $data['rating'] ) ? wp_strip_all_tags( (string) $data['rating'] ) : null;
|
||||
$schema['aggregateRating']['reviewCount'] = ! empty( $data['review-count'] ) ? wp_strip_all_tags( (string) $data['review-count'] ) : null;
|
||||
}
|
||||
|
||||
// Initialize 'shippingDetails' array
|
||||
$shipping_details = array();
|
||||
|
||||
// Initialize 'deliveryTime' array
|
||||
$delivery_time = array();
|
||||
|
||||
// Modify the section where 'shippingDetails' are added to the schema
|
||||
if ( ! empty( $data['shippingDetails'] ) ) {
|
||||
// Iterate over each set of shipping details
|
||||
foreach ( $data['shippingDetails'] as $shipping_detail ) {
|
||||
// Initialize shipping detail array for this set
|
||||
$shipping = array();
|
||||
|
||||
// Add handlingTimeMinValue if available
|
||||
if ( ! empty( $shipping_detail['handlingTimeMinValue'] ) && $shipping_detail['handlingTimeMinValue'] !== 'none' ) {
|
||||
// Initialize 'deliveryTime' array
|
||||
$delivery_time = array();
|
||||
|
||||
// Add handlingTimeMinValue to 'deliveryTime' array
|
||||
$delivery_time['@type'] = 'ShippingDeliveryTime';
|
||||
$delivery_time['handlingTime']['minValue'] = wp_strip_all_tags( (string) $shipping_detail['handlingTimeMinValue'] );
|
||||
|
||||
|
||||
// Push the 'deliveryTime' array to 'shipping' array
|
||||
$shipping['deliveryTime'] = $delivery_time;
|
||||
}
|
||||
|
||||
if ( ! empty( $shipping_detail['unitCode'] ) && $shipping_detail['unitCode'] !== 'none' ) {
|
||||
$delivery_time['handlingTime']['unitCode'] = wp_strip_all_tags( (string) $shipping_detail['unitCode'] );
|
||||
|
||||
$delivery_time['transitTime']['unitCode'] = wp_strip_all_tags( (string) $shipping_detail['unitCode'] );
|
||||
}
|
||||
|
||||
// Add shipping destination
|
||||
if ( ! empty( $shipping_detail['shippingDestination'] ) && $shipping_detail['shippingDestination'] !== 'none' ) {
|
||||
// Initialize shipping destination array
|
||||
$shipping_destination = array();
|
||||
|
||||
// Add address country to shipping destination
|
||||
$shipping_destination['@type'] = 'DefinedRegion';
|
||||
$shipping_destination['addressCountry'] = $shipping_detail['shippingDestination']; // Assign selected country directly
|
||||
|
||||
$shipping['shippingDestination'] = $shipping_destination;
|
||||
}
|
||||
|
||||
// Add shipping rate
|
||||
if ( ! empty( $shipping_detail['shippingRate'] ) ) {
|
||||
// Initialize shipping rate array
|
||||
$shipping_rate = array();
|
||||
|
||||
// Add value and currency to shipping rate
|
||||
$shipping_rate['@type'] = 'MonetaryAmount';
|
||||
$shipping_rate['value'] = $shipping_detail['shippingRate'];
|
||||
$shipping_rate['currency'] = ! empty( $shipping_detail['shippingCurrency'] ) ? $shipping_detail['shippingCurrency'] : 'USD'; // Default to USD if currency not provided
|
||||
|
||||
$shipping['shippingRate'] = $shipping_rate;
|
||||
}
|
||||
|
||||
// Add handlingTimeMaxValue if available
|
||||
if ( ! empty( $shipping_detail['handlingTimeMaxValue'] ) && $shipping_detail['handlingTimeMaxValue'] !== 'none' ) {
|
||||
// Initialize 'deliveryTime' array if not already initialized
|
||||
if ( empty( $delivery_time ) ) {
|
||||
$delivery_time = array();
|
||||
}
|
||||
|
||||
// Add handlingTimeMaxValue to 'deliveryTime' array
|
||||
$delivery_time['handlingTime']['maxValue'] = wp_strip_all_tags( (string) $shipping_detail['handlingTimeMaxValue'] );
|
||||
|
||||
// Push the 'deliveryTime' array to 'shipping' array
|
||||
$shipping['deliveryTime'] = $delivery_time;
|
||||
}
|
||||
|
||||
// Add transitTimeMinValue if available
|
||||
if ( ! empty( $shipping_detail['transitTimeMinValue'] ) && $shipping_detail['transitTimeMinValue'] !== 'none' ) {
|
||||
// Initialize 'deliveryTime' array if not already initialized
|
||||
if ( empty( $delivery_time ) ) {
|
||||
$delivery_time = array();
|
||||
}
|
||||
|
||||
// Add transitTimeMinValue to 'deliveryTime' array
|
||||
$delivery_time['transitTime']['minValue'] = wp_strip_all_tags( (string) $shipping_detail['transitTimeMinValue'] );
|
||||
|
||||
|
||||
// Push the 'deliveryTime' array to 'shipping' array
|
||||
$shipping['deliveryTime'] = $delivery_time;
|
||||
}
|
||||
|
||||
// Add transitTimeMaxValue if available
|
||||
if ( ! empty( $shipping_detail['transitTimeMaxValue'] ) && $shipping_detail['transitTimeMaxValue'] !== 'none' ) {
|
||||
// Initialize 'deliveryTime' array if not already initialized
|
||||
if ( empty( $delivery_time ) ) {
|
||||
$delivery_time = array();
|
||||
}
|
||||
|
||||
// Add transitTimeMaxValue to 'deliveryTime' array
|
||||
$delivery_time['transitTime']['maxValue'] = wp_strip_all_tags( (string) $shipping_detail['transitTimeMaxValue'] );
|
||||
|
||||
// Push the 'deliveryTime' array to 'shipping' array
|
||||
$shipping['deliveryTime'] = $delivery_time;
|
||||
}
|
||||
|
||||
// Push the shipping detail to 'shippingDetails' array
|
||||
$shipping_details[] = $shipping;
|
||||
}
|
||||
|
||||
// Assign 'shippingDetails' array to 'offers'
|
||||
$schema['offers']['shippingDetails'] = $shipping_details;
|
||||
}
|
||||
|
||||
if ( apply_filters( 'wp_schema_pro_remove_product_offers', true ) ) {
|
||||
$schema['offers']['@type'] = 'Offer';
|
||||
$schema['offers']['price'] = '0';
|
||||
@@ -88,35 +199,80 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Product' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($data['merchant-return-policy']) && !empty($data['merchant-return-policy'] ) ) {
|
||||
// Initialize hasMerchantReturnPolicy array
|
||||
$schema['offers']['hasMerchantReturnPolicy'] = array();
|
||||
|
||||
foreach ($data['merchant-return-policy'] as $policy) {
|
||||
// Add each policy to hasMerchantReturnPolicy
|
||||
$return_policy = array();
|
||||
|
||||
$return_policy['@type'] = 'MerchantReturnPolicy';
|
||||
$return_policy['applicableCountry'] = isset($policy['applicableCountry']) ? wp_strip_all_tags((string)$policy['applicableCountry']) : null;
|
||||
// Validate length of applicableCountry
|
||||
if ($return_policy['applicableCountry'] && strlen($return_policy['applicableCountry']) > 2) {
|
||||
// Truncate or handle the string appropriately if it exceeds the maximum length
|
||||
$return_policy['applicableCountry'] = substr($return_policy['applicableCountry'], 0, 2);
|
||||
}
|
||||
$return_policy['returnPolicyCategory'] = isset($policy['returnPolicyCategory']) ? esc_url($policy['returnPolicyCategory']) : null;
|
||||
$return_policy['merchantReturnDays'] = isset($policy['merchantReturnDays']) ? intval($policy['merchantReturnDays']) : null;
|
||||
$return_policy['returnFees'] = isset($policy['returnFees']) ? esc_url($policy['returnFees']) : null;
|
||||
$return_policy['returnMethod'] = isset($policy['returnMethod']) ? esc_url($policy['returnMethod']) : null;
|
||||
|
||||
// Add returnShippingFeesAmount if returnFees is set to ReturnShippingFees
|
||||
if (
|
||||
isset($policy['returnFees']) &&
|
||||
$policy['returnFees'] === 'https://schema.org/ReturnShippingFees' &&
|
||||
isset($policy['returnShippingFeesAmount']) &&
|
||||
!empty($policy['returnShippingFeesAmount'])
|
||||
) {
|
||||
// Initialize returnShippingFeesAmount array
|
||||
$return_shipping_fees_amount = array();
|
||||
|
||||
// Add value and currency to returnShippingFeesAmount
|
||||
$return_shipping_fees_amount['@type'] = 'MonetaryAmount';
|
||||
$return_shipping_fees_amount['value'] = floatval($policy['returnShippingFeesAmount']);
|
||||
$return_shipping_fees_amount['currency'] = !empty($policy['merchantCurrency']) ? $policy['merchantCurrency'] : null; // Default to USD if currency not provided
|
||||
|
||||
$return_policy['returnShippingFeesAmount'] = $return_shipping_fees_amount;
|
||||
}
|
||||
|
||||
// Push the policy to hasMerchantReturnPolicy array
|
||||
$schema['offers']['hasMerchantReturnPolicy'][] = $return_policy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Fetch woocommerce review.
|
||||
if ( defined( 'WC_VERSION' ) && apply_filters( 'wp_schema_pro_add_woocommerce_review', false ) ) {
|
||||
$comments = get_comments(
|
||||
array(
|
||||
'number' => 5,
|
||||
'post_id' => $post['ID'],
|
||||
'status' => 'approve',
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'product',
|
||||
'parent' => 0,
|
||||
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
||||
array(
|
||||
'key' => 'rating',
|
||||
'type' => 'NUMERIC',
|
||||
'compare' => '>',
|
||||
'value' => 0,
|
||||
),
|
||||
$comments = get_comments(
|
||||
array(
|
||||
'number' => 5,
|
||||
'post_id' => $post['ID'],
|
||||
'status' => 'approve',
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'product',
|
||||
'parent' => 0,
|
||||
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
||||
array(
|
||||
'key' => 'rating',
|
||||
'type' => 'NUMERIC',
|
||||
'compare' => '>',
|
||||
'value' => 0,
|
||||
),
|
||||
)
|
||||
);
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
if ( $comments ) {
|
||||
foreach ( $comments as $key => $comment ) {
|
||||
$schema['review'][ $key ]['@type'] = 'Review';
|
||||
$schema['review'][ $key ]['reviewRating']['@type'] = 'Rating';
|
||||
$schema['review'][ $key ]['reviewRating']['ratingValue'] = get_comment_meta( $comment->comment_ID, 'rating', true );
|
||||
$schema['review'][ $key ]['author']['@type'] = 'Person';
|
||||
$schema['review'][ $key ]['author']['name'] = get_comment_author( $comment );
|
||||
$schema['review'][ $key ]['reviewBody'] = get_comment_text( $comment );
|
||||
$schema['review'][ $key ]['@type'] = 'Review';
|
||||
$schema['review'][ $key ]['reviewRating']['@type'] = 'Rating';
|
||||
$schema['review'][ $key ]['reviewRating']['ratingValue'] = get_comment_meta( $comment->comment_ID, 'rating', true );
|
||||
$schema['review'][ $key ]['author']['@type'] = 'Person';
|
||||
$schema['review'][ $key ]['author']['name'] = get_comment_author( $comment );
|
||||
$schema['review'][ $key ]['reviewBody'] = get_comment_text( $comment );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,11 +52,25 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Review' ) ) {
|
||||
$schema['itemReviewed']['@type'] = 'Course';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-course-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-name'] ) : null;
|
||||
$schema['itemReviewed']['description'] = ! empty( $data['bsf-aiosrs-course-description'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-description'] ) : null;
|
||||
|
||||
if ( isset( $data['bsf-aiosrs-course-orgnization-name'] ) && ! empty( $data['bsf-aiosrs-course-orgnization-name'] ) ) {
|
||||
$schema['itemReviewed']['provider']['@type'] = 'Organization';
|
||||
$schema['itemReviewed']['provider']['name'] = wp_strip_all_tags( (string) $data['bsf-aiosrs-course-orgnization-name'] );
|
||||
}
|
||||
//phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase.
|
||||
// Initialize 'hasCourseInstance' array.
|
||||
$hasCourseInstance = array();
|
||||
$schema['itemReviewed']['hasCourseInstance']['course-instance'] = ! empty( $data['bsf-aiosrs-course-course-instance'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-course-instance'] ) : null;
|
||||
$schema['itemReviewed']['hasCourseInstance']['courseMode'] = ! empty( $data['bsf-aiosrs-course-courseMode'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-courseMode'] ) : null;
|
||||
$schema['itemReviewed']['hasCourseInstance']['courseWorkload'] = ! empty( $data['bsf-aiosrs-course-course-workload'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-course-workload'] ) : null;
|
||||
|
||||
// Initialize 'offers' array.
|
||||
$offers = array();
|
||||
$schema['itemReviewed']['offers']['price'] = ! empty( $data['bsf-aiosrs-course-price'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-price'] ) : null;
|
||||
$schema['itemReviewed']['offers']['currency'] = ! empty( $data['bsf-aiosrs-course-currency'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-currency'] ) : null;
|
||||
$schema['itemReviewed']['offers']['category'] = ! empty( $data['bsf-aiosrs-course-category'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-course-category'] ) : null;
|
||||
break;
|
||||
|
||||
case 'bsf-aiosrs-event':
|
||||
$schema['itemReviewed']['@type'] = 'event';
|
||||
$schema['itemReviewed']['name'] = ! empty( $data['bsf-aiosrs-event-name'] ) ? wp_strip_all_tags( (string) $data['bsf-aiosrs-event-name'] ) : null;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
* Author: Brainstorm Force
|
||||
* Author URI: https://www.brainstormforce.com
|
||||
* Description: Schema Pro is the go-to plugin to adding Schema Markup on your website with ease. Enables you to display rich snippets on search engines and improve your overall page SEO.
|
||||
* Version: 2.7.17
|
||||
* Version: 2.7.18
|
||||
* Text Domain: wp-schema-pro
|
||||
* License: GPL2
|
||||
*
|
||||
@@ -70,7 +70,7 @@ define( 'BSF_AIOSRS_PRO_FILE', __FILE__ );
|
||||
define( 'BSF_AIOSRS_PRO_BASE', plugin_basename( BSF_AIOSRS_PRO_FILE ) );
|
||||
define( 'BSF_AIOSRS_PRO_DIR', plugin_dir_path( BSF_AIOSRS_PRO_FILE ) );
|
||||
define( 'BSF_AIOSRS_PRO_URI', plugins_url( '/', BSF_AIOSRS_PRO_FILE ) );
|
||||
define( 'BSF_AIOSRS_PRO_VER', '2.7.17' );
|
||||
define( 'BSF_AIOSRS_PRO_VER', '2.7.18' );
|
||||
define( 'BSF_AIOSRS_PRO_CACHE_KEY', 'wp_schema_pro_optimized_structured_data' );
|
||||
define( 'BSF_AIOSRS_PRO_WEBSITE_URL', 'https://wpschema.com/' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user