auto-patch 748-dev-dev01-2024-06-08T22_32_58

This commit is contained in:
root
2024-06-08 22:32:59 +00:00
parent b81216dce7
commit aa87a51361
25 changed files with 3628 additions and 3201 deletions

View File

@@ -44,6 +44,31 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<div class="about__section changelog has-subtle-background-color">
<div class="column">
<h2><?php _e( 'Maintenance and Security Release' ); ?></h2>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
10
),
'6.5.4',
'5'
);
?>
<?php
printf(
/* translators: %s: HelpHub URL. */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
sprintf(
/* translators: %s: WordPress version. */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( '6.5.4' )
)
);
?>
</p>
<p>
<?php
printf(

View File

@@ -1514,25 +1514,6 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,

File diff suppressed because one or more lines are too long

View File

@@ -1513,25 +1513,6 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,

File diff suppressed because one or more lines are too long

View File

@@ -1112,26 +1112,14 @@
*/
wp.updates.activatePluginSuccess = function( response ) {
var $message = $( '.plugin-card-' + response.slug + ', #plugin-information-footer' ).find( '.activating-message' ),
isInModal = 'plugin-information-footer' === $message.parent().attr( 'id' ),
buttonText = _x( 'Activated!', 'plugin' ),
ariaLabel = sprintf(
/* translators: %s: The plugin name. */
'%s activated successfully.',
response.pluginName
),
noticeData = {
id: 'plugin-activated-successfully',
className: 'notice-success',
message: sprintf(
/* translators: %s: The refresh link's attributes. */
__( 'Plugin activated. Some changes may not occur until you refresh the page. <a %s>Refresh Now</a>' ),
'href="#" class="button button-secondary refresh-page"'
),
slug: response.slug
},
noticeTarget;
);
wp.a11y.speak( __( 'Activation completed successfully. Some changes may not occur until you refresh the page.' ) );
wp.a11y.speak( __( 'Activation completed successfully.' ) );
$document.trigger( 'wp-plugin-activate-success', response );
$message
@@ -1140,7 +1128,7 @@
.attr( 'aria-label', ariaLabel )
.text( buttonText );
if ( isInModal ) {
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
wp.updates.setCardButtonStatus(
{
status: 'activated-plugin',
@@ -1151,26 +1139,13 @@
ariaLabel: ariaLabel
}
);
// Add a notice to the modal's footer.
$message.replaceWith( wp.updates.adminNotice( noticeData ) );
// Send notice information back to the parent screen.
noticeTarget = window.parent === window ? null : window.parent;
$.support.postMessage = !! window.postMessage;
if ( false !== $.support.postMessage && null !== noticeTarget && -1 === window.parent.location.pathname.indexOf( 'index.php' ) ) {
noticeTarget.postMessage(
JSON.stringify( noticeData ),
window.location.origin
);
}
} else {
// Add a notice to the top of the screen.
wp.updates.addAdminNotice( noticeData );
}
setTimeout( function() {
if ( isInModal ) {
$message.removeClass( 'activated-message' )
.text( _x( 'Active', 'plugin' ) );
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
wp.updates.setCardButtonStatus(
{
status: 'plugin-active',
@@ -1184,8 +1159,6 @@
)
}
);
} else {
$message.removeClass( 'activated-message' ).text( _x( 'Active', 'plugin' ) );
}
}, 1000 );
};
@@ -2664,41 +2637,16 @@
} );
/**
* Click handler for plugin activations in plugin activation view.
* Click handler for plugin activations in plugin activation modal view.
*
* @since 6.5.0
* @since 6.5.4 Redirect the parent window to the activation URL.
*
* @param {Event} event Event interface.
*/
$pluginFilter.on( 'click', '.activate-now', function( event ) {
var $activateButton = $( event.target );
$document.on( 'click', '#plugin-information-footer .activate-now', function( event ) {
event.preventDefault();
if ( $activateButton.hasClass( 'activating-message' ) || $activateButton.hasClass( 'button-disabled' ) ) {
return;
}
$activateButton
.removeClass( 'activate-now button-primary' )
.addClass( 'activating-message' )
.attr(
'aria-label',
sprintf(
/* translators: %s: Plugin name. */
_x( 'Activating %s', 'plugin' ),
$activateButton.data( 'name' )
)
)
.text( __( 'Activating...' ) );
wp.updates.activatePlugin(
{
name: $activateButton.data( 'name' ),
slug: $activateButton.data( 'slug' ),
plugin: $activateButton.data( 'plugin' )
}
);
window.parent.location.href = $( event.target ).attr( 'href' );
});
/**
@@ -3253,11 +3201,6 @@
return;
}
if ( 'undefined' !== typeof message.id && 'plugin-activated-successfully' === message.id ) {
wp.updates.addAdminNotice( message );
return;
}
if (
'undefined' !== typeof message.status &&
'undefined' !== typeof message.slug &&
@@ -3490,22 +3433,5 @@
} );
}
);
/**
* Click handler for page refresh link.
*
* @since 6.5.3
*
* @param {Event} event Event interface.
*/
$document.on( 'click', '.refresh-page', function( event ) {
event.preventDefault();
if ( window.parent === window ) {
window.location.reload();
} else {
window.parent.location.reload();
}
} );
} );
})( jQuery, window.wp, window._wpUpdatesSettings );

