MatthewMi11er/wordpress-plugin-mi11er-utility

View on GitHub

Showing 154 of 154 total issues

The class Site_Icons has 11 public methods. Consider refactoring Site_Icons to keep number of public methods under 10.
Open

class Site_Icons implements Plugin_Interface
{
/**
* List of Icons
*

Consider simplifying this complex logical expression.
Open

if ( $offset > 0 && $offset + mb_strlen( $matches[0], 'UTF-8' ) !== mb_strlen( $title, 'UTF-8' )
&& preg_match( $small_words, $matches[0] ) && ( $offset - 2 < 0 || mb_substr( $title, $offset - 2, 1 , 'UTF-8' ) !== ':' )
&& ( mb_substr( $title, $offset + mb_strlen( $matches[0], 'UTF-8' ), 1 ) !== '-'
|| $offset - 1 < 0 || mb_substr( $title, $offset - 1, 1, 'UTF-8' ) === '-' )
&& ( $offset - 1 < 0 || ! preg_match( '/[^\s-]/', mb_substr( $title, $offset - 1, 1, 'UTF-8' ) ) ) ) {
Severity: Critical
Found in includes/mi11er-utility/class-template-tags.php - About 2 hrs to fix

Method template_redirect_action has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function template_redirect_action() {
global $wpdb;
 
if ( ! is_404() ) {
return;
Severity: Minor
Found in includes/mi11er-utility/class-redirect.php - About 1 hr to fix

Avoid using short method names like ::mu(). The configured minimum method name length is 3.
Open

function mu() {
return Mu::instance();
}
Severity: Minor
Found in mi11er-utility.php by phpmd

Avoid using undefined variables such as '$date_parts' which will lead to PHP notices.
Open

if ( '00' === $date_parts[2] ) {

Avoid using undefined variables such as '$date_parts' which will lead to PHP notices.
Open

return $date_parts[1] . ' ' . $meridian;

Method the_posts_filter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function the_posts_filter( $posts, $wp_query ) {
$file_config = $this->get_config();
if ( false !== $file_config && $wp_query->is_main_query() && ! is_admin() ) {
$default_post = [
'post_author' => 1,
Severity: Minor
Found in includes/mi11er-utility/class-file-handler.php - About 1 hr to fix

Avoid variables with short names like $y. Configured minimum length is 3.
Open

protected function _year_string( $y ) {

The parameter $the_date is not named in camelCase.
Open

function get_the_modified_date_filter( $the_date, $d = '' ) {
 
if ( self::AP_STYLE !== $d ) {
return $the_date;
}

The parameter $requested_url is not named in camelCase.
Open

public function redirect_canonical_filter( $redirect_url, $requested_url ) {
/**
* Filter if we want to remove the 404 redirect guess.
*
* @param bool $prevent_guess Prevent the guess or not.

The property $_icons is not named in camelCase.
Open

class Site_Icons implements Plugin_Interface
{
/**
* List of Icons
*

The class Template_Tags is not named in CamelCase.
Open

class Template_Tags
{
/**
* Tags that have been added
*

Avoid variables with short names like $d. Configured minimum length is 3.
Open

function get_the_modified_date_filter( $the_date, $d = '' ) {

The parameter $prevent_slash is not named in camelCase.
Open

public function add_config( $file, $rewrite, $template, $prevent_slash = true, $post = [] ) {
$this->_files[] = [
'file' => $file,
'rewrite' => $rewrite,
'template' => $template,

The property $_registery is not named in camelCase.
Open

final class Mu
{
/**
* Registery
*
Severity: Minor
Found in includes/mi11er-utility/class-mu.php by phpmd

The parameter $the_time is not named in camelCase.
Open

function get_the_modified_time_filter( $the_time, $d = '' ) {
 
if ( self::AP_STYLE !== $d ) {
return $the_time;
}

The parameter $the_date is not named in camelCase.
Open

public function get_the_date_filter( $the_date, $d = '', $post = null ) {
 
if ( self::AP_STYLE !== $d ) {
return $the_date;
}

The class File_Handler is not named in CamelCase.
Open

class File_Handler implements Plugin_Interface
{
/**
* List of files that this plugin will handle.
*

The property $_plugins is not named in camelCase.
Open

final class Mu
{
/**
* Registery
*
Severity: Minor
Found in includes/mi11er-utility/class-mu.php by phpmd

The parameter $post_type is not named in camelCase.
Open

function add_meta_boxes_action( $post_type, $post ) {
if ( ! empty( get_post_meta( $post->ID, self::META_FIELD, false ) ) ) {
add_meta_box(
self::META_BOX,
__( 'Old URL Redirect', 'mi11er-utility' ),
Severity
Category
Status
Source
Language