This commit is contained in:
Ron Rennick 2019-11-18 11:17:48 -04:00 committed by GitHub
parent 634a4edc13
commit 241fad75cc
4 changed files with 15 additions and 9 deletions

View File

@ -160,7 +160,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
* Installs the requested plugin.
*
* @param WP_REST_Request $request Full details about the request.
* @return array Plugin Status
* @return WP_Error|array Plugin Status
*/
public function install_plugin( $request ) {
$allowed_plugins = Onboarding::get_allowed_plugins();
@ -234,7 +234,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
* Activate the requested plugin.
*
* @param WP_REST_Request $request Full details about the request.
* @return array Plugin Status
* @return WP_Error|array Plugin Status
*/
public function activate_plugins( $request ) {
$allowed_plugins = Onboarding::get_allowed_plugins();
@ -274,7 +274,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
* Generates a Jetpack Connect URL.
*
* @param WP_REST_Request $request Full details about the request.
* @return array Connection URL for Jetpack
* @return WP_Error|array Connection URL for Jetpack
*/
public function connect_jetpack( $request ) {
if ( ! class_exists( '\Jetpack' ) ) {
@ -298,7 +298,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
/**
* Kicks off the WCCOM Connect process.
*
* @return array Connection URL for WooCommerce.com
* @return WP_Error|array Connection URL for WooCommerce.com
*/
public function request_wccom_connect() {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-api.php';
@ -358,7 +358,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
* Finishes connecting to WooCommerce.com.
*
* @param object $rest_request Request details.
* @return array Contains success status.
* @return WP_Error|array Contains success status.
*/
public function finish_wccom_connect( $rest_request ) {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper.php';
@ -419,7 +419,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
/**
* Returns a URL that can be used to connect to PayPal.
*
* @return array Connect URL.
* @return WP_Error|array Connect URL.
*/
public function connect_paypal() {
if ( ! function_exists( 'wc_gateway_ppec' ) ) {
@ -450,7 +450,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
/**
* Returns a URL that can be used to connect to Square.
*
* @return array Connect URL.
* @return WP_Error|array Connect URL.
*/
public function connect_square() {
if ( ! class_exists( '\WooCommerce\Square\Handlers\Connection' ) ) {

View File

@ -394,6 +394,8 @@ class OnboardingTasks extends \WC_REST_Data_Controller {
/**
* Create a homepage from a template.
*
* @return WP_Error|array
*/
public static function create_homepage() {
$post_id = wp_insert_post(

View File

@ -261,7 +261,7 @@ class Onboarding {
}
/**
* Check if theme has declared support for WooCommerce
* Check if theme has declared support for WooCommerce.
*
* @param WP_Theme $theme Theme to check.
* @return bool
@ -470,6 +470,7 @@ class Onboarding {
/**
* Gets an array of plugins that can be installed & activated via the onboarding wizard.
*
* @return array
* @todo Handle edgecase of where installed plugins may have versioned folder names (i.e. `jetpack-master/jetpack.php`).
*/
public static function get_allowed_plugins() {

View File

@ -75,6 +75,7 @@ class OnboardingTasks {
* Add task items to component settings.
*
* @param array $settings Component settings.
* @return array
*/
public function component_settings( $settings ) {
$products = wp_count_posts( 'product' );
@ -130,6 +131,8 @@ class OnboardingTasks {
/**
* Check for active task completion, and clears the transient.
*
* @return bool
*/
public static function is_active_task_complete() {
$active_task = self::get_active_task();
@ -150,7 +153,7 @@ class OnboardingTasks {
* Check for task completion of a given task.
*
* @param string $task Name of task.
* @return bool;
* @return bool
*/
public static function check_task_completion( $task ) {
switch ( $task ) {