File diff suppressed because one or more lines are too long

View File

@@ -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 ""

View File

@@ -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' ) );
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.
*/

View File

@@ -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).

View File

@@ -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 );
}
}
/**

View File

@@ -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__ . '/../../',

View File

@@ -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'
),
);

View File

@@ -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

View File

@@ -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.

View File

@@ -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;
}
}
/**

View File

@@ -679,10 +679,10 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
),
'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' ),
'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',
),
@@ -1583,7 +1574,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'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(
'label' => esc_html__( 'Product MPN', 'wp-schema-pro' ),
@@ -1597,6 +1588,110 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'default' => 'none',
'dropdown-type' => 'availability',
),
'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',
@@ -1661,38 +1756,6 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'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(
@@ -2094,13 +2157,11 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'label' => esc_html__( 'Clip Name', 'wp-schema-pro' ),
'type' => 'text',
'default' => 'none',
'required' => true,
),
'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' ),
),
),
@@ -2134,6 +2194,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'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' ),
@@ -2144,19 +2205,16 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'label' => esc_html__( 'Is Live Broadcast', 'wp-schema-pro' ),
'type' => 'text',
'default' => false,
'required' => true,
),
'start-date' => array(
'label' => esc_html__( 'Live Broadcast Start Date', 'wp-schema-pro' ),
'type' => 'datetime-local',
'default' => 'none',
'required' => true,
),
'end-date' => array(
'label' => esc_html__( 'Live Broadcast End Date', 'wp-schema-pro' ),
'type' => 'datetime-local',
'default' => 'none',
'required' => true,
),
),
),
@@ -2414,9 +2472,57 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
'type' => 'text',
'default' => 'blogname',
),
'category' => array(
'label' => esc_html__( 'Category', 'wp-schema-pro' ),
'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__( '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,6 +4116,15 @@ 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',
@@ -4021,6 +4136,45 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema' ) ) {
)
);
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',

View File

@@ -15,6 +15,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Product' ) ) {
*/
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,6 +199,51 @@ 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(

View File

@@ -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

View File

@@ -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/' );

View File

@@ -488,6 +488,7 @@ class WP_Plugin_Dependencies {
$status['activateUrl'] = add_query_arg( array( 'networkwide' => 1 ), $status['activateUrl'] );
}
self::initialize();
$dependencies = self::get_dependencies( $plugin_file );
if ( empty( $dependencies ) ) {
$status['message'] = __( 'The plugin has no required plugins.' );

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5.3';
$wp_version = '6.5.4';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.