rebase code on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:51:46 -04:00
parent b16ad94b69
commit 8f1a2c3a66
2197 changed files with 184921 additions and 35568 deletions

View File

@@ -97,37 +97,7 @@ class OnboardingFreeExtensions extends WC_REST_Data_Controller {
}
}
$extensions = $this->replace_jetpack_with_jetpack_boost_for_treatment( $extensions );
return new WP_REST_Response( $extensions );
}
private function replace_jetpack_with_jetpack_boost_for_treatment( array $extensions ) {
$is_treatment = \WooCommerce\Admin\Experimental_Abtest::in_treatment( 'woocommerce_jetpack_copy' );
if ( ! $is_treatment ) {
return $extensions;
}
$has_core_profiler = array_search( 'obw/core-profiler', array_column( $extensions, 'key' ) );
if ( $has_core_profiler === false ) {
return $extensions;
}
$has_jetpack = array_search( 'jetpack', array_column( $extensions[ $has_core_profiler ]['plugins'], 'key' ) );
if ( $has_jetpack === false ) {
return $extensions;
}
$jetpack = &$extensions[ $has_core_profiler ]['plugins'][ $has_jetpack ];
$jetpack->key = 'jetpack-boost';
$jetpack->name = 'Jetpack Boost';
$jetpack->label = __( 'Optimize store performance with Jetpack Boost', 'woocommerce' );
$jetpack->description = __( 'Speed up your store and improve your SEO with performance-boosting tools from Jetpack. Learn more', 'woocommerce' );
$jetpack->learn_more_link = 'https://jetpack.com/boost/';
return $extensions;
}
}

View File

@@ -391,7 +391,6 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
'items' => array(
'enum' => array(
'jetpack',
'jetpack-boost',
'woocommerce-services',
'woocommerce-payments',
'mailchimp-for-woocommerce',

View File

@@ -39,7 +39,7 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
/**
* Duration to milisecond mapping.
*
* @var array
* @var string
*/
protected $duration_to_ms = array(
'day' => DAY_IN_SECONDS * 1000,
@@ -762,7 +762,6 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task && $id ) {
$task = new DeprecatedExtendedTask(
null,
array(
'id' => $id,
'is_dismissable' => true,
@@ -796,7 +795,6 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task && $id ) {
$task = new DeprecatedExtendedTask(
null,
array(
'id' => $id,
'is_dismissable' => true,
@@ -839,7 +837,6 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task && $task_id ) {
$task = new DeprecatedExtendedTask(
null,
array(
'id' => $task_id,
'is_snoozeable' => true,
@@ -877,7 +874,6 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task && $id ) {
$task = new DeprecatedExtendedTask(
null,
array(
'id' => $id,
'is_snoozeable' => true,
@@ -965,7 +961,6 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
if ( ! $task && $id ) {
$task = new DeprecatedExtendedTask(
null,
array(
'id' => $id,
)

View File

@@ -30,13 +30,6 @@ class DataStore extends SqlQuery {
*/
protected $cache_timeout = 3600;
/**
* Cache identifier.
*
* @var string
*/
protected $cache_key = '';
/**
* Table used as a data store for this report.
*

View File

@@ -542,87 +542,6 @@ class Segmenter {
}
}
/**
* Calculate segments for totals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
*
* @param array $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
* @param string $segmenting_from FROM part of segmenting SQL query.
* @param string $segmenting_where WHERE part of segmenting SQL query.
* @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
* @param string $segmenting_dimension_name Name of the segmenting dimension.
* @param string $table_name Name of SQL table which is the stats table for orders.
* @param array $totals_query Array of SQL clauses for totals query.
* @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
*
* @return array
*/
protected function get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $totals_query, $unique_orders_table ) {
return array();
}
/**
* Calculate segments for intervals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
*
* @param array $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
* @param string $segmenting_from FROM part of segmenting SQL query.
* @param string $segmenting_where WHERE part of segmenting SQL query.
* @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
* @param string $segmenting_dimension_name Name of the segmenting dimension.
* @param string $table_name Name of SQL table which is the stats table for orders.
* @param array $intervals_query Array of SQL clauses for intervals query.
* @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
*
* @return array
*/
protected function get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $intervals_query, $unique_orders_table ) {
return array();
}
/**
* Calculate segments for totals query where the segmenting property is bound to order (e.g. coupon or customer type).
*
* @param string $segmenting_select SELECT part of segmenting SQL query.
* @param string $segmenting_from FROM part of segmenting SQL query.
* @param string $segmenting_where WHERE part of segmenting SQL query.
* @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
* @param string $table_name Name of SQL table which is the stats table for orders.
* @param array $totals_query Array of SQL clauses for intervals query.
*
* @return array
*/
protected function get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query ) {
return array();
}
/**
* Calculate segments for intervals query where the segmenting property is bound to order (e.g. coupon or customer type).
*
* @param string $segmenting_select SELECT part of segmenting SQL query.
* @param string $segmenting_from FROM part of segmenting SQL query.
* @param string $segmenting_where WHERE part of segmenting SQL query.
* @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
* @param string $table_name Name of SQL table which is the stats table for orders.
* @param array $intervals_query Array of SQL clauses for intervals query.
*
* @return array
*/
protected function get_order_related_intervals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $intervals_query ) {
return array();
}
/**
* Return array of segments formatted for REST response.
*
* @param string $type Type of segments to return--'totals' or 'intervals'.
* @param array $query_params SQL query parameter array.
* @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
*
* @return array
*/
protected function get_segments( $type, $query_params, $table_name ) {
return array();
}
/**
* Calculate segments for segmenting property bound to product (e.g. category, product_id, variation_id).
*