<commit_before><?php

/**
 * Colophon mods
 *
 * @link            https://jentil.grotttopress.com
 * @package		    jentil
 * @subpackage 	    jentil/includes
 * @since		    Jentil 0.1.0
 */

namespace GrottoPress\Jentil\Utilities\Mods;

if ( ! defined( 'WPINC' ) ) {
    wp_die( esc_html__( 'Do not load this file directly!', 'jentil' ) );
}

/**
 * Colophon Mods
 *
 * @link			https://jentil.grotttopress.com
 * @package			jentil
 * @subpackage 	    jentil/includes
 * @since			Jentil 0.1.0
 */
final class Colophon extends Mod {
    /**
     * Constructor
     *
     * @since       Jentil 0.1.0
     * @access      public
     */
    public function __construct() {
        $this->name = 'colophon';
        $this->default = sprintf( esc_html__( 'Copyright &copy; %1$s %2$s. All Rights Reserved.', 'jentil' ), '<span itemprop="copyrightYear">{{this_year}}</span>', '<a class="blog-name" itemprop="url" href="{{site_url}}"><span itemprop="copyrightHolder">{{site_name}}</span></a>' );
    }

    /**
     * Get mod
     *
     * @since		Jentil 0.1.0
     * @access      public
     *
     * @return      string          Mod
     */
    public function mod() {
        $colophon = get_theme_mod( $this->name, $this->default );

        $colophon = str_ireplace( '{{site_name}}', esc_attr( get_bloginfo( 'name' ) ), $colophon );
        $colophon = str_ireplace( '{{site_url}}', esc_attr( home_url( '/' ) ), $colophon );
        $colophon = str_ireplace( '{{this_year}}', esc_attr( date( 'Y' ) ), $colophon );
        $colophon = str_ireplace( '{{site_description}}', esc_attr( date( 'Y' ) ), $colophon );

        return $colophon;
    }
}<commit_msg>separate logic for replacing placeholders in colophon mod<commit_after><?php

/**
 * Colophon mods
 *
 * @link            https://jentil.grotttopress.com
 * @package		    jentil
 * @subpackage 	    jentil/includes
 * @since		    Jentil 0.1.0
 */

namespace GrottoPress\Jentil\Utilities\Mods;

if ( ! defined( 'WPINC' ) ) {
    wp_die( esc_html__( 'Do not load this file directly!', 'jentil' ) );
}

/**
 * Colophon Mods
 *
 * @link			https://jentil.grotttopress.com
 * @package			jentil
 * @subpackage 	    jentil/includes
 * @since			Jentil 0.1.0
 */
final class Colophon extends Mod {
    /**
     * Constructor
     *
     * @since       Jentil 0.1.0
     * @access      public
     */
    public function __construct() {
        $this->name = 'colophon';
        $this->default = sprintf( esc_html__( 'Copyright &copy; %1$s %2$s. All Rights Reserved.', 'jentil' ), '<span itemprop="copyrightYear">{{this_year}}</span>', '<a class="blog-name" itemprop="url" href="{{site_url}}"><span itemprop="copyrightHolder">{{site_name}}</span></a>' );
    }

    /**
     * Get mod
     *
     * @since		Jentil 0.1.0
     * @access      public
     *
     * @return      string          Mod
     */
    public function mod() {
        return $this->parse_placeholders( get_theme_mod( $this->name, $this->default ) );
    }

    /**
     * Parse placeholders
     *
     * Replace placeholders with actual info
     *
     * @since       Jentil 0.1.0
     * @access      private
     *
     * @return      string          Mod with placeholders replaced
     */
    private function parse_placeholders( $mod ) {
        $mod = str_ireplace( '{{site_name}}', esc_attr( get_bloginfo( 'name' ) ), $mod );
        $mod = str_ireplace( '{{site_url}}', esc_attr( home_url( '/' ) ), $mod );
        $mod = str_ireplace( '{{this_year}}', esc_attr( date( 'Y' ) ), $mod );
        $mod = str_ireplace( '{{site_description}}', esc_attr( date( 'Y' ) ), $mod );

        return $mod;
    }
}
{'fraction_non_alphanumeric': 0.16579165515335728, 'fraction_numerical': 0.00856590218292346, 'mean_word_length': 2.4183191690273844, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 24, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2631461', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1271, 'n_words': 264}