lock file maintenance

This commit is contained in:
Ron Rennick 2020-10-01 14:21:40 -03:00
commit 4af90518da
285 changed files with 5801 additions and 8101 deletions

View File

@ -1,6 +1,6 @@
---
name: "\U0001F47D External issues"
about: Please report WooCommerce REST API, WooCommerce Admin or WooCommerce Gutenberg Products Blocks issues directly to their respective repositories.
about: Please report WooCommerce Admin, WooCommerce Gutenberg Products Blocks or Action Scheduler issues directly to their respective repositories.
title: ''
labels: ''
assignees: ''
@ -9,10 +9,12 @@ assignees: ''
Please report issues for the following features directly to their respective repositories.
WooCommerce REST API: https://github.com/woocommerce/woocommerce-rest-api
WooCommerce Admin: https://github.com/woocommerce/woocommerce-admin
WooCommerce Gutenberg Products Blocks: https://github.com/woocommerce/woocommerce-gutenberg-products-block
Action Scheduler: https://github.com/woocommerce/action-scheduler
WooCommerce REST API Docs: https://github.com/woocommerce/woocommerce-rest-api-docs
WooCommerce Code Reference: https://github.com/woocommerce/code-reference

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
v10

View File

@ -33,7 +33,6 @@ jobs:
php: 7.4
env: WP_VERSION=latest WP_MULTISITE=0 RUN_E2E=1
script:
- npm install
- npm run build:assets
- npm install jest --global
- npm run docker:up
@ -71,7 +70,7 @@ install:
else
echo "xdebug.ini does not exist"
fi
- nvm install 10
- nvm install
- npm install
- composer install --no-dev
- |

View File

