Codemod to change php i18n text domain from 'woocommerce-admin' to 'woocommerce' in post-merge WCA folders

This commit is contained in:
RJChow 2022-03-31 19:26:53 +08:00
parent 6e8d620f00
commit 09a0d2568e
156 changed files with 1320 additions and 1320 deletions

View File

@ -23,25 +23,25 @@ function wc_admin_get_core_pages_to_connect() {
return array(
'wc-addons' => array(
'title' => __( 'Extensions', 'woocommerce-admin' ),
'title' => __( 'Extensions', 'woocommerce' ),
'tabs' => array(),
),
'wc-reports' => array(
'title' => __( 'Reports', 'woocommerce-admin' ),
'title' => __( 'Reports', 'woocommerce' ),
'tabs' => $report_tabs,
),
'wc-settings' => array(
'title' => __( 'Settings', 'woocommerce-admin' ),
'title' => __( 'Settings', 'woocommerce' ),
'tabs' => apply_filters( 'woocommerce_settings_tabs_array', array() ),
),
'wc-status' => array(
'title' => __( 'Status', 'woocommerce-admin' ),
'title' => __( 'Status', 'woocommerce' ),
'tabs' => apply_filters(
'woocommerce_admin_status_tabs',
array(
'status' => __( 'System status', 'woocommerce-admin' ),
'tools' => __( 'Tools', 'woocommerce-admin' ),
'logs' => __( 'Logs', 'woocommerce-admin' ),
'status' => __( 'System status', 'woocommerce' ),
'tools' => __( 'Tools', 'woocommerce' ),
'logs' => __( 'Logs', 'woocommerce' ),
)
),
),
@ -59,7 +59,7 @@ function wc_admin_filter_core_page_breadcrumbs( $breadcrumbs ) {
$pages_to_connect = wc_admin_get_core_pages_to_connect();
$woocommerce_breadcrumb = array(
'admin.php?page=wc-admin',
__( 'WooCommerce', 'woocommerce-admin' ),
__( 'WooCommerce', 'woocommerce' ),
);
foreach ( $pages_to_connect as $page_id => $page_data ) {
@ -129,7 +129,7 @@ wc_admin_connect_page(
array(
'id' => 'woocommerce-orders',
'screen_id' => 'edit-shop_order',
'title' => __( 'Orders', 'woocommerce-admin' ),
'title' => __( 'Orders', 'woocommerce' ),
'path' => add_query_arg( 'post_type', 'shop_order', $posttype_list_base ),
)
);
@ -140,7 +140,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-add-order',
'parent' => 'woocommerce-orders',
'screen_id' => 'shop_order-add',
'title' => __( 'Add New', 'woocommerce-admin' ),
'title' => __( 'Add New', 'woocommerce' ),
)
);
@ -150,7 +150,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-edit-order',
'parent' => 'woocommerce-orders',
'screen_id' => 'shop_order',
'title' => __( 'Edit Order', 'woocommerce-admin' ),
'title' => __( 'Edit Order', 'woocommerce' ),
)
);
@ -160,7 +160,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-coupons',
'parent' => Features::is_enabled( 'coupons' ) ? 'woocommerce-marketing' : null,
'screen_id' => 'edit-shop_coupon',
'title' => __( 'Coupons', 'woocommerce-admin' ),
'title' => __( 'Coupons', 'woocommerce' ),
'path' => add_query_arg( 'post_type', 'shop_coupon', $posttype_list_base ),
)
);
@ -171,7 +171,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-add-coupon',
'parent' => 'woocommerce-coupons',
'screen_id' => 'shop_coupon-add',
'title' => __( 'Add New', 'woocommerce-admin' ),
'title' => __( 'Add New', 'woocommerce' ),
)
);
@ -181,7 +181,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-edit-coupon',
'parent' => 'woocommerce-coupons',
'screen_id' => 'shop_coupon',
'title' => __( 'Edit Coupon', 'woocommerce-admin' ),
'title' => __( 'Edit Coupon', 'woocommerce' ),
)
);
@ -190,7 +190,7 @@ wc_admin_connect_page(
array(
'id' => 'woocommerce-products',
'screen_id' => 'edit-product',
'title' => __( 'Products', 'woocommerce-admin' ),
'title' => __( 'Products', 'woocommerce' ),
'path' => add_query_arg( 'post_type', 'product', $posttype_list_base ),
)
);
@ -201,7 +201,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-add-product',
'parent' => 'woocommerce-products',
'screen_id' => 'product-add',
'title' => __( 'Add New', 'woocommerce-admin' ),
'title' => __( 'Add New', 'woocommerce' ),
)
);
@ -211,7 +211,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-edit-product',
'parent' => 'woocommerce-products',
'screen_id' => 'product',
'title' => __( 'Edit Product', 'woocommerce-admin' ),
'title' => __( 'Edit Product', 'woocommerce' ),
)
);
@ -221,7 +221,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-import-products',
'parent' => 'woocommerce-products',
'screen_id' => 'product_page_product_importer',
'title' => __( 'Import Products', 'woocommerce-admin' ),
'title' => __( 'Import Products', 'woocommerce' ),
)
);
@ -231,7 +231,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-export-products',
'parent' => 'woocommerce-products',
'screen_id' => 'product_page_product_exporter',
'title' => __( 'Export Products', 'woocommerce-admin' ),
'title' => __( 'Export Products', 'woocommerce' ),
)
);
@ -241,7 +241,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-categories',
'parent' => 'woocommerce-products',
'screen_id' => 'edit-product_cat',
'title' => __( 'Product categories', 'woocommerce-admin' ),
'title' => __( 'Product categories', 'woocommerce' ),
)
);
@ -251,7 +251,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-edit-category',
'parent' => 'woocommerce-products',
'screen_id' => 'product_cat',
'title' => __( 'Edit category', 'woocommerce-admin' ),
'title' => __( 'Edit category', 'woocommerce' ),
)
);
@ -261,7 +261,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-tags',
'parent' => 'woocommerce-products',
'screen_id' => 'edit-product_tag',
'title' => __( 'Product tags', 'woocommerce-admin' ),
'title' => __( 'Product tags', 'woocommerce' ),
)
);
@ -271,7 +271,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-edit-tag',
'parent' => 'woocommerce-products',
'screen_id' => 'product_tag',
'title' => __( 'Edit tag', 'woocommerce-admin' ),
'title' => __( 'Edit tag', 'woocommerce' ),
)
);
@ -281,7 +281,7 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-attributes',
'parent' => 'woocommerce-products',
'screen_id' => 'product_page_product_attributes',
'title' => __( 'Attributes', 'woocommerce-admin' ),
'title' => __( 'Attributes', 'woocommerce' ),
)
);
@ -291,6 +291,6 @@ wc_admin_connect_page(
'id' => 'woocommerce-product-edit-attribute',
'parent' => 'woocommerce-products',
'screen_id' => 'product_page_product_attribute-edit',
'title' => __( 'Edit attribute', 'woocommerce-admin' ),
'title' => __( 'Edit attribute', 'woocommerce' ),
)
);

View File

@ -16,7 +16,7 @@ do_action( 'woocommerce_email_header', $email_heading, $email );
<a href="<?php echo esc_url( $download_url ); ?>">
<?php
/* translators: %s: report name */
echo esc_html( sprintf( __( 'Download your %s Report', 'woocommerce-admin' ), $report_name ) );
echo esc_html( sprintf( __( 'Download your %s Report', 'woocommerce' ), $report_name ) );
?>
</a>
<?php

View File

@ -12,7 +12,7 @@ echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %1$s: report name, %2$s: download URL */
echo wp_kses_post( sprintf( __( 'Download your %1$s Report: %2$s', 'woocommerce-admin' ), $report_name, $download_url ) );
echo wp_kses_post( sprintf( __( 'Download your %1$s Report: %2$s', 'woocommerce' ), $report_name, $download_url ) );
echo "\n\n----------------------------------------\n\n";

View File

@ -16,7 +16,7 @@ echo wp_kses_post( $email_content );
foreach ( $email_actions as $an_action ) {
echo "\n";
/* translators: %1$s: action label, %2$s: action URL */
echo wp_kses_post( sprintf( __( '%1$s: %2$s', 'woocommerce-admin' ), $an_action->label, $trigger_note_action_url . $an_action->id ) );
echo wp_kses_post( sprintf( __( '%1$s: %2$s', 'woocommerce' ), $an_action->label, $trigger_note_action_url . $an_action->id ) );
}
echo "\n\n----------------------------------------\n\n";

View File

