Method create
has 155 lines of code (exceeds 25 allowed). Consider refactoring.
function create($post_id, $post, $update, $recreated = false)
{
if (strpos(get_post_status($post_id), 'draft') !== false) {
Method update
has 120 lines of code (exceeds 25 allowed). Consider refactoring.
function update($post_id)
{
$product = wc_get_product($post_id);
Function create
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
function create($post_id, $post, $update, $recreated = false)
{
if (strpos(get_post_status($post_id), 'draft') !== false) {
File PlansController.php
has 349 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
namespace VindiPaymentGateways;
/**
The class PlansController has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
class PlansController
{
* @var array
*/
Function update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
function update($post_id)
{
$product = wc_get_product($post_id);
Avoid too many return
statements within this method.
return $response;
Avoid too many return
statements within this method.
return $response;
Avoid too many return
statements within this method.
return array(
'product' => $variations_products,
'plan' => $variations_plans,
);
The method update() has an NPath complexity of 84672. The configured NPath complexity threshold is 200.
function update($post_id)
{
$product = wc_get_product($post_id);
The method create() has an NPath complexity of 1291438080. The configured NPath complexity threshold is 200.
function create($post_id, $post, $update, $recreated = false)
{
if (strpos(get_post_status($post_id), 'draft') !== false) {
The method update() has 160 lines of code. Current threshold is set to 100. Avoid really long methods.
function update($post_id)
{
$product = wc_get_product($post_id);
The method create() has 204 lines of code. Current threshold is set to 100. Avoid really long methods.
function create($post_id, $post, $update, $recreated = false)
{
if (strpos(get_post_status($post_id), 'draft') !== false) {
The method create() has a Cyclomatic Complexity of 38. The configured cyclomatic complexity threshold is 10.
function create($post_id, $post, $update, $recreated = false)
{
if (strpos(get_post_status($post_id), 'draft') !== false) {
The method update() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
function update($post_id)
{
$product = wc_get_product($post_id);
The method create has a boolean flag argument $recreated, which is a certain sign of a Single Responsibility Principle violation.
function create($post_id, $post, $update, $recreated = false)
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
$trigger_day = VindiConversions::convertTriggerToDay(
$product->get_meta('_subscription_trial_length'),
$product->get_meta('_subscription_trial_period')
);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
$trigger_day = VindiConversions::convertTriggerToDay(
$product->get_meta('_subscription_trial_length'),
$product->get_meta('_subscription_trial_period')
);
The method update uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
set_transient('vindi_product_message', 'error', 60);
}
The method create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
set_transient('vindi_product_message', 'error', 60);
}
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
$trigger_day = VindiConversions::convertTriggerToDay(
$product->get_meta('_subscription_trial_length'),
$product->get_meta('_subscription_trial_period')
);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
$trigger_day = VindiConversions::convertTriggerToDay(
$product->get_meta('_subscription_trial_length'),
$product->get_meta('_subscription_trial_period')
);
Avoid unused parameters such as '$post'.
function create($post_id, $post, $update, $recreated = false)
Avoid unused private fields such as '$types'.
private $types;
Avoid unused parameters such as '$update'.
function create($post_id, $post, $update, $recreated = false)
Visibility must be declared on method "__construct"
function __construct(VindiSettings $vindi_settings)
Visibility must be declared on method "create"
function create($post_id, $post, $update, $recreated = false)
Blank line found at start of control structure
if ($product->get_type() == 'variable-subscription') {
Blank line found at start of control structure
if (empty($vindi_plan_id)) {
Visibility must be declared on method "update"
function update($post_id)
Blank line found at start of control structure
if ($product->get_type() == 'subscription') {
Blank line found at start of control structure
if ($product->get_type() == 'variable-subscription') {
Blank line found at start of control structure
if (empty($vindi_plan_id)) {
Visibility must be declared on method "trash"
function trash($post_id)
Visibility must be declared on method "untrash"
function untrash($post_id)
Line exceeds 120 characters; contains 132 characters
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line exceeds 120 characters; contains 134 characters
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line exceeds 120 characters; contains 128 characters
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line exceeds 120 characters; contains 130 characters
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line indented incorrectly; expected 4 spaces, found 2
function create($post_id, $post, $update, $recreated = false)
Line indented incorrectly; expected at least 16 spaces, found 8
$interval_type = $variation_product->get_meta('_subscription_period');
Multi-line function call not indented correctly; expected 22 spaces but found 20
);
Line indented incorrectly; expected at least 22 spaces, found 10
'interval' => $plan_interval['interval'],
Line indented incorrectly; expected at least 22 spaces, found 10
),
Line indented incorrectly; expected 8 spaces, found 4
if ($product->get_type() == 'variable-subscription') {
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 16 spaces, found 8
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Line indented incorrectly; expected at least 16 spaces, found 8
$trigger_day = VindiConversions::convertTriggerToDay(
Multi-line function call not indented correctly; expected 26 spaces but found 22
)
Line indented incorrectly; expected at least 22 spaces, found 10
'billing_trigger_day' => $trigger_day,
Line indented incorrectly; expected at least 22 spaces, found 10
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line indented incorrectly; expected 4 spaces, found 2
private $routes;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 16 spaces, found 10
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 22 spaces, found 14
'product_id' => $createdProduct['id']
Line indented incorrectly; expected 4 spaces, found 2
function __construct(VindiSettings $vindi_settings)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
$product = wc_get_product($post_id);
Line indented incorrectly; expected at least 22 spaces, found 8
$vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);
Line indented incorrectly; expected at least 22 spaces, found 20
);
Line indented incorrectly; expected 12 spaces, found 6
foreach ($variations as $variation) {
Line indented incorrectly; expected at least 16 spaces, found 8
$variation_product = wc_get_product($variation['variation_id']);
Multi-line function call not indented correctly; expected 12 spaces but found 10
$product->get_meta('_subscription_trial_period')
Multi-line function call not indented correctly; expected 26 spaces but found 22
array(
Line indented incorrectly; expected at least 22 spaces, found 10
'name' => VINDI_PREFIX_PLAN . $data['name'],
Line indented incorrectly; expected at least 22 spaces, found 14
'cycles' => $product->get_meta('_subscription_length'),
Line indented incorrectly; expected at least 22 spaces, found 10
'plan_items' => array(
Line indented incorrectly; expected at least 22 spaces, found 14
'product_id' => $createdProduct['id']
Line indented incorrectly; expected at least 8 spaces, found 4
add_action('wp_insert_post', array($this, 'create'), 10, 3);
Line indented incorrectly; expected at least 12 spaces, found 10
return;
Line indented incorrectly; expected at least 22 spaces, found 8
$createdPlan = $this->routes->createPlan(array(
Line indented incorrectly; expected at least 22 spaces, found 10
'interval_count' => $plan_interval['interval_count'],
Line indented incorrectly; expected at least 22 spaces, found 10
'code' => 'WC-' . $data['id'],
Line indented incorrectly; expected at least 22 spaces, found 12
($product->get_meta('_subscription_length') == 0) ? array(
Line indented incorrectly; expected at least 8 spaces, found 4
$this->logger = $vindi_settings->logger;
Line indented incorrectly; expected at least 8 spaces, found 4
add_action('wp_trash_post', array($this, 'trash'), 10, 1);
Line indented incorrectly; expected 8 spaces, found 4
if (get_post_type($post_id) != 'product') {
Multi-line function call not indented correctly; expected 12 spaces but found 10
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 22 spaces, found 8
);
Line indented incorrectly; expected at least 22 spaces, found 12
) : array(
Line indented incorrectly; expected at least 8 spaces, found 4
$this->routes = $vindi_settings->routes;
Line indented incorrectly; expected at least 22 spaces, found 10
$this->routes->findProductById($vindi_product_id) :
Multi-line function call not indented correctly; expected 26 spaces but found 24
)
Line indented incorrectly; expected at least 22 spaces, found 8
));
Line indented incorrectly; expected 4 spaces, found 2
private $types;
Line indented incorrectly; expected 8 spaces, found 4
if (strpos(get_post_status($post_id), 'draft') !== false) {
Line indented incorrectly; expected at least 12 spaces, found 6
$variations = $product->get_available_variations();
Line indented incorrectly; expected at least 12 spaces, found 6
$variations_products = $variations_plans = [];
Line indented incorrectly; expected at least 22 spaces, found 10
'billing_trigger_type' => 'beginning_of_period',
Line indented incorrectly; expected at least 8 spaces, found 4
$data = $product->get_data();
Multi-line function call not indented correctly; expected 8 spaces but found 6
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected at least 10 spaces, found 6
'code' => 'WC-' . $data['id'],
Line indented incorrectly; expected at least 10 spaces, found 8
) : array(
Line indented incorrectly; expected at least 12 spaces, found 4
$response = array(
Line indented incorrectly; expected at least 16 spaces, found 8
$trigger_day = VindiConversions::convertTriggerToDay(
Multi-line function call not indented correctly; expected 12 spaces but found 10
array(
Line indented incorrectly; expected at least 22 spaces, found 12
'name' => VINDI_PREFIX_PRODUCT . $data['name'],
Line indented incorrectly; expected at least 22 spaces, found 10
)
Line indented incorrectly; expected at least 12 spaces, found 8
'plan' => $variations_plans,
Line indented incorrectly; expected at least 8 spaces, found 4
$interval_type = $product->get_meta('_subscription_period');
Line indented incorrectly; expected at least 22 spaces, found 10
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
$interval_type = $product->get_meta('_subscription_period');
Line indented incorrectly; expected at least 8 spaces, found 4
$product = wc_get_product($post_id);
Line indented incorrectly; expected 8 spaces, found 4
if ($product->get_type() == 'variable-subscription') {
Line indented incorrectly; expected 16 spaces, found 8
}
Line indented incorrectly; expected at least 22 spaces, found 8
);
Multi-line function call not indented correctly; expected 8 spaces but found 6
$product->get_meta('_subscription_trial_period')
Multi-line function call not indented correctly; expected 8 spaces but found 6
array(
Line indented incorrectly; expected at least 8 spaces, found 4
add_action('untrash_post', array($this, 'untrash'), 10, 1);
Line indented incorrectly; expected at least 16 spaces, found 8
$interval_count = $variation_product->get_meta('_subscription_period_interval');
Line indented incorrectly; expected at least 16 spaces, found 10
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected at least 22 spaces, found 12
)
Line indented incorrectly; expected at least 22 spaces, found 8
$variations_plans[$variation['variation_id']] = $createdPlan;
Line indented incorrectly; expected at least 16 spaces, found 6
set_transient('vindi_product_message', 'created', 60);
Line indented incorrectly; expected at least 12 spaces, found 6
'product' => $createdProduct,
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 16 spaces, found 8
$interval_type = $variation_product->get_meta('_subscription_period');
Line indented incorrectly; expected at least 22 spaces, found 14
'price' => ($data['price']) ? $data['price'] : 0,
Multi-line function call not indented correctly; expected 8 spaces but found 6
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 10 spaces, found 6
$vindi_product_id,
Line indented incorrectly; expected at least 10 spaces, found 8
'code' => 'WC-' . $data['id'],
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 16 spaces, found 8
$data = $variation_product->get_data();
Line indented incorrectly; expected at least 22 spaces, found 8
$createdProduct = !empty($vindi_product_id) ?
Line indented incorrectly; expected at least 12 spaces, found 8
'plan' => $variations_plans,
Line indented incorrectly; expected at least 16 spaces, found 6
);
Line indented incorrectly; expected at least 10 spaces, found 6
'billing_trigger_type' => 'beginning_of_period',
Line indented incorrectly; expected at least 10 spaces, found 6
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line indented incorrectly; expected 4 spaces, found 2
function update($post_id)
Line indented incorrectly; expected at least 16 spaces, found 8
$vindi_product_id = get_post_meta($variation['variation_id'], 'vindi_product_id', true);
Line indented incorrectly; expected at least 16 spaces, found 8
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Line indented incorrectly; expected at least 12 spaces, found 6
$this->routes->findProductById($vindi_product_id) :
Multi-line function call not indented correctly; expected 16 spaces but found 14
array(
Line indented incorrectly; expected 12 spaces, found 10
}
Line indented incorrectly; expected at least 22 spaces, found 10
$vindi_product_id,
Line indented incorrectly; expected at least 22 spaces, found 12
'code' => 'WC-' . $data['id'],
Line indented incorrectly; expected at least 22 spaces, found 12
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Multi-line function call not indented correctly; expected 12 spaces but found 10
)
Line indented incorrectly; expected 24 spaces, found 22
}
Line indented incorrectly; expected at least 12 spaces, found 6
return array(
Line indented incorrectly; expected at least 12 spaces, found 8
'product' => $variations_products,
Line indented incorrectly; expected at least 8 spaces, found 4
$trigger_day = VindiConversions::convertTriggerToDay(
Line indented incorrectly; expected at least 10 spaces, found 6
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Line indented incorrectly; expected at least 14 spaces, found 12
update_post_meta($post_id, 'vindi_product_id', $createdProduct['id']);
Line indented incorrectly; expected 12 spaces, found 6
foreach ($variations as $variation) {
Line indented incorrectly; expected 16 spaces, found 8
if (empty($vindi_plan_id)) {
Line indented incorrectly; expected at least 22 spaces, found 12
)
Line indented incorrectly; expected at least 22 spaces, found 12
'interval' => $plan_interval['interval'],
Line indented incorrectly; expected at least 8 spaces, found 4
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Line indented incorrectly; expected at least 10 spaces, found 4
$vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);
Multi-line function call not indented correctly; expected 8 spaces but found 6
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 10 spaces, found 8
'name' => VINDI_PREFIX_PRODUCT . $data['name'],
Line indented incorrectly; expected at least 12 spaces, found 4
$vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);
Line indented incorrectly; expected at least 10 spaces, found 6
'billing_trigger_day' => $trigger_day,
Line indented incorrectly; expected at least 10 spaces, found 8
)
Line indented incorrectly; expected 12 spaces, found 4
} else {
Line indented incorrectly; expected 12 spaces, found 4
}
Line indented incorrectly; expected at least 12 spaces, found 6
'plan' => $createdPlan,
Line indented incorrectly; expected at least 10 spaces, found 4
return $response;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 8 spaces, found 4
if ($product->get_type() == 'subscription') {
Line indented incorrectly; expected at least 22 spaces, found 8
);
Line indented incorrectly; expected at least 22 spaces, found 8
$variations_products[$variation['variation_id']] = $createdProduct;
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected at least 10 spaces, found 6
'name' => VINDI_PREFIX_PLAN . $data['name'],
Line indented incorrectly; expected at least 22 spaces, found 10
array(
Line indented incorrectly; expected at least 22 spaces, found 10
array(
Line indented incorrectly; expected at least 12 spaces, found 6
return array(
Line indented incorrectly; expected at least 8 spaces, found 6
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected 12 spaces, found 10
}
Line indented incorrectly; expected at least 10 spaces, found 4
$createdPlan = $this->routes->createPlan(array(
Line indented incorrectly; expected at least 10 spaces, found 6
'interval' => $plan_interval['interval'],
Line indented incorrectly; expected at least 10 spaces, found 6
'plan_items' => array(
Line indented incorrectly; expected 12 spaces, found 4
if ($createdPlan && $createdProduct) {
Line indented incorrectly; expected 12 spaces, found 6
if (empty($vindi_plan_id)) {
Line indented incorrectly; expected at least 20 spaces, found 10
break;
Line indented incorrectly; expected at least 16 spaces, found 10
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 22 spaces, found 8
$variations_products[$variation['variation_id']] = $updatedProduct;
Line indented incorrectly; expected at least 12 spaces, found 8
'product' => $variations_products,
Line indented incorrectly; expected at least 16 spaces, found 6
);
Line indented incorrectly; expected at least 10 spaces, found 6
array(
Line indented incorrectly; expected at least 10 spaces, found 4
));
Line indented incorrectly; expected at least 16 spaces, found 6
set_transient('vindi_product_message', 'error', 60);
Line indented incorrectly; expected at least 12 spaces, found 6
$variations_products = $variations_plans = [];
Multi-line function call not indented correctly; expected 12 spaces but found 10
$vindi_product_id,
Line indented incorrectly; expected at least 22 spaces, found 12
'invoice' => 'always',
Line indented incorrectly; expected at least 22 spaces, found 10
$vindi_plan_id,
Line indented incorrectly; expected at least 22 spaces, found 12
'billing_trigger_type' => 'beginning_of_period',
Line indented incorrectly; expected at least 22 spaces, found 12
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Line indented incorrectly; expected 8 spaces, found 4
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
$vindi_product_id,
Line indented incorrectly; expected at least 16 spaces, found 14
update_post_meta($post_id, 'vindi_plan_id', $createdPlan['id']);
Line indented incorrectly; expected at least 12 spaces, found 10
return;
Line indented incorrectly; expected at least 16 spaces, found 8
return $this->create($post_id, '', '', true);
Line indented incorrectly; expected at least 16 spaces, found 8
$data = $variation_product->get_data();
Line indented incorrectly; expected at least 16 spaces, found 8
$interval_count = $variation_product->get_meta('_subscription_period_interval');
Line indented incorrectly; expected at least 22 spaces, found 8
$updatedProduct = $this->routes->updateProduct(
Line indented incorrectly; expected at least 22 spaces, found 12
'code' => 'WC-' . $data['id'],
Line indented incorrectly; expected 12 spaces, found 6
}
Line indented incorrectly; expected at least 8 spaces, found 4
$data = $product->get_data();
Line indented incorrectly; expected at least 8 spaces, found 4
$trigger_day = VindiConversions::convertTriggerToDay(
Line indented incorrectly; expected at least 8 spaces, found 4
$interval_count = $product->get_meta('_subscription_period_interval');
Multi-line function call not indented correctly; expected 16 spaces but found 14
)
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 16 spaces, found 8
$vindi_plan_id = get_post_meta($variation['variation_id'], 'vindi_plan_id', true);
Multi-line function call not indented correctly; expected 12 spaces but found 10
$product->get_meta('_subscription_trial_length'),
Multi-line function call not indented correctly; expected 12 spaces but found 10
$vindi_plan_id,
Line indented incorrectly; expected at least 10 spaces, found 4
$updatedProduct = $this->routes->updateProduct(
Line indented incorrectly; expected at least 8 spaces, found 6
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 12 spaces, found 4
$createdProduct = !empty($vindi_product_id) ?
Line indented incorrectly; expected at least 10 spaces, found 6
),
Line indented incorrectly; expected 12 spaces, found 6
}
Multi-line function call not indented correctly; expected 12 spaces but found 10
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected at least 22 spaces, found 12
'interval_count' => $plan_interval['interval_count'],
Line indented incorrectly; expected at least 22 spaces, found 12
'billing_trigger_day' => $trigger_day,
Line indented incorrectly; expected at least 8 spaces, found 6
$product->get_meta('_subscription_trial_length'),
Line indented incorrectly; expected at least 8 spaces, found 4
$plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
Line indented incorrectly; expected at least 10 spaces, found 8
($product->get_meta('_subscription_length') == 0) ? array(
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected at least 12 spaces, found 6
$vindi_plan_id = get_post_meta($post_id, 'vindi_plan_id', true);
Line indented incorrectly; expected at least 22 spaces, found 14
'schema_type' => 'flat',
Line indented incorrectly; expected at least 22 spaces, found 8
$updatedPlan = $this->routes->updatePlan(
Line indented incorrectly; expected at least 22 spaces, found 12
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line indented incorrectly; expected at least 8 spaces, found 6
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected at least 12 spaces, found 6
$variations = $product->get_available_variations();
Line indented incorrectly; expected at least 16 spaces, found 8
$variation_product = wc_get_product($variation['variation_id']);
Multi-line function call not indented correctly; expected 12 spaces but found 10
)
Line indented incorrectly; expected 12 spaces, found 6
}
Line indented incorrectly; expected at least 10 spaces, found 6
'interval_count' => $plan_interval['interval_count'],
Line indented incorrectly; expected at least 20 spaces, found 10
return $this->create($post_id, '', '', true);
Line indented incorrectly; expected at least 16 spaces, found 10
$product->get_meta('_subscription_trial_period')
Line indented incorrectly; expected at least 22 spaces, found 12
'pricing_schema' => array(
Line indented incorrectly; expected at least 22 spaces, found 8
);
Multi-line function call not indented correctly; expected 12 spaces but found 10
array(
Line indented incorrectly; expected at least 22 spaces, found 12
'name' => VINDI_PREFIX_PLAN . $data['name'],
Line indented incorrectly; expected at least 22 spaces, found 10
)
Line indented incorrectly; expected at least 22 spaces, found 8
$variations_plans[$variation['variation_id']] = $updatedPlan;
Line indented incorrectly; expected at least 8 spaces, found 4
$interval_count = $product->get_meta('_subscription_period_interval');
Line indented incorrectly; expected at least 12 spaces, found 8
'name' => VINDI_PREFIX_PLAN . $data['name'],
Line indented incorrectly; expected at least 14 spaces, found 6
set_transient('vindi_product_message', 'updated', 60);
Line indented incorrectly; expected at least 16 spaces, found 6
set_transient('vindi_product_message', 'error', 60);
Line indented incorrectly; expected at least 12 spaces, found 6
'plan' => $updatedPlan,
Line indented incorrectly; expected at least 8 spaces, found 4
$vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);
Line indented incorrectly; expected at least 8 spaces, found 4
$inactivatedProduct = $this->routes->updateProduct($vindi_product_id, array(
Line indented incorrectly; expected at least 8 spaces, found 6
'status' => 'inactive',
Line indented incorrectly; expected 8 spaces, found 4
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
)
Line indented incorrectly; expected at least 12 spaces, found 8
'billing_trigger_day' => $trigger_day,
Multi-line function call not indented correctly; expected 8 spaces but found 6
)
Line indented incorrectly; expected at least 12 spaces, found 6
'product' => $updatedProduct,
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
));
Line indented incorrectly; expected at least 12 spaces, found 8
'interval' => $plan_interval['interval'],
Line indented incorrectly; expected at least 10 spaces, found 4
));
Line indented incorrectly; expected at least 10 spaces, found 6
'plan' => $inactivatedPlan,
Line indented incorrectly; expected at least 10 spaces, found 6
'product' => $activatedProduct,
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 10 spaces, found 6
)
Line indented incorrectly; expected at least 10 spaces, found 4
$vindi_plan_id = get_post_meta($post_id, 'vindi_plan_id', true);
Line indented incorrectly; expected 4 spaces, found 2
function trash($post_id)
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
));
Line indented incorrectly; expected at least 10 spaces, found 6
'plan' => $activatedPlan,
Line indented incorrectly; expected 10 spaces, found 4
if ($updatedPlan && $updatedProduct) {
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
$product = wc_get_product($post_id);
Line indented incorrectly; expected at least 8 spaces, found 4
$activatedProduct = $this->routes->updateProduct($vindi_product_id, array(
Line indented incorrectly; expected at least 10 spaces, found 4
));
Line indented incorrectly; expected at least 10 spaces, found 8
'pricing_schema' => array(
Line indented incorrectly; expected at least 10 spaces, found 6
'status' => 'inactive',
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 12 spaces, found 8
'interval_count' => $plan_interval['interval_count'],
Line indented incorrectly; expected 12 spaces, found 4
} else {
Line indented incorrectly; expected at least 12 spaces, found 4
$response = array(
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected at least 10 spaces, found 8
'invoice' => 'always',
Line indented incorrectly; expected at least 10 spaces, found 6
'status' => 'active',
Line indented incorrectly; expected at least 12 spaces, found 6
$vindi_plan_id,
Line indented incorrectly; expected at least 10 spaces, found 4
return $response;
Multi-line function call not indented correctly; expected 8 spaces but found 6
array(
Line indented incorrectly; expected at least 12 spaces, found 8
'billing_trigger_type' => 'beginning_of_period',
Line indented incorrectly; expected at least 8 spaces, found 4
$vindi_plan_id = get_post_meta($product->id, 'vindi_plan_id', true);
Line indented incorrectly; expected at least 8 spaces, found 4
$vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);
Line indented incorrectly; expected at least 10 spaces, found 4
$activatedPlan = $this->routes->updatePlan($vindi_plan_id, array(
Line indented incorrectly; expected 12 spaces, found 10
}
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 10 spaces, found 4
return array(
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected 8 spaces, found 4
if (empty($vindi_product_id) || empty($vindi_plan_id)) {
Line indented incorrectly; expected at least 10 spaces, found 6
'product' => $inactivatedProduct,
Line indented incorrectly; expected at least 10 spaces, found 8
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Line indented incorrectly; expected at least 12 spaces, found 4
$updatedPlan = $this->routes->updatePlan(
Line indented incorrectly; expected at least 12 spaces, found 6
array(
Line indented incorrectly; expected at least 12 spaces, found 8
'code' => 'WC-' . $data['id'],
Multi-line function call not indented correctly; expected 8 spaces but found 6
$vindi_plan_id,
Line indented incorrectly; expected at least 12 spaces, found 8
'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),
Line indented incorrectly; expected at least 12 spaces, found 8
'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',
Line indented incorrectly; expected 8 spaces, found 4
if (get_post_type($post_id) != 'product') {
Line indented incorrectly; expected at least 8 spaces, found 4
$product = wc_get_product($post_id);
Line indented incorrectly; expected 4 spaces, found 2
function untrash($post_id)
Line indented incorrectly; expected 8 spaces, found 4
if (get_post_type($post_id) != 'product') {
Line indented incorrectly; expected 8 spaces, found 4
if (empty($vindi_product_id) || empty($vindi_plan_id)) {
Line indented incorrectly; expected at least 10 spaces, found 8
)
Line indented incorrectly; expected at least 12 spaces, found 6
)
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected at least 10 spaces, found 4
return array(
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 8 spaces, found 4
$vindi_plan_id = get_post_meta($product->id, 'vindi_plan_id', true);
Line indented incorrectly; expected at least 10 spaces, found 4
);
Line indented incorrectly; expected 12 spaces, found 4
}
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 10 spaces, found 4
$inactivatedPlan = $this->routes->updatePlan($vindi_plan_id, array(
Line indented incorrectly; expected at least 12 spaces, found 6
return;
Line indented incorrectly; expected at least 8 spaces, found 6
'status' => 'active',
There are no issues that match your filters.