MatthewMi11er/wordpress-plugin-mi11er-utility

View on GitHub
includes/mi11er-utility/class-site-icons.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 58 of 58 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
*

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

throw new \UnexpectedValueException( $icon_name . ' is not a known Icon' );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="76x76" href="<?php TT::the_site_icon_url( 'apple-touch-icon-76x76.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="manifest" href="<?php TT::the_home_url( '/manifest.json' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="theme-color" content="<?php TT::the_theme_color(); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_site_icon_url'.
Open

echo esc_url( TT::get_the_site_icon_url( $icon_name ) );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'get_the_site_icon_url', [ $this, 'get_the_site_icon_url' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="icon" type="image/png" href="<?php TT::the_site_icon_url( 'android-chrome-192x192.png' ); ?>" sizes="192x192">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="mask-icon" href="<?php TT::the_site_icon_url( 'safari-pinned-tab.svg' ); ?>" color="#5bbad5">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_site_name', [ $this, 'the_site_name' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="180x180" href="<?php TT::the_site_icon_url( 'apple-touch-icon-180x180.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="icon" type="image/png" href="<?php TT::the_site_icon_url( 'favicon-96x96.png' ); ?>" sizes="96x96">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="icon" type="image/png" href="<?php TT::the_site_icon_url( 'favicon-16x16.png' ); ?>" sizes="16x16">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="msapplication-TileColor" content="<?php TT::the_site_icon_tile_color(); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_application_tooltip', [ $this, 'the_application_tooltip' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="114x114" href="<?php TT::the_site_icon_url( 'apple-touch-icon-114x114.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="120x120" href="<?php TT::the_site_icon_url( 'apple-touch-icon-120x120.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_site_icon_url', [ $this, 'the_site_icon_url' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="152x152" href="<?php TT::the_site_icon_url( 'apple-touch-icon-152x152.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="apple-mobile-web-app-title" content="<?php TT::the_site_name(); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_site_name'.
Open

echo esc_attr( TT::get_the_site_name() );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="144x144" href="<?php TT::the_site_icon_url( 'apple-touch-icon-144x144.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="icon" type="image/png" href="<?php TT::the_site_icon_url( 'favicon-32x32.png' ); ?>" sizes="32x32">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'get_the_site_icon_url'.
Open

$icon_file = TT::get_the_root_directory() . $icon_name;

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="57x57" href="<?php TT::the_site_icon_url( 'apple-touch-icon-57x57.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="shortcut icon" href="<?php TT::the_site_icon_url( 'favicon.ico' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="msapplication-tooltip" content="<?php TT::the_application_tooltip(); ?>" />

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'get_the_site_name', [ $this, 'get_the_site_name' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_site_icon_tile_color', [ $this, 'the_site_icon_tile_color' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'mu_file_handler_action'.
Open

$template_directory = trailingslashit( TT::get_mu_template_directory() );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="72x72" href="<?php TT::the_site_icon_url( 'apple-touch-icon-72x72.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<link rel="apple-touch-icon" sizes="60x60" href="<?php TT::the_site_icon_url( 'apple-touch-icon-60x60.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="msapplication-TileImage" content="<?php TT::the_site_icon_url( 'mstile-144x144.png' ); ?>">

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_icon_links', [ $this, 'the_icon_links' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'setup'.
Open

TT::add_tag( 'the_theme_color', [ $this, 'the_theme_color' ] );

Avoid using static access to class '\Mi11er\Utility\Template_Tags' in method 'the_icon_links'.
Open

<meta name="application-name" content="<?php TT::the_site_name(); ?>">

Avoid unused parameters such as '$value'.
Open

public static function option_site_icon_filter( $value ) {

TODO found
Open

* TODO: maskicon color

TODO found
Open

* TODO: File Names

TODO found
Open

* TODO: theme-color

The property $_icons is not named in camelCase.
Open

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

The parameter $wp_customize is not named in camelCase.
Open

public function customize_register_action( $wp_customize ) {
/**
* Since we're over ridding them...
* Remove the default wp-site-icon settings in the Customizer.
*

The parameter $file_handler is not named in camelCase.
Open

public function mu_file_handler_action( $file_handler ) {
$template_directory = trailingslashit( TT::get_mu_template_directory() );
$file_handler->add_config( 'browserconfig.xml', '^browserconfig\.xml$', $template_directory . 'browserconfig.php' , true );
$file_handler->add_config( 'manifest.json', '^manifest\.json$', $template_directory . 'manifest.php', true );
}

The parameter $icon_name is not named in camelCase.
Open

public function the_site_icon_url( $icon_name ) {
echo esc_url( TT::get_the_site_icon_url( $icon_name ) );
}

The class Site_Icons is not named in CamelCase.
Open

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

The parameter $icon_name is not named in camelCase.
Open

public function get_the_site_icon_url( $icon_name ) {
if ( ! in_array( $icon_name , $this->_icons, true ) ) {
throw new \UnexpectedValueException( $icon_name . ' is not a known Icon' );
}
$query_string = '';

The method mu_file_handler_action is not named in camelCase.
Open

public function mu_file_handler_action( $file_handler ) {
$template_directory = trailingslashit( TT::get_mu_template_directory() );
$file_handler->add_config( 'browserconfig.xml', '^browserconfig\.xml$', $template_directory . 'browserconfig.php' , true );
$file_handler->add_config( 'manifest.json', '^manifest\.json$', $template_directory . 'manifest.php', true );
}

The method get_the_site_name is not named in camelCase.
Open

public function get_the_site_name() {
/**
* Filter the site name
*
* @param string The site name.

The method the_site_name is not named in camelCase.
Open

public function the_site_name() {
echo esc_attr( TT::get_the_site_name() );
}

The method the_application_tooltip is not named in camelCase.
Open

public function the_application_tooltip() {
/**
* Filters the application tooltip
*
* @param string The application tooltip.

The method the_site_icon_url is not named in camelCase.
Open

public function the_site_icon_url( $icon_name ) {
echo esc_url( TT::get_the_site_icon_url( $icon_name ) );
}

The method customize_register_action is not named in camelCase.
Open

public function customize_register_action( $wp_customize ) {
/**
* Since we're over ridding them...
* Remove the default wp-site-icon settings in the Customizer.
*

The method get_the_site_icon_url is not named in camelCase.
Open

public function get_the_site_icon_url( $icon_name ) {
if ( ! in_array( $icon_name , $this->_icons, true ) ) {
throw new \UnexpectedValueException( $icon_name . ' is not a known Icon' );
}
$query_string = '';

The method the_theme_color is not named in camelCase.
Open

public function the_theme_color() {
echo esc_attr( apply_filters( 'mu_site_icons_theme_color', '#ffffff' ) );
}

The method wp_head_action is not named in camelCase.
Open

public function wp_head_action() {
// Display our icons in the header.
$this->the_icon_links();
}

The method option_site_icon_filter is not named in camelCase.
Open

public static function option_site_icon_filter( $value ) {
return 0;
}

The method the_site_icon_tile_color is not named in camelCase.
Open

public function the_site_icon_tile_color() {
/**
* Filter the icon tile color
*
* @param string The icon color.

The method the_icon_links is not named in camelCase.
Open

public function the_icon_links() {
?>
<!-- ======================== BEGIN SITE ICONS ======================== -->
<link rel="apple-touch-icon" sizes="57x57" href="<?php TT::the_site_icon_url( 'apple-touch-icon-57x57.png' ); ?>">
<link rel="apple-touch-icon" sizes="60x60" href="<?php TT::the_site_icon_url( 'apple-touch-icon-60x60.png' ); ?>">

There are no issues that match your filters.

Category
Status