@ -1,4 +1,6 @@
/* stylelint-disable no-descending-specificity */
/* @deprecated 4.6.0 */
body {
margin: 65px auto 24px;
box-shadow: none;

View File

@ -1,6 +1,7 @@
/*global wc_setup_params */
/*global wc_setup_currencies */
/*global wc_base_state */
/* @deprecated 4.6.0 */
jQuery( function( $ ) {
function blockWizardUI() {
$('.wc-setup-content').block({

View File

@ -3,7 +3,10 @@
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
runOnChange() {
echo "$changedFiles" | grep -q "$1" && eval "$2"
if echo "$changedFiles" | grep -q "$1"
then
eval "$2"
fi
}
runOnChange "package-lock.json" "npm install"

View File

@ -4,8 +4,8 @@ PROTECTED_BRANCH="master"
REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
if [ -n "$REMOTE_REF" ]; then
if [ "refs/heads/${PROTECTED_BRANCH}" == "$REMOTE_REF" ]; then
if [ "$TERM" == "dumb" ]; then
if [ "refs/heads/${PROTECTED_BRANCH}" = "$REMOTE_REF" ]; then
if [ "$TERM" = "dumb" ]; then
>&2 echo "Sorry, you are unable to push to master using a GUI client! Please use git CLI."
exit 1
fi

View File

@ -1,5 +1,9 @@
== Changelog ==
= 4.5.2 - 2020-09-14 =
* Fix - Revert the changes in filtering by attribute that were introduced in WooCommerce 4.4. #27625
* Fix - Adjusted validation to allow for variations with "0" as an attribute value. #27633
= 4.5.1 - 2020-09-09 =
* Fix - Check for state and postcode fields only if required in `show_shipping`. #27628

View File

@ -15,8 +15,8 @@
"pelago/emogrifier": "3.1.0",
"psr/container": "1.0.0",
"woocommerce/action-scheduler": "3.1.6",
"woocommerce/woocommerce-admin": "1.5.0",
"woocommerce/woocommerce-blocks": "3.1.0"
"woocommerce/woocommerce-admin": "1.6.0-beta.1",
"woocommerce/woocommerce-blocks": "3.4.0"
},
"require-dev": {
"phpunit/phpunit": "7.5.20",

24
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "11ae24e5fa6a835a12e6e4f853825392",
"content-hash": "ddfcf89afffda07ac78adfff8b311224",
"packages": [
{
"name": "automattic/jetpack-autoloader",
@ -468,20 +468,20 @@
},
{
"name": "woocommerce/woocommerce-admin",
"version": "1.5.0",
"version": "1.6.0-beta.1",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "b788329894265b4698c5ea997ce73a9f506d3e4c"
"reference": "a03cafd0a218451d83c42285b02f797555a7450e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/b788329894265b4698c5ea997ce73a9f506d3e4c",
"reference": "b788329894265b4698c5ea997ce73a9f506d3e4c",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/a03cafd0a218451d83c42285b02f797555a7450e",
"reference": "a03cafd0a218451d83c42285b02f797555a7450e",
"shasum": ""
},
"require": {
"automattic/jetpack-autoloader": "^2.0.0",
"automattic/jetpack-autoloader": "^2.2.0",
"composer/installers": "1.7.0",
"php": ">=5.6|>=7.0"
},
@ -511,20 +511,20 @@
],
"description": "A modern, javascript-driven WooCommerce Admin experience.",
"homepage": "https://github.com/woocommerce/woocommerce-admin",
"time": "2020-09-07T02:36:13+00:00"
"time": "2020-09-18T15:24:50+00:00"
},
{
"name": "woocommerce/woocommerce-blocks",
"version": "v3.1.0",
"version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436"
"reference": "d64a2616932f312ec4fd8f4e46195c3f9aca0000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436",
"reference": "d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/d64a2616932f312ec4fd8f4e46195c3f9aca0000",
"reference": "d64a2616932f312ec4fd8f4e46195c3f9aca0000",
"shasum": ""
},
"require": {
@ -558,7 +558,7 @@
"gutenberg",
"woocommerce"
],
"time": "2020-07-29T15:45:19+00:00"
"time": "2020-09-15T12:10:40+00:00"
}
],
"packages-dev": [

View File

@ -172,6 +172,20 @@ return array(
),
'BH' => array(),
'BI' => array(),
'BJ' => array( // Benin states.
'AL' => __( 'Alibori', 'woocommerce' ),
'AK' => __( 'Atakora', 'woocommerce' ),
'AQ' => __( 'Atlantique', 'woocommerce' ),
'BO' => __( 'Borgou', 'woocommerce' ),
'CO' => __( 'Collines', 'woocommerce' ),
'KO' => __( 'Kouffo', 'woocommerce' ),
'DO' => __( 'Donga', 'woocommerce' ),
'LI' => __( 'Littoral', 'woocommerce' ),
'MO' => __( 'Mono', 'woocommerce' ),
'OU' => __( 'Ouémé', 'woocommerce' ),
'PL' => __( 'Plateau', 'woocommerce' ),
'ZO' => __( 'Zou', 'woocommerce' ),
),
'BO' => array( // Bolivian states.
'B' => __( 'Chuquisaca', 'woocommerce' ),
'H' => __( 'Beni', 'woocommerce' ),
@ -475,7 +489,7 @@ return array(
'BA' => __( 'Baranya', 'woocommerce' ),
'BZ' => __( 'Borsod-Abaúj-Zemplén', 'woocommerce' ),
'BU' => __( 'Budapest', 'woocommerce' ),
'CS' => __( 'Csongrád', 'woocommerce' ),
'CS' => __( 'Csongrád-Csanád', 'woocommerce' ),
'FE' => __( 'Fejér', 'woocommerce' ),
'GS' => __( 'Győr-Moson-Sopron', 'woocommerce' ),
'HB' => __( 'Hajdú-Bihar', 'woocommerce' ),

View File

@ -71,18 +71,6 @@ class WC_Admin_Help {
)
);
$screen->add_help_tab(
array(
'id' => 'woocommerce_onboard_tab',
'title' => __( 'Setup wizard', 'woocommerce' ),
'content' =>
'<h2>' . __( 'Setup wizard', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __( 'Setup wizard', 'woocommerce' ) . '</a></p>',
)
);
$screen->set_help_sidebar(
'<p><strong>' . __( 'For more information:', 'woocommerce' ) . '</strong></p>' .
'<p><a href="https://woocommerce.com/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=woocommerceplugin" target="_blank">' . __( 'About WooCommerce', 'woocommerce' ) . '</a></p>' .

View File

@ -28,7 +28,6 @@ class WC_Admin_Notices {
* @var array
*/
private static $core_notices = array(
'install' => 'install_notice',
'update' => 'update_notice',
'template_files' => 'template_file_check_notice',
'legacy_shipping' => 'legacy_shipping_notice',
@ -260,9 +259,11 @@ class WC_Admin_Notices {
/**
* If we have just installed, show a message with the install pages button.
*
* @deprecated 4.6.0
*/
public static function install_notice() {
include dirname( __FILE__ ) . '/views/html-notice-install.php';
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
}
/**

View File

@ -28,10 +28,10 @@ class WC_Admin_Post_Types {
* Constructor.
*/
public function __construct() {
include_once dirname( __FILE__ ) . '/class-wc-admin-meta-boxes.php';
include_once __DIR__ . '/class-wc-admin-meta-boxes.php';
if ( ! function_exists( 'duplicate_post_plugin_activation' ) ) {
include_once 'class-wc-admin-duplicate-product.php';
include_once __DIR__ . '/class-wc-admin-duplicate-product.php';
}
// Load correct list table classes for current screen.
@ -94,15 +94,15 @@ class WC_Admin_Post_Types {
switch ( $screen_id ) {
case 'edit-shop_order':
include_once 'list-tables/class-wc-admin-list-table-orders.php';
include_once __DIR__ . '/list-tables/class-wc-admin-list-table-orders.php';
$wc_list_table = new WC_Admin_List_Table_Orders();
break;
case 'edit-shop_coupon':
include_once 'list-tables/class-wc-admin-list-table-coupons.php';
include_once __DIR__ . '/list-tables/class-wc-admin-list-table-coupons.php';
$wc_list_table = new WC_Admin_List_Table_Coupons();
break;
case 'edit-product':
include_once 'list-tables/class-wc-admin-list-table-products.php';
include_once __DIR__ . '/list-tables/class-wc-admin-list-table-products.php';
$wc_list_table = new WC_Admin_List_Table_Products();
break;
}

View File

@ -49,15 +49,15 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
include_once dirname( __FILE__ ) . '/settings/class-wc-settings-page.php';
$settings[] = include 'settings/class-wc-settings-general.php';
$settings[] = include 'settings/class-wc-settings-products.php';
$settings[] = include 'settings/class-wc-settings-tax.php';
$settings[] = include 'settings/class-wc-settings-shipping.php';
$settings[] = include 'settings/class-wc-settings-payment-gateways.php';
$settings[] = include 'settings/class-wc-settings-accounts.php';
$settings[] = include 'settings/class-wc-settings-emails.php';
$settings[] = include 'settings/class-wc-settings-integrations.php';
$settings[] = include 'settings/class-wc-settings-advanced.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-general.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-products.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-tax.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-shipping.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-payment-gateways.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-accounts.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-emails.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-integrations.php';
$settings[] = include __DIR__ . '/settings/class-wc-settings-advanced.php';
self::$settings = apply_filters( 'woocommerce_get_settings_pages', $settings );
}

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,14 @@ class WC_Admin_Status {
* Handles output of the reports page in admin.
*/
public static function output() {
include_once dirname( __FILE__ ) . '/views/html-admin-page-status.php';
include_once __DIR__ . '/views/html-admin-page-status.php';
}
/**
* Handles output of report.
*/
public static function status_report() {
include_once dirname( __FILE__ ) . '/views/html-admin-page-status-report.php';
include_once __DIR__ . '/views/html-admin-page-status-report.php';
}
/**
@ -80,7 +80,7 @@ class WC_Admin_Status {
echo '<div class="updated inline"><p>' . esc_html__( 'Your changes have been saved.', 'woocommerce' ) . '</p></div>';
}
include_once dirname( __FILE__ ) . '/views/html-admin-page-status-tools.php';
include_once __DIR__ . '/views/html-admin-page-status-tools.php';
}
/**
@ -124,7 +124,7 @@ class WC_Admin_Status {
self::remove_log();
}
include_once 'views/html-admin-page-status-logs.php';
include_once __DIR__ . '/views/html-admin-page-status-logs.php';
}
/**
@ -142,7 +142,7 @@ class WC_Admin_Status {
$log_table_list = new WC_Admin_Log_Table_List();
$log_table_list->prepare_items();
include_once 'views/html-admin-page-status-logs-db.php';
include_once __DIR__ . '/views/html-admin-page-status-logs-db.php';
}
/**

View File

@ -208,7 +208,7 @@ class WC_Admin_Webhooks {
$webhook_id = absint( $_GET['edit-webhook'] ); // WPCS: input var okay, CSRF ok.
$webhook = new WC_Webhook( $webhook_id );
include 'settings/views/html-webhooks-edit.php';
include __DIR__ . '/settings/views/html-webhooks-edit.php';
return;
}

View File

@ -28,7 +28,6 @@ class WC_Admin {
add_action( 'admin_init', array( $this, 'admin_redirects' ) );
add_action( 'admin_footer', 'wc_print_js', 25 );
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
add_action( 'wp_ajax_setup_wizard_check_jetpack', array( $this, 'setup_wizard_check_jetpack' ) );
add_action( 'init', array( 'WC_Site_Tracking', 'init' ) );
// Disable WXR export of schedule action posts.
@ -49,19 +48,19 @@ class WC_Admin {
* Include any classes we need within admin.
*/
public function includes() {
include_once dirname( __FILE__ ) . '/wc-admin-functions.php';
include_once dirname( __FILE__ ) . '/wc-meta-box-functions.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-post-types.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-taxonomies.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-menus.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-customize.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-notices.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-assets.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-api-keys.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-webhooks.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-pointers.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-importers.php';
include_once dirname( __FILE__ ) . '/class-wc-admin-exporters.php';
include_once __DIR__ . '/wc-admin-functions.php';
include_once __DIR__ . '/wc-meta-box-functions.php';
include_once __DIR__ . '/class-wc-admin-post-types.php';
include_once __DIR__ . '/class-wc-admin-taxonomies.php';
include_once __DIR__ . '/class-wc-admin-menus.php';
include_once __DIR__ . '/class-wc-admin-customize.php';
include_once __DIR__ . '/class-wc-admin-notices.php';
include_once __DIR__ . '/class-wc-admin-assets.php';
include_once __DIR__ . '/class-wc-admin-api-keys.php';
include_once __DIR__ . '/class-wc-admin-webhooks.php';
include_once __DIR__ . '/class-wc-admin-pointers.php';
include_once __DIR__ . '/class-wc-admin-importers.php';
include_once __DIR__ . '/class-wc-admin-exporters.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
@ -71,24 +70,15 @@ class WC_Admin {
// Help Tabs.
if ( apply_filters( 'woocommerce_enable_admin_help_tab', true ) ) {
include_once dirname( __FILE__ ) . '/class-wc-admin-help.php';
}
// Setup/welcome.
if ( ! empty( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
switch ( $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
case 'wc-setup':
include_once dirname( __FILE__ ) . '/class-wc-admin-setup-wizard.php';
break;
}
include_once __DIR__ . '/class-wc-admin-help.php';
}
// Helper.
include_once dirname( __FILE__ ) . '/helper/class-wc-helper.php';
include_once __DIR__ . '/helper/class-wc-helper.php';
// Marketplace suggestions & related REST API.
include_once dirname( __FILE__ ) . '/marketplace-suggestions/class-wc-marketplace-suggestions.php';
include_once dirname( __FILE__ ) . '/marketplace-suggestions/class-wc-marketplace-updater.php';
include_once __DIR__ . '/marketplace-suggestions/class-wc-marketplace-suggestions.php';
include_once __DIR__ . '/marketplace-suggestions/class-wc-marketplace-updater.php';
}
/**
@ -104,22 +94,22 @@ class WC_Admin {
switch ( $screen->id ) {
case 'dashboard':
case 'dashboard-network':
include 'class-wc-admin-dashboard.php';
include __DIR__ . '/class-wc-admin-dashboard.php';
break;
case 'options-permalink':
include 'class-wc-admin-permalink-settings.php';
include __DIR__ . '/class-wc-admin-permalink-settings.php';
break;
case 'plugins':
include 'plugin-updates/class-wc-plugins-screen-updates.php';
include __DIR__ . '/plugin-updates/class-wc-plugins-screen-updates.php';
break;
case 'update-core':
include 'plugin-updates/class-wc-updates-screen-updates.php';
include __DIR__ . '/plugin-updates/class-wc-updates-screen-updates.php';
break;
case 'users':
case 'user':
case 'profile':
case 'user-edit':
include 'class-wc-admin-profile.php';
include __DIR__ . '/class-wc-admin-profile.php';
break;
}
}
@ -127,7 +117,7 @@ class WC_Admin {
/**
* Handle redirects to setup/welcome page after install and updates.
*
* For setup wizard, transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
* The user must have access rights, and we must ignore the network/bulk plugin updaters.
*/
public function admin_redirects() {
// Don't run this fn from Action Scheduler requests, as it would clear _wc_activation_redirect transient.
@ -152,28 +142,6 @@ class WC_Admin {
exit;
}
// Setup wizard redirect.
if ( get_transient( '_wc_activation_redirect' ) && apply_filters( 'woocommerce_enable_setup_wizard', true ) ) {
$do_redirect = true;
$current_page = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false;
// On these pages, or during these events, postpone the redirect.
if ( wp_doing_ajax() || is_network_admin() || ! current_user_can( 'manage_woocommerce' ) ) {
$do_redirect = false;
}
// On these pages, or during these events, disable the redirect.
if ( 'wc-setup' === $current_page || ! WC_Admin_Notices::has_notice( 'install' ) || apply_filters( 'woocommerce_prevent_automatic_wizard_redirect', false ) || isset( $_GET['activate-multi'] ) ) {
delete_transient( '_wc_activation_redirect' );
$do_redirect = false;
}
if ( $do_redirect ) {
delete_transient( '_wc_activation_redirect' );
wp_safe_redirect( admin_url( 'index.php?page=wc-setup' ) );
exit;
}
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
}
@ -223,7 +191,7 @@ class WC_Admin {
// get the preview email content.
ob_start();
include 'views/html-email-template-preview.php';
include __DIR__ . '/views/html-email-template-preview.php';
$message = ob_get_clean();
// create a new email.

View File

@ -1,9 +1,8 @@
<?php
/**
* WooCommerce Admin
* WooCommerce Admin Helper API
*
* @class WC_Helper_API
* @package WooCommerce\Admin
* @package WooCommerce\Admin\Helper
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,4 +1,10 @@
<?php
/**
* WooCommerce Admin Helper Compat
*
* @package WooCommerce\Admin\Helper
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -1,4 +1,10 @@
<?php
/**
* WooCommerce Admin Helper Options
*
* @package WooCommerce\Admin\Helper
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -1,4 +1,10 @@
<?php
/**
* WooCommerce Admin Helper Plugin Info
*
* @package WooCommerce\Admin\Helper
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -3,7 +3,7 @@
* The update helper for WooCommerce.com plugins.
*
* @class WC_Helper_Updater
* @package WooCommerce\Admin.
* @package WooCommerce\Admin\Helper
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,9 +1,8 @@
<?php
/**
* WooCommerce Admin
* WooCommerce Admin Helper
*
* @class WC_Helper
* @package WooCommerce\Admin
* @package WooCommerce\Admin\Helper
*/
use Automattic\Jetpack\Constants;

View File

@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Coupons', false ) ) {
}
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
include_once 'abstract-class-wc-admin-list-table.php';
include_once __DIR__ . '/abstract-class-wc-admin-list-table.php';
}
/**

View File

@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Orders', false ) ) {
}
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
include_once 'abstract-class-wc-admin-list-table.php';
include_once __DIR__ . '/abstract-class-wc-admin-list-table.php';
}
/**

View File

@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Products', false ) ) {
}
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
include_once 'abstract-class-wc-admin-list-table.php';
include_once __DIR__ . '/abstract-class-wc-admin-list-table.php';
}
/**

View File

@ -56,7 +56,7 @@ class WC_Meta_Box_Order_Downloads {
$file = $product->get_file( $download->get_download_id() );
$file_count = isset( $file['name'] ) ? $file['name'] : sprintf( __( 'File %d', 'woocommerce' ), $file_counter );
include 'views/html-order-download-permission.php';
include __DIR__ . '/views/html-order-download-permission.php';
$loop++;
$file_counter++;

View File

@ -38,7 +38,7 @@ class WC_Meta_Box_Order_Items {
$order = $theorder;
$data = get_post_meta( $post->ID );
include 'views/html-order-items.php';
include __DIR__ . '/views/html-order-items.php';
}
/**

View File

@ -28,7 +28,7 @@ class WC_Meta_Box_Order_Notes {
$notes = wc_get_order_notes( $args );
include 'views/html-order-notes.php';
include __DIR__ . '/views/html-order-notes.php';
?>
<div class="add_note">
<p>

View File

@ -30,7 +30,7 @@ class WC_Meta_Box_Product_Data {
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
include 'views/html-product-data-panel.php';
include __DIR__ . '/views/html-product-data-panel.php';
}
/**
@ -39,12 +39,12 @@ class WC_Meta_Box_Product_Data {
private static function output_tabs() {
global $post, $thepostid, $product_object;
include 'views/html-product-data-general.php';
include 'views/html-product-data-inventory.php';
include 'views/html-product-data-shipping.php';
include 'views/html-product-data-linked-products.php';
include 'views/html-product-data-attributes.php';
include 'views/html-product-data-advanced.php';
include __DIR__ . '/views/html-product-data-general.php';
include __DIR__ . '/views/html-product-data-inventory.php';
include __DIR__ . '/views/html-product-data-shipping.php';
include __DIR__ . '/views/html-product-data-linked-products.php';
include __DIR__ . '/views/html-product-data-attributes.php';
include __DIR__ . '/views/html-product-data-advanced.php';
}
/**
@ -177,7 +177,7 @@ class WC_Meta_Box_Product_Data {
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) );
$variations_total_pages = ceil( $variations_count / $variations_per_page );
include 'views/html-product-data-variations.php';
include __DIR__ . '/views/html-product-data-variations.php';
}
/**
@ -371,7 +371,7 @@ class WC_Meta_Box_Product_Data {
'featured' => isset( $_POST['_featured'] ),
'catalog_visibility' => isset( $_POST['_visibility'] ) ? wc_clean( wp_unslash( $_POST['_visibility'] ) ) : null,
'tax_status' => isset( $_POST['_tax_status'] ) ? wc_clean( wp_unslash( $_POST['_tax_status'] ) ) : null,
'tax_class' => isset( $_POST['_tax_class'] ) ? wc_clean( wp_unslash( $_POST['_tax_class'] ) ) : null,
'tax_class' => isset( $_POST['_tax_class'] ) ? sanitize_title( wp_unslash( $_POST['_tax_class'] ) ) : null,
'weight' => isset( $_POST['_weight'] ) ? wc_clean( wp_unslash( $_POST['_weight'] ) ) : null,
'length' => isset( $_POST['_length'] ) ? wc_clean( wp_unslash( $_POST['_length'] ) ) : null,
'width' => isset( $_POST['_width'] ) ? wc_clean( wp_unslash( $_POST['_width'] ) ) : null,

View File

@ -41,7 +41,7 @@ $row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empt
<input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" />
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $product ); ?>
<?php require 'html-order-item-meta.php'; ?>
<?php require __DIR__ . '/html-order-item-meta.php'; ?>
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, $product ); ?>
</td>

View File

@ -59,7 +59,7 @@ if ( wc_tax_enabled() ) {
foreach ( $line_items as $item_id => $item ) {
do_action( 'woocommerce_before_order_item_' . $item->get_type() . '_html', $item_id, $item, $order );
include 'html-order-item.php';
include __DIR__ . '/html-order-item.php';
do_action( 'woocommerce_order_item_' . $item->get_type() . '_html', $item_id, $item, $order );
}
@ -69,7 +69,7 @@ if ( wc_tax_enabled() ) {
<tbody id="order_fee_line_items">
<?php
foreach ( $line_items_fee as $item_id => $item ) {
include 'html-order-fee.php';
include __DIR__ . '/html-order-fee.php';
}
do_action( 'woocommerce_admin_order_items_after_fees', $order->get_id() );
?>
@ -78,7 +78,7 @@ if ( wc_tax_enabled() ) {
<?php
$shipping_methods = WC()->shipping() ? WC()->shipping()->load_shipping_methods() : array();
foreach ( $line_items_shipping as $item_id => $item ) {
include 'html-order-shipping.php';
include __DIR__ . '/html-order-shipping.php';
}
do_action( 'woocommerce_admin_order_items_after_shipping', $order->get_id() );
?>
@ -89,7 +89,7 @@ if ( wc_tax_enabled() ) {
if ( $refunds ) {
foreach ( $refunds as $refund ) {
include 'html-order-refund.php';
include __DIR__ . '/html-order-refund.php';
}
do_action( 'woocommerce_admin_order_items_after_refunds', $order->get_id() );
}

View File

@ -51,7 +51,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</div>
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ); ?>
<?php require 'html-order-item-meta.php'; ?>
<?php require __DIR__ . '/html-order-item-meta.php'; ?>
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ); ?>
</td>

View File

@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$metabox_class[] = $attribute->get_name();
}
include 'html-product-attribute.php';
include __DIR__ . '/html-product-attribute.php';
}
?>
</div>

View File

@ -89,7 +89,7 @@ defined( 'ABSPATH' ) || exit;
$downloadable_files = $product_object->get_downloads( 'edit' );
if ( $downloadable_files ) {
foreach ( $downloadable_files as $key => $file ) {
include 'html-product-download.php';
include __DIR__ . '/html-product-download.php';
}
}
?>
@ -105,7 +105,7 @@ defined( 'ABSPATH' ) || exit;
'name' => '',
);
ob_start();
require 'html-product-download.php';
require __DIR__ . '/html-product-download.php';
echo esc_attr( ob_get_clean() );
?>
"><?php esc_html_e( 'Add File', 'woocommerce' ); ?></a>

View File

@ -378,7 +378,7 @@ defined( 'ABSPATH' ) || exit;
if ( $downloads ) {
foreach ( $downloads as $key => $file ) {
include 'html-product-variation-download.php';
include __DIR__ . '/html-product-variation-download.php';
}
}
?>
@ -394,7 +394,7 @@ defined( 'ABSPATH' ) || exit;
'name' => '',
);
ob_start();
require 'html-product-variation-download.php';
require __DIR__ . '/html-product-variation-download.php';
echo esc_attr( ob_get_clean() );
?>
"><?php esc_html_e( 'Add file', 'woocommerce' ); ?></a>

View File

@ -115,7 +115,7 @@ class WC_Plugin_Updates {
$message = sprintf( __( "<strong>Heads up!</strong> The versions of the following plugins you're running haven't been tested with WooCommerce %s. Please update them or confirm compatibility before updating WooCommerce, or you may experience issues:", 'woocommerce' ), $new_version );
ob_start();
include 'views/html-notice-untested-extensions-inline.php';
include __DIR__ . '/views/html-notice-untested-extensions-inline.php';
return ob_get_clean();
}
@ -130,7 +130,7 @@ class WC_Plugin_Updates {
$plugins = $this->major_untested_plugins;
ob_start();
include 'views/html-notice-untested-extensions-modal.php';
include __DIR__ . '/views/html-notice-untested-extensions-modal.php';
return ob_get_clean();
}

View File

@ -42,7 +42,6 @@ class WC_Settings_Advanced extends WC_Settings_Page {
'webhooks' => __( 'Webhooks', 'woocommerce' ),
'legacy_api' => __( 'Legacy API', 'woocommerce' ),
'woocommerce_com' => __( 'WooCommerce.com', 'woocommerce' ),
'features' => __( 'Features', 'woocommerce' ),
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
@ -398,28 +397,6 @@ class WC_Settings_Advanced extends WC_Settings_Page {
),
)
);
} elseif ( 'features' === $current_section ) {
$settings = apply_filters(
'woocommerce_settings_features',
array(
array(
'title' => __( 'Features', 'woocommerce' ),
'type' => 'title',
'desc' => __( 'Start using new features that are being progressively rolled out to improve the store management experience.', 'woocommerce' ),
'id' => 'features_options',
),
array(
'title' => __( 'Home Screen', 'woocommerce' ),
'desc' => __( 'Displays analytical insights, inbox notifications, and handy shortcuts in a single screen', 'woocommerce' ),
'id' => 'woocommerce_homescreen_enabled',
'type' => 'checkbox',
),
array(
'type' => 'sectionend',
'id' => 'features_options',
),
)
);
}
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );

View File

@ -8,4 +8,4 @@
defined( 'ABSPATH' ) || exit;
return include 'class-wc-settings-payment-gateways.php';
return include __DIR__ . '/class-wc-settings-payment-gateways.php';

View File

@ -82,7 +82,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
$settings = array();
if ( '' === $current_section ) {
$settings = include 'views/settings-tax.php';
$settings = include __DIR__ . '/views/settings-tax.php';
}
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
}
@ -237,7 +237,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
);
wp_enqueue_script( 'wc-settings-tax' );
include 'views/html-settings-tax.php';
include __DIR__ . '/views/html-settings-tax.php';
}
/**

View File

@ -8,4 +8,4 @@
defined( 'ABSPATH' ) || exit;
return include 'class-wc-settings-advanced.php';
return include __DIR__ . '/class-wc-settings-advanced.php';

View File

@ -1,6 +1,8 @@
<?php
/**
* Admin View: Notice - Install
*
* @deprecated 4.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -548,7 +548,7 @@ class WC_AJAX {
$order = wc_get_order( absint( $_GET['order_id'] ) ); // WPCS: sanitization ok.
if ( $order ) {
include_once 'admin/list-tables/class-wc-admin-list-table-orders.php';
include_once __DIR__ . '/admin/list-tables/class-wc-admin-list-table-orders.php';
wp_send_json_success( WC_Admin_List_Table_Orders::order_preview_get_order_details( $order ) );
}
@ -581,7 +581,7 @@ class WC_AJAX {
$metabox_class[] = $attribute->get_name();
}
include 'admin/meta-boxes/views/html-product-attribute.php';
include __DIR__ . '/admin/meta-boxes/views/html-product-attribute.php';
wp_die();
}
@ -681,7 +681,7 @@ class WC_AJAX {
$metabox_class[] = $attribute->get_name();
}
include 'admin/meta-boxes/views/html-product-attribute.php';
include __DIR__ . '/admin/meta-boxes/views/html-product-attribute.php';
}
}
@ -716,7 +716,7 @@ class WC_AJAX {
$variation_id = $variation_object->save();
$variation = get_post( $variation_id );
$variation_data = array_merge( get_post_custom( $variation_id ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
include 'admin/meta-boxes/views/html-variation-admin.php';
include __DIR__ . '/admin/meta-boxes/views/html-variation-admin.php';
wp_die();
}
@ -816,7 +816,7 @@ class WC_AJAX {
/* translators: %d file count */
$file_count = sprintf( __( 'File %d', 'woocommerce' ), $file_counter );
}
include 'admin/meta-boxes/views/html-order-download-permission.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-download-permission.php';
}
}
}
@ -946,12 +946,12 @@ class WC_AJAX {
// Get HTML to return.
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$items_html = ob_get_clean();
ob_start();
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
include 'admin/meta-boxes/views/html-order-notes.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-notes.php';
$notes_html = ob_get_clean();
return array(
@ -1015,7 +1015,7 @@ class WC_AJAX {
$order->save();
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1057,7 +1057,7 @@ class WC_AJAX {
$item_id = $item->save();
ob_start();
include 'admin/meta-boxes/views/html-order-shipping.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-shipping.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1104,7 +1104,7 @@ class WC_AJAX {
$item->save();
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1167,7 +1167,7 @@ class WC_AJAX {
$order->calculate_totals( false );
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1214,7 +1214,7 @@ class WC_AJAX {
$order->calculate_totals( false );
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1300,12 +1300,12 @@ class WC_AJAX {
// Get HTML to return.
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$items_html = ob_get_clean();
ob_start();
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
include 'admin/meta-boxes/views/html-order-notes.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-notes.php';
$notes_html = ob_get_clean();
wp_send_json_success(
@ -1352,7 +1352,7 @@ class WC_AJAX {
$order->calculate_totals( false );
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$response['html'] = ob_get_clean();
} catch ( Exception $e ) {
wp_send_json_error( array( 'error' => $e->getMessage() ) );
@ -1391,7 +1391,7 @@ class WC_AJAX {
$order = wc_get_order( $order_id );
$order->calculate_taxes( $calculate_tax_args );
$order->calculate_totals( false );
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
wp_die();
}
@ -1420,12 +1420,12 @@ class WC_AJAX {
// Get HTML to return.
ob_start();
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
$items_html = ob_get_clean();
ob_start();
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
include 'admin/meta-boxes/views/html-order-notes.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-notes.php';
$notes_html = ob_get_clean();
wp_send_json_success(
@ -1451,7 +1451,7 @@ class WC_AJAX {
// Return HTML items.
$order_id = absint( $_POST['order_id'] );
$order = wc_get_order( $order_id );
include 'admin/meta-boxes/views/html-order-items.php';
include __DIR__ . '/admin/meta-boxes/views/html-order-items.php';
wp_die();
}
@ -2101,7 +2101,7 @@ class WC_AJAX {
$variation_id = $variation_object->get_id();
$variation = get_post( $variation_id );
$variation_data = array_merge( get_post_custom( $variation_id ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
include 'admin/meta-boxes/views/html-variation-admin.php';
include __DIR__ . '/admin/meta-boxes/views/html-variation-admin.php';
$loop++;
}
}

View File

@ -7,7 +7,7 @@
* - Legacy REST API - Deprecated in 2.6.0. @see class-wc-legacy-api.php
* - WP REST API - The main REST API in WooCommerce which is built on top of the WP REST API.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.0.0
*/

View File

@ -4,7 +4,7 @@
*
* Handles wc-auth endpoint requests.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.4.0
*/

View File

@ -50,7 +50,7 @@ class WC_Countries {
if ( empty( $this->countries ) ) {
$this->countries = apply_filters( 'woocommerce_countries', include WC()->plugin_path() . '/i18n/countries.php' );
if ( apply_filters( 'woocommerce_sort_countries', true ) ) {
uasort( $this->countries, 'wc_ascii_uasort_comparison' );
wc_asort_by_locale( $this->countries );
}
}

View File

@ -218,17 +218,17 @@ class WC_Emails {
// Include email classes.
include_once dirname( __FILE__ ) . '/emails/class-wc-email.php';
$this->emails['WC_Email_New_Order'] = include 'emails/class-wc-email-new-order.php';
$this->emails['WC_Email_Cancelled_Order'] = include 'emails/class-wc-email-cancelled-order.php';
$this->emails['WC_Email_Failed_Order'] = include 'emails/class-wc-email-failed-order.php';
$this->emails['WC_Email_Customer_On_Hold_Order'] = include 'emails/class-wc-email-customer-on-hold-order.php';
$this->emails['WC_Email_Customer_Processing_Order'] = include 'emails/class-wc-email-customer-processing-order.php';
$this->emails['WC_Email_Customer_Completed_Order'] = include 'emails/class-wc-email-customer-completed-order.php';
$this->emails['WC_Email_Customer_Refunded_Order'] = include 'emails/class-wc-email-customer-refunded-order.php';
$this->emails['WC_Email_Customer_Invoice'] = include 'emails/class-wc-email-customer-invoice.php';
$this->emails['WC_Email_Customer_Note'] = include 'emails/class-wc-email-customer-note.php';
$this->emails['WC_Email_Customer_Reset_Password'] = include 'emails/class-wc-email-customer-reset-password.php';
$this->emails['WC_Email_Customer_New_Account'] = include 'emails/class-wc-email-customer-new-account.php';
$this->emails['WC_Email_New_Order'] = include __DIR__ . '/emails/class-wc-email-new-order.php';
$this->emails['WC_Email_Cancelled_Order'] = include __DIR__ . '/emails/class-wc-email-cancelled-order.php';
$this->emails['WC_Email_Failed_Order'] = include __DIR__ . '/emails/class-wc-email-failed-order.php';
$this->emails['WC_Email_Customer_On_Hold_Order'] = include __DIR__ . '/emails/class-wc-email-customer-on-hold-order.php';
$this->emails['WC_Email_Customer_Processing_Order'] = include __DIR__ . '/emails/class-wc-email-customer-processing-order.php';
$this->emails['WC_Email_Customer_Completed_Order'] = include __DIR__ . '/emails/class-wc-email-customer-completed-order.php';
$this->emails['WC_Email_Customer_Refunded_Order'] = include __DIR__ . '/emails/class-wc-email-customer-refunded-order.php';
$this->emails['WC_Email_Customer_Invoice'] = include __DIR__ . '/emails/class-wc-email-customer-invoice.php';
$this->emails['WC_Email_Customer_Note'] = include __DIR__ . '/emails/class-wc-email-customer-note.php';
$this->emails['WC_Email_Customer_Reset_Password'] = include __DIR__ . '/emails/class-wc-email-customer-reset-password.php';
$this->emails['WC_Email_Customer_New_Account'] = include __DIR__ . '/emails/class-wc-email-customer-new-account.php';
$this->emails = apply_filters( 'woocommerce_email_classes', $this->emails );
}
@ -638,6 +638,17 @@ class WC_Emails {
return;
}
/**
* Determine if the current product should trigger a no stock notification
*
* @param int $product_id - The out of stock product id
*
* @since 4.6.0
*/
if ( false === apply_filters( 'woocommerce_should_send_no_stock_notification', true, $product->get_id() ) ) {
return;
}
$subject = sprintf( '[%s] %s', $this->get_blogname(), __( 'Product out of stock', 'woocommerce' ) );
/* translators: %s: product name */
$message = sprintf( __( '%s is out of stock.', 'woocommerce' ), html_entity_decode( wp_strip_all_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ) );

View File

@ -826,6 +826,7 @@ class WC_Form_Handler {
$quantity_set = false;
foreach ( $items as $item => $quantity ) {
$quantity = wc_stock_amount( $quantity );
if ( $quantity <= 0 ) {
continue;
}

View File

@ -303,12 +303,12 @@ class WC_Install {
self::create_terms();
self::create_cron_jobs();
self::create_files();
self::maybe_enable_setup_wizard();
self::maybe_create_pages();
self::update_wc_version();
self::maybe_update_db_version();
self::maybe_enable_homescreen();
delete_transient( 'wc_installing' );
set_transient( '_wc_activation_redirect', 1, 30 );
do_action( 'woocommerce_flush_rewrite_rules' );
do_action( 'woocommerce_installed' );
@ -351,17 +351,6 @@ class WC_Install {
return $missing_tables;
}
/**
* Check if the homepage should be enabled and set the appropriate option if thats the case.
*
* @since 4.3.0
*/
private static function maybe_enable_homescreen() {
if ( self::is_new_install() && ! get_option( 'woocommerce_homescreen_enabled' ) ) {
add_option( 'woocommerce_homescreen_enabled', 'yes' );
}
}
/**
* Reset any notices added to admin.
*
@ -415,18 +404,6 @@ class WC_Install {
return ! is_null( $current_db_version ) && version_compare( $current_db_version, end( $update_versions ), '<' );
}
/**
* See if we need the wizard or not.
*
* @since 3.2.0
*/
private static function maybe_enable_setup_wizard() {
if ( apply_filters( 'woocommerce_enable_setup_wizard', true ) && self::is_new_install() ) {
WC_Admin_Notices::add_notice( 'install', true );
set_transient( '_wc_activation_redirect', 1, 30 );
}
}
/**
* See if we need to show or run database updates during install.
*
@ -548,6 +525,15 @@ class WC_Install {
wp_schedule_event( time() + 10, apply_filters( 'woocommerce_tracker_event_recurrence', 'daily' ), 'woocommerce_tracker_send_event' );
}
/**
* Create pages on installation.
*/
public static function maybe_create_pages() {
if ( empty( get_option( 'woocommerce_db_version' ) ) ) {
self::create_pages();
}
}
/**
* Create pages that the plugin relies on, storing page IDs in variables.
*/

View File

@ -9,7 +9,7 @@
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'WC_Privacy_Background_Process', false ) ) {
include_once dirname( __FILE__ ) . '/class-wc-privacy-background-process.php';
include_once __DIR__ . '/class-wc-privacy-background-process.php';
}
/**
@ -35,8 +35,8 @@ class WC_Privacy extends WC_Abstract_Privacy {
}
// Include supporting classes.
include_once 'class-wc-privacy-erasers.php';
include_once 'class-wc-privacy-exporters.php';
include_once __DIR__ . '/class-wc-privacy-erasers.php';
include_once __DIR__ . '/class-wc-privacy-exporters.php';
// This hook registers WooCommerce data exporters.
$this->add_exporter( 'woocommerce-customer-data', __( 'WooCommerce Customer Data', 'woocommerce' ), array( 'WC_Privacy_Exporters', 'customer_data_exporter' ) );

View File

@ -2,7 +2,7 @@
/**
* REST API Authentication
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.6.0
*/

View File

@ -4,7 +4,7 @@
*
* Extends Exception to provide additional data.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.6.0
*/

View File

@ -9,7 +9,7 @@
defined( 'ABSPATH' ) || exit;
require_once 'legacy/class-wc-legacy-shipping-zone.php';
require_once __DIR__ . '/legacy/class-wc-legacy-shipping-zone.php';
/**
* WC_Shipping_Zone class.

View File

@ -202,11 +202,19 @@ class WC_Tracker {
$memory = max( $memory, $system_memory );
}
// WordPress 5.5+ environment type specification.
// 'production' is the default in WP, thus using it as a default here, too.
$environment_type = 'production';
if ( function_exists( 'wp_get_environment_type' ) ) {
$environment_type = wp_get_environment_type();
}
$wp_data['memory_limit'] = size_format( $memory );
$wp_data['debug_mode'] = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No';
$wp_data['locale'] = get_locale();
$wp_data['version'] = get_bloginfo( 'version' );
$wp_data['multisite'] = is_multisite() ? 'Yes' : 'No';
$wp_data['env_type'] = $environment_type;
return $wp_data;
}

View File

@ -15,7 +15,7 @@ use Automattic\Jetpack\Constants;
defined( 'ABSPATH' ) || exit;
require_once 'legacy/class-wc-legacy-webhook.php';
require_once __DIR__ . '/legacy/class-wc-legacy-webhook.php';
/**
* Webhook class.

View File

@ -22,7 +22,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '4.5.1';
public $version = '4.7.0';
/**
* WooCommerce Schema version.

View File

@ -294,7 +294,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
$this->form_fields = include 'includes/settings-paypal.php';
$this->form_fields = include __DIR__ . '/includes/settings-paypal.php';
}
/**

View File

@ -115,10 +115,10 @@ class WC_Gateway_Paypal_API_Handler {
WC_Gateway_Paypal::log( 'DoCapture Response: ' . wc_print_r( $raw_response, true ) );
if ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );
} elseif ( is_wp_error( $raw_response ) ) {
if ( is_wp_error( $raw_response ) ) {
return $raw_response;
} elseif ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );
}
parse_str( $raw_response['body'], $response );
@ -148,10 +148,10 @@ class WC_Gateway_Paypal_API_Handler {
WC_Gateway_Paypal::log( 'Refund Response: ' . wc_print_r( $raw_response, true ) );
if ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );
} elseif ( is_wp_error( $raw_response ) ) {
if ( is_wp_error( $raw_response ) ) {
return $raw_response;
} elseif ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );
}
parse_str( $raw_response['body'], $response );

View File

@ -8,7 +8,7 @@
defined( 'ABSPATH' ) || exit;
require_once 'class-wc-integration-maxmind-database-service.php';
require_once __DIR__ . '/class-wc-integration-maxmind-database-service.php';
/**
* WC Integration MaxMind Geolocation

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 3.0.0
*/
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* REST API Legacy Coupons controller class.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @extends WC_REST_CRUD_Controller
*/
class WC_REST_Legacy_Coupons_Controller extends WC_REST_CRUD_Controller {

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 3.0.0
*/
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* REST API Legacy Orders controller class.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @extends WC_REST_CRUD_Controller
*/
class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 3.0.0
*/
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* REST API Legacy Products controller class.
*
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @extends WC_REST_CRUD_Controller
*/
class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1.0
* @version 2.4.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 3.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -9,7 +9,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 2.1
*/

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1.0
* @version 2.4.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 3.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -9,7 +9,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1.0
* @version 2.4.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
* @version 3.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -9,7 +9,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.5.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.2
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category API
* @package WooCommerce\API
* @package WooCommerce\RestApi
* @since 2.1
*/

Some files were not shown because too many files have changed in this diff Show More