lesterchan/wp-sweep

View on GitHub

Showing 326 of 326 total issues

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

Inline PHP statement must end with a semicolon
Open

    <?php /* translators: %1 is the number of posts, %2 is the number of post meta */ ?>
Severity: Minor
Found in admin.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

There must be no blank line following an inline comment
Open

// Silence is golden.
Severity: Minor
Found in index.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

Inline PHP statement must end with a semicolon
Open

    <?php /* translators: %1 is the number of users, %2 is the number of user meta */ ?>
Severity: Minor
Found in admin.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

Inline PHP statement must end with a semicolon
Open

    <?php /* translators: %1 is the number of terms, %2 is the number of term meta */ ?>
Severity: Minor
Found in admin.php by phpcodesniffer

Inline PHP statement must end with a semicolon
Open

    <?php /* translators: %1 is the number of database tables */ ?>
Severity: Minor
Found in admin.php by phpcodesniffer

There must be no blank lines before the file comment
Open

<?php
Severity: Minor
Found in wp-sweep.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

Missing class import via use statement (line '137', column '14').
Open

        return new WP_REST_Response(
Severity: Minor
Found in inc/class-wpsweep-api.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '161', column '14').
Open

        return new WP_REST_Response(
Severity: Minor
Found in inc/class-wpsweep-api.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Severity
Category
Status
Source
Language