Plugin Directory

Changeset 3318981


Ignore:
Timestamp:
06/27/2025 10:17:01 PM (9 months ago)
Author:
firetree
Message:

Update to version 2.1.1 from GitHub

Location:
hey-notify
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hey-notify/tags/2.1.1/hey-notify.php

    r3128398 r3318981  
    2020}
    2121
    22 define( 'HEY_NOTIFY_VERSION', '2.1.0' );
     22define( 'HEY_NOTIFY_VERSION', '2.1.1' );
    2323define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ );
    2424define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • hey-notify/tags/2.1.1/includes/events/page/class-page-hook.php

    r3128398 r3318981  
    2525     */
    2626    public function page_draft( $post ) {
    27 
    2827        if ( empty( $post ) || ! is_object( $post ) ) {
    2928            return;
  • hey-notify/tags/2.1.1/includes/services/class-slack.php

    r3115121 r3318981  
    3232        \add_action( 'hey_notify_send_message_slack', array( $this, 'send' ), 10, 3 );
    3333        \add_action( 'admin_init', array( $this, 'settings' ) );
     34        \add_filter( 'hey_notify_slack_settings_core', array( $this, 'get_core_settings' ), 10, 1 );
    3435
    3536        // Filters.
     
    171172
    172173    /**
     174     * Get service settings
     175     *
     176     * @param object $data Data.
     177     * @return boolean|array
     178     */
     179    public function get_core_settings( $data ) {
     180
     181        if ( ! is_object( $data ) || ! isset( $data->ID ) ) {
     182            return false;
     183        }
     184
     185        return array(
     186            'webhook_url' => \get_post_meta( $data->ID, '_hey_notify_slack_webhook', true ),
     187        );
     188    }
     189
     190    /**
    173191     * Add the service
    174192     *
     
    193211     */
    194212    private function sanitize( $value ) {
     213        $value = $value ?? '';
    195214        $value = str_replace( '&', '&', $value );
    196215        $value = str_replace( '<', '&lt;', $value );
     
    302321        }
    303322
    304         $body = array();
    305 
    306         $body['attachments'][] = array(
    307             'color'  => $settings['color'],
    308             'blocks' => $blocks,
    309         );
    310 
    311         if ( '' !== $settings['username'] ) {
    312             $body['username'] = $settings['username'];
    313         }
    314 
    315         if ( '' !== $settings['icon'] ) {
    316             if ( filter_var( $settings['icon'], FILTER_VALIDATE_URL ) ) {
    317                 $body['icon_url'] = $settings['icon'];
    318             } else {
    319                 $icon_url = \wp_get_attachment_image_url( $settings['icon'], array( 250, 250 ) );
    320                 if ( false !== $icon_url ) {
    321                     $body['icon_url'] = $icon_url;
    322                 }
    323             }
    324         }
     323        $body           = array();
     324        $body['blocks'] = $blocks;
    325325
    326326        return $body;
     
    336336     */
    337337    public function send( $message, $trigger, $data ) {
    338 
    339338        $settings = \apply_filters( "hey_notify_slack_settings_{$trigger}", $data );
    340339
  • hey-notify/tags/2.1.1/readme.txt

    r3128404 r3318981  
    33Tags: notifications, alert, slack, discord, email
    44Requires at least: 4.3
    5 Tested up to: 6.6
     5Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 2.1.0
     7Stable tag: 2.1.1
    88License: GPLv2 or later
    99License URI: http://ww.gnu.org/licenses/gpl-2.0.html
     
    7777== Changelog ==
    7878
     79= 2.1.1 =
     80* Fixed an issue that caused Slack notifications to not send.
     81
    7982= 2.1.0 =
    8083* Microsoft Teams support has been removed due to changes with Office 365 connectors.
  • hey-notify/trunk/hey-notify.php

    r3128398 r3318981  
    2020}
    2121
    22 define( 'HEY_NOTIFY_VERSION', '2.1.0' );
     22define( 'HEY_NOTIFY_VERSION', '2.1.1' );
    2323define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ );
    2424define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • hey-notify/trunk/includes/events/page/class-page-hook.php

    r3128398 r3318981  
    2525     */
    2626    public function page_draft( $post ) {
    27 
    2827        if ( empty( $post ) || ! is_object( $post ) ) {
    2928            return;
  • hey-notify/trunk/includes/services/class-slack.php

    r3115121 r3318981  
    3232        \add_action( 'hey_notify_send_message_slack', array( $this, 'send' ), 10, 3 );
    3333        \add_action( 'admin_init', array( $this, 'settings' ) );
     34        \add_filter( 'hey_notify_slack_settings_core', array( $this, 'get_core_settings' ), 10, 1 );
    3435
    3536        // Filters.
     
    171172
    172173    /**
     174     * Get service settings
     175     *
     176     * @param object $data Data.
     177     * @return boolean|array
     178     */
     179    public function get_core_settings( $data ) {
     180
     181        if ( ! is_object( $data ) || ! isset( $data->ID ) ) {
     182            return false;
     183        }
     184
     185        return array(
     186            'webhook_url' => \get_post_meta( $data->ID, '_hey_notify_slack_webhook', true ),
     187        );
     188    }
     189
     190    /**
    173191     * Add the service
    174192     *
     
    193211     */
    194212    private function sanitize( $value ) {
     213        $value = $value ?? '';
    195214        $value = str_replace( '&', '&amp;', $value );
    196215        $value = str_replace( '<', '&lt;', $value );
     
    302321        }
    303322
    304         $body = array();
    305 
    306         $body['attachments'][] = array(
    307             'color'  => $settings['color'],
    308             'blocks' => $blocks,
    309         );
    310 
    311         if ( '' !== $settings['username'] ) {
    312             $body['username'] = $settings['username'];
    313         }
    314 
    315         if ( '' !== $settings['icon'] ) {
    316             if ( filter_var( $settings['icon'], FILTER_VALIDATE_URL ) ) {
    317                 $body['icon_url'] = $settings['icon'];
    318             } else {
    319                 $icon_url = \wp_get_attachment_image_url( $settings['icon'], array( 250, 250 ) );
    320                 if ( false !== $icon_url ) {
    321                     $body['icon_url'] = $icon_url;
    322                 }
    323             }
    324         }
     323        $body           = array();
     324        $body['blocks'] = $blocks;
    325325
    326326        return $body;
     
    336336     */
    337337    public function send( $message, $trigger, $data ) {
    338 
    339338        $settings = \apply_filters( "hey_notify_slack_settings_{$trigger}", $data );
    340339
  • hey-notify/trunk/readme.txt

    r3128404 r3318981  
    33Tags: notifications, alert, slack, discord, email
    44Requires at least: 4.3
    5 Tested up to: 6.6
     5Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 2.1.0
     7Stable tag: 2.1.1
    88License: GPLv2 or later
    99License URI: http://ww.gnu.org/licenses/gpl-2.0.html
     
    7777== Changelog ==
    7878
     79= 2.1.1 =
     80* Fixed an issue that caused Slack notifications to not send.
     81
    7982= 2.1.0 =
    8083* Microsoft Teams support has been removed due to changes with Office 365 connectors.
Note: See TracChangeset for help on using the changeset viewer.