Plugin Directory

Changeset 2443010

Timestamp:
12/19/2020 06:36:43 PM (4 years ago)
Author:
husobj
Message:

Version 2.0

Location:
wp-mailfrom-ii/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-mailfrom-ii/trunk/CHANGELOG.md

    r2438912 r2443010  
    22All notable changes to this project will be documented in this file.
    33This project adheres to [Semantic Versioning](http://semver.org/).
     4
     5
     6
     7
     8
     9
     10
     11
    412
    513## [1.2] - 2020-12-14
     
    5462- Fork of original [WP Mail From](https://wordpress.org/plugins/wp-mailfrom/) plugin
    5563
    56 [Unreleased]: https://github.com/benhuson/wp-mailfrom/compare/1.2...HEAD
     64[Unreleased]: https://github.com/benhuson/wp-mailfrom/compare/2.0...HEAD
     65[2.0]: https://github.com/benhuson/wp-mailfrom/compare/1.2...2.0
    5766[1.2]: https://github.com/benhuson/wp-mailfrom/compare/1.1.1...1.2
    5867[1.1.1]: https://github.com/benhuson/wp-mailfrom/compare/1.1...1.1.1
  • wp-mailfrom-ii/trunk/README.md

    r2438912 r2443010  
    5656--------------
    5757
     58
     59
     60
    5861### 1.2
    5962Makes admin field labels clickable and removes deprecated `screen_icon()`.
  • wp-mailfrom-ii/trunk/admin/class-wp-mailfrom-ii-admin.php

    r2438912 r2443010  
    196196    public function wp_mailfrom_ii_name_field() {
    197197
    198         echo '<input name="wp_mailfrom_ii_name" type="text" id="wp_mailfrom_ii_name" value="' . esc_attr( get_option( 'wp_mailfrom_ii_name', '' ) ) . '" class="regular-text" />';
     198        $wp_mailfrom_ii = \WP_MailFrom_II::get_instance();
     199
     200        echo '<input name="wp_mailfrom_ii_name" type="text" id="wp_mailfrom_ii_name" value="' . esc_attr( get_option( 'wp_mailfrom_ii_name', '' ) ) . '" class="regular-text" placeholder="' . esc_attr( $wp_mailfrom_ii->get_default_from_name() ) . '" />';
    199201
    200202    }
     
    207209    public function wp_mailfrom_ii_email_field() {
    208210
    209         echo '<input name="wp_mailfrom_ii_email" type="text" id="wp_mailfrom_ii_email" value="' . esc_attr( get_option( 'wp_mailfrom_ii_email', '' ) ) . '" class="regular-text" />';
     211        $wp_mailfrom_ii = \WP_MailFrom_II::get_instance();
     212
     213        echo '<input name="wp_mailfrom_ii_email" type="text" id="wp_mailfrom_ii_email" value="' . esc_attr( get_option( 'wp_mailfrom_ii_email', '' ) ) . '" class="regular-text" placeholder="' . esc_attr( $wp_mailfrom_ii->get_default_from() ) . '" />';
    210214
    211215    }
  • wp-mailfrom-ii/trunk/public/class-wp-mailfrom-ii.php

    r2187985 r2443010  
    156156     * Is Default From Name
    157157     *
    158      * Checks to see if the name is the default name assigned by WordPress.
    159      * This is defined in wp_mail() in wp-includes/pluggable.php
    160      *
    161158     * @since   1.1
    162159     *
     
    166163    public function is_default_from_name( $name ) {
    167164
    168         return 'WordPress' == $name;
     165        return $this->get_default_from_name() == $name;
     166
     167    }
     168
     169    /**
     170     * Get Default From Name
     171     *
     172     * Get the default name assigned by WordPress.
     173     * This is defined in wp_mail() in wp-includes/pluggable.php
     174     *
     175     * @since   2.0
     176     *
     177     * @return  string  Default name.
     178     */
     179    public function get_default_from_name() {
     180
     181        return 'WordPress';
    169182
    170183    }
     
    202215    public function get_default_from() {
    203216
    204         $sitename = strtolower( $_SERVER['SERVER_NAME'] );
    205 
    206         if ( substr( $sitename, 0, 4 ) == 'www.' ) {
     217        global $wp_version;
     218
     219        /**
     220         * New method of getting sitename in WordPress 5.5+
     221         *
     222         * @see  https://core.trac.wordpress.org/ticket/25239#comment:114
     223         * @see  https://core.trac.wordpress.org/changeset/48601
     224         */
     225        if ( version_compare( $wp_version, '5.5' ) >= 0 ) {
     226            $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
     227        } else {
     228            $sitename = strtolower( $_SERVER['SERVER_NAME'] );
     229        }
     230
     231        if ( 'www.' === substr( $sitename, 0, 4 ) ) {
    207232            $sitename = substr( $sitename, 4 );
    208233        }
  • wp-mailfrom-ii/trunk/readme.txt

    r2438912 r2443010  
    44Tags: mail from, from email, email from, from address, mail, email, smtp, from address, email address, from header
    55Requires at least: 4.3
    6 Tested up to: 5.4.4
    7 Stable tag: 1.2
     6Tested up to: 5.
     7Stable tag:
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Changelog ==
    6969
     70
     71
     72
     73
    7074= 1.2 =
    7175* Make admin field labels clickable. Props [Viktor Szépe](https://github.com/szepeviktor).
  • wp-mailfrom-ii/trunk/wp-mailfrom-ii.php

    r2438912 r2443010  
    55 * Plugin URI:         https://wordpress.org/plugins/wp-mailfrom-ii/
    66 * Description:        Allows you to configure the default email address and name used for emails sent by WordPress.
    7  * Version:            1.2
     7 * Version:           
    88 * Author:             Ben Huson
    99 * Author URI:         https://github.com/benhuson/
    1010 * Minimum WordPress Version Required: 4.3
    11  * Tested up to:       5.4.4
     11 * Tested up to:       5.
    1212 * Text Domain:        wp-mailfrom-ii
    1313 * Domain Path:        /languages
Note: See TracChangeset for help on using the changeset viewer.