vindi/vindi-woocommerce

View on GitHub
src/controllers/PlansController.php

Summary

Maintainability
D
3 days
Test Coverage

Method create has 155 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function create($post_id, $post, $update, $recreated = false)
  {

    // Check if the post is a draft
    if (strpos(get_post_status($post_id), 'draft') !== false) {
Severity: Major
Found in src/controllers/PlansController.php - About 6 hrs to fix

    Method update has 120 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function update($post_id)
      {
        $product = wc_get_product($post_id);
    
        // Check if the post is of the signature type
    Severity: Major
    Found in src/controllers/PlansController.php - About 4 hrs to fix

      Function create has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

        function create($post_id, $post, $update, $recreated = false)
        {
      
          // Check if the post is a draft
          if (strpos(get_post_status($post_id), 'draft') !== false) {
      Severity: Minor
      Found in src/controllers/PlansController.php - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File PlansController.php has 349 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace VindiPaymentGateways;
      
      /**
      Severity: Minor
      Found in src/controllers/PlansController.php - About 4 hrs to fix

        The class PlansController has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
        Open

        class PlansController
        {
          /**
           * @var array
           */
        Severity: Minor
        Found in src/controllers/PlansController.php by phpmd

        Function update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

          function update($post_id)
          {
            $product = wc_get_product($post_id);
        
            // Check if the post is of the signature type
        Severity: Minor
        Found in src/controllers/PlansController.php - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Avoid too many return statements within this method.
        Open

            return $response;
        Severity: Major
        Found in src/controllers/PlansController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return array(
                  'product' => $variations_products,
                  'plan' => $variations_plans,
                );
          Severity: Major
          Found in src/controllers/PlansController.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return $response;
            Severity: Major
            Found in src/controllers/PlansController.php - About 30 mins to fix

              The method create() has an NPath complexity of 1291438080. The configured NPath complexity threshold is 200.
              Open

                function create($post_id, $post, $update, $recreated = false)
                {
              
                  // Check if the post is a draft
                  if (strpos(get_post_status($post_id), 'draft') !== false) {
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              NPathComplexity

              Since: 0.1

              The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

              Example

              class Foo {
                  function bar() {
                      // lots of complicated code
                  }
              }

              Source https://phpmd.org/rules/codesize.html#npathcomplexity

              The method update() has 160 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

                function update($post_id)
                {
                  $product = wc_get_product($post_id);
              
                  // Check if the post is of the signature type
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              The method create() has 204 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

                function create($post_id, $post, $update, $recreated = false)
                {
              
                  // Check if the post is a draft
                  if (strpos(get_post_status($post_id), 'draft') !== false) {
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              The method update() has an NPath complexity of 84672. The configured NPath complexity threshold is 200.
              Open

                function update($post_id)
                {
                  $product = wc_get_product($post_id);
              
                  // Check if the post is of the signature type
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              NPathComplexity

              Since: 0.1

              The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

              Example

              class Foo {
                  function bar() {
                      // lots of complicated code
                  }
              }

              Source https://phpmd.org/rules/codesize.html#npathcomplexity

              The method create() has a Cyclomatic Complexity of 38. The configured cyclomatic complexity threshold is 10.
              Open

                function create($post_id, $post, $update, $recreated = false)
                {
              
                  // Check if the post is a draft
                  if (strpos(get_post_status($post_id), 'draft') !== false) {
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              The method update() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
              Open

                function update($post_id)
                {
                  $product = wc_get_product($post_id);
              
                  // Check if the post is of the signature type
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              The method create has a boolean flag argument $recreated, which is a certain sign of a Single Responsibility Principle violation.
              Open

                function create($post_id, $post, $update, $recreated = false)
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
              Open

                      $trigger_day = VindiConversions::convertTriggerToDay(
                        $product->get_meta('_subscription_trial_length'),
                        $product->get_meta('_subscription_trial_period')
                      );
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
              Open

                      $trigger_day = VindiConversions::convertTriggerToDay(
                        $product->get_meta('_subscription_trial_length'),
                        $product->get_meta('_subscription_trial_period')
                      );
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
              Open

                  $plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                  } else {
                    set_transient('vindi_product_message', 'error', 60);
                  }
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method update uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                  } else {
                    set_transient('vindi_product_message', 'error', 60);
                  }
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
              Open

                      $plan_interval     = VindiConversions::convert_interval($interval_count, $interval_type);
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
              Open

                  $trigger_day = VindiConversions::convertTriggerToDay(
                    $product->get_meta('_subscription_trial_length'),
                    $product->get_meta('_subscription_trial_period')
                  );
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
              Open

                  $trigger_day = VindiConversions::convertTriggerToDay(
                    $product->get_meta('_subscription_trial_length'),
                    $product->get_meta('_subscription_trial_period')
                  );
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'create'.
              Open

                      $plan_interval     = VindiConversions::convert_interval($interval_count, $interval_type);
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'VindiPaymentGateways\VindiConversions' in method 'update'.
              Open

                  $plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid unused private fields such as '$types'.
              Open

                private $types;
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

              Avoid unused parameters such as '$post'.
              Open

                function create($post_id, $post, $update, $recreated = false)
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$update'.
              Open

                function create($post_id, $post, $update, $recreated = false)
              Severity: Minor
              Found in src/controllers/PlansController.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Visibility must be declared on method "__construct"
              Open

                function __construct(VindiSettings $vindi_settings)

              Visibility must be declared on method "create"
              Open

                function create($post_id, $post, $update, $recreated = false)

              Blank line found at start of control structure
              Open

                  if ($product->get_type() == 'variable-subscription') {

              Visibility must be declared on method "update"
              Open

                function update($post_id)

              Blank line found at start of control structure
              Open

                  if ($product->get_type() == 'variable-subscription') {

              Blank line found at start of control structure
              Open

                    if (empty($vindi_plan_id)) {

              Blank line found at start of control structure
              Open

                  if ($product->get_type() == 'subscription') {

              Blank line found at start of control structure
              Open

                      if (empty($vindi_plan_id)) {

              Visibility must be declared on method "untrash"
              Open

                function untrash($post_id)

              Visibility must be declared on method "trash"
              Open

                function trash($post_id)

              Line exceeds 120 characters; contains 128 characters
              Open

                    'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line exceeds 120 characters; contains 132 characters
              Open

                        'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line exceeds 120 characters; contains 134 characters
              Open

                          'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line exceeds 120 characters; contains 130 characters
              Open

                      'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 4 spaces, found 2
              Open

                {

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $this->routes = $vindi_settings->routes;

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $data = $variation_product->get_data();

              Line indented incorrectly; expected at least 16 spaces, found 10
              Open

                        $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $product = wc_get_product($post_id);

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $variations_products = $variations_plans = [];

              Multi-line function call not indented correctly; expected 26 spaces but found 22
              Open

                                    array(

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $plan_interval     = VindiConversions::convert_interval($interval_count, $interval_type);

              Line indented incorrectly; expected at least 22 spaces, found 20
              Open

                                  );

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                }

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $product->get_meta('_subscription_trial_period')

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $this->logger = $vindi_settings->logger;

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if ($product->get_type() == 'variable-subscription') {

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $interval_count    = $variation_product->get_meta('_subscription_period_interval');

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'name' => VINDI_PREFIX_PLAN . $data['name'],

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                function create($post_id, $post, $update, $recreated = false)

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $variations = $product->get_available_variations();

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                private $types;

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        $this->routes->findProductById($vindi_product_id) :

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  add_action('wp_insert_post', array($this, 'create'), 10, 3);

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (strpos(get_post_status($post_id), 'draft') !== false) {

              Multi-line function call not indented correctly; expected 26 spaces but found 24
              Open

                                      )

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);

              Multi-line function call not indented correctly; expected 26 spaces but found 22
              Open

                                    )

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $createdPlan = $this->routes->createPlan(array(

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                function __construct(VindiSettings $vindi_settings)

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    foreach ($variations as $variation) {

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $interval_type     = $variation_product->get_meta('_subscription_period');

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                private $routes;

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      );

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  add_action('wp_trash_post', array($this, 'trash'), 10, 1);

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  add_action('untrash_post', array($this, 'untrash'), 10, 1);

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (get_post_type($post_id) != 'product') {

              Line indented incorrectly; expected at least 12 spaces, found 10
              Open

                        return;

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $variation_product = wc_get_product($variation['variation_id']);

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $trigger_day = VindiConversions::convertTriggerToDay(

              Line indented incorrectly; expected at least 16 spaces, found 10
              Open

                        $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $createdProduct = !empty($vindi_product_id) ?

              Line indented incorrectly; expected at least 4 spaces, found 2
              Open

                {

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Multi-line function call not indented correctly; expected 22 spaces but found 20
              Open

                                  );

              Line indented incorrectly; expected at least 22 spaces, found 14
              Open

                            'product_id' => $createdProduct['id']

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      ($product->get_meta('_subscription_length') == 0) ? array(

              Line indented incorrectly; expected at least 14 spaces, found 12
              Open

                          update_post_meta($post_id, 'vindi_product_id', $createdProduct['id']);

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $vindi_plan_id = get_post_meta($variation['variation_id'], 'vindi_plan_id', true);

              Line indented incorrectly; expected at least 16 spaces, found 10
              Open

                        $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        $vindi_product_id,

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          )

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'interval_count' => $plan_interval['interval_count'],

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'billing_trigger_type' => 'beginning_of_period',

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'plan' => $variations_plans,

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $data = $product->get_data();

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    }

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $interval_type = $product->get_meta('_subscription_period');

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'name' => VINDI_PREFIX_PLAN . $data['name'],

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'plan_items' => array(

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    'product' => $createdProduct,

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $trigger_day = VindiConversions::convertTriggerToDay(

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        array(

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'invoice' => 'always',

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        )

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      );

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $updatedPlan = $this->routes->updatePlan(

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        array(

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'code' => 'WC-' . $data['id'],

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      );

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'billing_trigger_type' => 'beginning_of_period',

              Line indented incorrectly; expected 12 spaces, found 4
              Open

                  } else {

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $data = $variation_product->get_data();

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $this->routes->findProductById($vindi_product_id) :

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      )

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    }

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'plan' => $variations_plans,

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'interval_count' => $plan_interval['interval_count'],

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 4 spaces, found 2
              Open

                {

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $product = wc_get_product($post_id);

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'plan_items' => array(

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $interval_count = $product->get_meta('_subscription_period_interval');

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if ($product->get_type() == 'variable-subscription') {

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $plan_interval     = VindiConversions::convert_interval($interval_count, $interval_type);

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'code' => 'WC-' . $data['id'],

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $vindi_plan_id,

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'billing_trigger_day' => $trigger_day,

              Line indented incorrectly; expected at least 16 spaces, found 14
              Open

                            update_post_meta($post_id, 'vindi_plan_id', $createdPlan['id']);

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        )

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  return $response;

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        )

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $vindi_plan_id = get_post_meta($post_id, 'vindi_plan_id', true);

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return array(

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    }

              Line indented incorrectly; expected at least 20 spaces, found 10
              Open

                        return $this->create($post_id, '', '', true);

              Line indented incorrectly; expected at least 16 spaces, found 6
              Open

                    );

              Line indented incorrectly; expected at least 20 spaces, found 10
              Open

                        break;

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $vindi_product_id,

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        $vindi_plan_id,

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'interval' => $plan_interval['interval'],

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'billing_trigger_type' => 'beginning_of_period',

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'code' => 'WC-' . $data['id'],

              Line indented incorrectly; expected at least 16 spaces, found 6
              Open

                    set_transient('vindi_product_message', 'error', 60);

              Line indented incorrectly; expected 12 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                }

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'code' => 'WC-' . $data['id'],

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        array(

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'billing_trigger_day' => $trigger_day,

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        ),

              Line indented incorrectly; expected 24 spaces, found 22
              Open

                                    }

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $createdPlan = $this->routes->createPlan(array(

              Line indented incorrectly; expected 12 spaces, found 4
              Open

                  if ($createdPlan && $createdProduct) {

              Line indented incorrectly; expected at least 12 spaces, found 4
              Open

                  $response = array(

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    foreach ($variations as $variation) {

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 22 spaces, found 14
              Open

                            'schema_type' => 'flat',

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'interval' => $plan_interval['interval'],

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  ));

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    'plan' => $createdPlan,

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      ));

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $interval_count    = $variation_product->get_meta('_subscription_period_interval');

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return array(

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      );

              Multi-line function call not indented correctly; expected 16 spaces but found 14
              Open

                            )

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        )

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'interval_count' => $plan_interval['interval_count'],

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'name' => VINDI_PREFIX_PLAN . $data['name'],

              Line indented incorrectly; expected 12 spaces, found 10
              Open

                        }

              Line indented incorrectly; expected at least 16 spaces, found 6
              Open

                    set_transient('vindi_product_message', 'created', 60);

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $variations_products[$variation['variation_id']] = $updatedProduct;

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          ) : array(

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $variations_plans[$variation['variation_id']] = $createdPlan;

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 12 spaces, found 4
              Open

                  $vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);

              Line indented incorrectly; expected at least 12 spaces, found 4
              Open

                  $createdProduct = !empty($vindi_product_id) ?

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    ),

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                function update($post_id)

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      return $this->create($post_id, '', '', true);

              Line indented incorrectly; expected 16 spaces, found 8
              Open

                      }

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $interval_type     = $variation_product->get_meta('_subscription_period');

              Multi-line function call not indented correctly; expected 12 spaces but found 10
              Open

                        $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        array(

              Line indented incorrectly; expected at least 22 spaces, found 10
              Open

                        'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 22 spaces, found 14
              Open

                            'product_id' => $createdProduct['id']

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $variations_products[$variation['variation_id']] = $createdProduct;

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $trigger_day = VindiConversions::convertTriggerToDay(

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected 12 spaces, found 6
              Open

                    if (empty($vindi_plan_id)) {

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $variations = $product->get_available_variations();

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $variation_product = wc_get_product($variation['variation_id']);

              Line indented incorrectly; expected at least 16 spaces, found 10
              Open

                        $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'pricing_schema' => array(

              Line indented incorrectly; expected at least 16 spaces, found 6
              Open

                    );

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected 12 spaces, found 10
              Open

                        }

              Multi-line function call not indented correctly; expected 16 spaces but found 14
              Open

                            array(

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $updatedProduct = $this->routes->updateProduct(

              Line indented incorrectly; expected at least 22 spaces, found 8
              Open

                      $variations_plans[$variation['variation_id']] = $updatedPlan;

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'product' => $variations_products,

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if ($product->get_type() == 'subscription') {

              Line indented incorrectly; expected at least 22 spaces, found 14
              Open

                            'cycles' => $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          )

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $variations_products = $variations_plans = [];

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'billing_trigger_day' => $trigger_day,

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      ) : array(

              Line indented incorrectly; expected at least 16 spaces, found 8
              Open

                      $vindi_product_id = get_post_meta($variation['variation_id'], 'vindi_product_id', true);

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'name' => VINDI_PREFIX_PRODUCT . $data['name'],

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'interval' => $plan_interval['interval'],

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'product' => $variations_products,

              Line indented incorrectly; expected at least 22 spaces, found 12
              Open

                          ($product->get_meta('_subscription_length') == 0) ? array(

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $data = $product->get_data();

              Line indented incorrectly; expected at least 12 spaces, found 10
              Open

                        return;

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected 16 spaces, found 8
              Open

                      if (empty($vindi_plan_id)) {

              Line indented incorrectly; expected at least 22 spaces, found 14
              Open

                            'price' => ($data['price']) ? $data['price'] : 0,

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    $product->get_meta('_subscription_trial_period')

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    array(

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      'invoice' => 'always',

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    )

              Line indented incorrectly; expected 10 spaces, found 4
              Open

                  if ($updatedPlan && $updatedProduct) {

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    'product' => $updatedProduct,

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  return $response;

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    'status' => 'inactive',

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    $vindi_plan_id,

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $interval_count = $product->get_meta('_subscription_period_interval');

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      'code' => 'WC-' . $data['id'],

              Line indented incorrectly; expected 12 spaces, found 10
              Open

                        }

              Line indented incorrectly; expected at least 12 spaces, found 4
              Open

                  $response = array(

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $vindi_plan_id = get_post_meta($product->id, 'vindi_plan_id', true);

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  ));

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    $product->get_meta('_subscription_trial_length'),

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $product->get_meta('_subscription_trial_period')

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    array(

              Line indented incorrectly; expected 12 spaces, found 4
              Open

                  } else {

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $inactivatedProduct = $this->routes->updateProduct($vindi_product_id, array(

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'status' => 'inactive',

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  return array(

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $product = wc_get_product($post_id);

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $activatedPlan = $this->routes->updatePlan($vindi_plan_id, array(

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      )

              Line indented incorrectly; expected at least 14 spaces, found 6
              Open

                    set_transient('vindi_product_message', 'updated', 60);

              Line indented incorrectly; expected at least 16 spaces, found 6
              Open

                    set_transient('vindi_product_message', 'error', 60);

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                }

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (empty($vindi_product_id) || empty($vindi_plan_id)) {

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'status' => 'active',

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                }

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $product->get_meta('_subscription_trial_length'),

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $updatedProduct = $this->routes->updateProduct(

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      'pricing_schema' => array(

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $vindi_product_id,

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                }

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  ));

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    )

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'plan' => $inactivatedPlan,

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    $vindi_plan_id,

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'name' => VINDI_PREFIX_PLAN . $data['name'],

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $vindi_plan_id = get_post_meta($product->id, 'vindi_plan_id', true);

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'billing_trigger_type' => 'beginning_of_period',

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  ));

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (get_post_type($post_id) != 'product') {

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $vindi_plan_id     = get_post_meta($post_id, 'vindi_plan_id', true);

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'code' => 'WC-' . $data['id'],

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                function trash($post_id)

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'product' => $inactivatedProduct,

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  ));

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'product' => $activatedProduct,

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    array(

              Line indented incorrectly; expected at least 12 spaces, found 4
              Open

                  $updatedPlan = $this->routes->updatePlan(

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'interval_count' => $plan_interval['interval_count'],

              Multi-line function call not indented correctly; expected 8 spaces but found 6
              Open

                    )

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $interval_type = $product->get_meta('_subscription_period');

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $trigger_day = VindiConversions::convertTriggerToDay(

              Line indented incorrectly; expected at least 10 spaces, found 8
              Open

                      'name' => VINDI_PREFIX_PRODUCT . $data['name'],

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'interval' => $plan_interval['interval'],

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    'plan' => $updatedPlan,

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    array(

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'billing_cycles' => ($product->get_meta('_subscription_length') == 0) ? null : $product->get_meta('_subscription_length'),

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    )

              Line indented incorrectly; expected 12 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $activatedProduct = $this->routes->updateProduct($vindi_product_id, array(

              Line indented incorrectly; expected at least 8 spaces, found 6
              Open

                    'status' => 'active',

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              Line indented incorrectly; expected at least 12 spaces, found 6
              Open

                    return;

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $product = wc_get_product($post_id);

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (empty($vindi_product_id) || empty($vindi_plan_id)) {

              Line indented incorrectly; expected at least 8 spaces, found 4
              Open

                  $plan_interval = VindiConversions::convert_interval($interval_count, $interval_type);

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'billing_trigger_day' => $trigger_day,

              Line indented incorrectly; expected at least 12 spaces, found 8
              Open

                      'status' => ($data['status'] == 'publish') ? 'active' : 'inactive',

              Line indented incorrectly; expected at least 4 spaces, found 2
              Open

                {

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  $inactivatedPlan = $this->routes->updatePlan($vindi_plan_id, array(

              Line indented incorrectly; expected at least 4 spaces, found 2
              Open

                {

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  }

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  return array(

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    $vindi_product_id,

              Line indented incorrectly; expected 8 spaces, found 4
              Open

                  if (get_post_type($post_id) != 'product') {

              Line indented incorrectly; expected 4 spaces, found 2
              Open

                function untrash($post_id)

              Line indented incorrectly; expected at least 10 spaces, found 6
              Open

                    'plan' => $activatedPlan,

              Line indented incorrectly; expected at least 10 spaces, found 4
              Open

                  );

              There are no issues that match your filters.

              Category
              Status