The class Site_Icons has 11 public methods. Consider refactoring Site_Icons to keep number of public methods under 10. class Site_Icons implements Plugin_Interface
{
/ **
* List of Icons
*
Consider simplifying this complex logical expression. 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' ) ) ) ) {
Method template_redirect_action
has 35 lines of code (exceeds 25 allowed). Consider refactoring. public function template_redirect_action ( ) {
global $wpdb ;
if ( ! is_404 ( ) ) {
return ;
Avoid using short method names like ::mu(). The configured minimum method name length is 3. function mu ( ) {
return Mu:: instance ( ) ;
}
Avoid using undefined variables such as '$date_parts' which will lead to PHP notices. if ( '00' === $date_parts [ 2 ] ) {
Avoid using undefined variables such as '$date_parts' which will lead to PHP notices. return $date_parts [ 1 ] . ' ' . $meridian ;
Method the_posts_filter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. 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 ,
Avoid variables with short names like $y. Configured minimum length is 3. protected function _year_string ( $y ) {
The parameter $the_date is not named in camelCase. 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. 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. class Site_Icons implements Plugin_Interface
{
/ **
* List of Icons
*
The class Template_Tags is not named in CamelCase. class Template_Tags
{
/ **
* Tags that have been added
*
Avoid variables with short names like $d. Configured minimum length is 3. function get_the_modified_date_filter ( $the_date , $d = '' ) {
The parameter $prevent_slash is not named in camelCase. 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. final class Mu
{
/ **
* Registery
*
The parameter $the_time is not named in camelCase. 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. 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. class File_Handler implements Plugin_Interface
{
/ **
* List of files that this plugin will handle.
*
The property $_plugins is not named in camelCase. final class Mu
{
/ **
* Registery
*
The parameter $post_type is not named in camelCase. 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' ) ,