@ -32,7 +32,7 @@ class Coupons extends \WC_REST_Coupons_Controller {
public function get_collection_params() {
$params = parent::get_collection_params();
$params['search'] = array(
'description' => __( 'Limit results to coupons with codes matching a given string.', 'woocommerce-admin' ),
'description' => __( 'Limit results to coupons with codes matching a given string.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);

View File

@ -26,7 +26,7 @@ trait CustomAttributeTraits {
if ( empty( $matching_attributes ) ) {
return new \WP_Error(
'woocommerce_rest_product_attribute_not_found',
__( 'No product attribute with that slug was found.', 'woocommerce-admin' ),
__( 'No product attribute with that slug was found.', 'woocommerce' ),
array( 'status' => 404 )
);
}

View File

@ -48,7 +48,7 @@ class Customers extends \Automattic\WooCommerce\Admin\API\Reports\Customers\Cont
array(
'args' => array(
'id' => array(
'description' => __( 'Unique ID for the resource.', 'woocommerce-admin' ),
'description' => __( 'Unique ID for the resource.', 'woocommerce' ),
'type' => 'integer',
),
),

View File

@ -36,7 +36,7 @@ class Data extends \WC_REST_Data_Controller {
$this->prepare_item_for_response(
(object) array(
'slug' => 'download-ips',
'description' => __( 'An endpoint used for searching download logs for a specific IP address.', 'woocommerce-admin' ),
'description' => __( 'An endpoint used for searching download logs for a specific IP address.', 'woocommerce' ),
),
$request
)

View File

@ -70,7 +70,7 @@ class DataDownloadIPs extends \WC_REST_Data_Controller {
)
);
} else {
return new \WP_Error( 'woocommerce_rest_data_download_ips_invalid_request', __( 'Invalid request. Please pass the match parameter.', 'woocommerce-admin' ), array( 'status' => 400 ) );
return new \WP_Error( 'woocommerce_rest_data_download_ips_invalid_request', __( 'Invalid request. Please pass the match parameter.', 'woocommerce' ), array( 'status' => 400 ) );
}
$data = array();
@ -134,7 +134,7 @@ class DataDownloadIPs extends \WC_REST_Data_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['match'] = array(
'description' => __( 'A partial IP address can be passed and matching results will be returned.', 'woocommerce-admin' ),
'description' => __( 'A partial IP address can be passed and matching results will be returned.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
@ -155,7 +155,7 @@ class DataDownloadIPs extends \WC_REST_Data_Controller {
'properties' => array(
'user_ip_address' => array(
'type' => 'string',
'description' => __( 'IP address.', 'woocommerce-admin' ),
'description' => __( 'IP address.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
),

View File

@ -62,7 +62,7 @@ class Experiments extends \WC_REST_Data_Controller {
if ( ! isset( $args['experiment_name'] ) ) {
return new \WP_Error(
'woocommerce_rest_experiment_name_required',
__( 'Sorry, experiment_name is required.', 'woocommerce-admin' ),
__( 'Sorry, experiment_name is required.', 'woocommerce' ),
array( 'status' => 400 )
);
}

View File

@ -59,7 +59,7 @@ class Features extends \WC_REST_Data_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;

View File

@ -120,16 +120,16 @@ class Leaderboards extends \WC_REST_Data_Controller {
return array(
'id' => 'coupons',
'label' => __( 'Top Coupons - Number of Orders', 'woocommerce-admin' ),
'label' => __( 'Top Coupons - Number of Orders', 'woocommerce' ),
'headers' => array(
array(
'label' => __( 'Coupon code', 'woocommerce-admin' ),
'label' => __( 'Coupon code', 'woocommerce' ),
),
array(
'label' => __( 'Orders', 'woocommerce-admin' ),
'label' => __( 'Orders', 'woocommerce' ),
),
array(
'label' => __( 'Amount discounted', 'woocommerce-admin' ),
'label' => __( 'Amount discounted', 'woocommerce' ),
),
),
'rows' => $rows,
@ -189,16 +189,16 @@ class Leaderboards extends \WC_REST_Data_Controller {
return array(
'id' => 'categories',
'label' => __( 'Top categories - Items sold', 'woocommerce-admin' ),
'label' => __( 'Top categories - Items sold', 'woocommerce' ),
'headers' => array(
array(
'label' => __( 'Category', 'woocommerce-admin' ),
'label' => __( 'Category', 'woocommerce' ),
),
array(
'label' => __( 'Items sold', 'woocommerce-admin' ),
'label' => __( 'Items sold', 'woocommerce' ),
),
array(
'label' => __( 'Net sales', 'woocommerce-admin' ),
'label' => __( 'Net sales', 'woocommerce' ),
),
),
'rows' => $rows,
@ -256,16 +256,16 @@ class Leaderboards extends \WC_REST_Data_Controller {
return array(
'id' => 'customers',
'label' => __( 'Top Customers - Total Spend', 'woocommerce-admin' ),
'label' => __( 'Top Customers - Total Spend', 'woocommerce' ),
'headers' => array(
array(
'label' => __( 'Customer Name', 'woocommerce-admin' ),
'label' => __( 'Customer Name', 'woocommerce' ),
),
array(
'label' => __( 'Orders', 'woocommerce-admin' ),
'label' => __( 'Orders', 'woocommerce' ),
),
array(
'label' => __( 'Total Spend', 'woocommerce-admin' ),
'label' => __( 'Total Spend', 'woocommerce' ),
),
),
'rows' => $rows,
@ -325,16 +325,16 @@ class Leaderboards extends \WC_REST_Data_Controller {
return array(
'id' => 'products',
'label' => __( 'Top products - Items sold', 'woocommerce-admin' ),
'label' => __( 'Top products - Items sold', 'woocommerce' ),
'headers' => array(
array(
'label' => __( 'Product', 'woocommerce-admin' ),
'label' => __( 'Product', 'woocommerce' ),
),
array(
'label' => __( 'Items sold', 'woocommerce-admin' ),
'label' => __( 'Items sold', 'woocommerce' ),
),
array(
'label' => __( 'Net sales', 'woocommerce-admin' ),
'label' => __( 'Net sales', 'woocommerce' ),
),
),
'rows' => $rows,
@ -445,7 +445,7 @@ class Leaderboards extends \WC_REST_Data_Controller {
public function get_collection_params() {
$params = array();
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -453,7 +453,7 @@ class Leaderboards extends \WC_REST_Data_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 5,
'minimum' => 1,
@ -462,19 +462,19 @@ class Leaderboards extends \WC_REST_Data_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['persisted_query'] = array(
'description' => __( 'URL query to persist across links.', 'woocommerce-admin' ),
'description' => __( 'URL query to persist across links.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
@ -494,26 +494,26 @@ class Leaderboards extends \WC_REST_Data_Controller {
'properties' => array(
'id' => array(
'type' => 'string',
'description' => __( 'Leaderboard ID.', 'woocommerce-admin' ),
'description' => __( 'Leaderboard ID.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
),
'label' => array(
'type' => 'string',
'description' => __( 'Displayed title for the leaderboard.', 'woocommerce-admin' ),
'description' => __( 'Displayed title for the leaderboard.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
),
'headers' => array(
'type' => 'array',
'description' => __( 'Table headers.', 'woocommerce-admin' ),
'description' => __( 'Table headers.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'array',
'properties' => array(
'label' => array(
'description' => __( 'Table column header.', 'woocommerce-admin' ),
'description' => __( 'Table column header.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -523,20 +523,20 @@ class Leaderboards extends \WC_REST_Data_Controller {
),
'rows' => array(
'type' => 'array',
'description' => __( 'Table rows.', 'woocommerce-admin' ),
'description' => __( 'Table rows.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'array',
'properties' => array(
'display' => array(
'description' => __( 'Table cell display.', 'woocommerce-admin' ),
'description' => __( 'Table cell display.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'value' => array(
'description' => __( 'Table cell value.', 'woocommerce-admin' ),
'description' => __( 'Table cell value.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -88,7 +88,7 @@ class Marketing extends \WC_REST_Data_Controller {
*/
public function get_recommended_plugins_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;

View File

@ -84,13 +84,13 @@ class MarketingOverview extends \WC_REST_Data_Controller {
$plugin_slug = $request->get_param( 'plugin' );
if ( ! PluginsHelper::is_plugin_installed( $plugin_slug ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'Invalid plugin.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'Invalid plugin.', 'woocommerce' ), 404 );
}
$result = activate_plugin( PluginsHelper::get_plugin_path_from_slug( $plugin_slug ) );
if ( ! is_null( $result ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'The plugin could not be activated.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'The plugin could not be activated.', 'woocommerce' ), 500 );
}
// IMPORTANT - Don't return the active plugins data here.
@ -111,7 +111,7 @@ class MarketingOverview extends \WC_REST_Data_Controller {
*/
public function install_plugins_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;

View File

@ -118,7 +118,7 @@ class NavigationFavorites extends \WC_REST_Data_Controller {
return $this->prepare_error(
new \WP_Error(
'woocommerce_favorites_invalid_user',
__( 'Invalid user_id provided', 'woocommerce-admin' )
__( 'Invalid user_id provided', 'woocommerce' )
)
);
}

View File

@ -30,11 +30,11 @@ class NoteActions extends Notes {
array(
'args' => array(
'note_id' => array(
'description' => __( 'Unique ID for the Note.', 'woocommerce-admin' ),
'description' => __( 'Unique ID for the Note.', 'woocommerce' ),
'type' => 'integer',
),
'action_id' => array(
'description' => __( 'Unique ID for the Note Action.', 'woocommerce-admin' ),
'description' => __( 'Unique ID for the Note Action.', 'woocommerce' ),
'type' => 'integer',
),
),
@ -61,7 +61,7 @@ class NoteActions extends Notes {
if ( ! $note ) {
return new \WP_Error(
'woocommerce_note_invalid_id',
__( 'Sorry, there is no resource with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}
@ -74,7 +74,7 @@ class NoteActions extends Notes {
if ( ! $triggered_action ) {
return new \WP_Error(
'woocommerce_note_action_invalid_id',
__( 'Sorry, there is no resource with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}

View File

@ -67,7 +67,7 @@ class Notes extends \WC_REST_CRUD_Controller {
array(
'args' => array(
'id' => array(
'description' => __( 'Unique ID for the resource.', 'woocommerce-admin' ),
'description' => __( 'Unique ID for the resource.', 'woocommerce' ),
'type' => 'integer',
),
),
@ -108,7 +108,7 @@ class Notes extends \WC_REST_CRUD_Controller {
'permission_callback' => array( $this, 'update_items_permissions_check' ),
'args' => array(
'status' => array(
'description' => __( 'Status of note.', 'woocommerce-admin' ),
'description' => __( 'Status of note.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -175,7 +175,7 @@ class Notes extends \WC_REST_CRUD_Controller {
if ( ! $note ) {
return new \WP_Error(
'woocommerce_note_invalid_id',
__( 'Sorry, there is no resource with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}
@ -295,7 +295,7 @@ class Notes extends \WC_REST_CRUD_Controller {
*/
public function get_item_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'system_status', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -309,7 +309,7 @@ class Notes extends \WC_REST_CRUD_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'system_status', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -327,7 +327,7 @@ class Notes extends \WC_REST_CRUD_Controller {
if ( ! $note ) {
return new \WP_Error(
'woocommerce_note_invalid_id',
__( 'Sorry, there is no resource with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}
@ -348,7 +348,7 @@ class Notes extends \WC_REST_CRUD_Controller {
if ( ! $note ) {
return new \WP_Error(
'woocommerce_note_invalid_id',
__( 'Sorry, there is no note with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no note with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}
@ -434,7 +434,7 @@ class Notes extends \WC_REST_CRUD_Controller {
if ( ! isset( $note_ids ) || ! is_array( $note_ids ) ) {
return new \WP_Error(
'woocommerce_note_invalid_ids',
__( 'Please provide an array of IDs through the noteIds param.', 'woocommerce-admin' ),
__( 'Please provide an array of IDs through the noteIds param.', 'woocommerce' ),
array( 'status' => 422 )
);
}
@ -464,7 +464,7 @@ class Notes extends \WC_REST_CRUD_Controller {
if ( ! in_array( $promo_note_name, $this->allowed_promo_notes, true ) ) {
return new \WP_Error(
'woocommerce_note_invalid_promo_note_name',
__( 'Please provide a valid promo note name.', 'woocommerce-admin' ),
__( 'Please provide a valid promo note name.', 'woocommerce' ),
array( 'status' => 422 )
);
}
@ -505,7 +505,7 @@ class Notes extends \WC_REST_CRUD_Controller {
*/
public function update_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
}
@ -634,14 +634,14 @@ class Notes extends \WC_REST_CRUD_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -654,7 +654,7 @@ class Notes extends \WC_REST_CRUD_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -662,7 +662,7 @@ class Notes extends \WC_REST_CRUD_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -671,7 +671,7 @@ class Notes extends \WC_REST_CRUD_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['type'] = array(
'description' => __( 'Type of note.', 'woocommerce-admin' ),
'description' => __( 'Type of note.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -681,7 +681,7 @@ class Notes extends \WC_REST_CRUD_Controller {
),
);
$params['status'] = array(
'description' => __( 'Status of note.', 'woocommerce-admin' ),
'description' => __( 'Status of note.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -691,7 +691,7 @@ class Notes extends \WC_REST_CRUD_Controller {
),
);
$params['source'] = array(
'description' => __( 'Source of note.', 'woocommerce-admin' ),
'description' => __( 'Source of note.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_list',
'validate_callback' => 'rest_validate_request_arg',
@ -714,108 +714,108 @@ class Notes extends \WC_REST_CRUD_Controller {
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'ID of the note record.', 'woocommerce-admin' ),
'description' => __( 'ID of the note record.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Name of the note.', 'woocommerce-admin' ),
'description' => __( 'Name of the note.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'type' => array(
'description' => __( 'The type of the note (e.g. error, warning, etc.).', 'woocommerce-admin' ),
'description' => __( 'The type of the note (e.g. error, warning, etc.).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'locale' => array(
'description' => __( 'Locale used for the note title and content.', 'woocommerce-admin' ),
'description' => __( 'Locale used for the note title and content.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'title' => array(
'description' => __( 'Title of the note.', 'woocommerce-admin' ),
'description' => __( 'Title of the note.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'content' => array(
'description' => __( 'Content of the note.', 'woocommerce-admin' ),
'description' => __( 'Content of the note.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'content_data' => array(
'description' => __( 'Content data for the note. JSON string. Available for re-localization.', 'woocommerce-admin' ),
'description' => __( 'Content data for the note. JSON string. Available for re-localization.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'status' => array(
'description' => __( 'The status of the note (e.g. unactioned, actioned).', 'woocommerce-admin' ),
'description' => __( 'The status of the note (e.g. unactioned, actioned).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'source' => array(
'description' => __( 'Source of the note.', 'woocommerce-admin' ),
'description' => __( 'Source of the note.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created' => array(
'description' => __( 'Date the note was created.', 'woocommerce-admin' ),
'description' => __( 'Date the note was created.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created_gmt' => array(
'description' => __( 'Date the note was created (GMT).', 'woocommerce-admin' ),
'description' => __( 'Date the note was created (GMT).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_reminder' => array(
'description' => __( 'Date after which the user should be reminded of the note, if any.', 'woocommerce-admin' ),
'description' => __( 'Date after which the user should be reminded of the note, if any.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true, // @todo Allow date_reminder to be updated.
),
'date_reminder_gmt' => array(
'description' => __( 'Date after which the user should be reminded of the note, if any (GMT).', 'woocommerce-admin' ),
'description' => __( 'Date after which the user should be reminded of the note, if any (GMT).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'is_snoozable' => array(
'description' => __( 'Whether or not a user can request to be reminded about the note.', 'woocommerce-admin' ),
'description' => __( 'Whether or not a user can request to be reminded about the note.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'actions' => array(
'description' => __( 'An array of actions, if any, for the note.', 'woocommerce-admin' ),
'description' => __( 'An array of actions, if any, for the note.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'layout' => array(
'description' => __( 'The layout of the note (e.g. banner, thumbnail, plain).', 'woocommerce-admin' ),
'description' => __( 'The layout of the note (e.g. banner, thumbnail, plain).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'image' => array(
'description' => __( 'The image of the note, if any.', 'woocommerce-admin' ),
'description' => __( 'The image of the note, if any.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'is_deleted' => array(
'description' => __( 'Registers whether the note is deleted or not', 'woocommerce-admin' ),
'description' => __( 'Registers whether the note is deleted or not', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -59,7 +59,7 @@ class OnboardingFreeExtensions extends \WC_REST_Data_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;

View File

@ -59,7 +59,7 @@ class OnboardingProductTypes extends \WC_REST_Data_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;

View File

@ -87,7 +87,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -101,7 +101,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
*/
public function update_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot edit this resource.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -162,7 +162,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
$result = array(
'status' => 'success',
'message' => __( 'Onboarding profile data has been updated.', 'woocommerce-admin' ),
'message' => __( 'Onboarding profile data has been updated.', 'woocommerce' ),
);
$response = $this->prepare_item_for_response( $result, $request );
@ -263,21 +263,21 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
$properties = array(
'completed' => array(
'type' => 'boolean',
'description' => __( 'Whether or not the profile was completed.', 'woocommerce-admin' ),
'description' => __( 'Whether or not the profile was completed.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'skipped' => array(
'type' => 'boolean',
'description' => __( 'Whether or not the profile was skipped.', 'woocommerce-admin' ),
'description' => __( 'Whether or not the profile was skipped.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'industry' => array(
'type' => 'array',
'description' => __( 'Industry.', 'woocommerce-admin' ),
'description' => __( 'Industry.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -287,7 +287,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'product_types' => array(
'type' => 'array',
'description' => __( 'Types of products sold.', 'woocommerce-admin' ),
'description' => __( 'Types of products sold.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'sanitize_callback' => 'wp_parse_slug_list',
@ -299,7 +299,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'product_count' => array(
'type' => 'string',
'description' => __( 'Number of products to be added.', 'woocommerce-admin' ),
'description' => __( 'Number of products to be added.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -313,7 +313,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'selling_venues' => array(
'type' => 'string',
'description' => __( 'Other places the store is selling products.', 'woocommerce-admin' ),
'description' => __( 'Other places the store is selling products.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -327,7 +327,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'number_employees' => array(
'type' => 'string',
'description' => __( 'Number of employees of the store.', 'woocommerce-admin' ),
'description' => __( 'Number of employees of the store.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -342,7 +342,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'revenue' => array(
'type' => 'string',
'description' => __( 'Current annual revenue of the store.', 'woocommerce-admin' ),
'description' => __( 'Current annual revenue of the store.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -358,7 +358,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'other_platform' => array(
'type' => 'string',
'description' => __( 'Name of other platform used to sell.', 'woocommerce-admin' ),
'description' => __( 'Name of other platform used to sell.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
@ -376,14 +376,14 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'other_platform_name' => array(
'type' => 'string',
'description' => __( 'Name of other platform used to sell (not listed).', 'woocommerce-admin' ),
'description' => __( 'Name of other platform used to sell (not listed).', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'business_extensions' => array(
'type' => 'array',
'description' => __( 'Extra business extensions to install.', 'woocommerce-admin' ),
'description' => __( 'Extra business extensions to install.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'sanitize_callback' => 'wp_parse_slug_list',
@ -404,7 +404,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'theme' => array(
'type' => 'string',
'description' => __( 'Selected store theme.', 'woocommerce-admin' ),
'description' => __( 'Selected store theme.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'sanitize_callback' => 'sanitize_title_with_dashes',
@ -412,28 +412,28 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
),
'setup_client' => array(
'type' => 'boolean',
'description' => __( 'Whether or not this store was setup for a client.', 'woocommerce-admin' ),
'description' => __( 'Whether or not this store was setup for a client.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'wccom_connected' => array(
'type' => 'boolean',
'description' => __( 'Whether or not the store was connected to WooCommerce.com during the extension flow.', 'woocommerce-admin' ),
'description' => __( 'Whether or not the store was connected to WooCommerce.com during the extension flow.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'is_agree_marketing' => array(
'type' => 'boolean',
'description' => __( 'Whether or not this store agreed to receiving marketing contents from WooCommerce.com.', 'woocommerce-admin' ),
'description' => __( 'Whether or not this store agreed to receiving marketing contents from WooCommerce.com.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => 'rest_validate_request_arg',
),
'store_email' => array(
'type' => 'string',
'description' => __( 'Store email address.', 'woocommerce-admin' ),
'description' => __( 'Store email address.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
'validate_callback' => array( __CLASS__, 'rest_validate_marketing_email' ),
@ -456,7 +456,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
if (
( $is_agree_marketing || ! empty( $value ) ) &&
! is_email( $value ) ) {
return new \WP_Error( 'rest_invalid_email', __( 'Invalid email address', 'woocommerce-admin' ) );
return new \WP_Error( 'rest_invalid_email', __( 'Invalid email address', 'woocommerce' ) );
};
return true;
}

View File

@ -91,7 +91,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
'template_name' => array(
'required' => true,
'type' => 'string',
'description' => __( 'Product template name.', 'woocommerce-admin' ),
'description' => __( 'Product template name.', 'woocommerce' ),
),
)
),
@ -110,7 +110,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
'permission_callback' => array( $this, 'get_tasks_permission_check' ),
'args' => array(
'ids' => array(
'description' => __( 'Optional parameter to get only specific task lists by id.', 'woocommerce-admin' ),
'description' => __( 'Optional parameter to get only specific task lists by id.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -189,14 +189,14 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
array(
'args' => array(
'duration' => array(
'description' => __( 'Time period to snooze the task.', 'woocommerce-admin' ),
'description' => __( 'Time period to snooze the task.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => function( $param, $request, $key ) {
return in_array( $param, array_keys( $this->duration_to_ms ), true );
},
),
'task_list_id' => array(
'description' => __( 'Optional parameter to query specific task list.', 'woocommerce-admin' ),
'description' => __( 'Optional parameter to query specific task list.', 'woocommerce' ),
'type' => 'string',
),
),
@ -244,7 +244,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
*/
public function create_products_permission_check( $request ) {
if ( ! wc_rest_check_post_permissions( 'product', 'create' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -258,7 +258,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
*/
public function create_pages_permission_check( $request ) {
if ( ! wc_rest_check_post_permissions( 'page', 'create' ) || ! current_user_can( 'manage_options' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create new pages.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create new pages.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -272,7 +272,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
*/
public function get_tasks_permission_check( $request ) {
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve onboarding tasks.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -286,7 +286,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
*/
public function hide_task_list_permission_check( $request ) {
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you are not allowed to hide task lists.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you are not allowed to hide task lists.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -300,7 +300,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
*/
public function snooze_task_permissions_check( $request ) {
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to snooze onboarding tasks.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to snooze onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -329,7 +329,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
$import = $importer->import();
return $import;
} else {
return new \WP_Error( 'woocommerce_rest_import_error', __( 'Sorry, the sample products data file was not found.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_rest_import_error', __( 'Sorry, the sample products data file was not found.', 'woocommerce' ) );
}
}
@ -365,7 +365,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
return new \WP_Error(
'woocommerce_rest_product_creation_error',
/* translators: %s is template name */
__( 'Sorry, creating the product with template failed.', 'woocommerce-admin' ),
__( 'Sorry, creating the product with template failed.', 'woocommerce' ),
array( 'status' => 500 )
);
}
@ -439,31 +439,31 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
$shop_url = get_permalink( wc_get_page_id( 'shop' ) );
if ( ! empty( $image['url'] ) && ! empty( $image['id'] ) ) {
return '<!-- wp:cover {"url":"' . esc_url( $image['url'] ) . '","id":' . intval( $image['id'] ) . ',"dimRatio":0} -->
<div class="wp-block-cover" style="background-image:url(' . esc_url( $image['url'] ) . ')"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce-admin' ) . '","textColor":"white","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce-admin' ) . '</p>
<div class="wp-block-cover" style="background-image:url(' . esc_url( $image['url'] ) . ')"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce' ) . '","textColor":"white","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph {"align":"center","textColor":"white"} -->
<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce-admin' ) . '</p>
<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:button {"align":"center"} -->
<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce-admin' ) . '</a></div>
<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce' ) . '</a></div>
<!-- /wp:button --></div></div>
<!-- /wp:cover -->';
}
return '<!-- wp:cover {"dimRatio":0} -->
<div class="wp-block-cover"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce-admin' ) . '","textColor":"white","fontSize":"large"} -->
<p class="has-text-color has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce-admin' ) . '</p>
<div class="wp-block-cover"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce' ) . '","textColor":"white","fontSize":"large"} -->
<p class="has-text-color has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph {"align":"center","textColor":"white"} -->
<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce-admin' ) . '</p>
<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:button {"align":"center"} -->
<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce-admin' ) . '</a></div>
<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce' ) . '</a></div>
<!-- /wp:button --></div></div>
<!-- /wp:cover -->';
}
@ -482,14 +482,14 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! empty( $image['url'] ) && ! empty( $image['id'] ) ) {
return '<!-- wp:media-text {' . $media_position . '"mediaId":' . intval( $image['id'] ) . ',"mediaType":"image"} -->
<div class="wp-block-media-text alignwide' . $css_class . '""><figure class="wp-block-media-text__media"><img src="' . esc_url( $image['url'] ) . '" alt="" class="wp-image-' . intval( $image['id'] ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce-admin' ) . '","fontSize":"large"} -->
<div class="wp-block-media-text alignwide' . $css_class . '""><figure class="wp-block-media-text__media"><img src="' . esc_url( $image['url'] ) . '" alt="" class="wp-image-' . intval( $image['id'] ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce' ) . '","fontSize":"large"} -->
<p class="has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:media-text -->';
}
return '<!-- wp:media-text {' . $media_position . '} -->
<div class="wp-block-media-text alignwide' . $css_class . '"><figure class="wp-block-media-text__media"></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce-admin' ) . '","fontSize":"large"} -->
<div class="wp-block-media-text alignwide' . $css_class . '"><figure class="wp-block-media-text__media"></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce' ) . '","fontSize":"large"} -->
<p class="has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:media-text -->';
@ -509,25 +509,25 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
$image_1 = ! empty( $images[0] ) ? $images[0] : '';
$template = self::get_homepage_cover_block( $image_1 ) . '
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'Shop by Category', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'Shop by Category', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:shortcode -->
[product_categories number="0" parent="0"]
<!-- /wp:shortcode -->
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'New In', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'New In', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:woocommerce/product-new {"columns":4} /-->
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'Fan Favorites', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'Fan Favorites', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:woocommerce/product-top-rated {"columns":4} /-->
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'On Sale', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'On Sale', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:woocommerce/product-on-sale {"columns":4} /-->
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'Best Sellers', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'Best Sellers', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:woocommerce/product-best-sellers {"columns":4} /-->
';
@ -546,7 +546,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
$image_3 = ! empty( $images[2] ) ? $images[2] : '';
$template = self::get_homepage_cover_block( $image_1 ) . '
<!-- wp:heading {"align":"center"} -->
<h2 style="text-align:center">' . __( 'New Products', 'woocommerce-admin' ) . '</h2>
<h2 style="text-align:center">' . __( 'New Products', 'woocommerce' ) . '</h2>
<!-- /wp:heading -->
<!-- wp:woocommerce/product-new /--> ' .
@ -648,7 +648,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
public static function create_homepage() {
$post_id = wp_insert_post(
array(
'post_title' => __( 'Homepage', 'woocommerce-admin' ),
'post_title' => __( 'Homepage', 'woocommerce' ),
'post_type' => 'page',
'post_status' => 'publish',
'post_content' => '', // Template content is updated below, so images can be attached to the post.
@ -676,7 +676,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
return array(
'status' => 'success',
'message' => __( 'Homepage created', 'woocommerce-admin' ),
'message' => __( 'Homepage created', 'woocommerce' ),
'post_id' => $post_id,
'edit_post_link' => htmlspecialchars_decode( get_edit_post_link( $post_id ) ),
);
@ -693,7 +693,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
public function get_task_list_params() {
$params = array();
$params['ids'] = array(
'description' => __( 'Optional parameter to get only specific task lists by id.', 'woocommerce-admin' ),
'description' => __( 'Optional parameter to get only specific task lists by id.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -703,7 +703,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
),
);
$params['extended_tasks'] = array(
'description' => __( 'List of extended deprecated tasks from the client side filter.', 'woocommerce-admin' ),
'description' => __( 'List of extended deprecated tasks from the client side filter.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => function( $param, $request, $key ) {
$has_valid_keys = true;
@ -764,7 +764,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task || ! $task->is_dismissable() ) {
return new \WP_Error(
'woocommerce_rest_invalid_task',
__( 'Sorry, no dismissable task with that ID was found.', 'woocommerce-admin' ),
__( 'Sorry, no dismissable task with that ID was found.', 'woocommerce' ),
array(
'status' => 404,
)
@ -797,7 +797,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task || ! $task->is_dismissable() ) {
return new \WP_Error(
'woocommerce_rest_invalid_task',
__( 'Sorry, no dismissable task with that ID was found.', 'woocommerce-admin' ),
__( 'Sorry, no dismissable task with that ID was found.', 'woocommerce' ),
array(
'status' => 404,
)
@ -835,7 +835,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task || ! $task->is_snoozeable() ) {
return new \WP_Error(
'woocommerce_rest_invalid_task',
__( 'Sorry, no snoozeable task with that ID was found.', 'woocommerce-admin' ),
__( 'Sorry, no snoozeable task with that ID was found.', 'woocommerce' ),
array(
'status' => 404,
)
@ -868,7 +868,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task || ! $task->is_snoozeable() ) {
return new \WP_Error(
'woocommerce_rest_invalid_task',
__( 'Sorry, no snoozeable task with that ID was found.', 'woocommerce-admin' ),
__( 'Sorry, no snoozeable task with that ID was found.', 'woocommerce' ),
array(
'status' => 404,
)
@ -893,7 +893,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task_list ) {
return new \WP_Error(
'woocommerce_rest_invalid_task_list',
__( 'Sorry, that task list was not found', 'woocommerce-admin' ),
__( 'Sorry, that task list was not found', 'woocommerce' ),
array(
'status' => 404,
)
@ -920,7 +920,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task_list ) {
return new \WP_Error(
'woocommerce_tasks_invalid_task_list',
__( 'Sorry, that task list was not found', 'woocommerce-admin' ),
__( 'Sorry, that task list was not found', 'woocommerce' ),
array(
'status' => 404,
)
@ -954,7 +954,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task ) {
return new \WP_Error(
'woocommerce_rest_invalid_task',
__( 'Sorry, no task with that ID was found.', 'woocommerce-admin' ),
__( 'Sorry, no task with that ID was found.', 'woocommerce' ),
array(
'status' => 404,
)

View File

@ -71,7 +71,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
*/
public function update_item_permissions_check( $request ) {
if ( ! current_user_can( 'switch_themes' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage themes.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage themes.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
}
@ -87,7 +87,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
$theme = sanitize_text_field( $request['theme'] );
if ( ! in_array( $theme, $allowed_themes, true ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce' ), 404 );
}
$installed_themes = wp_get_themes();
@ -121,7 +121,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
'woocommerce_rest_theme_install',
sprintf(
/* translators: %s: theme slug (example: woocommerce-services) */
__( 'The requested theme `%s` could not be installed. Theme API call failed.', 'woocommerce-admin' ),
__( 'The requested theme `%s` could not be installed. Theme API call failed.', 'woocommerce' ),
$theme
),
500
@ -136,7 +136,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
'woocommerce_rest_theme_install',
sprintf(
/* translators: %s: theme slug (example: woocommerce-services) */
__( 'The requested theme `%s` could not be installed.', 'woocommerce-admin' ),
__( 'The requested theme `%s` could not be installed.', 'woocommerce' ),
$theme
),
500
@ -160,7 +160,7 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
$allowed_themes = Themes::get_allowed_themes();
$theme = sanitize_text_field( $request['theme'] );
if ( ! in_array( $theme, $allowed_themes, true ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce' ), 404 );
}
require_once ABSPATH . 'wp-admin/includes/theme.php';
@ -169,12 +169,12 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
if ( ! in_array( $theme, array_keys( $installed_themes ), true ) ) {
/* translators: %s: theme slug (example: woocommerce-services) */
return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'Invalid theme %s.', 'woocommerce-admin' ), $theme ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'Invalid theme %s.', 'woocommerce' ), $theme ), 404 );
}
$result = switch_theme( $theme );
if ( ! is_null( $result ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'The requested theme could not be activated.', 'woocommerce-admin' ), $theme ), 500 );
return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'The requested theme could not be activated.', 'woocommerce' ), $theme ), 500 );
}
return( array(
@ -196,19 +196,19 @@ class OnboardingThemes extends \WC_REST_Data_Controller {
'type' => 'object',
'properties' => array(
'slug' => array(
'description' => __( 'Theme slug.', 'woocommerce-admin' ),
'description' => __( 'Theme slug.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Theme name.', 'woocommerce-admin' ),
'description' => __( 'Theme name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'status' => array(
'description' => __( 'Theme status.', 'woocommerce-admin' ),
'description' => __( 'Theme status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -72,12 +72,12 @@ class Options extends \WC_REST_Data_Controller {
$params = explode( ',', $request['options'] );
if ( ! isset( $request['options'] ) || ! is_array( $params ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'You must supply an array of options.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'You must supply an array of options.', 'woocommerce' ), 500 );
}
foreach ( $params as $option ) {
if ( ! $this->user_has_permission( $option, $request ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view these options.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
}
@ -113,12 +113,12 @@ class Options extends \WC_REST_Data_Controller {
$params = $request->get_json_params();
if ( ! is_array( $params ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'You must supply an array of options and values.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'You must supply an array of options and values.', 'woocommerce' ), 500 );
}
foreach ( $params as $option_name => $option_value ) {
if ( ! $this->user_has_permission( $option_name, $request, true ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage these options.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
}
@ -248,7 +248,7 @@ class Options extends \WC_REST_Data_Controller {
'properties' => array(
'options' => array(
'type' => 'array',
'description' => __( 'Array of options with associated values.', 'woocommerce-admin' ),
'description' => __( 'Array of options with associated values.', 'woocommerce' ),
'context' => array( 'view' ),
'readonly' => true,
),

View File

@ -34,7 +34,7 @@ class Orders extends \WC_REST_Orders_Controller {
$params = parent::get_collection_params();
// This needs to remain a string to support extensions that filter Order Number.
$params['number'] = array(
'description' => __( 'Limit result set to orders matching part of an order number.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders matching part of an order number.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);

View File

@ -73,7 +73,7 @@ class PaymentGatewaySuggestions extends \WC_REST_Data_Controller {
*/
public function get_permission_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
}
@ -114,43 +114,43 @@ class PaymentGatewaySuggestions extends \WC_REST_Data_Controller {
'type' => 'array',
'properties' => array(
'content' => array(
'description' => __( 'Suggestion description.', 'woocommerce-admin' ),
'description' => __( 'Suggestion description.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'id' => array(
'description' => __( 'Suggestion ID.', 'woocommerce-admin' ),
'description' => __( 'Suggestion ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'image' => array(
'description' => __( 'Gateway image.', 'woocommerce-admin' ),
'description' => __( 'Gateway image.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'is_visible' => array(
'description' => __( 'Suggestion visibility.', 'woocommerce-admin' ),
'description' => __( 'Suggestion visibility.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'plugins' => array(
'description' => __( 'Array of plugin slugs.', 'woocommerce-admin' ),
'description' => __( 'Array of plugin slugs.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'recommendation_priority' => array(
'description' => __( 'Priority of recommendation.', 'woocommerce-admin' ),
'description' => __( 'Priority of recommendation.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'title' => array(
'description' => __( 'Gateway title.', 'woocommerce-admin' ),
'description' => __( 'Gateway title.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -217,7 +217,7 @@ class Plugins extends \WC_REST_Data_Controller {
*/
public function update_item_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
}
@ -245,7 +245,7 @@ class Plugins extends \WC_REST_Data_Controller {
$plugins = explode( ',', $request['plugins'] );
if ( empty( $request['plugins'] ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
}
if ( isset( $request['async'] ) && $request['async'] ) {
@ -256,7 +256,7 @@ class Plugins extends \WC_REST_Data_Controller {
'job_id' => $job_id,
'plugins' => $plugins,
),
'message' => __( 'Plugin installation has been scheduled.', 'woocommerce-admin' ),
'message' => __( 'Plugin installation has been scheduled.', 'woocommerce' ),
);
}
@ -271,8 +271,8 @@ class Plugins extends \WC_REST_Data_Controller {
'errors' => $data['errors'],
'success' => count( $data['errors']->errors ) === 0,
'message' => count( $data['errors']->errors ) === 0
? __( 'Plugins were successfully installed.', 'woocommerce-admin' )
: __( 'There was a problem installing some of the requested plugins.', 'woocommerce-admin' ),
? __( 'Plugins were successfully installed.', 'woocommerce' )
: __( 'There was a problem installing some of the requested plugins.', 'woocommerce' ),
);
}
@ -340,7 +340,7 @@ class Plugins extends \WC_REST_Data_Controller {
$plugins = explode( ',', $request['plugins'] );
if ( empty( $request['plugins'] ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
}
if ( isset( $request['async'] ) && $request['async'] ) {
@ -351,7 +351,7 @@ class Plugins extends \WC_REST_Data_Controller {
'job_id' => $job_id,
'plugins' => $plugins,
),
'message' => __( 'Plugin activation has been scheduled.', 'woocommerce-admin' ),
'message' => __( 'Plugin activation has been scheduled.', 'woocommerce' ),
);
}
@ -365,8 +365,8 @@ class Plugins extends \WC_REST_Data_Controller {
'errors' => $data['errors'],
'success' => count( $data['errors']->errors ) === 0,
'message' => count( $data['errors']->errors ) === 0
? __( 'Plugins were successfully activated.', 'woocommerce-admin' )
: __( 'There was a problem activating some of the requested plugins.', 'woocommerce-admin' ),
? __( 'Plugins were successfully activated.', 'woocommerce' )
: __( 'There was a problem activating some of the requested plugins.', 'woocommerce' ),
) );
}
@ -400,7 +400,7 @@ class Plugins extends \WC_REST_Data_Controller {
*/
public function connect_jetpack( $request ) {
if ( ! class_exists( '\Jetpack' ) ) {
return new \WP_Error( 'woocommerce_rest_jetpack_not_active', __( 'Jetpack is not installed or active.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_jetpack_not_active', __( 'Jetpack is not installed or active.', 'woocommerce' ), 404 );
}
$redirect_url = apply_filters( 'woocommerce_admin_onboarding_jetpack_connect_redirect_url', esc_url_raw( $request['redirect_url'] ) );
@ -411,7 +411,7 @@ class Plugins extends \WC_REST_Data_Controller {
return( array(
'slug' => 'jetpack',
'name' => __( 'Jetpack', 'woocommerce-admin' ),
'name' => __( 'Jetpack', 'woocommerce' ),
'connectAction' => $connect_url,
) );
}
@ -424,7 +424,7 @@ class Plugins extends \WC_REST_Data_Controller {
public function request_wccom_connect() {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-api.php';
if ( ! class_exists( 'WC_Helper_API' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
}
$redirect_uri = wc_admin_url( '&task=connect&wccom-connected=1' );
@ -441,12 +441,12 @@ class Plugins extends \WC_REST_Data_Controller {
$code = wp_remote_retrieve_response_code( $request );
if ( 200 !== $code ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
}
$secret = json_decode( wp_remote_retrieve_body( $request ) );
if ( empty( $secret ) ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
}
do_action( 'woocommerce_helper_connect_start' );
@ -487,7 +487,7 @@ class Plugins extends \WC_REST_Data_Controller {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-updater.php';
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
if ( ! class_exists( 'WC_Helper_API' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
}
// Obtain an access token.
@ -503,12 +503,12 @@ class Plugins extends \WC_REST_Data_Controller {
$code = wp_remote_retrieve_response_code( $request );
if ( 200 !== $code ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
}
$access_token = json_decode( wp_remote_retrieve_body( $request ), true );
if ( ! $access_token ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
}
\WC_Helper_Options::update(
@ -524,7 +524,7 @@ class Plugins extends \WC_REST_Data_Controller {
if ( ! \WC_Helper::_flush_authentication_cache() ) {
\WC_Helper_Options::update( 'auth', array() );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
}
delete_transient( '_woocommerce_helper_subscriptions' );
@ -545,7 +545,7 @@ class Plugins extends \WC_REST_Data_Controller {
*/
public function connect_square() {
if ( ! class_exists( '\WooCommerce\Square\Handlers\Connection' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Square.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Square.', 'woocommerce' ), 500 );
}
if ( 'US' === WC()->countries->get_base_country() ) {
@ -597,7 +597,7 @@ class Plugins extends \WC_REST_Data_Controller {
*/
public function connect_wcpay() {
if ( ! class_exists( 'WC_Payments_Account' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error communicating with the WooCommerce Payments plugin.', 'woocommerce-admin' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error communicating with the WooCommerce Payments plugin.', 'woocommerce' ), 500 );
}
$connect_url = add_query_arg(
@ -625,19 +625,19 @@ class Plugins extends \WC_REST_Data_Controller {
'type' => 'object',
'properties' => array(
'slug' => array(
'description' => __( 'Plugin slug.', 'woocommerce-admin' ),
'description' => __( 'Plugin slug.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Plugin name.', 'woocommerce-admin' ),
'description' => __( 'Plugin name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'status' => array(
'description' => __( 'Plugin status.', 'woocommerce-admin' ),
'description' => __( 'Plugin status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -657,7 +657,7 @@ class Plugins extends \WC_REST_Data_Controller {
$schema = $this->get_item_schema();
unset( $schema['properties']['status'] );
$schema['properties']['connectAction'] = array(
'description' => __( 'Action that should be completed to connect Jetpack.', 'woocommerce-admin' ),
'description' => __( 'Action that should be completed to connect Jetpack.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -38,7 +38,7 @@ class ProductAttributeTerms extends \WC_REST_Product_Attribute_Terms_Controller
array(
'args' => array(
'slug' => array(
'description' => __( 'Slug identifier for the resource.', 'woocommerce-admin' ),
'description' => __( 'Slug identifier for the resource.', 'woocommerce' ),
'type' => 'string',
),
),
@ -63,7 +63,7 @@ class ProductAttributeTerms extends \WC_REST_Product_Attribute_Terms_Controller
if ( ! wc_rest_check_manager_permissions( 'attributes', 'read' ) ) {
return new WP_Error(
'woocommerce_rest_cannot_view',
__( 'Sorry, you cannot view this resource.', 'woocommerce-admin' ),
__( 'Sorry, you cannot view this resource.', 'woocommerce' ),
array(
'status' => rest_authorization_required_code(),
)

View File

@ -37,7 +37,7 @@ class ProductAttributes extends \WC_REST_Product_Attributes_Controller {
array(
'args' => array(
'slug' => array(
'description' => __( 'Slug identifier for the resource.', 'woocommerce-admin' ),
'description' => __( 'Slug identifier for the resource.', 'woocommerce' ),
'type' => 'string',
),
),
@ -59,7 +59,7 @@ class ProductAttributes extends \WC_REST_Product_Attributes_Controller {
public function get_collection_params() {
$params = parent::get_collection_params();
$params['search'] = array(
'description' => __( 'Search by similar attribute name.', 'woocommerce-admin' ),
'description' => __( 'Search by similar attribute name.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);

View File

@ -53,7 +53,7 @@ class ProductVariations extends \WC_REST_Product_Variations_Controller {
public function get_collection_params() {
$params = parent::get_collection_params();
$params['search'] = array(
'description' => __( 'Search by similar product name, sku, or attribute value.', 'woocommerce-admin' ),
'description' => __( 'Search by similar product name, sku, or attribute value.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
@ -163,19 +163,19 @@ class ProductVariations extends \WC_REST_Product_Variations_Controller {
$schema = parent::get_item_schema();
$schema['properties']['name'] = array(
'description' => __( 'Product parent name.', 'woocommerce-admin' ),
'description' => __( 'Product parent name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
);
$schema['properties']['type'] = array(
'description' => __( 'Product type.', 'woocommerce-admin' ),
'description' => __( 'Product type.', 'woocommerce' ),
'type' => 'string',
'default' => 'variation',
'enum' => array( 'variation' ),
'context' => array( 'view', 'edit' ),
);
$schema['properties']['parent_id'] = array(
'description' => __( 'Product parent ID.', 'woocommerce-admin' ),
'description' => __( 'Product parent ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
);

View File

@ -54,7 +54,7 @@ class Products extends \WC_REST_Products_Controller {
}
$schema['properties']['last_order_date'] = array(
'description' => __( "The date the last order for this product was placed, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the last order for this product was placed, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -71,13 +71,13 @@ class Products extends \WC_REST_Products_Controller {
public function get_collection_params() {
$params = parent::get_collection_params();
$params['low_in_stock'] = array(
'description' => __( 'Limit result set to products that are low or out of stock. (Deprecated)', 'woocommerce-admin' ),
'description' => __( 'Limit result set to products that are low or out of stock. (Deprecated)', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
);
$params['search'] = array(
'description' => __( 'Search by similar product name or sku.', 'woocommerce-admin' ),
'description' => __( 'Search by similar product name or sku.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);

View File

@ -288,7 +288,7 @@ final class ProductsLowInStock extends \WC_REST_Products_Controller {
$params['context']['default'] = 'view';
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -296,7 +296,7 @@ final class ProductsLowInStock extends \WC_REST_Products_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -307,7 +307,7 @@ final class ProductsLowInStock extends \WC_REST_Products_Controller {
$params['status'] = array(
'default' => 'publish',
'description' => __( 'Limit result set to products assigned a specific status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to products assigned a specific status.', 'woocommerce' ),
'type' => 'string',
'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),
'sanitize_callback' => 'sanitize_key',

View File

@ -73,7 +73,7 @@ class Controller extends ReportsController implements ExportableInterface {
}
if ( ! isset( $report_data->data ) || ! isset( $report_data->page_no ) || ! isset( $report_data->pages ) ) {
return new \WP_Error( 'woocommerce_rest_reports_categories_invalid_response', __( 'Invalid response from data store.', 'woocommerce-admin' ), array( 'status' => 500 ) );
return new \WP_Error( 'woocommerce_rest_reports_categories_invalid_response', __( 'Invalid response from data store.', 'woocommerce' ), array( 'status' => 500 ) );
}
$out_data = array();
@ -165,31 +165,31 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'object',
'properties' => array(
'category_id' => array(
'description' => __( 'Category ID.', 'woocommerce-admin' ),
'description' => __( 'Category ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'items_sold' => array(
'description' => __( 'Amount of items sold.', 'woocommerce-admin' ),
'description' => __( 'Amount of items sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'net_revenue' => array(
'description' => __( 'Total sales.', 'woocommerce-admin' ),
'description' => __( 'Total sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'products_count' => array(
'description' => __( 'Amount of products.', 'woocommerce-admin' ),
'description' => __( 'Amount of products.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -199,7 +199,7 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Category name.', 'woocommerce-admin' ),
'description' => __( 'Category name.', 'woocommerce' ),
),
),
),
@ -217,7 +217,7 @@ class Controller extends ReportsController implements ExportableInterface {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -225,7 +225,7 @@ class Controller extends ReportsController implements ExportableInterface {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -234,26 +234,26 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'category_id',
'enum' => array(
@ -267,7 +267,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -281,7 +281,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['status_is'] = array(
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -291,7 +291,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['status_is_not'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -301,7 +301,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['categories'] = array(
'description' => __( 'Limit result set to all items that have the specified term assigned in the categories taxonomy.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to all items that have the specified term assigned in the categories taxonomy.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -310,7 +310,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['extended_info'] = array(
'description' => __( 'Add additional piece of info about each category to the report.', 'woocommerce-admin' ),
'description' => __( 'Add additional piece of info about each category to the report.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
@ -327,11 +327,11 @@ class Controller extends ReportsController implements ExportableInterface {
*/
public function get_export_columns() {
$export_columns = array(
'category' => __( 'Category', 'woocommerce-admin' ),
'items_sold' => __( 'Items sold', 'woocommerce-admin' ),
'net_revenue' => __( 'Net Revenue', 'woocommerce-admin' ),
'products_count' => __( 'Products', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'category' => __( 'Category', 'woocommerce' ),
'items_sold' => __( 'Items sold', 'woocommerce' ),
'net_revenue' => __( 'Net Revenue', 'woocommerce' ),
'products_count' => __( 'Products', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
);
/**

View File

@ -272,7 +272,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
);
if ( null === $categories_data ) {
return new \WP_Error( 'woocommerce_analytics_categories_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ), array( 'status' => 500 ) );
return new \WP_Error( 'woocommerce_analytics_categories_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ), array( 'status' => 500 ) );
}
$record_count = count( $categories_data );

View File

@ -58,7 +58,7 @@ class Controller extends \WC_REST_Reports_Controller {
*/
public function get_items_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'reports', 'read' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -76,71 +76,71 @@ class Controller extends \WC_REST_Reports_Controller {
$reports = array(
array(
'slug' => 'performance-indicators',
'description' => __( 'Batch endpoint for getting specific performance indicators from `stats` endpoints.', 'woocommerce-admin' ),
'description' => __( 'Batch endpoint for getting specific performance indicators from `stats` endpoints.', 'woocommerce' ),
),
array(
'slug' => 'revenue/stats',
'description' => __( 'Stats about revenue.', 'woocommerce-admin' ),
'description' => __( 'Stats about revenue.', 'woocommerce' ),
),
array(
'slug' => 'orders/stats',
'description' => __( 'Stats about orders.', 'woocommerce-admin' ),
'description' => __( 'Stats about orders.', 'woocommerce' ),
),
array(
'slug' => 'products',
'description' => __( 'Products detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Products detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'products/stats',
'description' => __( 'Stats about products.', 'woocommerce-admin' ),
'description' => __( 'Stats about products.', 'woocommerce' ),
),
array(
'slug' => 'variations',
'description' => __( 'Variations detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Variations detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'variations/stats',
'description' => __( 'Stats about variations.', 'woocommerce-admin' ),
'description' => __( 'Stats about variations.', 'woocommerce' ),
),
array(
'slug' => 'categories',
'description' => __( 'Product categories detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Product categories detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'categories/stats',
'description' => __( 'Stats about product categories.', 'woocommerce-admin' ),
'description' => __( 'Stats about product categories.', 'woocommerce' ),
),
array(
'slug' => 'coupons',
'description' => __( 'Coupons detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Coupons detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'coupons/stats',
'description' => __( 'Stats about coupons.', 'woocommerce-admin' ),
'description' => __( 'Stats about coupons.', 'woocommerce' ),
),
array(
'slug' => 'taxes',
'description' => __( 'Taxes detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Taxes detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'taxes/stats',
'description' => __( 'Stats about taxes.', 'woocommerce-admin' ),
'description' => __( 'Stats about taxes.', 'woocommerce' ),
),
array(
'slug' => 'downloads',
'description' => __( 'Product downloads detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Product downloads detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'downloads/files',
'description' => __( 'Product download files detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Product download files detailed reports.', 'woocommerce' ),
),
array(
'slug' => 'downloads/stats',
'description' => __( 'Stats about product downloads.', 'woocommerce-admin' ),
'description' => __( 'Stats about product downloads.', 'woocommerce' ),
),
array(
'slug' => 'customers',
'description' => __( 'Customers detailed reports.', 'woocommerce-admin' ),
'description' => __( 'Customers detailed reports.', 'woocommerce' ),
),
);
@ -285,19 +285,19 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'slug' => array(
'description' => __( 'An alphanumeric identifier for the resource.', 'woocommerce-admin' ),
'description' => __( 'An alphanumeric identifier for the resource.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'description' => array(
'description' => __( 'A human-readable description of the resource.', 'woocommerce-admin' ),
'description' => __( 'A human-readable description of the resource.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'path' => array(
'description' => __( 'API path.', 'woocommerce-admin' ),
'description' => __( 'API path.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,

View File

@ -152,19 +152,19 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'coupon_id' => array(
'description' => __( 'Coupon ID.', 'woocommerce-admin' ),
'description' => __( 'Coupon ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'amount' => array(
'description' => __( 'Net discount amount.', 'woocommerce-admin' ),
'description' => __( 'Net discount amount.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -174,38 +174,38 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Coupon code.', 'woocommerce-admin' ),
'description' => __( 'Coupon code.', 'woocommerce' ),
),
'date_created' => array(
'type' => 'date-time',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Coupon creation date.', 'woocommerce-admin' ),
'description' => __( 'Coupon creation date.', 'woocommerce' ),
),
'date_created_gmt' => array(
'type' => 'date-time',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Coupon creation date in GMT.', 'woocommerce-admin' ),
'description' => __( 'Coupon creation date in GMT.', 'woocommerce' ),
),
'date_expires' => array(
'type' => 'date-time',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Coupon expiration date.', 'woocommerce-admin' ),
'description' => __( 'Coupon expiration date.', 'woocommerce' ),
),
'date_expires_gmt' => array(
'type' => 'date-time',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Coupon expiration date in GMT.', 'woocommerce-admin' ),
'description' => __( 'Coupon expiration date in GMT.', 'woocommerce' ),
),
'discount_type' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'enum' => array_keys( wc_get_coupon_types() ),
'description' => __( 'Coupon discount type.', 'woocommerce-admin' ),
'description' => __( 'Coupon discount type.', 'woocommerce' ),
),
),
),
@ -223,7 +223,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -231,7 +231,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -240,26 +240,26 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'coupon_id',
'enum' => array(
@ -271,7 +271,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['coupons'] = array(
'description' => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -280,7 +280,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['extended_info'] = array(
'description' => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce-admin' ),
'description' => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
@ -297,12 +297,12 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
$export_columns = array(
'code' => __( 'Coupon code', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'amount' => __( 'Amount discounted', 'woocommerce-admin' ),
'created' => __( 'Created', 'woocommerce-admin' ),
'expires' => __( 'Expires', 'woocommerce-admin' ),
'type' => __( 'Type', 'woocommerce-admin' ),
'code' => __( 'Coupon code', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
'amount' => __( 'Amount discounted', 'woocommerce' ),
'created' => __( 'Created', 'woocommerce' ),
'expires' => __( 'Expires', 'woocommerce' ),
'type' => __( 'Type', 'woocommerce' ),
);
/**
@ -325,7 +325,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function prepare_item_for_export( $item ) {
$date_expires = empty( $item['extended_info']['date_expires'] )
? __( 'N/A', 'woocommerce-admin' )
? __( 'N/A', 'woocommerce' )
: $item['extended_info']['date_expires'];
$export_item = array(

View File

@ -170,12 +170,12 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
if ( 0 === $coupon->get_id() ) {
// Deleted or otherwise invalid coupon.
$extended_info = array(
'code' => __( '(Deleted)', 'woocommerce-admin' ),
'code' => __( '(Deleted)', 'woocommerce' ),
'date_created' => '',
'date_created_gmt' => '',
'date_expires' => '',
'date_expires_gmt' => '',
'discount_type' => __( 'N/A', 'woocommerce-admin' ),
'discount_type' => __( 'N/A', 'woocommerce' ),
);
} else {
$gmt_timzone = new \DateTimeZone( 'UTC' );

View File

@ -142,7 +142,7 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$data_values = array(
'amount' => array(
'description' => __( 'Net discount amount.', 'woocommerce-admin' ),
'description' => __( 'Net discount amount.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -150,14 +150,14 @@ class Controller extends \WC_REST_Reports_Controller {
'format' => 'currency',
),
'coupons_count' => array(
'description' => __( 'Number of coupons.', 'woocommerce-admin' ),
'description' => __( 'Number of coupons.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'orders_count' => array(
'title' => __( 'Discounted orders', 'woocommerce-admin' ),
'description' => __( 'Number of discounted orders.', 'woocommerce-admin' ),
'title' => __( 'Discounted orders', 'woocommerce' ),
'description' => __( 'Number of discounted orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -167,7 +167,7 @@ class Controller extends \WC_REST_Reports_Controller {
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -175,13 +175,13 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -200,14 +200,14 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -215,38 +215,38 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -270,7 +270,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -278,7 +278,7 @@ class Controller extends \WC_REST_Reports_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -287,26 +287,26 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -318,7 +318,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -332,7 +332,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['coupons'] = array(
'description' => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -341,7 +341,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'product',
@ -352,7 +352,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -280,7 +280,7 @@ class Segmenter extends ReportsSegmenter {
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
} elseif ( 'variation' === $this->query_args['segmentby'] ) {
if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce-admin' ) );
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
}
$product_level_columns = $this->get_segment_selections_product_level( $product_segmenting_table );

View File

@ -222,91 +222,91 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Customer ID.', 'woocommerce-admin' ),
'description' => __( 'Customer ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'user_id' => array(
'description' => __( 'User ID.', 'woocommerce-admin' ),
'description' => __( 'User ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Name.', 'woocommerce-admin' ),
'description' => __( 'Name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'username' => array(
'description' => __( 'Username.', 'woocommerce-admin' ),
'description' => __( 'Username.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'country' => array(
'description' => __( 'Country / Region.', 'woocommerce-admin' ),
'description' => __( 'Country / Region.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'city' => array(
'description' => __( 'City.', 'woocommerce-admin' ),
'description' => __( 'City.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'state' => array(
'description' => __( 'Region.', 'woocommerce-admin' ),
'description' => __( 'Region.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'postcode' => array(
'description' => __( 'Postal code.', 'woocommerce-admin' ),
'description' => __( 'Postal code.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_registered' => array(
'description' => __( 'Date registered.', 'woocommerce-admin' ),
'description' => __( 'Date registered.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_registered_gmt' => array(
'description' => __( 'Date registered GMT.', 'woocommerce-admin' ),
'description' => __( 'Date registered GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_last_active' => array(
'description' => __( 'Date last active.', 'woocommerce-admin' ),
'description' => __( 'Date last active.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_last_active_gmt' => array(
'description' => __( 'Date last active GMT.', 'woocommerce-admin' ),
'description' => __( 'Date last active GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'orders_count' => array(
'description' => __( 'Order count.', 'woocommerce-admin' ),
'description' => __( 'Order count.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'total_spend' => array(
'description' => __( 'Total spend.', 'woocommerce-admin' ),
'description' => __( 'Total spend.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'avg_order_value' => array(
'description' => __( 'Avg order value.', 'woocommerce-admin' ),
'description' => __( 'Avg order value.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -325,31 +325,31 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['registered_before'] = array(
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_after'] = array(
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources with orders published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources with orders published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources with orders published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources with orders published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -357,7 +357,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -366,14 +366,14 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date_registered',
'enum' => array(
@ -392,7 +392,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -402,7 +402,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['search'] = array(
'description' => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
@ -417,59 +417,59 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['name_includes'] = array(
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['name_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['username_includes'] = array(
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['username_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['email_includes'] = array(
'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects including emails.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['email_excludes'] = array(
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['country_includes'] = array(
'description' => __( 'Limit response to objects with specfic countries.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic countries.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['country_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic countries.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic countries.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_before'] = array(
'description' => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_after'] = array(
'description' => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_between'] = array(
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
'items' => array(
@ -477,19 +477,19 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['registered_before'] = array(
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_after'] = array(
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_between'] = array(
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
'items' => array(
@ -497,19 +497,19 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['orders_count_min'] = array(
'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['orders_count_max'] = array(
'description' => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['orders_count_between'] = array(
'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -517,17 +517,17 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['total_spend_min'] = array(
'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['total_spend_max'] = array(
'description' => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['total_spend_between'] = array(
'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -535,17 +535,17 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['avg_order_value_min'] = array(
'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['avg_order_value_max'] = array(
'description' => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['avg_order_value_between'] = array(
'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -553,19 +553,19 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['last_order_before'] = array(
'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_order_after'] = array(
'description' => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['customers'] = array(
'description' => __( 'Limit result to items with specified customer ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified customer ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -584,18 +584,18 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
$export_columns = array(
'name' => __( 'Name', 'woocommerce-admin' ),
'username' => __( 'Username', 'woocommerce-admin' ),
'last_active' => __( 'Last Active', 'woocommerce-admin' ),
'registered' => __( 'Sign Up', 'woocommerce-admin' ),
'email' => __( 'Email', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'total_spend' => __( 'Total Spend', 'woocommerce-admin' ),
'avg_order_value' => __( 'AOV', 'woocommerce-admin' ),
'country' => __( 'Country / Region', 'woocommerce-admin' ),
'city' => __( 'City', 'woocommerce-admin' ),
'region' => __( 'Region', 'woocommerce-admin' ),
'postcode' => __( 'Postal Code', 'woocommerce-admin' ),
'name' => __( 'Name', 'woocommerce' ),
'username' => __( 'Username', 'woocommerce' ),
'last_active' => __( 'Last Active', 'woocommerce' ),
'registered' => __( 'Sign Up', 'woocommerce' ),
'email' => __( 'Email', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
'total_spend' => __( 'Total Spend', 'woocommerce' ),
'avg_order_value' => __( 'AOV', 'woocommerce' ),
'country' => __( 'Country / Region', 'woocommerce' ),
'city' => __( 'City', 'woocommerce' ),
'region' => __( 'Region', 'woocommerce' ),
'postcode' => __( 'Postal Code', 'woocommerce' ),
);
/**

View File

@ -129,26 +129,26 @@ class Controller extends \WC_REST_Reports_Controller {
// @todo Should any of these be 'indicator's?
$totals = array(
'customers_count' => array(
'description' => __( 'Number of customers.', 'woocommerce-admin' ),
'description' => __( 'Number of customers.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'avg_orders_count' => array(
'description' => __( 'Average number of orders.', 'woocommerce-admin' ),
'description' => __( 'Average number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'avg_total_spend' => array(
'description' => __( 'Average total spend per customer.', 'woocommerce-admin' ),
'description' => __( 'Average total spend per customer.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'avg_avg_order_value' => array(
'description' => __( 'Average AOV per customer.', 'woocommerce-admin' ),
'description' => __( 'Average AOV per customer.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -162,7 +162,7 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -183,19 +183,19 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['registered_before'] = array(
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_after'] = array(
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -205,7 +205,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['search'] = array(
'description' => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
@ -220,59 +220,59 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['name_includes'] = array(
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['name_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['username_includes'] = array(
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['username_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['email_includes'] = array(
'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects including emails.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['email_excludes'] = array(
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['country_includes'] = array(
'description' => __( 'Limit response to objects with specfic countries.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with specfic countries.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['country_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic countries.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects excluding specfic countries.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_before'] = array(
'description' => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_after'] = array(
'description' => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_active_between'] = array(
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
'items' => array(
@ -280,19 +280,19 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['registered_before'] = array(
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_after'] = array(
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['registered_between'] = array(
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
'items' => array(
@ -300,19 +300,19 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['orders_count_min'] = array(
'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['orders_count_max'] = array(
'description' => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['orders_count_between'] = array(
'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -320,17 +320,17 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['total_spend_min'] = array(
'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['total_spend_max'] = array(
'description' => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['total_spend_between'] = array(
'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -338,17 +338,17 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['avg_order_value_min'] = array(
'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['avg_order_value_max'] = array(
'description' => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce' ),
'type' => 'number',
'validate_callback' => 'rest_validate_request_arg',
);
$params['avg_order_value_between'] = array(
'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
'items' => array(
@ -356,19 +356,19 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['last_order_before'] = array(
'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['last_order_after'] = array(
'description' => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['customers'] = array(
'description' => __( 'Limit result to items with specified customer ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified customer ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -377,7 +377,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -167,22 +167,22 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'ID.', 'woocommerce-admin' ),
'description' => __( 'ID.', 'woocommerce' ),
),
'product_id' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product ID.', 'woocommerce-admin' ),
'description' => __( 'Product ID.', 'woocommerce' ),
),
'date' => array(
'description' => __( "The date of the download, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date of the download, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_gmt' => array(
'description' => __( 'The date of the download, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date of the download, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -191,49 +191,49 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Download ID.', 'woocommerce-admin' ),
'description' => __( 'Download ID.', 'woocommerce' ),
),
'file_name' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'File name.', 'woocommerce-admin' ),
'description' => __( 'File name.', 'woocommerce' ),
),
'file_path' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'File URL.', 'woocommerce-admin' ),
'description' => __( 'File URL.', 'woocommerce' ),
),
'order_id' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Order ID.', 'woocommerce-admin' ),
'description' => __( 'Order ID.', 'woocommerce' ),
),
'order_number' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Order Number.', 'woocommerce-admin' ),
'description' => __( 'Order Number.', 'woocommerce' ),
),
'user_id' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'User ID for the downloader.', 'woocommerce-admin' ),
'description' => __( 'User ID for the downloader.', 'woocommerce' ),
),
'username' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'User name of the downloader.', 'woocommerce-admin' ),
'description' => __( 'User name of the downloader.', 'woocommerce' ),
),
'ip_address' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'IP address for the downloader.', 'woocommerce-admin' ),
'description' => __( 'IP address for the downloader.', 'woocommerce' ),
),
),
);
@ -250,7 +250,7 @@ class Controller extends ReportsController implements ExportableInterface {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -258,7 +258,7 @@ class Controller extends ReportsController implements ExportableInterface {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -267,26 +267,26 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -296,7 +296,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: products, orders, username, ip_address.', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: products, orders, username, ip_address.', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -306,7 +306,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -316,7 +316,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -326,7 +326,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['order_includes'] = array(
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -335,7 +335,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['order_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -344,7 +344,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['customer_includes'] = array(
'description' => __( 'Limit response to objects that have the specified user ids.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that have the specified user ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -353,7 +353,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['customer_excludes'] = array(
'description' => __( 'Limit response to objects that don\'t have the specified user ids.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that don\'t have the specified user ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -362,7 +362,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['ip_address_includes'] = array(
'description' => __( 'Limit response to objects that have a specified ip address.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that have a specified ip address.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => 'rest_validate_request_arg',
'items' => array(
@ -371,7 +371,7 @@ class Controller extends ReportsController implements ExportableInterface {
);
$params['ip_address_excludes'] = array(
'description' => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => 'rest_validate_request_arg',
'items' => array(
@ -389,12 +389,12 @@ class Controller extends ReportsController implements ExportableInterface {
*/
public function get_export_columns() {
$export_columns = array(
'date' => __( 'Date', 'woocommerce-admin' ),
'product' => __( 'Product title', 'woocommerce-admin' ),
'file_name' => __( 'File name', 'woocommerce-admin' ),
'order_number' => __( 'Order #', 'woocommerce-admin' ),
'user_id' => __( 'User Name', 'woocommerce-admin' ),
'ip_address' => __( 'IP', 'woocommerce-admin' ),
'date' => __( 'Date', 'woocommerce' ),
'product' => __( 'Product title', 'woocommerce' ),
'file_name' => __( 'File name', 'woocommerce' ),
'order_number' => __( 'Order #', 'woocommerce' ),
'user_id' => __( 'User Name', 'woocommerce' ),
'ip_address' => __( 'IP', 'woocommerce' ),
);
/**

View File

@ -142,8 +142,8 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$totals = array(
'download_count' => array(
'title' => __( 'Downloads', 'woocommerce-admin' ),
'description' => __( 'Number of downloads.', 'woocommerce-admin' ),
'title' => __( 'Downloads', 'woocommerce' ),
'description' => __( 'Number of downloads.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -157,14 +157,14 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -172,38 +172,38 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -227,7 +227,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -235,7 +235,7 @@ class Controller extends \WC_REST_Reports_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -244,26 +244,26 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -273,7 +273,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -287,7 +287,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -297,7 +297,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -307,7 +307,7 @@ class Controller extends \WC_REST_Reports_Controller {
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -316,7 +316,7 @@ class Controller extends \WC_REST_Reports_Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['order_includes'] = array(
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -325,7 +325,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['order_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -334,7 +334,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['customer_includes'] = array(
'description' => __( 'Limit response to objects that have the specified customer ids.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that have the specified customer ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -343,7 +343,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['customer_excludes'] = array(
'description' => __( 'Limit response to objects that don\'t have the specified customer ids.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that don\'t have the specified customer ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -352,7 +352,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['ip_address_includes'] = array(
'description' => __( 'Limit response to objects that have a specified ip address.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that have a specified ip address.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => 'rest_validate_request_arg',
'items' => array(
@ -361,7 +361,7 @@ class Controller extends \WC_REST_Reports_Controller {
);
$params['ip_address_excludes'] = array(
'description' => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce-admin' ),
'description' => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce' ),
'type' => 'array',
'validate_callback' => 'rest_validate_request_arg',
'items' => array(
@ -369,7 +369,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -117,7 +117,7 @@ class DataStore extends DownloadsDataStore implements DataStoreInterface {
ARRAY_A
); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
if ( null === $totals ) {
return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce' ) );
}
$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
@ -133,7 +133,7 @@ class DataStore extends DownloadsDataStore implements DataStoreInterface {
); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
if ( null === $intervals ) {
return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce' ) );
}
$totals = (object) $this->cast_numbers( $totals[0] );

View File

@ -74,12 +74,12 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
protected function get_export_collection_params() {
$params = array();
$params['report_args'] = array(
'description' => __( 'Parameters to pass on to the exported report.', 'woocommerce-admin' ),
'description' => __( 'Parameters to pass on to the exported report.', 'woocommerce' ),
'type' => 'object',
'validate_callback' => 'rest_validate_request_arg', // @todo: use each controller's schema?
);
$params['email'] = array(
'description' => __( 'When true, email a link to download the export to the requesting user.', 'woocommerce-admin' ),
'description' => __( 'When true, email a link to download the export to the requesting user.', 'woocommerce' ),
'type' => 'boolean',
'validate_callback' => 'rest_validate_request_arg',
);
@ -98,19 +98,19 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'status' => array(
'description' => __( 'Export status.', 'woocommerce-admin' ),
'description' => __( 'Export status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'message' => array(
'description' => __( 'Export status message.', 'woocommerce-admin' ),
'description' => __( 'Export status message.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'export_id' => array(
'description' => __( 'Export ID.', 'woocommerce-admin' ),
'description' => __( 'Export ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -133,13 +133,13 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'percent_complete' => array(
'description' => __( 'Percentage complete.', 'woocommerce-admin' ),
'description' => __( 'Percentage complete.', 'woocommerce' ),
'type' => 'int',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'download_url' => array(
'description' => __( 'Export download URL.', 'woocommerce-admin' ),
'description' => __( 'Export download URL.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -170,7 +170,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
if ( 0 === $total_rows ) {
return rest_ensure_response(
array(
'message' => __( 'There is no data to export for the given request.', 'woocommerce-admin' ),
'message' => __( 'There is no data to export for the given request.', 'woocommerce' ),
)
);
}
@ -179,7 +179,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
$response = rest_ensure_response(
array(
'message' => __( 'Your report file is being generated.', 'woocommerce-admin' ),
'message' => __( 'Your report file is being generated.', 'woocommerce' ),
'export_id' => $export_id,
)
);
@ -212,7 +212,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
if ( false === $percentage ) {
return new \WP_Error(
'woocommerce_admin_reports_export_invalid_id',
__( 'Sorry, there is no export with that ID.', 'woocommerce-admin' ),
__( 'Sorry, there is no export with that ID.', 'woocommerce' ),
array( 'status' => 404 )
);
}

View File

@ -108,7 +108,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
*/
public function import_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
}
@ -185,14 +185,14 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
public function get_import_collection_params() {
$params = array();
$params['days'] = array(
'description' => __( 'Number of days to import.', 'woocommerce-admin' ),
'description' => __( 'Number of days to import.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
'minimum' => 0,
);
$params['skip_existing'] = array(
'description' => __( 'Skip importing existing order data.', 'woocommerce-admin' ),
'description' => __( 'Skip importing existing order data.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
@ -213,13 +213,13 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'status' => array(
'description' => __( 'Regeneration status.', 'woocommerce-admin' ),
'description' => __( 'Regeneration status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'message' => array(
'description' => __( 'Regenerate data message.', 'woocommerce-admin' ),
'description' => __( 'Regenerate data message.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -241,7 +241,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
$result = array(
'status' => 'success',
'message' => __( 'All pending and in-progress import actions have been cancelled.', 'woocommerce-admin' ),
'message' => __( 'All pending and in-progress import actions have been cancelled.', 'woocommerce' ),
);
$response = $this->prepare_item_for_response( $result, $request );

View File

@ -172,61 +172,61 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'object',
'properties' => array(
'order_id' => array(
'description' => __( 'Order ID.', 'woocommerce-admin' ),
'description' => __( 'Order ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'order_number' => array(
'description' => __( 'Order Number.', 'woocommerce-admin' ),
'description' => __( 'Order Number.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created' => array(
'description' => __( "Date the order was created, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "Date the order was created, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created_gmt' => array(
'description' => __( 'Date the order was created, as GMT.', 'woocommerce-admin' ),
'description' => __( 'Date the order was created, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'status' => array(
'description' => __( 'Order status.', 'woocommerce-admin' ),
'description' => __( 'Order status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'customer_id' => array(
'description' => __( 'Customer ID.', 'woocommerce-admin' ),
'description' => __( 'Customer ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'num_items_sold' => array(
'description' => __( 'Number of items sold.', 'woocommerce-admin' ),
'description' => __( 'Number of items sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'net_total' => array(
'description' => __( 'Net total revenue.', 'woocommerce-admin' ),
'description' => __( 'Net total revenue.', 'woocommerce' ),
'type' => 'float',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'total_formatted' => array(
'description' => __( 'Net total revenue (formatted).', 'woocommerce-admin' ),
'description' => __( 'Net total revenue (formatted).', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'customer_type' => array(
'description' => __( 'Returning or new customer.', 'woocommerce-admin' ),
'description' => __( 'Returning or new customer.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -236,19 +236,19 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'List of order product IDs, names, quantities.', 'woocommerce-admin' ),
'description' => __( 'List of order product IDs, names, quantities.', 'woocommerce' ),
),
'coupons' => array(
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'List of order coupons.', 'woocommerce-admin' ),
'description' => __( 'List of order coupons.', 'woocommerce' ),
),
'customer' => array(
'type' => 'object',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Order customer information.', 'woocommerce-admin' ),
'description' => __( 'Order customer information.', 'woocommerce' ),
),
),
),
@ -266,7 +266,7 @@ class Controller extends ReportsController implements ExportableInterface {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -274,7 +274,7 @@ class Controller extends ReportsController implements ExportableInterface {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 0,
@ -283,26 +283,26 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -313,7 +313,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -323,7 +323,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -333,7 +333,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['variation_includes'] = array(
'description' => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -343,7 +343,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['variation_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -353,7 +353,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['coupon_includes'] = array(
'description' => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -363,7 +363,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['coupon_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -373,7 +373,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['tax_rate_includes'] = array(
'description' => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -383,7 +383,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['tax_rate_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -393,7 +393,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['status_is'] = array(
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -403,7 +403,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['status_is_not'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -413,7 +413,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['customer_type'] = array(
'description' => __( 'Limit result set to returning or new customers.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to returning or new customers.', 'woocommerce' ),
'type' => 'string',
'default' => '',
'enum' => array(
@ -424,7 +424,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['refunds'] = array(
'description' => __( 'Limit result set to specific types of refunds.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to specific types of refunds.', 'woocommerce' ),
'type' => 'string',
'default' => '',
'enum' => array(
@ -437,14 +437,14 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['extended_info'] = array(
'description' => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce-admin' ),
'description' => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order_includes'] = array(
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -453,7 +453,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['order_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -462,7 +462,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['attribute_is'] = array(
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -471,7 +471,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is_not'] = array(
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -505,7 +505,7 @@ class Controller extends ReportsController implements ExportableInterface {
foreach ( $products as $product ) {
$products_list[] = sprintf(
/* translators: 1: numeric product quantity, 2: name of product */
__( '%1$s× %2$s', 'woocommerce-admin' ),
__( '%1$s× %2$s', 'woocommerce' ),
$product['quantity'],
$product['name']
);
@ -531,16 +531,16 @@ class Controller extends ReportsController implements ExportableInterface {
*/
public function get_export_columns() {
$export_columns = array(
'date_created' => __( 'Date', 'woocommerce-admin' ),
'order_number' => __( 'Order #', 'woocommerce-admin' ),
'total_formatted' => __( 'N. Revenue (formatted)', 'woocommerce-admin' ),
'status' => __( 'Status', 'woocommerce-admin' ),
'customer_name' => __( 'Customer', 'woocommerce-admin' ),
'customer_type' => __( 'Customer type', 'woocommerce-admin' ),
'products' => __( 'Product(s)', 'woocommerce-admin' ),
'num_items_sold' => __( 'Items sold', 'woocommerce-admin' ),
'coupons' => __( 'Coupon(s)', 'woocommerce-admin' ),
'net_total' => __( 'N. Revenue', 'woocommerce-admin' ),
'date_created' => __( 'Date', 'woocommerce' ),
'order_number' => __( 'Order #', 'woocommerce' ),
'total_formatted' => __( 'N. Revenue (formatted)', 'woocommerce' ),
'status' => __( 'Status', 'woocommerce' ),
'customer_name' => __( 'Customer', 'woocommerce' ),
'customer_type' => __( 'Customer type', 'woocommerce' ),
'products' => __( 'Product(s)', 'woocommerce' ),
'num_items_sold' => __( 'Items sold', 'woocommerce' ),
'coupons' => __( 'Coupon(s)', 'woocommerce' ),
'net_total' => __( 'N. Revenue', 'woocommerce' ),
);
/**

View File

@ -161,22 +161,22 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
public function get_item_schema() {
$data_values = array(
'net_revenue' => array(
'description' => __( 'Net sales.', 'woocommerce-admin' ),
'description' => __( 'Net sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'orders_count' => array(
'title' => __( 'Orders', 'woocommerce-admin' ),
'description' => __( 'Number of orders', 'woocommerce-admin' ),
'title' => __( 'Orders', 'woocommerce' ),
'description' => __( 'Number of orders', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'indicator' => true,
),
'avg_order_value' => array(
'description' => __( 'Average order value.', 'woocommerce-admin' ),
'description' => __( 'Average order value.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -184,37 +184,37 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'format' => 'currency',
),
'avg_items_per_order' => array(
'description' => __( 'Average items per order', 'woocommerce-admin' ),
'description' => __( 'Average items per order', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'num_items_sold' => array(
'description' => __( 'Number of items sold', 'woocommerce-admin' ),
'description' => __( 'Number of items sold', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'coupons' => array(
'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ),
'description' => __( 'Amount discounted by coupons.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'coupons_count' => array(
'description' => __( 'Unique coupons count.', 'woocommerce-admin' ),
'description' => __( 'Unique coupons count.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'total_customers' => array(
'description' => __( 'Total distinct customers.', 'woocommerce-admin' ),
'description' => __( 'Total distinct customers.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'products' => array(
'description' => __( 'Number of distinct products sold.', 'woocommerce-admin' ),
'description' => __( 'Number of distinct products sold.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -223,7 +223,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -231,13 +231,13 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -261,14 +261,14 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -276,38 +276,38 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -331,7 +331,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -339,7 +339,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -348,26 +348,26 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -379,7 +379,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -393,7 +393,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -403,7 +403,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['status_is'] = array(
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -414,7 +414,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
),
);
$params['status_is_not'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -424,7 +424,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
),
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -434,7 +434,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -443,7 +443,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['variation_includes'] = array(
'description' => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -453,7 +453,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['variation_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -463,7 +463,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['coupon_includes'] = array(
'description' => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -472,7 +472,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['coupon_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -481,7 +481,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['tax_rate_includes'] = array(
'description' => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -491,7 +491,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['tax_rate_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -501,7 +501,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['customer'] = array(
'description' => __( 'Alias for customer_type (deprecated).', 'woocommerce-admin' ),
'description' => __( 'Alias for customer_type (deprecated).', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'new',
@ -510,7 +510,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['customer_type'] = array(
'description' => __( 'Limit result set to orders that have the specified customer_type', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that have the specified customer_type', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'new',
@ -519,7 +519,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['refunds'] = array(
'description' => __( 'Limit result set to specific types of refunds.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to specific types of refunds.', 'woocommerce' ),
'type' => 'string',
'default' => '',
'enum' => array(
@ -532,7 +532,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is'] = array(
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -541,7 +541,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is_not'] = array(
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -550,7 +550,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'product',
@ -562,7 +562,7 @@ class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -332,7 +332,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
ARRAY_A
); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
if ( null === $totals ) {
return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
// @todo Remove these assignements when refactoring segmenter classes to use query objects.
@ -385,7 +385,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
if ( null === $intervals ) {
return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
if ( isset( $intervals[0] ) ) {

View File

@ -375,7 +375,7 @@ class Segmenter extends ReportsSegmenter {
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
} elseif ( 'variation' === $this->query_args['segmentby'] ) {
if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce-admin' ) );
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
}
$product_level_columns = $this->get_segment_selections_product_level( $product_segmenting_table );

View File

@ -141,7 +141,7 @@ class Controller extends \WC_REST_Reports_Controller {
}
if ( 200 !== $response->get_status() ) {
return new \WP_Error( 'woocommerce_analytics_performance_indicators_result_failed', __( 'Sorry, fetching performance indicators failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_performance_indicators_result_failed', __( 'Sorry, fetching performance indicators failed.', 'woocommerce' ) );
}
$endpoints = $response->get_data();
@ -223,13 +223,13 @@ class Controller extends \WC_REST_Reports_Controller {
'woocommerce_rest_performance_indicators_jetpack_items',
array(
'stats/visitors' => array(
'label' => __( 'Visitors', 'woocommerce-admin' ),
'label' => __( 'Visitors', 'woocommerce' ),
'permission' => 'view_stats',
'format' => 'number',
'module' => 'stats',
),
'stats/views' => array(
'label' => __( 'Views', 'woocommerce-admin' ),
'label' => __( 'Views', 'woocommerce' ),
'permission' => 'view_stats',
'format' => 'number',
'module' => 'stats',
@ -405,7 +405,7 @@ class Controller extends \WC_REST_Reports_Controller {
$query_args = $this->prepare_reports_query( $request );
if ( empty( $query_args['stats'] ) ) {
return new \WP_Error( 'woocommerce_analytics_performance_indicators_empty_query', __( 'A list of stats to query must be provided.', 'woocommerce-admin' ), 400 );
return new \WP_Error( 'woocommerce_analytics_performance_indicators_empty_query', __( 'A list of stats to query must be provided.', 'woocommerce' ), 400 );
}
$stats = array();
@ -594,33 +594,33 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'stat' => array(
'description' => __( 'Unique identifier for the resource.', 'woocommerce-admin' ),
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => $allowed_stats,
),
'chart' => array(
'description' => __( 'The specific chart this stat referrers to.', 'woocommerce-admin' ),
'description' => __( 'The specific chart this stat referrers to.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'label' => array(
'description' => __( 'Human readable label for the stat.', 'woocommerce-admin' ),
'description' => __( 'Human readable label for the stat.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'format' => array(
'description' => __( 'Format of the stat.', 'woocommerce-admin' ),
'description' => __( 'Format of the stat.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'number', 'currency' ),
),
'value' => array(
'description' => __( 'Value of the stat. Returns null if the stat does not exist or cannot be loaded.', 'woocommerce-admin' ),
'description' => __( 'Value of the stat. Returns null if the stat does not exist or cannot be loaded.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -651,7 +651,7 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_collection_params() {
$indicator_data = $this->get_indicator_data();
if ( is_wp_error( $indicator_data ) ) {
$allowed_stats = __( 'There was an issue loading the report endpoints', 'woocommerce-admin' );
$allowed_stats = __( 'There was an issue loading the report endpoints', 'woocommerce' );
} else {
$allowed_stats = implode( ', ', $this->allowed_stats );
}
@ -661,7 +661,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params['stats'] = array(
'description' => sprintf(
/* translators: Allowed values is a list of stat endpoints. */
__( 'Limit response to specific report stats. Allowed values: %s.', 'woocommerce-admin' ),
__( 'Limit response to specific report stats. Allowed values: %s.', 'woocommerce' ),
$allowed_stats
),
'type' => 'array',
@ -673,13 +673,13 @@ class Controller extends \WC_REST_Reports_Controller {
'default' => $this->allowed_stats,
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -162,86 +162,86 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product ID.', 'woocommerce-admin' ),
'description' => __( 'Product ID.', 'woocommerce' ),
),
'items_sold' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Number of items sold.', 'woocommerce-admin' ),
'description' => __( 'Number of items sold.', 'woocommerce' ),
),
'net_revenue' => array(
'type' => 'number',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Total Net sales of all items sold.', 'woocommerce-admin' ),
'description' => __( 'Total Net sales of all items sold.', 'woocommerce' ),
),
'orders_count' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Number of orders product appeared in.', 'woocommerce-admin' ),
'description' => __( 'Number of orders product appeared in.', 'woocommerce' ),
),
'extended_info' => array(
'name' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product name.', 'woocommerce-admin' ),
'description' => __( 'Product name.', 'woocommerce' ),
),
'price' => array(
'type' => 'number',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product price.', 'woocommerce-admin' ),
'description' => __( 'Product price.', 'woocommerce' ),
),
'image' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product image.', 'woocommerce-admin' ),
'description' => __( 'Product image.', 'woocommerce' ),
),
'permalink' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product link.', 'woocommerce-admin' ),
'description' => __( 'Product link.', 'woocommerce' ),
),
'category_ids' => array(
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product category IDs.', 'woocommerce-admin' ),
'description' => __( 'Product category IDs.', 'woocommerce' ),
),
'stock_status' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory status.', 'woocommerce-admin' ),
'description' => __( 'Product inventory status.', 'woocommerce' ),
),
'stock_quantity' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory quantity.', 'woocommerce-admin' ),
'description' => __( 'Product inventory quantity.', 'woocommerce' ),
),
'low_stock_amount' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory threshold for low stock.', 'woocommerce-admin' ),
'description' => __( 'Product inventory threshold for low stock.', 'woocommerce' ),
),
'variations' => array(
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product variations IDs.', 'woocommerce-admin' ),
'description' => __( 'Product variations IDs.', 'woocommerce' ),
),
'sku' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product SKU.', 'woocommerce-admin' ),
'description' => __( 'Product SKU.', 'woocommerce' ),
),
),
),
@ -259,7 +259,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -267,7 +267,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -276,26 +276,26 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -310,7 +310,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['categories'] = array(
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -319,7 +319,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
),
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -329,7 +329,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['products'] = array(
'description' => __( 'Limit result to items with specified product ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified product ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -339,7 +339,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
);
$params['extended_info'] = array(
'description' => __( 'Add additional piece of info about each product to the report.', 'woocommerce-admin' ),
'description' => __( 'Add additional piece of info about each product to the report.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
@ -386,18 +386,18 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
$export_columns = array(
'product_name' => __( 'Product title', 'woocommerce-admin' ),
'sku' => __( 'SKU', 'woocommerce-admin' ),
'items_sold' => __( 'Items sold', 'woocommerce-admin' ),
'net_revenue' => __( 'N. Revenue', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'product_cat' => __( 'Category', 'woocommerce-admin' ),
'variations' => __( 'Variations', 'woocommerce-admin' ),
'product_name' => __( 'Product title', 'woocommerce' ),
'sku' => __( 'SKU', 'woocommerce' ),
'items_sold' => __( 'Items sold', 'woocommerce' ),
'net_revenue' => __( 'N. Revenue', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
'product_cat' => __( 'Category', 'woocommerce' ),
'variations' => __( 'Variations', 'woocommerce' ),
);
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
$export_columns['stock_status'] = __( 'Status', 'woocommerce-admin' );
$export_columns['stock'] = __( 'Stock', 'woocommerce-admin' );
$export_columns['stock_status'] = __( 'Status', 'woocommerce' );
$export_columns['stock'] = __( 'Stock', 'woocommerce' );
}
/**
@ -434,8 +434,8 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$export_item['stock_status'] = $this->get_stock_status( $item['extended_info']['stock_status'] );
$export_item['stock'] = $item['extended_info']['stock_quantity'];
} else {
$export_item['stock_status'] = __( 'N/A', 'woocommerce-admin' );
$export_item['stock'] = __( 'N/A', 'woocommerce-admin' );
$export_item['stock_status'] = __( 'N/A', 'woocommerce' );
$export_item['stock'] = __( 'N/A', 'woocommerce' );
}
}

View File

@ -224,7 +224,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
}
/* translators: %s is product name */
$products_data[ $key ]['extended_info']['name'] = $product_names[ $product_id ] ? sprintf( __( '%s (Deleted)', 'woocommerce-admin' ), $product_names[ $product_id ] ) : __( '(Deleted)', 'woocommerce-admin' );
$products_data[ $key ]['extended_info']['name'] = $product_names[ $product_id ] ? sprintf( __( '%s (Deleted)', 'woocommerce' ), $product_names[ $product_id ] ) : __( '(Deleted)', 'woocommerce' );
continue;
}

View File

@ -157,22 +157,22 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$data_values = array(
'items_sold' => array(
'title' => __( 'Products sold', 'woocommerce-admin' ),
'description' => __( 'Number of product items sold.', 'woocommerce-admin' ),
'title' => __( 'Products sold', 'woocommerce' ),
'description' => __( 'Number of product items sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'indicator' => true,
),
'net_revenue' => array(
'description' => __( 'Net sales.', 'woocommerce-admin' ),
'description' => __( 'Net sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -181,7 +181,7 @@ class Controller extends \WC_REST_Reports_Controller {
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -189,20 +189,20 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'segment_label' => array(
'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce-admin' ),
'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -221,14 +221,14 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -236,38 +236,38 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -313,7 +313,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -321,7 +321,7 @@ class Controller extends \WC_REST_Reports_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -330,26 +330,26 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -366,7 +366,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -380,7 +380,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['categories'] = array(
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -389,7 +389,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['products'] = array(
'description' => __( 'Limit result to items with specified product ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified product ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -398,7 +398,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['variations'] = array(
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -407,7 +407,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'product',
@ -417,7 +417,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -183,7 +183,7 @@ class DataStore extends ProductsDataStore implements DataStoreInterface {
$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );
if ( null === $totals ) {
return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
@ -199,7 +199,7 @@ class DataStore extends ProductsDataStore implements DataStoreInterface {
); // WPCS: cache ok, DB call ok, unprepared SQL ok.
if ( null === $intervals ) {
return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
$totals = (object) $this->cast_numbers( $totals[0] );

View File

@ -166,7 +166,7 @@ class Segmenter extends ReportsSegmenter {
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
} elseif ( 'variation' === $this->query_args['segmentby'] ) {
if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce-admin' ) );
throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
}
$product_level_columns = $this->get_segment_selections_product_level( $product_segmenting_table );

View File

@ -19,6 +19,6 @@ abstract class Query extends \WC_Object_Query {
*/
public function get_data() {
/* translators: %s: Method name */
return new \WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'woocommerce-admin' ), __METHOD__ ), array( 'status' => 405 ) );
return new \WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'woocommerce' ), __METHOD__ ), array( 'status' => 405 ) );
}
}

View File

@ -165,7 +165,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
public function get_item_schema() {
$data_values = array(
'total_sales' => array(
'description' => __( 'Total sales.', 'woocommerce-admin' ),
'description' => __( 'Total sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -173,7 +173,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'format' => 'currency',
),
'net_revenue' => array(
'description' => __( 'Net sales.', 'woocommerce-admin' ),
'description' => __( 'Net sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -181,21 +181,21 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'format' => 'currency',
),
'coupons' => array(
'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ),
'description' => __( 'Amount discounted by coupons.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'coupons_count' => array(
'description' => __( 'Unique coupons count.', 'woocommerce-admin' ),
'description' => __( 'Unique coupons count.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'shipping' => array(
'title' => __( 'Shipping', 'woocommerce-admin' ),
'description' => __( 'Total of shipping.', 'woocommerce-admin' ),
'title' => __( 'Shipping', 'woocommerce' ),
'description' => __( 'Total of shipping.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -203,15 +203,15 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'format' => 'currency',
),
'taxes' => array(
'description' => __( 'Total of taxes.', 'woocommerce-admin' ),
'description' => __( 'Total of taxes.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'refunds' => array(
'title' => __( 'Returns', 'woocommerce-admin' ),
'description' => __( 'Total of returns.', 'woocommerce-admin' ),
'title' => __( 'Returns', 'woocommerce' ),
'description' => __( 'Total of returns.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -219,25 +219,25 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'format' => 'currency',
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'num_items_sold' => array(
'description' => __( 'Items sold.', 'woocommerce-admin' ),
'description' => __( 'Items sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'products' => array(
'description' => __( 'Products sold.', 'woocommerce-admin' ),
'description' => __( 'Products sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'gross_sales' => array(
'description' => __( 'Gross sales.', 'woocommerce-admin' ),
'description' => __( 'Gross sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -248,7 +248,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -256,13 +256,13 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -286,14 +286,14 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -301,38 +301,38 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -356,7 +356,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -364,7 +364,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -373,26 +373,26 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -410,7 +410,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -424,7 +424,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'product',
@ -446,15 +446,15 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
return array(
'date' => __( 'Date', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'gross_sales' => __( 'Gross sales', 'woocommerce-admin' ),
'total_sales' => __( 'Total sales', 'woocommerce-admin' ),
'refunds' => __( 'Returns', 'woocommerce-admin' ),
'coupons' => __( 'Coupons', 'woocommerce-admin' ),
'taxes' => __( 'Taxes', 'woocommerce-admin' ),
'shipping' => __( 'Shipping', 'woocommerce-admin' ),
'net_revenue' => __( 'Net Revenue', 'woocommerce-admin' ),
'date' => __( 'Date', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
'gross_sales' => __( 'Gross sales', 'woocommerce' ),
'total_sales' => __( 'Total sales', 'woocommerce' ),
'refunds' => __( 'Returns', 'woocommerce' ),
'coupons' => __( 'Coupons', 'woocommerce' ),
'taxes' => __( 'Taxes', 'woocommerce' ),
'shipping' => __( 'Shipping', 'woocommerce' ),
'net_revenue' => __( 'Net Revenue', 'woocommerce' ),
);
}

View File

@ -387,44 +387,44 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the resource.', 'woocommerce-admin' ),
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'parent_id' => array(
'description' => __( 'Product parent ID.', 'woocommerce-admin' ),
'description' => __( 'Product parent ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Product name.', 'woocommerce-admin' ),
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'sku' => array(
'description' => __( 'Unique identifier.', 'woocommerce-admin' ),
'description' => __( 'Unique identifier.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'stock_status' => array(
'description' => __( 'Stock status.', 'woocommerce-admin' ),
'description' => __( 'Stock status.', 'woocommerce' ),
'type' => 'string',
'enum' => array_keys( wc_get_product_stock_status_options() ),
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'stock_quantity' => array(
'description' => __( 'Stock quantity.', 'woocommerce-admin' ),
'description' => __( 'Stock quantity.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'manage_stock' => array(
'description' => __( 'Manage stock.', 'woocommerce-admin' ),
'description' => __( 'Manage stock.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -444,7 +444,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -452,7 +452,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -461,7 +461,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['exclude'] = array(
'description' => __( 'Ensure result set excludes specific IDs.', 'woocommerce-admin' ),
'description' => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -470,7 +470,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'sanitize_callback' => 'wp_parse_id_list',
);
$params['include'] = array(
'description' => __( 'Limit result set to specific ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to specific ids.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -479,20 +479,20 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'sanitize_callback' => 'wp_parse_id_list',
);
$params['offset'] = array(
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce-admin' ),
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'asc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'stock_status',
'enum' => array(
@ -507,7 +507,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['parent'] = array(
'description' => __( 'Limit result set to those of particular parent IDs.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -516,7 +516,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'default' => array(),
);
$params['parent_exclude'] = array(
'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -525,7 +525,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'default' => array(),
);
$params['type'] = array(
'description' => __( 'Limit result set to items assigned a stock report type.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items assigned a stock report type.', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array_merge( array( 'all', 'lowstock' ), array_keys( wc_get_product_stock_status_options() ) ),
@ -541,10 +541,10 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
$export_columns = array(
'title' => __( 'Product / Variation', 'woocommerce-admin' ),
'sku' => __( 'SKU', 'woocommerce-admin' ),
'stock_status' => __( 'Status', 'woocommerce-admin' ),
'stock_quantity' => __( 'Stock', 'woocommerce-admin' ),
'title' => __( 'Product / Variation', 'woocommerce' ),
'sku' => __( 'SKU', 'woocommerce' ),
'stock_status' => __( 'Status', 'woocommerce' ),
'stock_quantity' => __( 'Stock', 'woocommerce' ),
);
/**

View File

@ -83,13 +83,13 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$totals = array(
'products' => array(
'description' => __( 'Number of products.', 'woocommerce-admin' ),
'description' => __( 'Number of products.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'lowstock' => array(
'description' => __( 'Number of low stock products.', 'woocommerce-admin' ),
'description' => __( 'Number of low stock products.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -100,7 +100,7 @@ class Controller extends \WC_REST_Reports_Controller {
foreach ( $status_options as $status => $label ) {
$totals[ $status ] = array(
/* translators: Stock status. Example: "Number of low stock products */
'description' => sprintf( __( 'Number of %s products.', 'woocommerce-admin' ), $label ),
'description' => sprintf( __( 'Number of %s products.', 'woocommerce' ), $label ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -113,7 +113,7 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -155,61 +155,61 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'type' => 'object',
'properties' => array(
'tax_rate_id' => array(
'description' => __( 'Tax rate ID.', 'woocommerce-admin' ),
'description' => __( 'Tax rate ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Tax rate name.', 'woocommerce-admin' ),
'description' => __( 'Tax rate name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'tax_rate' => array(
'description' => __( 'Tax rate.', 'woocommerce-admin' ),
'description' => __( 'Tax rate.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'country' => array(
'description' => __( 'Country / Region.', 'woocommerce-admin' ),
'description' => __( 'Country / Region.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'state' => array(
'description' => __( 'State.', 'woocommerce-admin' ),
'description' => __( 'State.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'priority' => array(
'description' => __( 'Priority.', 'woocommerce-admin' ),
'description' => __( 'Priority.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'total_tax' => array(
'description' => __( 'Total tax.', 'woocommerce-admin' ),
'description' => __( 'Total tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'order_tax' => array(
'description' => __( 'Order tax.', 'woocommerce-admin' ),
'description' => __( 'Order tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'shipping_tax' => array(
'description' => __( 'Shipping tax.', 'woocommerce-admin' ),
'description' => __( 'Shipping tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -229,7 +229,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -237,7 +237,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -246,26 +246,26 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'tax_rate_id',
'enum' => array(
@ -281,7 +281,7 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
'validate_callback' => 'rest_validate_request_arg',
);
$params['taxes'] = array(
'description' => __( 'Limit result set to items assigned one or more tax rates.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items assigned one or more tax rates.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -300,12 +300,12 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
public function get_export_columns() {
return array(
'tax_code' => __( 'Tax code', 'woocommerce-admin' ),
'rate' => __( 'Rate', 'woocommerce-admin' ),
'total_tax' => __( 'Total tax', 'woocommerce-admin' ),
'order_tax' => __( 'Order tax', 'woocommerce-admin' ),
'shipping_tax' => __( 'Shipping tax', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'tax_code' => __( 'Tax code', 'woocommerce' ),
'rate' => __( 'Rate', 'woocommerce' ),
'total_tax' => __( 'Total tax', 'woocommerce' ),
'order_tax' => __( 'Order tax', 'woocommerce' ),
'shipping_tax' => __( 'Shipping tax', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
);
}

View File

@ -166,7 +166,7 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$data_values = array(
'total_tax' => array(
'description' => __( 'Total tax.', 'woocommerce-admin' ),
'description' => __( 'Total tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -174,7 +174,7 @@ class Controller extends \WC_REST_Reports_Controller {
'format' => 'currency',
),
'order_tax' => array(
'description' => __( 'Order tax.', 'woocommerce-admin' ),
'description' => __( 'Order tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -182,7 +182,7 @@ class Controller extends \WC_REST_Reports_Controller {
'format' => 'currency',
),
'shipping_tax' => array(
'description' => __( 'Shipping tax.', 'woocommerce-admin' ),
'description' => __( 'Shipping tax.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -190,13 +190,13 @@ class Controller extends \WC_REST_Reports_Controller {
'format' => 'currency',
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'tax_codes' => array(
'description' => __( 'Amount of tax codes.', 'woocommerce-admin' ),
'description' => __( 'Amount of tax codes.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -205,7 +205,7 @@ class Controller extends \WC_REST_Reports_Controller {
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -213,13 +213,13 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -238,14 +238,14 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -253,38 +253,38 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -308,7 +308,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -316,7 +316,7 @@ class Controller extends \WC_REST_Reports_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -325,26 +325,26 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -357,7 +357,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -371,7 +371,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['taxes'] = array(
'description' => __( 'Limit result set to all items that have the specified term assigned in the taxes taxonomy.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to all items that have the specified term assigned in the taxes taxonomy.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -380,7 +380,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'tax_rate_id',
@ -388,7 +388,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',

View File

@ -192,7 +192,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
); // WPCS: cache ok, DB call ok, unprepared SQL ok.
if ( null === $totals ) {
return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
// @todo remove these assignements when refactoring segmenter classes to use query objects.
@ -226,7 +226,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
); // WPCS: cache ok, DB call ok, unprepared SQL ok.
if ( null === $intervals ) {
return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching tax data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching tax data failed.', 'woocommerce' ) );
}
$totals = (object) $this->cast_numbers( $totals[0] );

View File

@ -573,7 +573,7 @@ class TimeInterval {
return new \WP_Error(
'rest_invalid_param',
/* translators: 1: parameter name */
sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce-admin' ), $param )
sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce' ), $param )
);
}
@ -585,7 +585,7 @@ class TimeInterval {
return new \WP_Error(
'rest_invalid_param',
/* translators: %s: parameter name */
sprintf( __( '%s must contain 2 numbers.', 'woocommerce-admin' ), $param )
sprintf( __( '%s must contain 2 numbers.', 'woocommerce' ), $param )
);
}
@ -605,7 +605,7 @@ class TimeInterval {
return new \WP_Error(
'rest_invalid_param',
/* translators: 1: parameter name */
sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce-admin' ), $param )
sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce' ), $param )
);
}
@ -617,7 +617,7 @@ class TimeInterval {
return new \WP_Error(
'rest_invalid_param',
/* translators: %s: parameter name */
sprintf( __( '%s must contain 2 valid dates.', 'woocommerce-admin' ), $param )
sprintf( __( '%s must contain 2 valid dates.', 'woocommerce' ), $param )
);
}

View File

@ -177,80 +177,80 @@ class Controller extends ReportsController implements ExportableInterface {
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product ID.', 'woocommerce-admin' ),
'description' => __( 'Product ID.', 'woocommerce' ),
),
'variation_id' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product ID.', 'woocommerce-admin' ),
'description' => __( 'Product ID.', 'woocommerce' ),
),
'items_sold' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Number of items sold.', 'woocommerce-admin' ),
'description' => __( 'Number of items sold.', 'woocommerce' ),
),
'net_revenue' => array(
'type' => 'number',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Total Net sales of all items sold.', 'woocommerce-admin' ),
'description' => __( 'Total Net sales of all items sold.', 'woocommerce' ),
),
'orders_count' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Number of orders product appeared in.', 'woocommerce-admin' ),
'description' => __( 'Number of orders product appeared in.', 'woocommerce' ),
),
'extended_info' => array(
'name' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product name.', 'woocommerce-admin' ),
'description' => __( 'Product name.', 'woocommerce' ),
),
'price' => array(
'type' => 'number',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product price.', 'woocommerce-admin' ),
'description' => __( 'Product price.', 'woocommerce' ),
),
'image' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product image.', 'woocommerce-admin' ),
'description' => __( 'Product image.', 'woocommerce' ),
),
'permalink' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product link.', 'woocommerce-admin' ),
'description' => __( 'Product link.', 'woocommerce' ),
),
'attributes' => array(
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product attributes.', 'woocommerce-admin' ),
'description' => __( 'Product attributes.', 'woocommerce' ),
),
'stock_status' => array(
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory status.', 'woocommerce-admin' ),
'description' => __( 'Product inventory status.', 'woocommerce' ),
),
'stock_quantity' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory quantity.', 'woocommerce-admin' ),
'description' => __( 'Product inventory quantity.', 'woocommerce' ),
),
'low_stock_amount' => array(
'type' => 'integer',
'readonly' => true,
'context' => array( 'view', 'edit' ),
'description' => __( 'Product inventory threshold for low stock.', 'woocommerce-admin' ),
'description' => __( 'Product inventory threshold for low stock.', 'woocommerce' ),
),
),
),
@ -268,7 +268,7 @@ class Controller extends ReportsController implements ExportableInterface {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -276,7 +276,7 @@ class Controller extends ReportsController implements ExportableInterface {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -285,19 +285,19 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -307,14 +307,14 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -327,7 +327,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -337,7 +337,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -347,7 +347,7 @@ class Controller extends ReportsController implements ExportableInterface {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['variations'] = array(
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -356,14 +356,14 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['extended_info'] = array(
'description' => __( 'Add additional piece of info about each variation to the report.', 'woocommerce-admin' ),
'description' => __( 'Add additional piece of info about each variation to the report.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'sanitize_callback' => 'wc_string_to_bool',
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is'] = array(
'description' => __( 'Limit result set to variations that include the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to variations that include the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -372,7 +372,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is_not'] = array(
'description' => __( 'Limit result set to variations that don\'t include the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to variations that don\'t include the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -381,7 +381,7 @@ class Controller extends ReportsController implements ExportableInterface {
'validate_callback' => 'rest_validate_request_arg',
);
$params['category_includes'] = array(
'description' => __( 'Limit result set to variations in the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to variations in the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -390,7 +390,7 @@ class Controller extends ReportsController implements ExportableInterface {
),
);
$params['category_excludes'] = array(
'description' => __( 'Limit result set to variations not in the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to variations not in the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -421,16 +421,16 @@ class Controller extends ReportsController implements ExportableInterface {
*/
public function get_export_columns() {
$export_columns = array(
'product_name' => __( 'Product / Variation title', 'woocommerce-admin' ),
'sku' => __( 'SKU', 'woocommerce-admin' ),
'items_sold' => __( 'Items sold', 'woocommerce-admin' ),
'net_revenue' => __( 'N. Revenue', 'woocommerce-admin' ),
'orders_count' => __( 'Orders', 'woocommerce-admin' ),
'product_name' => __( 'Product / Variation title', 'woocommerce' ),
'sku' => __( 'SKU', 'woocommerce' ),
'items_sold' => __( 'Items sold', 'woocommerce' ),
'net_revenue' => __( 'N. Revenue', 'woocommerce' ),
'orders_count' => __( 'Orders', 'woocommerce' ),
);
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
$export_columns['stock_status'] = __( 'Status', 'woocommerce-admin' );
$export_columns['stock'] = __( 'Stock', 'woocommerce-admin' );
$export_columns['stock_status'] = __( 'Status', 'woocommerce' );
$export_columns['stock'] = __( 'Stock', 'woocommerce' );
}
return $export_columns;

View File

@ -161,22 +161,22 @@ class Controller extends \WC_REST_Reports_Controller {
public function get_item_schema() {
$data_values = array(
'items_sold' => array(
'title' => __( 'Variations Sold', 'woocommerce-admin' ),
'description' => __( 'Number of variation items sold.', 'woocommerce-admin' ),
'title' => __( 'Variations Sold', 'woocommerce' ),
'description' => __( 'Number of variation items sold.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'indicator' => true,
),
'net_revenue' => array(
'description' => __( 'Net sales.', 'woocommerce-admin' ),
'description' => __( 'Net sales.', 'woocommerce' ),
'type' => 'number',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'format' => 'currency',
),
'orders_count' => array(
'description' => __( 'Number of orders.', 'woocommerce-admin' ),
'description' => __( 'Number of orders.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -185,7 +185,7 @@ class Controller extends \WC_REST_Reports_Controller {
$segments = array(
'segments' => array(
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -193,20 +193,20 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'segment_id' => array(
'description' => __( 'Segment identificator.', 'woocommerce-admin' ),
'description' => __( 'Segment identificator.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'segment_label' => array(
'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce-admin' ),
'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -225,14 +225,14 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'totals' => array(
'description' => __( 'Totals data.', 'woocommerce-admin' ),
'description' => __( 'Totals data.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'properties' => $totals,
),
'intervals' => array(
'description' => __( 'Reports data grouped by intervals.', 'woocommerce-admin' ),
'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -240,38 +240,38 @@ class Controller extends \WC_REST_Reports_Controller {
'type' => 'object',
'properties' => array(
'interval' => array(
'description' => __( 'Type of interval.', 'woocommerce-admin' ),
'description' => __( 'Type of interval.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
'enum' => array( 'day', 'week', 'month', 'year' ),
),
'date_start' => array(
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_start_gmt' => array(
'description' => __( 'The date the report start, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end' => array(
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce-admin' ),
'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_end_gmt' => array(
'description' => __( 'The date the report end, as GMT.', 'woocommerce-admin' ),
'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'subtotals' => array(
'description' => __( 'Interval subtotals.', 'woocommerce-admin' ),
'description' => __( 'Interval subtotals.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -316,7 +316,7 @@ class Controller extends \WC_REST_Reports_Controller {
$params = array();
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce-admin' ),
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
@ -324,7 +324,7 @@ class Controller extends \WC_REST_Reports_Controller {
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce-admin' ),
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
@ -333,19 +333,19 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce-admin' ),
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['match'] = array(
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce-admin' ),
'description' => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
'type' => 'string',
'default' => 'all',
'enum' => array(
@ -355,14 +355,14 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce-admin' ),
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce-admin' ),
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
@ -379,7 +379,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['interval'] = array(
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce-admin' ),
'description' => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
'type' => 'string',
'default' => 'week',
'enum' => array(
@ -393,7 +393,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['category_includes'] = array(
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -402,7 +402,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['category_excludes'] = array(
'description' => __( 'Limit result set to variations not in the specified categories.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to variations not in the specified categories.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -411,7 +411,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['product_includes'] = array(
'description' => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -421,7 +421,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['product_excludes'] = array(
'description' => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
@ -431,7 +431,7 @@ class Controller extends \WC_REST_Reports_Controller {
'sanitize_callback' => 'wp_parse_id_list',
);
$params['variations'] = array(
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce-admin' ),
'description' => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
@ -440,7 +440,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['segmentby'] = array(
'description' => __( 'Segment the response by additional constraint.', 'woocommerce-admin' ),
'description' => __( 'Segment the response by additional constraint.', 'woocommerce' ),
'type' => 'string',
'enum' => array(
'product',
@ -450,7 +450,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['fields'] = array(
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce-admin' ),
'description' => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
'type' => 'array',
'sanitize_callback' => 'wp_parse_slug_list',
'validate_callback' => 'rest_validate_request_arg',
@ -459,7 +459,7 @@ class Controller extends \WC_REST_Reports_Controller {
),
);
$params['attribute_is'] = array(
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',
@ -468,7 +468,7 @@ class Controller extends \WC_REST_Reports_Controller {
'validate_callback' => 'rest_validate_request_arg',
);
$params['attribute_is_not'] = array(
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'array',

View File

@ -221,7 +221,7 @@ class DataStore extends VariationsDataStore implements DataStoreInterface {
$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );
if ( null === $totals ) {
return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
@ -239,7 +239,7 @@ class DataStore extends VariationsDataStore implements DataStoreInterface {
/* phpcs:enable */
if ( null === $intervals ) {
return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
}
$totals = (object) $this->cast_numbers( $totals[0] );

View File

@ -32,12 +32,12 @@ class Taxes extends \WC_REST_Taxes_Controller {
public function get_collection_params() {
$params = parent::get_collection_params();
$params['search'] = array(
'description' => __( 'Search by similar tax code.', 'woocommerce-admin' ),
'description' => __( 'Search by similar tax code.', 'woocommerce' ),
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
);
$params['include'] = array(
'description' => __( 'Limit result set to items that have the specified rate ID(s) assigned.', 'woocommerce-admin' ),
'description' => __( 'Limit result set to items that have the specified rate ID(s) assigned.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',

View File

@ -60,7 +60,7 @@ class Themes extends \WC_REST_Data_Controller {
*/
public function upload_theme_permissions_check( $request ) {
if ( ! current_user_can( 'upload_themes' ) ) {
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you are not allowed to install themes on this site.', 'woocommerce-admin' ), array( 'status' => rest_authorization_required_code() ) );
return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you are not allowed to install themes on this site.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
}
return true;
@ -75,7 +75,7 @@ class Themes extends \WC_REST_Data_Controller {
public function upload_theme( $request ) {
if (
! isset( $_FILES['pluginzip'] ) || ! isset( $_FILES['pluginzip']['tmp_name'] ) || ! is_uploaded_file( $_FILES['pluginzip']['tmp_name'] ) || ! is_file( $_FILES['pluginzip']['tmp_name'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
return new \WP_Error( 'woocommerce_rest_invalid_file', __( 'Specified file failed upload test.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_rest_invalid_file', __( 'Specified file failed upload test.', 'woocommerce' ) );
}
include_once ABSPATH . 'wp-admin/includes/file.php';
@ -163,19 +163,19 @@ class Themes extends \WC_REST_Data_Controller {
'type' => 'object',
'properties' => array(
'status' => array(
'description' => __( 'Theme installation status.', 'woocommerce-admin' ),
'description' => __( 'Theme installation status.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'message' => array(
'description' => __( 'Theme installation message.', 'woocommerce-admin' ),
'description' => __( 'Theme installation message.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'theme' => array(
'description' => __( 'Uploaded theme.', 'woocommerce-admin' ),
'description' => __( 'Uploaded theme.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view', 'edit' ),
'readonly' => true,
@ -194,7 +194,7 @@ class Themes extends \WC_REST_Data_Controller {
public function get_collection_params() {
$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
$params['pluginzip'] = array(
'description' => __( 'A zip file of the theme to be uploaded.', 'woocommerce-admin' ),
'description' => __( 'A zip file of the theme to be uploaded.', 'woocommerce' ),
'type' => 'file',
'validate_callback' => 'rest_validate_request_arg',
);

View File

@ -261,7 +261,7 @@ class Features {
return $sections;
}
$sections['features'] = __( 'Features', 'woocommerce-admin' );
$sections['features'] = __( 'Features', 'woocommerce' );
return $sections;
}
@ -288,8 +288,8 @@ class Features {
return $settings;
}
$desc = __( 'Start using new features that are being progressively rolled out to improve the store management experience.', 'woocommerce-admin' );
$disabled_desc = __( 'WooCommerce features have been disabled.', 'woocommerce-admin' );
$desc = __( 'Start using new features that are being progressively rolled out to improve the store management experience.', 'woocommerce' );
$disabled_desc = __( 'WooCommerce features have been disabled.', 'woocommerce' );
if ( $features_disabled ) {
$GLOBALS['hide_save_button'] = true;
@ -298,7 +298,7 @@ class Features {
return array_merge(
array(
array(
'title' => __( 'Features', 'woocommerce-admin' ),
'title' => __( 'Features', 'woocommerce' ),
'type' => 'title',
'desc' => $features_disabled ? $disabled_desc : $desc,
'id' => 'features_options',

View File

@ -92,43 +92,43 @@ class CoreMenu {
$analytics_enabled = Features::is_enabled( 'analytics' );
return array(
array(
'title' => __( 'Orders', 'woocommerce-admin' ),
'title' => __( 'Orders', 'woocommerce' ),
'id' => 'woocommerce-orders',
'badge' => self::get_shop_order_count(),
'order' => 10,
),
array(
'title' => __( 'Products', 'woocommerce-admin' ),
'title' => __( 'Products', 'woocommerce' ),
'id' => 'woocommerce-products',
'order' => 20,
),
$analytics_enabled ?
array(
'title' => __( 'Analytics', 'woocommerce-admin' ),
'title' => __( 'Analytics', 'woocommerce' ),
'id' => 'woocommerce-analytics',
'order' => 30,
) : null,
$analytics_enabled ?
array(
'title' => __( 'Reports', 'woocommerce-admin' ),
'title' => __( 'Reports', 'woocommerce' ),
'id' => 'woocommerce-reports',
'parent' => 'woocommerce-analytics',
'order' => 200,
) : null,
array(
'title' => __( 'Marketing', 'woocommerce-admin' ),
'title' => __( 'Marketing', 'woocommerce' ),
'id' => 'woocommerce-marketing',
'order' => 40,
),
array(
'title' => __( 'Settings', 'woocommerce-admin' ),
'title' => __( 'Settings', 'woocommerce' ),
'id' => 'woocommerce-settings',
'menuId' => 'secondary',
'order' => 20,
'url' => 'admin.php?page=wc-settings',
),
array(
'title' => __( 'Tools', 'woocommerce-admin' ),
'title' => __( 'Tools', 'woocommerce' ),
'id' => 'woocommerce-tools',
'menuId' => 'secondary',
'order' => 30,
@ -192,7 +192,7 @@ class CoreMenu {
if ( defined( '\Automattic\WooCommerce\Internal\Admin\Homescreen::MENU_SLUG' ) ) {
$home_item = array(
'id' => 'woocommerce-home',
'title' => __( 'Home', 'woocommerce-admin' ),
'title' => __( 'Home', 'woocommerce' ),
'url' => \Automattic\WooCommerce\Internal\Admin\Homescreen::MENU_SLUG,
'order' => 0,
'matchExpression' => 'page=wc-admin((?!path=).)*$',
@ -203,7 +203,7 @@ class CoreMenu {
if ( Features::is_enabled( 'analytics' ) ) {
$customers_item = array(
'id' => 'woocommerce-analytics-customers',
'title' => __( 'Customers', 'woocommerce-admin' ),
'title' => __( 'Customers', 'woocommerce' ),
'url' => 'wc-admin&path=/customers',
'order' => 50,
);
@ -220,7 +220,7 @@ class CoreMenu {
$product_tag_items['default'],
array(
'id' => 'woocommerce-product-attributes',
'title' => __( 'Attributes', 'woocommerce-admin' ),
'title' => __( 'Attributes', 'woocommerce' ),
'url' => 'edit.php?post_type=product&page=product_attributes',
'capability' => 'manage_product_terms',
'order' => 40,
@ -231,7 +231,7 @@ class CoreMenu {
$coupon_items['default'],
// Marketplace category.
array(
'title' => __( 'Marketplace', 'woocommerce-admin' ),
'title' => __( 'Marketplace', 'woocommerce' ),
'capability' => 'manage_woocommerce',
'id' => 'woocommerce-marketplace',
'url' => 'wc-addons',
@ -257,9 +257,9 @@ class CoreMenu {
*/
public static function get_tool_items() {
$tabs = array(
'status' => __( 'System status', 'woocommerce-admin' ),
'tools' => __( 'Utilities', 'woocommerce-admin' ),
'logs' => __( 'Logs', 'woocommerce-admin' ),
'status' => __( 'System status', 'woocommerce' ),
'tools' => __( 'Utilities', 'woocommerce' ),
'logs' => __( 'Logs', 'woocommerce' ),
);
$tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );
@ -267,7 +267,7 @@ class CoreMenu {
$items = array(
array(
'parent' => 'woocommerce-tools',
'title' => __( 'Import / Export', 'woocommerce-admin' ),
'title' => __( 'Import / Export', 'woocommerce' ),
'capability' => 'import',
'id' => 'tools-import-export',
'url' => 'import.php',

View File

@ -55,7 +55,7 @@ class Favorites {
if ( in_array( $item_id, $all_favorites, true ) ) {
return new \WP_Error(
'woocommerce_favorites_already_exists',
__( 'Favorite already exists', 'woocommerce-admin' )
__( 'Favorite already exists', 'woocommerce' )
);
}
@ -79,7 +79,7 @@ class Favorites {
if ( ! in_array( $item_id, $all_favorites, true ) ) {
return new \WP_Error(
'woocommerce_favorites_does_not_exist',
__( 'Favorite item not found', 'woocommerce-admin' )
__( 'Favorite item not found', 'woocommerce' )
);
}

View File

@ -47,14 +47,14 @@ class Init {
public static function add_feature_toggle( $features ) {
$description = __(
'Adds the new WooCommerce navigation experience to the dashboard',
'woocommerce-admin'
'woocommerce'
);
$update_text = '';
$needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' );
if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
$update_text = sprintf(
/* translators: 1: line break tag, 2: open link to WordPress update link, 3: close link tag. */
__( '%1$s %2$sUpdate WordPress to enable the new navigation%3$s', 'woocommerce-admin' ),
__( '%1$s %2$sUpdate WordPress to enable the new navigation%3$s', 'woocommerce' ),
'<br/>',
'<a href="' . self_admin_url( 'update-core.php' ) . '" target="_blank">',
'</a>'
@ -62,7 +62,7 @@ class Init {
}
$features[] = array(
'title' => __( 'Navigation', 'woocommerce-admin' ),
'title' => __( 'Navigation', 'woocommerce' ),
'desc' => $description . $update_text,
'id' => self::TOGGLE_OPTION_NAME,
'type' => 'checkbox',

View File

@ -188,7 +188,7 @@ class Menu {
$menu_item['parent'] = 'woocommerce';
$menu_item['backButtonLabel'] = __(
'WooCommerce Home',
'woocommerce-admin'
'woocommerce'
);
}
@ -226,7 +226,7 @@ class Menu {
error_log( // phpcs:ignore
sprintf(
/* translators: 1: Duplicate menu item path. */
esc_html__( 'You have attempted to register a duplicate item with WooCommerce Navigation: %1$s', 'woocommerce-admin' ),
esc_html__( 'You have attempted to register a duplicate item with WooCommerce Navigation: %1$s', 'woocommerce' ),
'`' . $args['id'] . '`'
)
);
@ -371,7 +371,7 @@ class Menu {
error_log( // phpcs:ignore
sprintf(
/* translators: 1: Duplicate menu item path. */
esc_html__( 'The item ID %1$s attempted to register using an invalid option. The arguments `menuId` and `parent` are not allowed for add_setting_item()', 'woocommerce-admin' ),
esc_html__( 'The item ID %1$s attempted to register using an invalid option. The arguments `menuId` and `parent` are not allowed for add_setting_item()', 'woocommerce' ),
'`' . $args['id'] . '`'
)
);

View File

@ -190,7 +190,7 @@ abstract class Task {
* @return string
*/
public function get_action_label() {
return __( "Let's go", 'woocommerce-admin' );
return __( "Let's go", 'woocommerce' );
}
/**

View File

@ -236,7 +236,7 @@ class TaskList {
if ( ! is_subclass_of( $task, 'Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task' ) ) {
return new \WP_Error(
'woocommerce_task_list_invalid_task',
__( 'Task is not a subclass of `Task`', 'woocommerce-admin' )
__( 'Task is not a subclass of `Task`', 'woocommerce' )
);
}
if ( array_search( $task, $this->tasks, true ) ) {

View File

@ -79,7 +79,7 @@ class TaskLists {
self::add_list(
array(
'id' => 'setup',
'title' => __( 'Get ready to start selling', 'woocommerce-admin' ),
'title' => __( 'Get ready to start selling', 'woocommerce' ),
'tasks' => array(
'StoreDetails',
'Purchase',
@ -100,7 +100,7 @@ class TaskLists {
array(
'id' => 'setup_experiment_1',
'hidden_id' => 'setup',
'title' => __( 'Get ready to start selling', 'woocommerce-admin' ),
'title' => __( 'Get ready to start selling', 'woocommerce' ),
'tasks' => array(
'StoreDetails',
'Products',
@ -123,7 +123,7 @@ class TaskLists {
self::add_list(
array(
'id' => 'extended',
'title' => __( 'Things to do next', 'woocommerce-admin' ),
'title' => __( 'Things to do next', 'woocommerce' ),
'sort_by' => array(
array(
'key' => 'is_complete',
@ -143,7 +143,7 @@ class TaskLists {
array(
'id' => 'setup_two_column',
'hidden_id' => 'setup',
'title' => __( 'Get ready to start selling', 'woocommerce-admin' ),
'title' => __( 'Get ready to start selling', 'woocommerce' ),
'tasks' => array(
'Products',
'WooCommercePayments',
@ -160,7 +160,7 @@ class TaskLists {
array(
'id' => 'extended_two_column',
'hidden_id' => 'extended',
'title' => __( 'Things to do next', 'woocommerce-admin' ),
'title' => __( 'Things to do next', 'woocommerce' ),
'sort_by' => array(
array(
'key' => 'is_complete',
@ -227,7 +227,7 @@ class TaskLists {
if ( isset( self::$lists[ $args['id'] ] ) ) {
return new \WP_Error(
'woocommerce_task_list_exists',
__( 'Task list ID already exists', 'woocommerce-admin' )
__( 'Task list ID already exists', 'woocommerce' )
);
}
@ -246,7 +246,7 @@ class TaskLists {
if ( ! isset( self::$lists[ $list_id ] ) ) {
return new \WP_Error(
'woocommerce_task_list_invalid_list',
__( 'Task list ID does not exist', 'woocommerce-admin' )
__( 'Task list ID does not exist', 'woocommerce' )
);
}

View File

@ -27,7 +27,7 @@ class AdditionalPayments extends Payments {
* @return string
*/
public function get_title() {
return __( 'Set up additional payment providers', 'woocommerce-admin' );
return __( 'Set up additional payment providers', 'woocommerce' );
}
/**
@ -38,7 +38,7 @@ class AdditionalPayments extends Payments {
public function get_content() {
return __(
'Choose payment providers and enable payment methods at checkout.',
'woocommerce-admin'
'woocommerce'
);
}
@ -48,7 +48,7 @@ class AdditionalPayments extends Payments {
* @return string
*/
public function get_time() {
return __( '2 minutes', 'woocommerce-admin' );
return __( '2 minutes', 'woocommerce' );
}
/**

View File

@ -41,11 +41,11 @@ class Appearance extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You personalized your store', 'woocommerce-admin' );
return __( 'You personalized your store', 'woocommerce' );
}
return __( 'Personalize your store', 'woocommerce-admin' );
return __( 'Personalize your store', 'woocommerce' );
}
return __( 'Personalize my store', 'woocommerce-admin' );
return __( 'Personalize my store', 'woocommerce' );
}
/**
@ -56,7 +56,7 @@ class Appearance extends Task {
public function get_content() {
return __(
'Add your logo, create a homepage, and start designing your store.',
'woocommerce-admin'
'woocommerce'
);
}
@ -66,7 +66,7 @@ class Appearance extends Task {
* @return string
*/
public function get_time() {
return __( '2 minutes', 'woocommerce-admin' );
return __( '2 minutes', 'woocommerce' );
}
/**

View File

@ -27,11 +27,11 @@ class Marketing extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You added sales channels', 'woocommerce-admin' );
return __( 'You added sales channels', 'woocommerce' );
}
return __( 'Get more sales', 'woocommerce-admin' );
return __( 'Get more sales', 'woocommerce' );
}
return __( 'Set up marketing tools', 'woocommerce-admin' );
return __( 'Set up marketing tools', 'woocommerce' );
}
/**
@ -42,7 +42,7 @@ class Marketing extends Task {
public function get_content() {
return __(
'Add recommended marketing tools to reach new customers and grow your business',
'woocommerce-admin'
'woocommerce'
);
}
@ -52,7 +52,7 @@ class Marketing extends Task {
* @return string
*/
public function get_time() {
return __( '1 minute', 'woocommerce-admin' );
return __( '1 minute', 'woocommerce' );
}
/**

View File

@ -27,11 +27,11 @@ class Payments extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You set up payments', 'woocommerce-admin' );
return __( 'You set up payments', 'woocommerce' );
}
return __( 'Set up payments', 'woocommerce-admin' );
return __( 'Set up payments', 'woocommerce' );
}
return __( 'Set up payments', 'woocommerce-admin' );
return __( 'Set up payments', 'woocommerce' );
}
/**
@ -42,7 +42,7 @@ class Payments extends Task {
public function get_content() {
return __(
'Choose payment providers and enable payment methods at checkout.',
'woocommerce-admin'
'woocommerce'
);
}
@ -52,7 +52,7 @@ class Payments extends Task {
* @return string
*/
public function get_time() {
return __( '2 minutes', 'woocommerce-admin' );
return __( '2 minutes', 'woocommerce' );
}
/**

View File

@ -38,11 +38,11 @@ class Products extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You added products', 'woocommerce-admin' );
return __( 'You added products', 'woocommerce' );
}
return __( 'Add products', 'woocommerce-admin' );
return __( 'Add products', 'woocommerce' );
}
return __( 'Add my products', 'woocommerce-admin' );
return __( 'Add my products', 'woocommerce' );
}
/**
@ -53,7 +53,7 @@ class Products extends Task {
public function get_content() {
return __(
'Start by adding the first product to your store. You can add your products manually, via CSV, or import them from another service.',
'woocommerce-admin'
'woocommerce'
);
}
@ -63,7 +63,7 @@ class Products extends Task {
* @return string
*/
public function get_time() {
return __( '1 minute per product', 'woocommerce-admin' );
return __( '1 minute per product', 'woocommerce' );
}
/**

View File

@ -61,13 +61,13 @@ class Purchase extends Task {
/* translators: %1$s: list of product names comma separated, %2%s the last product name */
__(
'Add %s to my store',
'woocommerce-admin'
'woocommerce'
),
$products['remaining'][0]
)
: __(
'Add paid extensions to my store',
'woocommerce-admin'
'woocommerce'
);
}
@ -86,7 +86,7 @@ class Purchase extends Task {
/* translators: %1$s: list of product names comma separated, %2%s the last product name */
__(
'Good choice! You chose to add %1$s and %2$s to your store.',
'woocommerce-admin'
'woocommerce'
),
implode( ', ', array_slice( $products['remaining'], 0, -1 ) ) . ( count( $products['remaining'] ) > 2 ? ',' : '' ),
end( $products['remaining'] )
@ -99,7 +99,7 @@ class Purchase extends Task {
* @return string
*/
public function get_action_label() {
return __( 'Purchase & install now', 'woocommerce-admin' );
return __( 'Purchase & install now', 'woocommerce' );
}
@ -109,7 +109,7 @@ class Purchase extends Task {
* @return string
*/
public function get_time() {
return __( '2 minutes', 'woocommerce-admin' );
return __( '2 minutes', 'woocommerce' );
}
/**

View File

@ -26,11 +26,11 @@ class Shipping extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You added shipping costs', 'woocommerce-admin' );
return __( 'You added shipping costs', 'woocommerce' );
}
return __( 'Add shipping costs', 'woocommerce-admin' );
return __( 'Add shipping costs', 'woocommerce' );
}
return __( 'Set up shipping', 'woocommerce-admin' );
return __( 'Set up shipping', 'woocommerce' );
}
/**
@ -41,7 +41,7 @@ class Shipping extends Task {
public function get_content() {
return __(
"Set your store location and where you'll ship to.",
'woocommerce-admin'
'woocommerce'
);
}
@ -51,7 +51,7 @@ class Shipping extends Task {
* @return string
*/
public function get_time() {
return __( '1 minute', 'woocommerce-admin' );
return __( '1 minute', 'woocommerce' );
}
/**

View File

@ -26,11 +26,11 @@ class StoreDetails extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You added store details', 'woocommerce-admin' );
return __( 'You added store details', 'woocommerce' );
}
return __( 'Add store details', 'woocommerce-admin' );
return __( 'Add store details', 'woocommerce' );
}
return __( 'Store details', 'woocommerce-admin' );
return __( 'Store details', 'woocommerce' );
}
/**
@ -41,7 +41,7 @@ class StoreDetails extends Task {
public function get_content() {
return __(
'Your store address is required to set the origin country for shipping, currencies, and payment options.',
'woocommerce-admin'
'woocommerce'
);
}
@ -51,7 +51,7 @@ class StoreDetails extends Task {
* @return string
*/
public function get_time() {
return __( '4 minutes', 'woocommerce-admin' );
return __( '4 minutes', 'woocommerce' );
}
/**

View File

@ -67,11 +67,11 @@ class Tax extends Task {
public function get_title() {
if ( true === $this->get_parent_option( 'use_completed_title' ) ) {
if ( $this->is_complete() ) {
return __( 'You added tax rates', 'woocommerce-admin' );
return __( 'You added tax rates', 'woocommerce' );
}
return __( 'Add tax rates', 'woocommerce-admin' );
return __( 'Add tax rates', 'woocommerce' );
}
return __( 'Set up tax', 'woocommerce-admin' );
return __( 'Set up tax', 'woocommerce' );
}
/**
@ -83,11 +83,11 @@ class Tax extends Task {
return self::can_use_automated_taxes()
? __(
'Good news! WooCommerce Services and Jetpack can automate your sales tax calculations for you.',
'woocommerce-admin'
'woocommerce'
)
: __(
'Set your store location and configure tax rate settings.',
'woocommerce-admin'
'woocommerce'
);
}
@ -97,7 +97,7 @@ class Tax extends Task {
* @return string
*/
public function get_time() {
return __( '1 minute', 'woocommerce-admin' );
return __( '1 minute', 'woocommerce' );
}
/**
@ -107,8 +107,8 @@ class Tax extends Task {
*/
public function get_action_label() {
return self::can_use_automated_taxes()
? __( 'Yes please', 'woocommerce-admin' )
: __( "Let's go", 'woocommerce-admin' );
? __( 'Yes please', 'woocommerce' )
: __( "Let's go", 'woocommerce' );
}
/**

View File

@ -34,7 +34,7 @@ class WooCommercePayments extends Task {
* @return string
*/
public function get_title() {
return __( 'Get paid with WooCommerce Payments', 'woocommerce-admin' );
return __( 'Get paid with WooCommerce Payments', 'woocommerce' );
}
/**
@ -45,7 +45,7 @@ class WooCommercePayments extends Task {
public function get_content() {
return __(
"You're only one step away from getting paid. Verify your business details to start managing transactions with WooCommerce Payments.",
'woocommerce-admin'
'woocommerce'
);
}
@ -55,7 +55,7 @@ class WooCommercePayments extends Task {
* @return string
*/
public function get_time() {
return __( '2 minutes', 'woocommerce-admin' );
return __( '2 minutes', 'woocommerce' );
}
/**
@ -64,7 +64,7 @@ class WooCommercePayments extends Task {
* @return string
*/
public function get_action_label() {
return __( 'Finish setup', 'woocommerce-admin' );
return __( 'Finish setup', 'woocommerce' );
}
/**
@ -75,7 +75,7 @@ class WooCommercePayments extends Task {
public function get_additional_info() {
return __(
'By setting up, you are agreeing to the <a href="https://wordpress.com/tos/" target="_blank">Terms of Service</a>',
'woocommerce-admin'
'woocommerce'
);
}

View File

@ -23,8 +23,8 @@ class DefaultPaymentGateways {
return array(
array(
'id' => 'payfast',
'title' => __( 'PayFast', 'woocommerce-admin' ),
'content' => __( 'The PayFast extension for WooCommerce enables you to accept payments by Credit Card and EFT via one of South Africas most popular payment gateways. No setup fees or monthly subscription costs. Selecting this extension will configure your store to use South African rands as the selected currency.', 'woocommerce-admin' ),
'title' => __( 'PayFast', 'woocommerce' ),
'content' => __( 'The PayFast extension for WooCommerce enables you to accept payments by Credit Card and EFT via one of South Africas most popular payment gateways. No setup fees or monthly subscription costs. Selecting this extension will configure your store to use South African rands as the selected currency.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/payfast.png',
'plugins' => array( 'woocommerce-payfast-gateway' ),
'is_visible' => array(
@ -38,8 +38,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'stripe',
'title' => __( ' Stripe', 'woocommerce-admin' ),
'content' => __( 'Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay.', 'woocommerce-admin' ),
'title' => __( ' Stripe', 'woocommerce' ),
'content' => __( 'Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/stripe.png',
'plugins' => array( 'woocommerce-gateway-stripe' ),
'is_visible' => array(
@ -94,8 +94,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'paystack',
'title' => __( 'Paystack', 'woocommerce-admin' ),
'content' => __( 'Paystack helps African merchants accept one-time and recurring payments online with a modern, safe, and secure payment gateway.', 'woocommerce-admin' ),
'title' => __( 'Paystack', 'woocommerce' ),
'content' => __( 'Paystack helps African merchants accept one-time and recurring payments online with a modern, safe, and secure payment gateway.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/paystack.png',
'plugins' => array( 'woo-paystack' ),
'is_visible' => array(
@ -105,8 +105,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'kco',
'title' => __( 'Klarna Checkout', 'woocommerce-admin' ),
'content' => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce-admin' ),
'title' => __( 'Klarna Checkout', 'woocommerce' ),
'content' => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/klarna-black.png',
'plugins' => array( 'klarna-checkout-for-woocommerce' ),
'is_visible' => array(
@ -116,8 +116,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'klarna_payments',
'title' => __( 'Klarna Payments', 'woocommerce-admin' ),
'content' => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce-admin' ),
'title' => __( 'Klarna Payments', 'woocommerce' ),
'content' => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/klarna-black.png',
'plugins' => array( 'klarna-payments-for-woocommerce' ),
'is_visible' => array(
@ -141,8 +141,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'mollie_wc_gateway_banktransfer',
'title' => __( 'Mollie', 'woocommerce-admin' ),
'content' => __( 'Effortless payments by Mollie: Offer global and local payment methods, get onboarded in minutes, and supported in your language.', 'woocommerce-admin' ),
'title' => __( 'Mollie', 'woocommerce' ),
'content' => __( 'Effortless payments by Mollie: Offer global and local payment methods, get onboarded in minutes, and supported in your language.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/mollie.svg',
'plugins' => array( 'mollie-payments-for-woocommerce' ),
'is_visible' => array(
@ -165,8 +165,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'woo-mercado-pago-custom',
'title' => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce-admin' ),
'content' => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce-admin' ),
'title' => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce' ),
'content' => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/mercadopago.png',
'plugins' => array( 'woocommerce-mercadopago' ),
'is_visible' => array(
@ -177,8 +177,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'ppcp-gateway',
'title' => __( 'PayPal Payments', 'woocommerce-admin' ),
'content' => __( "Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce-admin' ),
'title' => __( 'PayPal Payments', 'woocommerce' ),
'content' => __( "Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/paypal.png',
'plugins' => array( 'woocommerce-paypal-payments' ),
'is_visible' => array(
@ -192,8 +192,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'cod',
'title' => __( 'Cash on delivery', 'woocommerce-admin' ),
'content' => __( 'Take payments in cash upon delivery.', 'woocommerce-admin' ),
'title' => __( 'Cash on delivery', 'woocommerce' ),
'content' => __( 'Take payments in cash upon delivery.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/cod.svg',
'is_visible' => array(
self::get_rules_for_cbd( false ),
@ -201,8 +201,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'bacs',
'title' => __( 'Direct bank transfer', 'woocommerce-admin' ),
'content' => __( 'Take payments via bank transfer.', 'woocommerce-admin' ),
'title' => __( 'Direct bank transfer', 'woocommerce' ),
'content' => __( 'Take payments via bank transfer.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/bacs.svg',
'is_visible' => array(
self::get_rules_for_cbd( false ),
@ -210,10 +210,10 @@ class DefaultPaymentGateways {
),
array(
'id' => 'woocommerce_payments',
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
'title' => __( 'WooCommerce Payments', 'woocommerce' ),
'content' => __(
'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
'woocommerce-admin'
'woocommerce'
),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/wcpay.svg',
'plugins' => array( 'woocommerce-payments' ),
@ -252,10 +252,10 @@ class DefaultPaymentGateways {
),
array(
'id' => 'woocommerce_payments:non-us',
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
'title' => __( 'WooCommerce Payments', 'woocommerce' ),
'content' => __(
'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
'woocommerce-admin'
'woocommerce'
),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/wcpay.svg',
'plugins' => array( 'woocommerce-payments' ),
@ -286,10 +286,10 @@ class DefaultPaymentGateways {
),
array(
'id' => 'woocommerce_payments:us',
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
'title' => __( 'WooCommerce Payments', 'woocommerce' ),
'content' => __(
'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
'woocommerce-admin'
'woocommerce'
),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/wcpay.svg',
'plugins' => array( 'woocommerce-payments' ),
@ -320,8 +320,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'razorpay',
'title' => __( 'Razorpay', 'woocommerce-admin' ),
'content' => __( 'The official Razorpay extension for WooCommerce allows you to accept credit cards, debit cards, netbanking, wallet, and UPI payments.', 'woocommerce-admin' ),
'title' => __( 'Razorpay', 'woocommerce' ),
'content' => __( 'The official Razorpay extension for WooCommerce allows you to accept credit cards, debit cards, netbanking, wallet, and UPI payments.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/razorpay.svg',
'plugins' => array( 'woo-razorpay' ),
'is_visible' => array(
@ -335,8 +335,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'payubiz',
'title' => __( 'PayU for WooCommerce', 'woocommerce-admin' ),
'content' => __( 'Enable PayUs exclusive plugin for WooCommerce to start accepting payments in 100+ payment methods available in India including credit cards, debit cards, UPI, & more!', 'woocommerce-admin' ),
'title' => __( 'PayU for WooCommerce', 'woocommerce' ),
'content' => __( 'Enable PayUs exclusive plugin for WooCommerce to start accepting payments in 100+ payment methods available in India including credit cards, debit cards, UPI, & more!', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/payu.svg',
'plugins' => array( 'payu-india' ),
'is_visible' => array(
@ -350,8 +350,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'eway',
'title' => __( 'Eway', 'woocommerce-admin' ),
'content' => __( 'The Eway extension for WooCommerce allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.', 'woocommerce-admin' ),
'title' => __( 'Eway', 'woocommerce' ),
'content' => __( 'The Eway extension for WooCommerce allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.', 'woocommerce' ),
'image' => WC_ADMIN_IMAGES_FOLDER_URL . '/onboarding/eway.png',
'plugins' => array( 'woocommerce-gateway-eway' ),
'is_visible' => array(
@ -361,8 +361,8 @@ class DefaultPaymentGateways {
),
array(
'id' => 'square_credit_card',
'title' => __( 'Square', 'woocommerce-admin' ),
'content' => __( 'Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place.', 'woocommerce-admin' ),
'title' => __( 'Square', 'woocommerce' ),
'content' => __( 'Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/square-black.png',
'plugins' => array( 'woocommerce-square' ),
'is_visible' => array(

View File

@ -130,7 +130,7 @@ class PaymentGatewaysController {
'status' => 'success',
'content' => sprintf(
/* translators: the title of the payment gateway */
__( '%s connected successfully', 'woocommerce-admin' ),
__( '%s connected successfully', 'woocommerce' ),
$payment_gateway->method_title
),
)

View File

@ -121,7 +121,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
*/
do_action( 'woocommerce_note_loaded', $note );
} else {
throw new \Exception( __( 'Invalid admin note', 'woocommerce-admin' ) );
throw new \Exception( __( 'Invalid admin note', 'woocommerce' ) );
}
}

View File

@ -374,7 +374,7 @@ class Note extends \WC_Data {
public function set_name( $name ) {
// Don't allow empty names.
if ( empty( $name ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note name prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note name prop cannot be empty.', 'woocommerce' ) );
}
$this->set_prop( 'name', $name );
@ -387,7 +387,7 @@ class Note extends \WC_Data {
*/
public function set_type( $type ) {
if ( empty( $type ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note type prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note type prop cannot be empty.', 'woocommerce' ) );
}
if ( ! in_array( $type, self::get_allowed_types(), true ) ) {
@ -395,7 +395,7 @@ class Note extends \WC_Data {
'admin_note_invalid_data',
sprintf(
/* translators: %s: admin note type. */
__( 'The admin note type prop (%s) is not one of the supported types.', 'woocommerce-admin' ),
__( 'The admin note type prop (%s) is not one of the supported types.', 'woocommerce' ),
$type
)
);
@ -411,7 +411,7 @@ class Note extends \WC_Data {
*/
public function set_locale( $locale ) {
if ( empty( $locale ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note locale prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note locale prop cannot be empty.', 'woocommerce' ) );
}
$this->set_prop( 'locale', $locale );
@ -424,7 +424,7 @@ class Note extends \WC_Data {
*/
public function set_title( $title ) {
if ( empty( $title ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note title prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note title prop cannot be empty.', 'woocommerce' ) );
}
$this->set_prop( 'title', $title );
@ -464,7 +464,7 @@ class Note extends \WC_Data {
$content = wp_kses( $content, $allowed_html );
if ( empty( $content ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note content prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note content prop cannot be empty.', 'woocommerce' ) );
}
$this->set_prop( 'content', $content );
@ -481,7 +481,7 @@ class Note extends \WC_Data {
// Make sure $content_data is stdClass Object or an array.
if ( ! ( $content_data instanceof \stdClass ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note content_data prop must be an instance of stdClass.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note content_data prop must be an instance of stdClass.', 'woocommerce' ) );
}
$this->set_prop( 'content_data', $content_data );
@ -494,7 +494,7 @@ class Note extends \WC_Data {
*/
public function set_status( $status ) {
if ( empty( $status ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'woocommerce' ) );
}
if ( ! in_array( $status, self::get_allowed_statuses(), true ) ) {
@ -502,7 +502,7 @@ class Note extends \WC_Data {
'admin_note_invalid_data',
sprintf(
/* translators: %s: admin note status property. */
__( 'The admin note status prop (%s) is not one of the supported statuses.', 'woocommerce-admin' ),
__( 'The admin note status prop (%s) is not one of the supported statuses.', 'woocommerce' ),
$status
)
);
@ -518,7 +518,7 @@ class Note extends \WC_Data {
*/
public function set_source( $source ) {
if ( empty( $source ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note source prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note source prop cannot be empty.', 'woocommerce' ) );
}
$this->set_prop( 'source', $source );
@ -531,7 +531,7 @@ class Note extends \WC_Data {
*/
public function set_date_created( $date ) {
if ( empty( $date ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note date prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note date prop cannot be empty.', 'woocommerce' ) );
}
if ( is_string( $date ) ) {
@ -582,7 +582,7 @@ class Note extends \WC_Data {
if ( in_array( $layout, $valid_layouts, true ) ) {
$this->set_prop( 'layout', $layout );
} else {
$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce' ) );
}
}
@ -638,11 +638,11 @@ class Note extends \WC_Data {
$actioned_text = wc_clean( $actioned_text );
if ( empty( $name ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note action name prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note action name prop cannot be empty.', 'woocommerce' ) );
}
if ( empty( $label ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note action label prop cannot be empty.', 'woocommerce-admin' ) );
$this->error( 'admin_note_invalid_data', __( 'The admin note action label prop cannot be empty.', 'woocommerce' ) );
}
$action = array(

View File

@ -465,7 +465,7 @@ class Notes {
} catch ( \Exception $e ) {
throw new NotesUnavailableException(
'woocommerce_admin_notes_unavailable',
__( 'Notes are unavailable because the "admin-note" data store cannot be loaded.', 'woocommerce-admin' )
__( 'Notes are unavailable because the "admin-note" data store cannot be loaded.', 'woocommerce' )
);
}
}

View File

@ -198,7 +198,7 @@ class PageController {
}
}
$woocommerce_breadcrumb = array( 'admin.php?page=' . self::PAGE_ROOT, __( 'WooCommerce', 'woocommerce-admin' ) );
$woocommerce_breadcrumb = array( 'admin.php?page=' . self::PAGE_ROOT, __( 'WooCommerce', 'woocommerce' ) );
array_unshift( $breadcrumbs, $woocommerce_breadcrumb );
@ -220,7 +220,7 @@ class PageController {
// If 'current_screen' hasn't fired yet, the current page calculation
// will fail which causes `false` to be returned for all subsquent calls.
if ( ! did_action( 'current_screen' ) ) {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Current page retrieval should be called on or after the `current_screen` hook.', 'woocommerce-admin' ), '0.16.0' );
_doing_it_wrong( __FUNCTION__, esc_html__( 'Current page retrieval should be called on or after the `current_screen` hook.', 'woocommerce' ), '0.16.0' );
}
if ( is_null( $this->current_page ) ) {
@ -507,7 +507,7 @@ class PageController {
public function register_store_details_page() {
wc_admin_register_page(
array(
'title' => __( 'Setup Wizard', 'woocommerce-admin' ),
'title' => __( 'Setup Wizard', 'woocommerce' ),
'parent' => '',
'path' => '/setup-wizard',
)

View File

@ -154,7 +154,7 @@ class PluginsHelper {
$plugins = apply_filters( 'woocommerce_admin_plugins_pre_install', $plugins );
if ( empty( $plugins ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ) );
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ) );
}
require_once ABSPATH . 'wp-admin/includes/plugin.php';
@ -193,7 +193,7 @@ class PluginsHelper {
if ( is_wp_error( $api ) ) {
$properties = array(
/* translators: %s: plugin slug (example: woocommerce-services) */
'error_message' => __( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce-admin' ),
'error_message' => __( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce' ),
'api' => $api,
'slug' => $slug,
);
@ -205,7 +205,7 @@ class PluginsHelper {
$plugin,
sprintf(
/* translators: %s: plugin slug (example: woocommerce-services) */
__( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce-admin' ),
__( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce' ),
$slug
)
);
@ -221,7 +221,7 @@ class PluginsHelper {
if ( is_wp_error( $result ) || is_null( $result ) ) {
$properties = array(
/* translators: %s: plugin slug (example: woocommerce-services) */
'error_message' => __( 'The requested plugin `%s` could not be installed.', 'woocommerce-admin' ),
'error_message' => __( 'The requested plugin `%s` could not be installed.', 'woocommerce' ),
'slug' => $slug,
'api' => $api,
'upgrader' => $upgrader,
@ -235,7 +235,7 @@ class PluginsHelper {
$plugin,
sprintf(
/* translators: %s: plugin slug (example: woocommerce-services) */
__( 'The requested plugin `%s` could not be installed. Upgrader install failed.', 'woocommerce-admin' ),
__( 'The requested plugin `%s` could not be installed. Upgrader install failed.', 'woocommerce' ),
$slug
)
);
@ -263,7 +263,7 @@ class PluginsHelper {
*/
public static function schedule_install_plugins( $plugins ) {
if ( empty( $plugins ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
}
$job_id = uniqid();
@ -280,7 +280,7 @@ class PluginsHelper {
*/
public static function activate_plugins( $plugins ) {
if ( empty( $plugins ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
}
require_once ABSPATH . 'wp-admin/includes/plugin.php';
@ -307,7 +307,7 @@ class PluginsHelper {
$errors->add(
$plugin,
/* translators: %s: plugin slug (example: woocommerce-services) */
sprintf( __( 'The requested plugin `%s`. is not yet installed.', 'woocommerce-admin' ), $slug )
sprintf( __( 'The requested plugin `%s`. is not yet installed.', 'woocommerce' ), $slug )
);
continue;
}
@ -319,7 +319,7 @@ class PluginsHelper {
$errors->add(
$plugin,
/* translators: %s: plugin slug (example: woocommerce-services) */
sprintf( __( 'The requested plugin `%s` could not be activated.', 'woocommerce-admin' ), $slug )
sprintf( __( 'The requested plugin `%s` could not be activated.', 'woocommerce' ), $slug )
);
continue;
}
@ -344,7 +344,7 @@ class PluginsHelper {
*/
public static function schedule_activate_plugins( $plugins ) {
if ( empty( $plugins ) || ! is_array( $plugins ) ) {
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce-admin' ), 404 );
return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
}
$job_id = uniqid();

View File

@ -29,16 +29,16 @@ class ReportCSVEmail extends \WC_Email {
$this->template_html = 'html-admin-report-export-download.php';
$this->template_plain = 'plain-admin-report-export-download.php';
$this->report_labels = array(
'categories' => __( 'Categories', 'woocommerce-admin' ),
'coupons' => __( 'Coupons', 'woocommerce-admin' ),
'customers' => __( 'Customers', 'woocommerce-admin' ),
'downloads' => __( 'Downloads', 'woocommerce-admin' ),
'orders' => __( 'Orders', 'woocommerce-admin' ),
'products' => __( 'Products', 'woocommerce-admin' ),
'revenue' => __( 'Revenue', 'woocommerce-admin' ),
'stock' => __( 'Stock', 'woocommerce-admin' ),
'taxes' => __( 'Taxes', 'woocommerce-admin' ),
'variations' => __( 'Variations', 'woocommerce-admin' ),
'categories' => __( 'Categories', 'woocommerce' ),
'coupons' => __( 'Coupons', 'woocommerce' ),
'customers' => __( 'Customers', 'woocommerce' ),
'downloads' => __( 'Downloads', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'products' => __( 'Products', 'woocommerce' ),
'revenue' => __( 'Revenue', 'woocommerce' ),
'stock' => __( 'Stock', 'woocommerce' ),
'taxes' => __( 'Taxes', 'woocommerce' ),
'variations' => __( 'Variations', 'woocommerce' ),
);
// Call parent constructor.
@ -70,7 +70,7 @@ class ReportCSVEmail extends \WC_Email {
* @return string
*/
public function get_default_heading() {
return __( 'Your Report Download', 'woocommerce-admin' );
return __( 'Your Report Download', 'woocommerce' );
}
/**
@ -79,7 +79,7 @@ class ReportCSVEmail extends \WC_Email {
* @return string
*/
public function get_default_subject() {
return __( '[{site_title}]: Your {report_name} Report download is ready', 'woocommerce-admin' );
return __( '[{site_title}]: Your {report_name} Report download is ready', 'woocommerce' );
}
/**

View File

@ -46,7 +46,7 @@ class ReportsSync {
foreach ( $schedulers as $scheduler ) {
if ( ! is_subclass_of( $scheduler, 'Automattic\WooCommerce\Internal\Admin\Schedulers\ImportScheduler' ) ) {
throw new \Exception( __( 'Report sync schedulers should be derived from the Automattic\WooCommerce\Internal\Admin\Schedulers\ImportScheduler class.', 'woocommerce-admin' ) );
throw new \Exception( __( 'Report sync schedulers should be derived from the Automattic\WooCommerce\Internal\Admin\Schedulers\ImportScheduler class.', 'woocommerce' ) );
}
}
@ -76,7 +76,7 @@ class ReportsSync {
*/
public static function regenerate_report_data( $days, $skip_existing ) {
if ( self::is_importing() ) {
return new \WP_Error( 'wc_admin_import_in_progress', __( 'An import is already in progress. Please allow the previous import to complete before beginning a new one.', 'woocommerce-admin' ) );
return new \WP_Error( 'wc_admin_import_in_progress', __( 'An import is already in progress. Please allow the previous import to complete before beginning a new one.', 'woocommerce' ) );
}
self::reset_import_stats( $days, $skip_existing );
@ -92,7 +92,7 @@ class ReportsSync {
*/
do_action( 'woocommerce_analytics_regenerate_init', $days, $skip_existing );
return __( 'Report table data is being rebuilt. Please allow some time for data to fully populate.', 'woocommerce-admin' );
return __( 'Report table data is being rebuilt. Please allow some time for data to fully populate.', 'woocommerce' );
}
/**
@ -176,7 +176,7 @@ class ReportsSync {
// Delete import options.
delete_option( ImportScheduler::IMPORT_STATS_OPTION );
return __( 'Report table data is being deleted.', 'woocommerce-admin' );
return __( 'Report table data is being deleted.', 'woocommerce' );
}
/**

View File

@ -65,11 +65,11 @@ class Analytics {
public static function add_feature_toggle( $features ) {
$description = __(
'Enables WooCommerce Analytics',
'woocommerce-admin'
'woocommerce'
);
$features[] = array(
'title' => __( 'Analytics', 'woocommerce-admin' ),
'title' => __( 'Analytics', 'woocommerce' ),
'desc' => $description,
'id' => self::TOGGLE_OPTION_NAME,
'type' => 'checkbox',
@ -151,11 +151,11 @@ class Analytics {
);
$debug_tools[ self::CACHE_TOOL_ID ] = array(
'name' => __( 'Clear analytics cache', 'woocommerce-admin' ),
'button' => __( 'Clear', 'woocommerce-admin' ),
'name' => __( 'Clear analytics cache', 'woocommerce' ),
'button' => __( 'Clear', 'woocommerce' ),
'desc' => sprintf(
/* translators: 1: opening link tag, 2: closing tag */
__( 'This tool will reset the cached values used in WooCommerce Analytics. If numbers still look off, try %1$sReimporting Historical Data%2$s.', 'woocommerce-admin' ),
__( 'This tool will reset the cached values used in WooCommerce Analytics. If numbers still look off, try %1$sReimporting Historical Data%2$s.', 'woocommerce' ),
'<a href="' . esc_url( $settings_url ) . '">',
'</a>'
),
@ -183,7 +183,7 @@ class Analytics {
public static function get_report_pages() {
$overview_page = array(
'id' => 'woocommerce-analytics',
'title' => __( 'Analytics', 'woocommerce-admin' ),
'title' => __( 'Analytics', 'woocommerce' ),
'path' => '/analytics/overview',
'icon' => 'dashicons-chart-bar',
'position' => 57, // After WooCommerce & Product menu items.
@ -193,7 +193,7 @@ class Analytics {
$overview_page,
array(
'id' => 'woocommerce-analytics-overview',
'title' => __( 'Overview', 'woocommerce-admin' ),
'title' => __( 'Overview', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/overview',
'nav_args' => array(
@ -203,7 +203,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-products',
'title' => __( 'Products', 'woocommerce-admin' ),
'title' => __( 'Products', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/products',
'nav_args' => array(
@ -213,7 +213,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-revenue',
'title' => __( 'Revenue', 'woocommerce-admin' ),
'title' => __( 'Revenue', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/revenue',
'nav_args' => array(
@ -223,7 +223,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-orders',
'title' => __( 'Orders', 'woocommerce-admin' ),
'title' => __( 'Orders', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/orders',
'nav_args' => array(
@ -233,7 +233,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-variations',
'title' => __( 'Variations', 'woocommerce-admin' ),
'title' => __( 'Variations', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/variations',
'nav_args' => array(
@ -243,7 +243,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-categories',
'title' => __( 'Categories', 'woocommerce-admin' ),
'title' => __( 'Categories', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/categories',
'nav_args' => array(
@ -253,7 +253,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-coupons',
'title' => __( 'Coupons', 'woocommerce-admin' ),
'title' => __( 'Coupons', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/coupons',
'nav_args' => array(
@ -263,7 +263,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-taxes',
'title' => __( 'Taxes', 'woocommerce-admin' ),
'title' => __( 'Taxes', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/taxes',
'nav_args' => array(
@ -273,7 +273,7 @@ class Analytics {
),
array(
'id' => 'woocommerce-analytics-downloads',
'title' => __( 'Downloads', 'woocommerce-admin' ),
'title' => __( 'Downloads', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/downloads',
'nav_args' => array(
@ -283,7 +283,7 @@ class Analytics {
),
'yes' === get_option( 'woocommerce_manage_stock' ) ? array(
'id' => 'woocommerce-analytics-stock',
'title' => __( 'Stock', 'woocommerce-admin' ),
'title' => __( 'Stock', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/stock',
'nav_args' => array(
@ -293,17 +293,17 @@ class Analytics {
) : null,
array(
'id' => 'woocommerce-analytics-customers',
'title' => __( 'Customers', 'woocommerce-admin' ),
'title' => __( 'Customers', 'woocommerce' ),
'parent' => 'woocommerce',
'path' => '/customers',
),
array(
'id' => 'woocommerce-analytics-settings',
'title' => __( 'Settings', 'woocommerce-admin' ),
'title' => __( 'Settings', 'woocommerce' ),
'parent' => 'woocommerce-analytics',
'path' => '/analytics/settings',
'nav_args' => array(
'title' => __( 'Analytics', 'woocommerce-admin' ),
'title' => __( 'Analytics', 'woocommerce' ),
'parent' => 'woocommerce-settings',
),
),
@ -318,6 +318,6 @@ class Analytics {
public function run_clear_cache_tool() {
Cache::invalidate();
return __( 'Analytics cache cleared.', 'woocommerce-admin' );
return __( 'Analytics cache cleared.', 'woocommerce' );
}
}

View File

@ -71,8 +71,8 @@ class Coupons {
add_submenu_page(
'woocommerce',
__( 'Coupons', 'woocommerce-admin' ),
__( 'Coupons', 'woocommerce-admin' ),
__( 'Coupons', 'woocommerce' ),
__( 'Coupons', 'woocommerce' ),
'manage_options',
'coupons-moved',
[ $this, 'coupon_menu_moved' ]

View File

@ -129,7 +129,7 @@ class CustomerEffortScoreTracks {
3
);
}
$this->onsubmit_label = __( 'Thank you for your feedback!', 'woocommerce-admin' );
$this->onsubmit_label = __( 'Thank you for your feedback!', 'woocommerce' );
}
/**
@ -273,7 +273,7 @@ class CustomerEffortScoreTracks {
'action' => self::SEARCH_ACTION_NAME,
'label' => __(
'How easy was it to use search?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => $page_now,
@ -339,7 +339,7 @@ class CustomerEffortScoreTracks {
'action' => self::PRODUCT_ADD_PUBLISH_ACTION_NAME,
'label' => __(
'How easy was it to add a product?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'product',
@ -364,7 +364,7 @@ class CustomerEffortScoreTracks {
'action' => self::PRODUCT_UPDATE_ACTION_NAME,
'label' => __(
'How easy was it to edit your product?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'product',
@ -389,7 +389,7 @@ class CustomerEffortScoreTracks {
'action' => self::SHOP_ORDER_UPDATE_ACTION_NAME,
'label' => __(
'How easy was it to update an order?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'shop_order',
@ -447,7 +447,7 @@ class CustomerEffortScoreTracks {
wc_enqueue_js(
$this->get_script_track_edit_php(
self::ADD_PRODUCT_CATEGORIES_ACTION_NAME,
__( 'How easy was it to add product category?', 'woocommerce-admin' )
__( 'How easy was it to add product category?', 'woocommerce' )
)
);
}
@ -463,7 +463,7 @@ class CustomerEffortScoreTracks {
wc_enqueue_js(
$this->get_script_track_edit_php(
self::ADD_PRODUCT_TAGS_ACTION_NAME,
__( 'How easy was it to add a product tag?', 'woocommerce-admin' )
__( 'How easy was it to add a product tag?', 'woocommerce' )
)
);
}
@ -486,7 +486,7 @@ class CustomerEffortScoreTracks {
'action' => self::IMPORT_PRODUCTS_ACTION_NAME,
'label' => __(
'How easy was it to import products?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'product_page_product_importer',
@ -521,7 +521,7 @@ class CustomerEffortScoreTracks {
'action' => self::SETTINGS_CHANGE_ACTION_NAME,
'label' => __(
'How easy was it to update your settings?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'woocommerce_page_wc-settings',
@ -544,7 +544,7 @@ class CustomerEffortScoreTracks {
'action' => self::ADD_PRODUCT_ATTRIBUTES_ACTION_NAME,
'label' => __(
'How easy was it to add a product attribute?',
'woocommerce-admin'
'woocommerce'
),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'product_page_product_attributes',

View File

@ -245,7 +245,7 @@ class FeaturePlugin {
if ( ! $woocommerce_minimum_met ) {
$errors[] = sprintf(
/* translators: 1: URL of WooCommerce plugin, 2: The minimum WooCommerce version number */
__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WooCommerce</a> %2$s or greater to be installed and active.', 'woocommerce-admin' ),
__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WooCommerce</a> %2$s or greater to be installed and active.', 'woocommerce' ),
'https://wordpress.org/plugins/woocommerce/',
$minimum_woocommerce_version
);
@ -254,7 +254,7 @@ class FeaturePlugin {
if ( ! $wordpress_minimum_met ) {
$errors[] = sprintf(
/* translators: 1: URL of WordPress.org, 2: The minimum WordPress version number */
__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WordPress</a> %2$s or greater to be installed and active.', 'woocommerce-admin' ),
__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WordPress</a> %2$s or greater to be installed and active.', 'woocommerce' ),
'https://wordpress.org/',
$minimum_wordpress_version
);

View File

@ -81,7 +81,7 @@ class Homescreen {
wc_admin_register_page(
array(
'id' => 'woocommerce-home',
'title' => __( 'WooCommerce', 'woocommerce-admin' ),
'title' => __( 'WooCommerce', 'woocommerce' ),
'path' => self::MENU_SLUG,
'capability' => 'read',
)
@ -92,7 +92,7 @@ class Homescreen {
wc_admin_register_page(
array(
'id' => 'woocommerce-home',
'title' => __( 'Home', 'woocommerce-admin' ),
'title' => __( 'Home', 'woocommerce' ),
'parent' => 'woocommerce',
'path' => self::MENU_SLUG,
'order' => 0,

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