lesterchan/wp-sweep

View on GitHub
inc/class-wpsweep.php

Summary

Maintainability
F
1 wk
Test Coverage

ajax_sweep_details accesses the super-global variable $_GET.
Open

    public function ajax_sweep_details() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || ! check_admin_referer( 'wp_sweep_details_' . $_GET['sweep_name'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep_details accesses the super-global variable $_GET.
Open

    public function ajax_sweep_details() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || ! check_admin_referer( 'wp_sweep_details_' . $_GET['sweep_name'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep accesses the super-global variable $_GET.
Open

    public function ajax_sweep() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || empty( $_GET['sweep_type'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_sweep_details accesses the super-global variable $_GET.
Open

    public function ajax_sweep_details() {
        // Verify referer and check permissions.
        if (
            empty( $_GET['sweep_name'] )
            || ! check_admin_referer( 'wp_sweep_details_' . $_GET['sweep_name'] )
Severity: Minor
Found in inc/class-wpsweep.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Function sweep has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
Open

    public function sweep( $name ) {
        global $wpdb;

        $message = '';

Severity: Minor
Found in inc/class-wpsweep.php - About 2 days 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 class-wpsweep.php has 632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * WP-Sweep class-wpsweep.php
 *
 * @package wp-sweep
Severity: Major
Found in inc/class-wpsweep.php - About 1 day to fix

    Method sweep has 224 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function sweep( $name ) {
            global $wpdb;
    
            $message = '';
    
    
    Severity: Major
    Found in inc/class-wpsweep.php - About 1 day to fix

      Function details has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function details( $name ) {
              global $wpdb;
      
              $details = array();
      
      
      Severity: Minor
      Found in inc/class-wpsweep.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

      Function count has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          public function count( $name ) {
              global $wpdb;
      
              $count = 0;
      
      
      Severity: Minor
      Found in inc/class-wpsweep.php - About 3 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

      Method details has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function details( $name ) {
              global $wpdb;
      
              $details = array();
      
      
      Severity: Major
      Found in inc/class-wpsweep.php - About 3 hrs to fix

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

        class WPSweep {
            /**
             * Limit the number of items to show for sweep details
             *
             * @since 1.0.3
        Severity: Minor
        Found in inc/class-wpsweep.php by phpmd

        The class WPSweep has 14 public methods. Consider refactoring WPSweep to keep number of public methods under 10.
        Open

        class WPSweep {
            /**
             * Limit the number of items to show for sweep details
             *
             * @since 1.0.3
        Severity: Minor
        Found in inc/class-wpsweep.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

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

        Method count has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function count( $name ) {
                global $wpdb;
        
                $count = 0;
        
        
        Severity: Major
        Found in inc/class-wpsweep.php - About 3 hrs to fix

          Method ajax_sweep has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function ajax_sweep() {
                  // Verify referer and check permissions.
                  if (
                      empty( $_GET['sweep_name'] )
                      || empty( $_GET['sweep_type'] )
          Severity: Major
          Found in inc/class-wpsweep.php - About 2 hrs to fix

            WPSweep has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class WPSweep {
                /**
                 * Limit the number of items to show for sweep details
                 *
                 * @since 1.0.3
            Severity: Minor
            Found in inc/class-wpsweep.php - About 2 hrs to fix

              Method total_count has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function total_count( $name ) {
                      global $wpdb;
              
                      $count = 0;
              
              
              Severity: Minor
              Found in inc/class-wpsweep.php - About 1 hr to fix

                Function total_count has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function total_count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php - About 1 hr 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

                Function get_default_taxonomy_termids has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php - About 1 hr 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

                Function ajax_sweep has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php - About 55 mins 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

                Function plugin_deactivation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php - About 45 mins 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

                Function plugin_activation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php - About 45 mins 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

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

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

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

                    public function total_count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.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 count() has a Cyclomatic Complexity of 24. The configured cyclomatic complexity threshold is 10.
                Open

                    public function count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.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 ajax_sweep() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep() has a Cyclomatic Complexity of 66. The configured cyclomatic complexity threshold is 10.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.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 details() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
                Open

                    public function details( $name ) {
                        global $wpdb;
                
                        $details = array();
                
                
                Severity: Minor
                Found in inc/class-wpsweep.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

                Avoid using static access to class 'WP_CLI' in method 'init'.
                Open

                            WP_CLI::add_command( 'sweep', 'WPSweep_Command' );
                Severity: Minor
                Found in inc/class-wpsweep.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 admin_enqueue_scripts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            wp_enqueue_script( 'wp-sweep', plugins_url( 'wp-sweep/js/wp-sweep.min.js' ), array( 'jquery' ), WP_SWEEP_VERSION, true );
                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_transient( str_replace( '_transient_', '', $option_name ) );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_user_meta( $user_id, $meta->meta_key );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_post_meta( $post_id, $meta->meta_key );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", (int) $tax->term_taxonomy_id ) );
                                            $check_wp_terms = true;
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_comment_meta( $comment_id, $meta->meta_key );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_term_meta( $term_id, $meta->meta_key );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 plugin_deactivation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $this->plugin_deactivated();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 sweep uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            delete_post_meta( $post_id, $meta->meta_key );
                                        }
                Severity: Minor
                Found in inc/class-wpsweep.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 plugin_activation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $this->plugin_activated();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.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

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'duplicated_postmeta':
                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, post_id, COUNT(*) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 4 hrs to fix
                inc/class-wpsweep.php on lines 698..710
                inc/class-wpsweep.php on lines 711..723
                inc/class-wpsweep.php on lines 724..736

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 171.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'duplicated_commentmeta':
                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, comment_id, COUNT(*) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 4 hrs to fix
                inc/class-wpsweep.php on lines 685..697
                inc/class-wpsweep.php on lines 711..723
                inc/class-wpsweep.php on lines 724..736

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 171.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'duplicated_termmeta':
                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, term_id, COUNT(*) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 4 hrs to fix
                inc/class-wpsweep.php on lines 685..697
                inc/class-wpsweep.php on lines 698..710
                inc/class-wpsweep.php on lines 711..723

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 171.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'duplicated_usermeta':
                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(umeta_id ORDER BY umeta_id DESC) AS ids, user_id, COUNT(*) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $ids = array_map( 'intval', explode( ',', $meta->ids ) );
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 4 hrs to fix
                inc/class-wpsweep.php on lines 685..697
                inc/class-wpsweep.php on lines 698..710
                inc/class-wpsweep.php on lines 724..736

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 171.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'orphan_termmeta':
                                $query = $wpdb->get_results( "SELECT term_id, meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $term_id = (int) $meta->term_id;
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 3 hrs to fix
                inc/class-wpsweep.php on lines 586..601
                inc/class-wpsweep.php on lines 602..617
                inc/class-wpsweep.php on lines 618..633

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 147.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'orphan_usermeta':
                                $query = $wpdb->get_results( "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $user_id = (int) $meta->user_id;
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 3 hrs to fix
                inc/class-wpsweep.php on lines 586..601
                inc/class-wpsweep.php on lines 602..617
                inc/class-wpsweep.php on lines 634..649

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 147.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'orphan_commentmeta':
                                $query = $wpdb->get_results( "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $comment_id = (int) $meta->comment_id;
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 3 hrs to fix
                inc/class-wpsweep.php on lines 586..601
                inc/class-wpsweep.php on lines 618..633
                inc/class-wpsweep.php on lines 634..649

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 147.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            case 'orphan_postmeta':
                                $query = $wpdb->get_results( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
                                if ( $query ) {
                                    foreach ( $query as $meta ) {
                                        $post_id = (int) $meta->post_id;
                Severity: Major
                Found in inc/class-wpsweep.php and 3 other locations - About 3 hrs to fix
                inc/class-wpsweep.php on lines 602..617
                inc/class-wpsweep.php on lines 618..633
                inc/class-wpsweep.php on lines 634..649

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 147.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            case 'spam_comments':
                                $query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
                                if ( $query ) {
                                    foreach ( $query as $id ) {
                                        wp_delete_comment( (int) $id, true );
                Severity: Major
                Found in inc/class-wpsweep.php and 2 other locations - About 1 hr to fix
                inc/class-wpsweep.php on lines 516..526
                inc/class-wpsweep.php on lines 538..548

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 103.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            case 'auto_drafts':
                                $query = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
                                if ( $query ) {
                                    foreach ( $query as $id ) {
                                        wp_delete_post( (int) $id, true );
                Severity: Major
                Found in inc/class-wpsweep.php and 2 other locations - About 1 hr to fix
                inc/class-wpsweep.php on lines 538..548
                inc/class-wpsweep.php on lines 549..559

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 103.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            case 'unapproved_comments':
                                $query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
                                if ( $query ) {
                                    foreach ( $query as $id ) {
                                        wp_delete_comment( (int) $id, true );
                Severity: Major
                Found in inc/class-wpsweep.php and 2 other locations - About 1 hr to fix
                inc/class-wpsweep.php on lines 516..526
                inc/class-wpsweep.php on lines 549..559

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 103.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php and 1 other location - About 30 mins to fix
                inc/class-wpsweep.php on lines 865..879

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 90.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php and 1 other location - About 30 mins to fix
                inc/class-wpsweep.php on lines 901..915

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 90.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Avoid excessively long variable names like $orphan_term_relationships_sql. Keep variable name length under 20.
                Open

                                $orphan_term_relationships_sql = implode( "','", array_map( 'esc_sql', $this->get_excluded_taxonomies() ) );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                LongVariable

                Since: 0.2

                Detects when a field, formal or local variable is declared with a long name.

                Example

                class Something {
                    protected $reallyLongIntName = -3; // VIOLATION - Field
                    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                        $otherReallyLongName = -5; // VIOLATION - Local
                        for ($interestingIntIndex = 0; // VIOLATION - For
                             $interestingIntIndex < 10;
                             $interestingIntIndex++ ) {
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#longvariable

                Avoid excessively long variable names like $orphan_term_relationships_sql. Keep variable name length under 20.
                Open

                                $orphan_term_relationships_sql = implode( "','", array_map( 'esc_sql', $this->get_excluded_taxonomies() ) );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                LongVariable

                Since: 0.2

                Detects when a field, formal or local variable is declared with a long name.

                Example

                class Something {
                    protected $reallyLongIntName = -3; // VIOLATION - Field
                    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                        $otherReallyLongName = -5; // VIOLATION - Local
                        for ($interestingIntIndex = 0; // VIOLATION - For
                             $interestingIntIndex < 10;
                             $interestingIntIndex++ ) {
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#longvariable

                Avoid excessively long variable names like $wp_remove_object_terms. Keep variable name length under 20.
                Open

                                        $wp_remove_object_terms = wp_remove_object_terms( (int) $tax->object_id, (int) $tax->term_id, $tax->taxonomy );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                LongVariable

                Since: 0.2

                Detects when a field, formal or local variable is declared with a long name.

                Example

                class Something {
                    protected $reallyLongIntName = -3; // VIOLATION - Field
                    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                        $otherReallyLongName = -5; // VIOLATION - Local
                        for ($interestingIntIndex = 0; // VIOLATION - For
                             $interestingIntIndex < 10;
                             $interestingIntIndex++ ) {
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#longvariable

                The property $limit_details is not named in camelCase.
                Open

                class WPSweep {
                    /**
                     * Limit the number of items to show for sweep details
                     *
                     * @since 1.0.3
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCasePropertyName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name attributes.

                Example

                class ClassName {
                    protected $property_name;
                }

                Source

                The parameter $network_wide is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseParameterName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name parameters.

                Example

                class ClassName {
                    public function doSomething($user_name) {
                    }
                }

                Source

                The parameter $network_wide is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseParameterName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name parameters.

                Example

                class ClassName {
                    public function doSomething($user_name) {
                    }
                }

                Source

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT tt.term_taxonomy_id, t.term_id, tt.taxonomy FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND post_id = %d', (int) $meta->post_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $count                         = $wpdb->get_var( "SELECT COUNT(object_id) FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found get_excluded_termids
                Open

                                $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(t.term_id) FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $ids
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE umeta_id IN (" . implode( ',', $ids ) . ') AND user_id = %d', (int) $meta->user_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $ids
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND post_id = %d', (int) $meta->post_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found get_excluded_termids
                Open

                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT tt.term_taxonomy_id, t.term_id, tt.taxonomy FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found interpolated variable $tables at "OPTIMIZE TABLE $tables"
                Open

                                    $wpdb->query( "OPTIMIZE TABLE $tables" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(t.term_id) FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $ids
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND term_id = %d', (int) $meta->term_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $this
                Open

                                $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(t.term_id) FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found get_excluded_termids
                Open

                                $details = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ') LIMIT %d', 0, $this->limit_details ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $details = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ') LIMIT %d', 0, $this->limit_details ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found get_excluded_taxonomies
                Open

                                $query = $wpdb->get_results( "SELECT tr.object_id, tr.term_taxonomy_id, tt.term_id, tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('" . implode( '\',\'', $this->get_excluded_taxonomies() ) . "') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $ids
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND comment_id = %d', (int) $meta->comment_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND term_id = %d', (int) $meta->term_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $this
                Open

                                $query = $wpdb->get_results( "SELECT tr.object_id, tr.term_taxonomy_id, tt.term_id, tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('" . implode( '\',\'', $this->get_excluded_taxonomies() ) . "') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE umeta_id IN (" . implode( ',', $ids ) . ') AND user_id = %d', (int) $meta->user_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $this
                Open

                                $query = $wpdb->get_results( $wpdb->prepare( "SELECT tt.term_taxonomy_id, t.term_id, tt.taxonomy FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ')', 0 ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found $this
                Open

                                $details = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ') LIMIT %d', 0, $this->limit_details ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $query = $wpdb->get_results( "SELECT tr.object_id, tr.term_taxonomy_id, tt.term_id, tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('" . implode( '\',\'', $this->get_excluded_taxonomies() ) . "') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN (" . implode( ',', $ids ) . ') AND comment_id = %d', (int) $meta->comment_id ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                    $wpdb->query( "OPTIMIZE TABLE $tables" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Inline comments must end in full-stops, exclamation marks, or question marks
                Open

                                $details                       = $wpdb->get_col( $wpdb->prepare( "SELECT tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts) LIMIT %d", $this->limit_details ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found interpolated variable $orphan_term_relationships_sql at "SELECT COUNT(object_id) FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)"
                Open

                                $count                         = $wpdb->get_var( "SELECT COUNT(object_id) FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                Use placeholders and $wpdb->prepare(); found interpolated variable $orphan_term_relationships_sql at "SELECT tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts) LIMIT %d"
                Open

                                $details                       = $wpdb->get_col( $wpdb->prepare( "SELECT tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy NOT IN ('$orphan_term_relationships_sql') AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts) LIMIT %d", $this->limit_details ) ); // phpcs:ignore
                Severity: Minor
                Found in inc/class-wpsweep.php by phpcodesniffer

                The variable $total_count is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_count is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $orphan_term_relationships_sql is not named in camelCase.
                Open

                    public function count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_stats is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $total_count is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_site is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $orphan_term_relationships_sql is not named in camelCase.
                Open

                    public function details( $name ) {
                        global $wpdb;
                
                        $details = array();
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $comment_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $user_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_site is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $user_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $excluded_taxonomies is not named in camelCase.
                Open

                    private function get_excluded_taxonomies() {
                        $excluded_taxonomies   = array();
                        $excluded_taxonomies[] = 'link_category';
                
                        return apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $network_wide is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $wp_remove_object_terms is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $excluded_taxonomies is not named in camelCase.
                Open

                    private function get_excluded_taxonomies() {
                        $excluded_taxonomies   = array();
                        $excluded_taxonomies[] = 'link_category';
                
                        return apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $excluded_termids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $excluded_termids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $comment_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $comment_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $user_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $parent_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $parent_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_site is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $check_wp_terms is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $orphan_term_relationships_sql is not named in camelCase.
                Open

                    public function count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $option_name is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $check_wp_terms is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $post_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $excluded_taxonomies is not named in camelCase.
                Open

                    private function get_excluded_taxonomies() {
                        $excluded_taxonomies   = array();
                        $excluded_taxonomies[] = 'link_category';
                
                        return apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $parent_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $comment_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_site is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $option_name is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $option_name is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $term_id is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $option_name is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $user_id is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $orphan_term_relationships_sql is not named in camelCase.
                Open

                    public function details( $name ) {
                        global $wpdb;
                
                        $details = array();
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $wp_remove_object_terms is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $check_wp_terms is not named in camelCase.
                Open

                    public function sweep( $name ) {
                        global $wpdb;
                
                        $message = '';
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $parent_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $network_wide is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $ms_sites is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The variable $default_term_ids is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseVariableName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name variables.

                Example

                class ClassName {
                    public function doSomething() {
                        $data_module = new DataModule();
                    }
                }

                Source

                The method ajax_sweep_details is not named in camelCase.
                Open

                    public function ajax_sweep_details() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || ! check_admin_referer( 'wp_sweep_details_' . $_GET['sweep_name'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method admin_menu is not named in camelCase.
                Open

                    public function admin_menu() {
                        add_management_page( _x( 'Sweep', 'Page title', 'wp-sweep' ), _x( 'Sweep', 'Menu title', 'wp-sweep' ), 'activate_plugins', 'wp-sweep/admin.php' );
                    }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method add_hooks is not named in camelCase.
                Open

                    public function add_hooks() {
                        // Actions.
                        add_action( 'init', array( $this, 'init' ) );
                        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method total_count is not named in camelCase.
                Open

                    public function total_count( $name ) {
                        global $wpdb;
                
                        $count = 0;
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method get_instance is not named in camelCase.
                Open

                    public static function get_instance() {
                        if ( ! isset( self::$instance ) ) {
                            self::$instance = new self();
                        }
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method admin_enqueue_scripts is not named in camelCase.
                Open

                    public function admin_enqueue_scripts( $hook ) {
                        if ( 'wp-sweep/admin.php' !== $hook ) {
                            return;
                        }
                
                
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method ajax_sweep is not named in camelCase.
                Open

                    public function ajax_sweep() {
                        // Verify referer and check permissions.
                        if (
                            empty( $_GET['sweep_name'] )
                            || empty( $_GET['sweep_type'] )
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method plugin_activated is not named in camelCase.
                Open

                    private function plugin_activated() {
                    }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method get_default_taxonomy_termids is not named in camelCase.
                Open

                    private function get_default_taxonomy_termids() {
                        $taxonomies       = get_taxonomies();
                        $default_term_ids = array();
                        if ( $taxonomies ) {
                            $tax = array_keys( $taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method plugin_activation is not named in camelCase.
                Open

                    public function plugin_activation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method plugin_deactivated is not named in camelCase.
                Open

                    private function plugin_deactivated() {
                    }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method get_excluded_taxonomies is not named in camelCase.
                Open

                    private function get_excluded_taxonomies() {
                        $excluded_taxonomies   = array();
                        $excluded_taxonomies[] = 'link_category';
                
                        return apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies );
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method get_excluded_termids is not named in camelCase.
                Open

                    private function get_excluded_termids() {
                        $default_term_ids = $this->get_default_taxonomy_termids();
                        if ( ! is_array( $default_term_ids ) ) {
                            $default_term_ids = array();
                        }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method get_parent_termids is not named in camelCase.
                Open

                    private function get_parent_termids() {
                        global $wpdb;
                        return $wpdb->get_col( $wpdb->prepare( "SELECT tt.parent FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.parent > %d", 0 ) );
                    }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method format_percentage is not named in camelCase.
                Open

                    public function format_percentage( $current, $total ) {
                        return ( $total > 0 ? round( ( $current / $total ) * 100, 2 ) : 0 ) . '%';
                    }
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                The method plugin_deactivation is not named in camelCase.
                Open

                    public function plugin_deactivation( $network_wide ) {
                        if ( is_multisite() && $network_wide ) {
                            $ms_sites = (array) get_sites();
                
                            if ( 0 < count( $ms_sites ) ) {
                Severity: Minor
                Found in inc/class-wpsweep.php by phpmd

                CamelCaseMethodName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name methods.

                Example

                class ClassName {
                    public function get_name() {
                    }
                }

                Source

                There are no issues that match your filters.

                Category
                Status