Plugin Directory

Changeset 2959434


Ignore:
Timestamp:
08/28/2023 02:38:59 PM (3 years ago)
Author:
hallme
Message:

Update to version 2.5.4 from GitHub

Location:
gravity-forms-email-blacklist
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gravity-forms-email-blacklist/tags/2.5.4/gf-emailblacklist.php

    r2888656 r2959434  
    44 * Plugin URI: https://wordpress.org/plugins/gravity-forms-email-blacklist/
    55 * Description: This plugin adds the ability to set a blacklist of domains on the email field in gravity forms.
    6  * Version: 2.5.3
     6 * Version: 2.5.4
    77 * Author: CrossPeak Software
    88 * Author URI: https://www.crosspeaksoftware.com/
  • gravity-forms-email-blacklist/tags/2.5.4/includes/class-gfemailblacklist.php

    r2888656 r2959434  
    1717class GFEmailBlacklist extends GFAddOn {
    1818
    19     protected $_version                  = '2.5.3';
     19    protected $_version                  = '2.5.4';
    2020    protected $_min_gravityforms_version = '1.9';
    2121    protected $_slug                     = 'gf_email_blacklist';
     
    2424    protected $_title                    = 'Gravity Forms Email Blacklist';
    2525    protected $_short_title              = 'Email Blacklist';
     26
     27    /**
     28     * Defines the capability needed to access the Add-On settings page.
     29     *
     30     * @since  2.5.4
     31     * @access protected
     32     * @var    string $_capabilities_settings_page The capability needed to access the Add-On settings page.
     33     */
     34    protected $_capabilities_settings_page = 'gravityforms_email_blacklist';
     35
     36    /**
     37     * Defines the capability needed to access the Add-On form settings page.
     38     *
     39     * @since  2.5.4
     40     * @access protected
     41     * @var    string $_capabilities_form_settings The capability needed to access the Add-On form settings page.
     42     */
     43    protected $_capabilities_form_settings = 'gravityforms_email_blacklist';
     44
     45    /**
     46     * Defines the capability needed to uninstall the Add-On.
     47     *
     48     * @since  2.5.4
     49     * @access protected
     50     * @var    string $_capabilities_uninstall The capability needed to uninstall the Add-On.
     51     */
     52    protected $_capabilities_uninstall = 'gravityforms_email_blacklist_uninstall';
     53
     54    /**
     55     * Defines the capabilities needed for the Post Creation Add-On
     56     *
     57     * @since  2.5.4
     58     * @access protected
     59     * @var    array $_capabilities The capabilities needed for the Add-On
     60     */
     61    protected $_capabilities = array( 'gravityforms_email_blacklist', 'gravityforms_email_blacklist_uninstall' );
     62
    2663
    2764    private static $_instance = null;
     
    169206     */
    170207    public function gf_emailblacklist_validation( $validation_result ) {
     208
     209        // Collect global settings.
     210        $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );
     211        if ( is_array( $blacklist ) && ! empty( $blacklist['default_emailblacklist'] ) ) {
     212            $blacklist = $blacklist['default_emailblacklist'];
     213        } else {
     214            $blacklist = '';
     215        }
     216
    171217        // Collect form results.
    172218        $form = $validation_result['form'];
     219
    173220        // Loop through results.
    174221        foreach ( $form['fields'] as &$field ) {
     
    182229            if ( RGFormsModel::is_field_hidden( $form, $field, array() ) ) {
    183230                continue;
     231            }
     232
     233            // Collect banned domains from backend and clean up.
     234            if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.
     235                $blacklist = $field['email_blacklist'];
    184236            }
    185237
     
    188240            $domain = $this->gf_emailblacklist_clean( rgar( explode( '@', $email ), 1 ) );
    189241            $tld    = strrchr( $domain, '.' );
    190 
    191             // Collect banned domains from backend and clean up.
    192             if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.
    193                 $blacklist = $field['email_blacklist'];
    194             } else { // Collect default settings.
    195                 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );
    196                 $blacklist = $blacklist['default_emailblacklist'];
    197             }
    198242
    199243            /**
     
    216260            $blacklist = str_replace( '*', '', $blacklist );
    217261            $blacklist = array_map( array( $this, 'gf_emailblacklist_clean' ), $blacklist );
     262            $blacklist = array_filter( $blacklist );
     263
     264            // No blacklisted email, skip.
     265            if ( empty( $blacklist ) ) {
     266                continue;
     267            }
    218268
    219269            // if the email, domain or top-level domain isn't blacklisted, skip.
  • gravity-forms-email-blacklist/tags/2.5.4/readme.txt

    r2888656 r2959434  
    6363=== Changelog ===
    6464
     65= 2.5.4 =
     66* Fixed validation function to remove any empty values for the array of blacklisted emails to prevent false positives from empty email fields.
     67* Added capability declination to the class to allow the plugin to work with role and capabilities plugins.
     68
    6569= 2.5.3 =
    6670* Updated labels and descriptions throughout the admin settings to improve clarity.
  • gravity-forms-email-blacklist/trunk/gf-emailblacklist.php

    r2888656 r2959434  
    44 * Plugin URI: https://wordpress.org/plugins/gravity-forms-email-blacklist/
    55 * Description: This plugin adds the ability to set a blacklist of domains on the email field in gravity forms.
    6  * Version: 2.5.3
     6 * Version: 2.5.4
    77 * Author: CrossPeak Software
    88 * Author URI: https://www.crosspeaksoftware.com/
  • gravity-forms-email-blacklist/trunk/includes/class-gfemailblacklist.php

    r2888656 r2959434  
    1717class GFEmailBlacklist extends GFAddOn {
    1818
    19     protected $_version                  = '2.5.3';
     19    protected $_version                  = '2.5.4';
    2020    protected $_min_gravityforms_version = '1.9';
    2121    protected $_slug                     = 'gf_email_blacklist';
     
    2424    protected $_title                    = 'Gravity Forms Email Blacklist';
    2525    protected $_short_title              = 'Email Blacklist';
     26
     27    /**
     28     * Defines the capability needed to access the Add-On settings page.
     29     *
     30     * @since  2.5.4
     31     * @access protected
     32     * @var    string $_capabilities_settings_page The capability needed to access the Add-On settings page.
     33     */
     34    protected $_capabilities_settings_page = 'gravityforms_email_blacklist';
     35
     36    /**
     37     * Defines the capability needed to access the Add-On form settings page.
     38     *
     39     * @since  2.5.4
     40     * @access protected
     41     * @var    string $_capabilities_form_settings The capability needed to access the Add-On form settings page.
     42     */
     43    protected $_capabilities_form_settings = 'gravityforms_email_blacklist';
     44
     45    /**
     46     * Defines the capability needed to uninstall the Add-On.
     47     *
     48     * @since  2.5.4
     49     * @access protected
     50     * @var    string $_capabilities_uninstall The capability needed to uninstall the Add-On.
     51     */
     52    protected $_capabilities_uninstall = 'gravityforms_email_blacklist_uninstall';
     53
     54    /**
     55     * Defines the capabilities needed for the Post Creation Add-On
     56     *
     57     * @since  2.5.4
     58     * @access protected
     59     * @var    array $_capabilities The capabilities needed for the Add-On
     60     */
     61    protected $_capabilities = array( 'gravityforms_email_blacklist', 'gravityforms_email_blacklist_uninstall' );
     62
    2663
    2764    private static $_instance = null;
     
    169206     */
    170207    public function gf_emailblacklist_validation( $validation_result ) {
     208
     209        // Collect global settings.
     210        $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );
     211        if ( is_array( $blacklist ) && ! empty( $blacklist['default_emailblacklist'] ) ) {
     212            $blacklist = $blacklist['default_emailblacklist'];
     213        } else {
     214            $blacklist = '';
     215        }
     216
    171217        // Collect form results.
    172218        $form = $validation_result['form'];
     219
    173220        // Loop through results.
    174221        foreach ( $form['fields'] as &$field ) {
     
    182229            if ( RGFormsModel::is_field_hidden( $form, $field, array() ) ) {
    183230                continue;
     231            }
     232
     233            // Collect banned domains from backend and clean up.
     234            if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.
     235                $blacklist = $field['email_blacklist'];
    184236            }
    185237
     
    188240            $domain = $this->gf_emailblacklist_clean( rgar( explode( '@', $email ), 1 ) );
    189241            $tld    = strrchr( $domain, '.' );
    190 
    191             // Collect banned domains from backend and clean up.
    192             if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.
    193                 $blacklist = $field['email_blacklist'];
    194             } else { // Collect default settings.
    195                 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );
    196                 $blacklist = $blacklist['default_emailblacklist'];
    197             }
    198242
    199243            /**
     
    216260            $blacklist = str_replace( '*', '', $blacklist );
    217261            $blacklist = array_map( array( $this, 'gf_emailblacklist_clean' ), $blacklist );
     262            $blacklist = array_filter( $blacklist );
     263
     264            // No blacklisted email, skip.
     265            if ( empty( $blacklist ) ) {
     266                continue;
     267            }
    218268
    219269            // if the email, domain or top-level domain isn't blacklisted, skip.
  • gravity-forms-email-blacklist/trunk/readme.txt

    r2888656 r2959434  
    6363=== Changelog ===
    6464
     65= 2.5.4 =
     66* Fixed validation function to remove any empty values for the array of blacklisted emails to prevent false positives from empty email fields.
     67* Added capability declination to the class to allow the plugin to work with role and capabilities plugins.
     68
    6569= 2.5.3 =
    6670* Updated labels and descriptions throughout the admin settings to improve clarity.
Note: See TracChangeset for help on using the changeset viewer.