Plugin Directory

Changeset 3115944


Ignore:
Timestamp:
07/11/2024 12:08:59 AM (21 months ago)
Author:
firetree
Message:

Update to version 2.0.3 from GitHub

Location:
hey-notify
Files:
4 added
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hey-notify/assets/blueprints/blueprint.json

    r3115121 r3115944  
    11{
    2     "landingPage": "/wp-admin/post-new.php?post_type=hey_notify",
     2    "$schema": "https://playground.wordpress.net/blueprint-schema.json",
     3    "landingPage": "/wp-admin/edit.php?post_type=hey_notify",
    34    "preferredVersions": {
    4         "php": "7.4",
    5         "wp": "5.9"
     5        "php": "latest",
     6        "wp": "latest"
    67    },
    78    "phpExtensionBundles": [
     
    910    ],
    1011    "features": {
    11         "networking": true
     12        "networking": false
    1213    },
    1314    "steps": [
     
    2021            "step": "installPlugin",
    2122            "pluginZipFile": {
    22                 "resource": "wordpress.org\/plugins",
     23                "resource": "wordpress.org/plugins",
    2324                "slug": "hey-notify"
    2425            },
     
    2829        },
    2930        {
    30             "step": "installPlugin",
    31             "pluginZipFile": {
    32                 "resource": "wordpress.org\/plugins",
    33                 "slug": "wp-mail-logging"
    34             },
    35             "options": {
    36                 "activate": true
     31            "step": "importWxr",
     32            "file": {
     33                "resource": "url",
     34                "url": "https://raw.githubusercontent.com/firetreedesign/hey-notify/main/data/live-preview.xml"
    3735            }
    3836        },
    3937        {
    40             "step": "installPlugin",
    41             "pluginZipFile": {
    42                 "resource": "wordpress.org\/plugins",
    43                 "slug": "inspect-http-requests"
    44             },
     38            "step": "setSiteOptions",
    4539            "options": {
    46                 "activate": true
     40                "blogname": "Hey Notify Live Preview",
     41                "hey_notify_live_preview": true
    4742            }
    4843        }
  • hey-notify/tags/2.0.3/changelog.txt

    r2533806 r3115944  
    22
    33This is an archive of older changelog entries. Most recent entries are maintained in readme.txt
     4
     5= 1.4.2 =
     6* Fixed an issue with Post/Page/CPT Updated notifications being triggered.
     7
     8= 1.4.1 =
     9* Fixed a reference to a function that did not exist.
     10
     11= 1.4.0 =
     12* Added support for Microsoft Teams.
     13* Improved the type of status changes than can be detected for Posts, Pages, and Custom Post Types.
     14* Reorganized the Settings page.
    415
    516= 1.3.0 =
  • hey-notify/tags/2.0.3/hey-notify.php

    r3115315 r3115944  
    44 * Plugin URI: https://heynotifywp.com/
    55 * Description: Get notified when things happen in WordPress.
    6  * Version: 2.0.2
     6 * Version: 2.0.3
    77 * Author: FireTree Design, LLC <info@firetreedesign.com>
    88 * Author URI: https://firetreedesign.com/
     
    2020}
    2121
    22 define( 'HEY_NOTIFY_VERSION', '2.0.2' );
     22define( 'HEY_NOTIFY_VERSION', '2.0.3' );
    2323define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ );
    2424define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • hey-notify/tags/2.0.3/includes/cpt.php

    r3114686 r3115944  
    1919add_action( 'admin_menu', __NAMESPACE__ . '\\admin_menu' );
    2020add_action( 'admin_notices', __NAMESPACE__ . '\\admin_notices', 1 );
     21add_action( 'admin_notices', __NAMESPACE__ . '\\admin_notices_live_preview' );
    2122
    2223// Filters.
     
    199200function admin_notices() {
    200201    global $pagenow;
    201 
    202     if ( 'edit.php' !== $pagenow ) {
    203         return;
    204     }
    205 
    206     // phpcs:ignore
    207     if ( ! isset( $_GET['post_type'] ) ) {
    208         return;
    209     }
    210 
    211     // phpcs:ignore
    212     if ( 'hey_notify' !== $_GET['post_type'] ) {
     202    global $typenow;
     203
     204    if ( 'edit.php' !== $pagenow && 'post-new.php' !== $pagenow && 'post.php' !== $pagenow ) {
     205        return;
     206    }
     207
     208    // phpcs:ignore
     209    if ( ! isset( $_GET['post_type'] ) && 'hey_notify' !== $typenow ) {
     210        return;
     211    }
     212
     213    // phpcs:ignore
     214    if ( isset( $_GET['post_type'] ) && 'hey_notify' !== $_GET['post_type'] ) {
    213215        return;
    214216    }
     
    221223    \Hey_Notify\Helpers\admin_header();
    222224}
     225
     226/**
     227 * Function for handling live preview notifications in the admin area.
     228 */
     229function admin_notices_live_preview() {
     230    global $pagenow;
     231    global $typenow;
     232
     233    if ( 'edit.php' !== $pagenow && 'post-new.php' !== $pagenow && 'post.php' !== $pagenow ) {
     234        return;
     235    }
     236
     237    // phpcs:ignore
     238    if ( ! isset( $_GET['post_type'] ) && 'hey_notify' !== $typenow ) {
     239        return;
     240    }
     241
     242    // phpcs:ignore
     243    if ( isset( $_GET['post_type'] ) && 'hey_notify' !== $_GET['post_type'] ) {
     244        return;
     245    }
     246
     247    $screen = function_exists( 'get_current_screen' ) ? \get_current_screen() : false;
     248    if ( $screen && $screen->is_block_editor() ) {
     249        return;
     250    }
     251
     252    if ( boolval( get_option( 'hey_notify_live_preview', 0 ) ) !== true ) {
     253        return;
     254    }
     255
     256    ?>
     257    <div class="notice notice-info">
     258        <p>
     259            <?php
     260            esc_html_e( 'While in the Live Preview mode, notifications will not be sent.', 'hey-notify' );
     261            ?>
     262        </p>
     263    </div>
     264    <?php
     265}
  • hey-notify/tags/2.0.3/includes/helpers.php

    r3114686 r3115944  
    115115 */
    116116function admin_header() {
     117    global $pagenow;
     118    global $typenow;
     119
    117120    $all_tabs        = \apply_filters( 'hey_notify_settings_page_tabs', array() );
    118121    $active_tab      = isset( $_GET['tab'] ) ? $_GET['tab'] : ( count( $all_tabs ) > 0 ? $all_tabs[0]['tab_id'] : '' ); // phpcs:ignore
     
    131134    switch ( $current_page ) {
    132135        case 'settings':
    133             $page_title = __( 'Settings', 'easy-digital-downloads' );
     136            $page_title   = __( 'Settings', 'hey-notify' );
    134137            break;
     138    }
     139    if ( 'post-new.php' === $pagenow ) {
     140        $page_title   = __( 'Add Notification', 'hey-notify' );
     141    }
     142    if ( 'post.php' === $pagenow && 'hey_notify' === $typenow ) {
     143        $page_title   = __( 'Edit Notification', 'hey-notify' );
    135144    }
    136145    ?>
     
    139148                display: none;
    140149            }
    141             .page-title-action {
     150            /* .page-title-action {
    142151                visibility: hidden;
    143             }
     152            } */
    144153            .hey-notify-admin-header-container {
    145154                background-color: #fff;
  • hey-notify/tags/2.0.3/languages/hey-notify.pot

    r3114686 r3115944  
    44"Project-Id-Version: Hey Notify\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2024-07-02 05:52+0000\n"
     6"POT-Creation-Date: 2024-07-10 21:09+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1717"X-Domain: hey-notify"
    1818
    19 #: includes/events/page/class-page-event.php:63
    20 #: includes/events/post/class-post-event.php:63
    21 #: includes/events/cpt/class-cpt-event.php:92
    22 #: includes/events/comment/class-comment-event.php:58
    23 #: includes/events/user/class-user-event.php:60
    24 #: includes/events/system/class-system-event.php:63
     19#: includes/events/page/class-page-event.php:61
     20#: includes/events/post/class-post-event.php:61
     21#: includes/events/cpt/class-cpt-event.php:88
     22#: includes/events/comment/class-comment-event.php:56
     23#: includes/events/user/class-user-event.php:58
     24#: includes/events/system/class-system-event.php:61
    2525msgid "Action"
    2626msgstr ""
    2727
    28 #: includes/services/class-email.php:65
     28#: includes/services/class-email.php:64
    2929msgid "Add Email Address"
    3030msgstr ""
     
    4242msgstr ""
    4343
    44 #: includes/events/user/class-user-event.php:31
     44#: includes/helpers.php:140
     45msgid "Add Notification"
     46msgstr ""
     47
     48#: includes/events/user/class-user-event.php:29
    4549msgid "Administrator Failed Login"
    4650msgstr ""
    4751
    48 #: includes/events/user/class-user-event.php:30
     52#: includes/events/user/class-user-event.php:28
    4953msgid "Administrator Login"
    5054msgstr ""
     
    5862msgstr ""
    5963
    60 #: includes/services/class-slack.php:288
     64#: includes/services/class-slack.php:286
    6165msgid "Attached image"
    6266msgstr ""
    6367
    64 #: includes/services/class-microsoft-teams.php:86
    65 #: includes/services/class-microsoft-teams.php:166
     68#: includes/services/class-microsoft-teams.php:84
     69#: includes/services/class-microsoft-teams.php:164
    6670msgid "Color"
    6771msgstr ""
    6872
    69 #: includes/events/comment/class-comment-event.php:41
     73#: includes/events/comment/class-comment-event.php:39
    7074msgid "Comments"
    7175msgstr ""
     
    8892
    8993#: includes/services/class-discord.php:164
    90 #: includes/services/class-discord.php:432
    9194msgid "Default Settings for Discord"
    9295msgstr ""
    9396
    94 #: includes/services/class-microsoft-teams.php:139
     97#: includes/services/class-microsoft-teams.php:137
    9598msgid "Default Settings for Microsoft Teams"
    9699msgstr ""
    97100
    98 #: includes/services/class-slack.php:118
     101#: includes/services/class-slack.php:117
    99102msgid "Default Settings for Slack"
    100103msgstr ""
     
    103106#: includes/services/class-discord.php:141
    104107#: includes/services/class-discord.php:278
    105 #: includes/services/class-discord.php:430
    106108msgid "Discord"
    107109msgstr ""
     
    109111#: includes/services/class-discord.php:91
    110112#: includes/services/class-discord.php:191
    111 #: includes/services/class-discord.php:436
    112113msgid "Discord Avatar"
    113114msgstr ""
     
    115116#: includes/services/class-discord.php:110
    116117#: includes/services/class-discord.php:207
    117 #: includes/services/class-discord.php:439
    118118msgid "Discord Username"
    119119msgstr ""
     
    123123msgstr ""
    124124
    125 #: includes/cpt.php:44
     125#: includes/cpt.php:44 includes/helpers.php:143
    126126msgid "Edit Notification"
    127127msgstr ""
    128128
    129 #: includes/services/class-email.php:47 includes/services/class-email.php:114
     129#: includes/services/class-email.php:46 includes/services/class-email.php:113
    130130msgid "Email"
    131131msgstr ""
    132132
    133 #: includes/services/class-email.php:70 includes/services/class-email.php:132
    134 #: includes/services/class-email.php:138
     133#: includes/services/class-email.php:69
    135134msgid "Email Address"
    136 msgstr ""
    137 
    138 #: includes/services/class-email.php:137
    139 msgid "Email Addresses"
    140135msgstr ""
    141136
     
    181176msgstr ""
    182177
    183 #: includes/services/class-slack.php:66 includes/services/class-slack.php:136
     178#: includes/services/class-slack.php:65 includes/services/class-slack.php:135
    184179#: includes/services/class-discord.php:72
    185180#: includes/services/class-discord.php:182
    186 #: includes/services/class-discord.php:435
    187 #: includes/services/class-microsoft-teams.php:67
    188 #: includes/services/class-microsoft-teams.php:157
     181#: includes/services/class-microsoft-teams.php:65
     182#: includes/services/class-microsoft-teams.php:155
    189183msgid "Learn More"
    190184msgstr ""
     
    195189msgstr ""
    196190
    197 #: includes/services/class-microsoft-teams.php:51
    198 #: includes/services/class-microsoft-teams.php:116
    199 #: includes/services/class-microsoft-teams.php:219
     191#: includes/services/class-microsoft-teams.php:49
     192#: includes/services/class-microsoft-teams.php:114
     193#: includes/services/class-microsoft-teams.php:217
    200194msgid "Microsoft Teams"
    201195msgstr ""
    202196
    203 #: includes/events/comment/class-comment-event.php:29
     197#: includes/events/comment/class-comment-event.php:27
    204198msgid "New Comment"
    205199msgstr ""
    206200
    207 #: includes/events/user/class-user-event.php:29
     201#: includes/events/user/class-user-event.php:27
    208202msgid "New User Registration"
    209203msgstr ""
     
    225219msgstr ""
    226220
    227 #: includes/services/class-microsoft-teams.php:258
    228 #: includes/services/class-microsoft-teams.php:259
    229 #: includes/services/class-microsoft-teams.php:266
     221#: includes/services/class-microsoft-teams.php:255
     222#: includes/services/class-microsoft-teams.php:256
     223#: includes/services/class-microsoft-teams.php:263
    230224msgid "Notification from Hey Notify"
     225msgstr ""
     226
     227#: includes/helpers.php:133
     228msgid "Notifications"
    231229msgstr ""
    232230
     
    241239#: includes/services/class-discord.php:92
    242240#: includes/services/class-discord.php:198
    243 #: includes/services/class-discord.php:437
    244241msgid "Override the default avatar of the webhook. Not required."
    245242msgstr ""
     
    247244#: includes/services/class-discord.php:111
    248245#: includes/services/class-discord.php:215
    249 #: includes/services/class-discord.php:440
    250246msgid "Override the default username of the webhook. Not required."
    251247msgstr ""
    252248
     249#: includes/events/page/class-page-event.php:27
     250msgid "Page Draft"
     251msgstr ""
     252
     253#: includes/events/page/class-page-event.php:32
     254msgid "Page Moved to Trash"
     255msgstr ""
     256
     257#: includes/events/page/class-page-event.php:28
     258msgid "Page Pending"
     259msgstr ""
     260
    253261#: includes/events/page/class-page-event.php:29
    254 msgid "Page Draft"
    255 msgstr ""
    256 
    257 #: includes/events/page/class-page-event.php:34
    258 msgid "Page Moved to Trash"
     262msgid "Page Published"
    259263msgstr ""
    260264
    261265#: includes/events/page/class-page-event.php:30
    262 msgid "Page Pending"
     266msgid "Page Scheduled"
    263267msgstr ""
    264268
    265269#: includes/events/page/class-page-event.php:31
    266 msgid "Page Published"
    267 msgstr ""
    268 
    269 #: includes/events/page/class-page-event.php:32
    270 msgid "Page Scheduled"
    271 msgstr ""
    272 
    273 #: includes/events/page/class-page-event.php:33
    274270msgid "Page Updated"
    275271msgstr ""
    276272
    277 #: includes/events/page/class-page-event.php:46
     273#: includes/events/page/class-page-event.php:44
    278274msgid "Pages"
    279275msgstr ""
     
    291287msgstr ""
    292288
    293 #: includes/events/system/class-system-event.php:31
     289#: includes/events/system/class-system-event.php:29
    294290msgid "Plugin Activated"
    295291msgstr ""
    296292
    297 #: includes/events/system/class-system-event.php:32
     293#: includes/events/system/class-system-event.php:30
    298294msgid "Plugin Deactivated"
    299295msgstr ""
    300296
    301 #: includes/events/system/class-system-event.php:30
     297#: includes/events/system/class-system-event.php:28
    302298msgid "Plugin Update Available"
    303299msgstr ""
    304300
     301#: includes/events/post/class-post-event.php:27
     302msgid "Post Draft"
     303msgstr ""
     304
     305#: includes/events/post/class-post-event.php:32
     306msgid "Post Moved to Trash"
     307msgstr ""
     308
     309#: includes/events/post/class-post-event.php:28
     310msgid "Post Pending"
     311msgstr ""
     312
    305313#: includes/events/post/class-post-event.php:29
    306 msgid "Post Draft"
    307 msgstr ""
    308 
    309 #: includes/events/post/class-post-event.php:34
    310 msgid "Post Moved to Trash"
     314msgid "Post Published"
    311315msgstr ""
    312316
    313317#: includes/events/post/class-post-event.php:30
    314 msgid "Post Pending"
    315 msgstr ""
    316 
    317 #: includes/events/post/class-post-event.php:31
    318 msgid "Post Published"
    319 msgstr ""
    320 
    321 #: includes/events/post/class-post-event.php:32
    322318msgid "Post Scheduled"
    323319msgstr ""
     
    333329msgstr ""
    334330
    335 #: includes/events/post/class-post-event.php:33
     331#: includes/events/post/class-post-event.php:31
    336332msgid "Post Updated"
    337333msgstr ""
    338334
    339 #: includes/events/post/class-post-event.php:46
     335#: includes/events/post/class-post-event.php:44
    340336msgid "Posts"
    341337msgstr ""
     
    358354msgstr ""
    359355
    360 #: includes/services/class-microsoft-teams.php:87
    361 #: includes/services/class-microsoft-teams.php:173
     356#: includes/services/class-microsoft-teams.php:85
     357#: includes/services/class-microsoft-teams.php:171
    362358msgid "Select a color to use for the message attachment."
    363359msgstr ""
     
    376372msgstr ""
    377373
    378 #: includes/services/class-email.php:63 includes/services/class-email.php:129
     374#: includes/services/class-email.php:62
    379375msgid "Send notifications to"
    380376msgstr ""
     
    384380msgstr ""
    385381
    386 #: includes/admin/class-pages.php:42 includes/admin/class-pages.php:43
    387 #: includes/admin/class-pages.php:70
     382#: includes/helpers.php:136 includes/admin/class-pages.php:42
     383#: includes/admin/class-pages.php:43
    388384msgid "Settings"
    389385msgstr ""
    390386
    391 #: includes/services/class-slack.php:49 includes/services/class-slack.php:96
    392 #: includes/services/class-slack.php:183
     387#: includes/services/class-slack.php:48 includes/services/class-slack.php:95
     388#: includes/services/class-slack.php:182
    393389msgid "Slack"
    394390msgstr ""
     
    398394msgstr ""
    399395
    400 #: includes/events/system/class-system-event.php:46
     396#: includes/events/system/class-system-event.php:44
    401397msgid "System"
    402398msgstr ""
     
    404400#: includes/services/class-discord.php:72
    405401#: includes/services/class-discord.php:182
    406 #: includes/services/class-discord.php:435
    407402msgid "The webhook that you created for your Discord channel."
    408403msgstr ""
    409404
    410 #: includes/services/class-microsoft-teams.php:67
    411 #: includes/services/class-microsoft-teams.php:157
     405#: includes/services/class-microsoft-teams.php:65
     406#: includes/services/class-microsoft-teams.php:155
    412407msgid "The webhook that you created for your Microsoft Teams channel."
    413408msgstr ""
    414409
    415 #: includes/services/class-slack.php:66 includes/services/class-slack.php:136
     410#: includes/services/class-slack.php:65 includes/services/class-slack.php:135
    416411msgid "The webhook that you created for your Slack channel."
    417412msgstr ""
    418413
    419 #: includes/events/system/class-system-event.php:34
     414#: includes/events/system/class-system-event.php:32
    420415msgid "Theme Changed"
    421416msgstr ""
    422417
    423 #: includes/events/system/class-system-event.php:33
     418#: includes/events/system/class-system-event.php:31
    424419msgid "Theme Update Available"
    425420msgstr ""
    426421
    427 #: includes/services/class-email.php:66
     422#: includes/services/class-email.php:65
    428423msgid "There are email addresses yet."
    429424msgstr ""
     
    450445msgstr ""
    451446
    452 #: includes/admin/settings/class-uninstall.php:92
     447#: includes/admin/settings/class-uninstall.php:99
    453448msgid ""
    454449"Upon deletion of Hey Notify, you can optionally remove any custom tables, "
     
    456451msgstr ""
    457452
    458 #: includes/events/user/class-user-event.php:43
     453#: includes/events/user/class-user-event.php:41
    459454msgid "Users"
    460455msgstr ""
    461456
    462 #: includes/services/class-microsoft-teams.php:307
     457#: includes/services/class-microsoft-teams.php:304
    463458msgid "View"
    464459msgstr ""
     
    498493msgstr ""
    499494
    500 #: includes/services/class-slack.php:65 includes/services/class-slack.php:128
     495#: includes/services/class-slack.php:64 includes/services/class-slack.php:127
    501496#: includes/services/class-discord.php:71
    502497#: includes/services/class-discord.php:174
    503 #: includes/services/class-discord.php:433
    504 #: includes/services/class-microsoft-teams.php:66
    505 #: includes/services/class-microsoft-teams.php:149
     498#: includes/services/class-microsoft-teams.php:64
     499#: includes/services/class-microsoft-teams.php:147
    506500msgid "Webhook URL"
    507501msgstr ""
    508502
    509 #: includes/events/system/class-system-event.php:29
     503#: includes/cpt.php:260
     504msgid "While in the Live Preview mode, notifications will not be sent."
     505msgstr ""
     506
     507#: includes/events/system/class-system-event.php:27
    510508msgid "WordPress Update Available"
    511509msgstr ""
  • hey-notify/tags/2.0.3/readme.md

    r3115121 r3115944  
    44
    55[View plugin on WordPress.org](https://wordpress.org/plugins/hey-notify)
     6
     7[Live Preview in WordPress Playground](https://wordpress.org/plugins/hey-notify/?preview=1)
    68
    79Get notified when things happen in WordPress.
  • hey-notify/tags/2.0.3/readme.txt

    r3115315 r3115944  
    55Tested up to: 6.6
    66Requires PHP: 7.2
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88License: GPLv2 or later
    99License URI: http://ww.gnu.org/licenses/gpl-2.0.html
     
    7777== Changelog ==
    7878
     79= 2.0.3 =
     80* Added support for Live Preview in the Plugin Directory.
     81* Expanded admin header to add and edit notification pages.
     82* Updated language file for translations.
     83
    7984= 2.0.2 =
    8085* Fixed version.
     
    9095* Updated Slack settings to reflect their new webhook API.
    9196* New Comment notifications are not sent if comment is marked as spam.
    92 
    93 = 1.4.2 =
    94 * Fixed an issue with Post/Page/CPT Updated notifications being triggered.
    95 
    96 = 1.4.1 =
    97 * Fixed a reference to a function that did not exist.
    98 
    99 = 1.4.0 =
    100 * Added support for Microsoft Teams.
    101 * Improved the type of status changes than can be detected for Posts, Pages, and Custom Post Types.
    102 * Reorganized the Settings page.
  • hey-notify/trunk/changelog.txt

    r2533806 r3115944  
    22
    33This is an archive of older changelog entries. Most recent entries are maintained in readme.txt
     4
     5= 1.4.2 =
     6* Fixed an issue with Post/Page/CPT Updated notifications being triggered.
     7
     8= 1.4.1 =
     9* Fixed a reference to a function that did not exist.
     10
     11= 1.4.0 =
     12* Added support for Microsoft Teams.
     13* Improved the type of status changes than can be detected for Posts, Pages, and Custom Post Types.
     14* Reorganized the Settings page.
    415
    516= 1.3.0 =
  • hey-notify/trunk/hey-notify.php

    r3115315 r3115944  
    44 * Plugin URI: https://heynotifywp.com/
    55 * Description: Get notified when things happen in WordPress.
    6  * Version: 2.0.2
     6 * Version: 2.0.3
    77 * Author: FireTree Design, LLC <info@firetreedesign.com>
    88 * Author URI: https://firetreedesign.com/
     
    2020}
    2121
    22 define( 'HEY_NOTIFY_VERSION', '2.0.2' );
     22define( 'HEY_NOTIFY_VERSION', '2.0.3' );
    2323define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ );
    2424define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • hey-notify/trunk/includes/cpt.php

    r3114686 r3115944  
    1919add_action( 'admin_menu', __NAMESPACE__ . '\\admin_menu' );
    2020add_action( 'admin_notices', __NAMESPACE__ . '\\admin_notices', 1 );
     21add_action( 'admin_notices', __NAMESPACE__ . '\\admin_notices_live_preview' );
    2122
    2223// Filters.
     
    199200function admin_notices() {
    200201    global $pagenow;
    201 
    202     if ( 'edit.php' !== $pagenow ) {
    203         return;
    204     }
    205 
    206     // phpcs:ignore
    207     if ( ! isset( $_GET['post_type'] ) ) {
    208         return;
    209     }
    210 
    211     // phpcs:ignore
    212     if ( 'hey_notify' !== $_GET['post_type'] ) {
     202    global $typenow;
     203
     204    if ( 'edit.php' !== $pagenow && 'post-new.php' !== $pagenow && 'post.php' !== $pagenow ) {
     205        return;
     206    }
     207
     208    // phpcs:ignore
     209    if ( ! isset( $_GET['post_type'] ) && 'hey_notify' !== $typenow ) {
     210        return;
     211    }
     212
     213    // phpcs:ignore
     214    if ( isset( $_GET['post_type'] ) && 'hey_notify' !== $_GET['post_type'] ) {
    213215        return;
    214216    }
     
    221223    \Hey_Notify\Helpers\admin_header();
    222224}
     225
     226/**
     227 * Function for handling live preview notifications in the admin area.
     228 */
     229function admin_notices_live_preview() {
     230    global $pagenow;
     231    global $typenow;
     232
     233    if ( 'edit.php' !== $pagenow && 'post-new.php' !== $pagenow && 'post.php' !== $pagenow ) {
     234        return;
     235    }
     236
     237    // phpcs:ignore
     238    if ( ! isset( $_GET['post_type'] ) && 'hey_notify' !== $typenow ) {
     239        return;
     240    }
     241
     242    // phpcs:ignore
     243    if ( isset( $_GET['post_type'] ) && 'hey_notify' !== $_GET['post_type'] ) {
     244        return;
     245    }
     246
     247    $screen = function_exists( 'get_current_screen' ) ? \get_current_screen() : false;
     248    if ( $screen && $screen->is_block_editor() ) {
     249        return;
     250    }
     251
     252    if ( boolval( get_option( 'hey_notify_live_preview', 0 ) ) !== true ) {
     253        return;
     254    }
     255
     256    ?>
     257    <div class="notice notice-info">
     258        <p>
     259            <?php
     260            esc_html_e( 'While in the Live Preview mode, notifications will not be sent.', 'hey-notify' );
     261            ?>
     262        </p>
     263    </div>
     264    <?php
     265}
  • hey-notify/trunk/includes/helpers.php

    r3114686 r3115944  
    115115 */
    116116function admin_header() {
     117    global $pagenow;
     118    global $typenow;
     119
    117120    $all_tabs        = \apply_filters( 'hey_notify_settings_page_tabs', array() );
    118121    $active_tab      = isset( $_GET['tab'] ) ? $_GET['tab'] : ( count( $all_tabs ) > 0 ? $all_tabs[0]['tab_id'] : '' ); // phpcs:ignore
     
    131134    switch ( $current_page ) {
    132135        case 'settings':
    133             $page_title = __( 'Settings', 'easy-digital-downloads' );
     136            $page_title   = __( 'Settings', 'hey-notify' );
    134137            break;
     138    }
     139    if ( 'post-new.php' === $pagenow ) {
     140        $page_title   = __( 'Add Notification', 'hey-notify' );
     141    }
     142    if ( 'post.php' === $pagenow && 'hey_notify' === $typenow ) {
     143        $page_title   = __( 'Edit Notification', 'hey-notify' );
    135144    }
    136145    ?>
     
    139148                display: none;
    140149            }
    141             .page-title-action {
     150            /* .page-title-action {
    142151                visibility: hidden;
    143             }
     152            } */
    144153            .hey-notify-admin-header-container {
    145154                background-color: #fff;
  • hey-notify/trunk/languages/hey-notify.pot

    r3114686 r3115944  
    44"Project-Id-Version: Hey Notify\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2024-07-02 05:52+0000\n"
     6"POT-Creation-Date: 2024-07-10 21:09+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1717"X-Domain: hey-notify"
    1818
    19 #: includes/events/page/class-page-event.php:63
    20 #: includes/events/post/class-post-event.php:63
    21 #: includes/events/cpt/class-cpt-event.php:92
    22 #: includes/events/comment/class-comment-event.php:58
    23 #: includes/events/user/class-user-event.php:60
    24 #: includes/events/system/class-system-event.php:63
     19#: includes/events/page/class-page-event.php:61
     20#: includes/events/post/class-post-event.php:61
     21#: includes/events/cpt/class-cpt-event.php:88
     22#: includes/events/comment/class-comment-event.php:56
     23#: includes/events/user/class-user-event.php:58
     24#: includes/events/system/class-system-event.php:61
    2525msgid "Action"
    2626msgstr ""
    2727
    28 #: includes/services/class-email.php:65
     28#: includes/services/class-email.php:64
    2929msgid "Add Email Address"
    3030msgstr ""
     
    4242msgstr ""
    4343
    44 #: includes/events/user/class-user-event.php:31
     44#: includes/helpers.php:140
     45msgid "Add Notification"
     46msgstr ""
     47
     48#: includes/events/user/class-user-event.php:29
    4549msgid "Administrator Failed Login"
    4650msgstr ""
    4751
    48 #: includes/events/user/class-user-event.php:30
     52#: includes/events/user/class-user-event.php:28
    4953msgid "Administrator Login"
    5054msgstr ""
     
    5862msgstr ""
    5963
    60 #: includes/services/class-slack.php:288
     64#: includes/services/class-slack.php:286
    6165msgid "Attached image"
    6266msgstr ""
    6367
    64 #: includes/services/class-microsoft-teams.php:86
    65 #: includes/services/class-microsoft-teams.php:166
     68#: includes/services/class-microsoft-teams.php:84
     69#: includes/services/class-microsoft-teams.php:164
    6670msgid "Color"
    6771msgstr ""
    6872
    69 #: includes/events/comment/class-comment-event.php:41
     73#: includes/events/comment/class-comment-event.php:39
    7074msgid "Comments"
    7175msgstr ""
     
    8892
    8993#: includes/services/class-discord.php:164
    90 #: includes/services/class-discord.php:432
    9194msgid "Default Settings for Discord"
    9295msgstr ""
    9396
    94 #: includes/services/class-microsoft-teams.php:139
     97#: includes/services/class-microsoft-teams.php:137
    9598msgid "Default Settings for Microsoft Teams"
    9699msgstr ""
    97100
    98 #: includes/services/class-slack.php:118
     101#: includes/services/class-slack.php:117
    99102msgid "Default Settings for Slack"
    100103msgstr ""
     
    103106#: includes/services/class-discord.php:141
    104107#: includes/services/class-discord.php:278
    105 #: includes/services/class-discord.php:430
    106108msgid "Discord"
    107109msgstr ""
     
    109111#: includes/services/class-discord.php:91
    110112#: includes/services/class-discord.php:191
    111 #: includes/services/class-discord.php:436
    112113msgid "Discord Avatar"
    113114msgstr ""
     
    115116#: includes/services/class-discord.php:110
    116117#: includes/services/class-discord.php:207
    117 #: includes/services/class-discord.php:439
    118118msgid "Discord Username"
    119119msgstr ""
     
    123123msgstr ""
    124124
    125 #: includes/cpt.php:44
     125#: includes/cpt.php:44 includes/helpers.php:143
    126126msgid "Edit Notification"
    127127msgstr ""
    128128
    129 #: includes/services/class-email.php:47 includes/services/class-email.php:114
     129#: includes/services/class-email.php:46 includes/services/class-email.php:113
    130130msgid "Email"
    131131msgstr ""
    132132
    133 #: includes/services/class-email.php:70 includes/services/class-email.php:132
    134 #: includes/services/class-email.php:138
     133#: includes/services/class-email.php:69
    135134msgid "Email Address"
    136 msgstr ""
    137 
    138 #: includes/services/class-email.php:137
    139 msgid "Email Addresses"
    140135msgstr ""
    141136
     
    181176msgstr ""
    182177
    183 #: includes/services/class-slack.php:66 includes/services/class-slack.php:136
     178#: includes/services/class-slack.php:65 includes/services/class-slack.php:135
    184179#: includes/services/class-discord.php:72
    185180#: includes/services/class-discord.php:182
    186 #: includes/services/class-discord.php:435
    187 #: includes/services/class-microsoft-teams.php:67
    188 #: includes/services/class-microsoft-teams.php:157
     181#: includes/services/class-microsoft-teams.php:65
     182#: includes/services/class-microsoft-teams.php:155
    189183msgid "Learn More"
    190184msgstr ""
     
    195189msgstr ""
    196190
    197 #: includes/services/class-microsoft-teams.php:51
    198 #: includes/services/class-microsoft-teams.php:116
    199 #: includes/services/class-microsoft-teams.php:219
     191#: includes/services/class-microsoft-teams.php:49
     192#: includes/services/class-microsoft-teams.php:114
     193#: includes/services/class-microsoft-teams.php:217
    200194msgid "Microsoft Teams"
    201195msgstr ""
    202196
    203 #: includes/events/comment/class-comment-event.php:29
     197#: includes/events/comment/class-comment-event.php:27
    204198msgid "New Comment"
    205199msgstr ""
    206200
    207 #: includes/events/user/class-user-event.php:29
     201#: includes/events/user/class-user-event.php:27
    208202msgid "New User Registration"
    209203msgstr ""
     
    225219msgstr ""
    226220
    227 #: includes/services/class-microsoft-teams.php:258
    228 #: includes/services/class-microsoft-teams.php:259
    229 #: includes/services/class-microsoft-teams.php:266
     221#: includes/services/class-microsoft-teams.php:255
     222#: includes/services/class-microsoft-teams.php:256
     223#: includes/services/class-microsoft-teams.php:263
    230224msgid "Notification from Hey Notify"
     225msgstr ""
     226
     227#: includes/helpers.php:133
     228msgid "Notifications"
    231229msgstr ""
    232230
     
    241239#: includes/services/class-discord.php:92
    242240#: includes/services/class-discord.php:198
    243 #: includes/services/class-discord.php:437
    244241msgid "Override the default avatar of the webhook. Not required."
    245242msgstr ""
     
    247244#: includes/services/class-discord.php:111
    248245#: includes/services/class-discord.php:215
    249 #: includes/services/class-discord.php:440
    250246msgid "Override the default username of the webhook. Not required."
    251247msgstr ""
    252248
     249#: includes/events/page/class-page-event.php:27
     250msgid "Page Draft"
     251msgstr ""
     252
     253#: includes/events/page/class-page-event.php:32
     254msgid "Page Moved to Trash"
     255msgstr ""
     256
     257#: includes/events/page/class-page-event.php:28
     258msgid "Page Pending"
     259msgstr ""
     260
    253261#: includes/events/page/class-page-event.php:29
    254 msgid "Page Draft"
    255 msgstr ""
    256 
    257 #: includes/events/page/class-page-event.php:34
    258 msgid "Page Moved to Trash"
     262msgid "Page Published"
    259263msgstr ""
    260264
    261265#: includes/events/page/class-page-event.php:30
    262 msgid "Page Pending"
     266msgid "Page Scheduled"
    263267msgstr ""
    264268
    265269#: includes/events/page/class-page-event.php:31
    266 msgid "Page Published"
    267 msgstr ""
    268 
    269 #: includes/events/page/class-page-event.php:32
    270 msgid "Page Scheduled"
    271 msgstr ""
    272 
    273 #: includes/events/page/class-page-event.php:33
    274270msgid "Page Updated"
    275271msgstr ""
    276272
    277 #: includes/events/page/class-page-event.php:46
     273#: includes/events/page/class-page-event.php:44
    278274msgid "Pages"
    279275msgstr ""
     
    291287msgstr ""
    292288
    293 #: includes/events/system/class-system-event.php:31
     289#: includes/events/system/class-system-event.php:29
    294290msgid "Plugin Activated"
    295291msgstr ""
    296292
    297 #: includes/events/system/class-system-event.php:32
     293#: includes/events/system/class-system-event.php:30
    298294msgid "Plugin Deactivated"
    299295msgstr ""
    300296
    301 #: includes/events/system/class-system-event.php:30
     297#: includes/events/system/class-system-event.php:28
    302298msgid "Plugin Update Available"
    303299msgstr ""
    304300
     301#: includes/events/post/class-post-event.php:27
     302msgid "Post Draft"
     303msgstr ""
     304
     305#: includes/events/post/class-post-event.php:32
     306msgid "Post Moved to Trash"
     307msgstr ""
     308
     309#: includes/events/post/class-post-event.php:28
     310msgid "Post Pending"
     311msgstr ""
     312
    305313#: includes/events/post/class-post-event.php:29
    306 msgid "Post Draft"
    307 msgstr ""
    308 
    309 #: includes/events/post/class-post-event.php:34
    310 msgid "Post Moved to Trash"
     314msgid "Post Published"
    311315msgstr ""
    312316
    313317#: includes/events/post/class-post-event.php:30
    314 msgid "Post Pending"
    315 msgstr ""
    316 
    317 #: includes/events/post/class-post-event.php:31
    318 msgid "Post Published"
    319 msgstr ""
    320 
    321 #: includes/events/post/class-post-event.php:32
    322318msgid "Post Scheduled"
    323319msgstr ""
     
    333329msgstr ""
    334330
    335 #: includes/events/post/class-post-event.php:33
     331#: includes/events/post/class-post-event.php:31
    336332msgid "Post Updated"
    337333msgstr ""
    338334
    339 #: includes/events/post/class-post-event.php:46
     335#: includes/events/post/class-post-event.php:44
    340336msgid "Posts"
    341337msgstr ""
     
    358354msgstr ""
    359355
    360 #: includes/services/class-microsoft-teams.php:87
    361 #: includes/services/class-microsoft-teams.php:173
     356#: includes/services/class-microsoft-teams.php:85
     357#: includes/services/class-microsoft-teams.php:171
    362358msgid "Select a color to use for the message attachment."
    363359msgstr ""
     
    376372msgstr ""
    377373
    378 #: includes/services/class-email.php:63 includes/services/class-email.php:129
     374#: includes/services/class-email.php:62
    379375msgid "Send notifications to"
    380376msgstr ""
     
    384380msgstr ""
    385381
    386 #: includes/admin/class-pages.php:42 includes/admin/class-pages.php:43
    387 #: includes/admin/class-pages.php:70
     382#: includes/helpers.php:136 includes/admin/class-pages.php:42
     383#: includes/admin/class-pages.php:43
    388384msgid "Settings"
    389385msgstr ""
    390386
    391 #: includes/services/class-slack.php:49 includes/services/class-slack.php:96
    392 #: includes/services/class-slack.php:183
     387#: includes/services/class-slack.php:48 includes/services/class-slack.php:95
     388#: includes/services/class-slack.php:182
    393389msgid "Slack"
    394390msgstr ""
     
    398394msgstr ""
    399395
    400 #: includes/events/system/class-system-event.php:46
     396#: includes/events/system/class-system-event.php:44
    401397msgid "System"
    402398msgstr ""
     
    404400#: includes/services/class-discord.php:72
    405401#: includes/services/class-discord.php:182
    406 #: includes/services/class-discord.php:435
    407402msgid "The webhook that you created for your Discord channel."
    408403msgstr ""
    409404
    410 #: includes/services/class-microsoft-teams.php:67
    411 #: includes/services/class-microsoft-teams.php:157
     405#: includes/services/class-microsoft-teams.php:65
     406#: includes/services/class-microsoft-teams.php:155
    412407msgid "The webhook that you created for your Microsoft Teams channel."
    413408msgstr ""
    414409
    415 #: includes/services/class-slack.php:66 includes/services/class-slack.php:136
     410#: includes/services/class-slack.php:65 includes/services/class-slack.php:135
    416411msgid "The webhook that you created for your Slack channel."
    417412msgstr ""
    418413
    419 #: includes/events/system/class-system-event.php:34
     414#: includes/events/system/class-system-event.php:32
    420415msgid "Theme Changed"
    421416msgstr ""
    422417
    423 #: includes/events/system/class-system-event.php:33
     418#: includes/events/system/class-system-event.php:31
    424419msgid "Theme Update Available"
    425420msgstr ""
    426421
    427 #: includes/services/class-email.php:66
     422#: includes/services/class-email.php:65
    428423msgid "There are email addresses yet."
    429424msgstr ""
     
    450445msgstr ""
    451446
    452 #: includes/admin/settings/class-uninstall.php:92
     447#: includes/admin/settings/class-uninstall.php:99
    453448msgid ""
    454449"Upon deletion of Hey Notify, you can optionally remove any custom tables, "
     
    456451msgstr ""
    457452
    458 #: includes/events/user/class-user-event.php:43
     453#: includes/events/user/class-user-event.php:41
    459454msgid "Users"
    460455msgstr ""
    461456
    462 #: includes/services/class-microsoft-teams.php:307
     457#: includes/services/class-microsoft-teams.php:304
    463458msgid "View"
    464459msgstr ""
     
    498493msgstr ""
    499494
    500 #: includes/services/class-slack.php:65 includes/services/class-slack.php:128
     495#: includes/services/class-slack.php:64 includes/services/class-slack.php:127
    501496#: includes/services/class-discord.php:71
    502497#: includes/services/class-discord.php:174
    503 #: includes/services/class-discord.php:433
    504 #: includes/services/class-microsoft-teams.php:66
    505 #: includes/services/class-microsoft-teams.php:149
     498#: includes/services/class-microsoft-teams.php:64
     499#: includes/services/class-microsoft-teams.php:147
    506500msgid "Webhook URL"
    507501msgstr ""
    508502
    509 #: includes/events/system/class-system-event.php:29
     503#: includes/cpt.php:260
     504msgid "While in the Live Preview mode, notifications will not be sent."
     505msgstr ""
     506
     507#: includes/events/system/class-system-event.php:27
    510508msgid "WordPress Update Available"
    511509msgstr ""
  • hey-notify/trunk/readme.md

    r3115121 r3115944  
    44
    55[View plugin on WordPress.org](https://wordpress.org/plugins/hey-notify)
     6
     7[Live Preview in WordPress Playground](https://wordpress.org/plugins/hey-notify/?preview=1)
    68
    79Get notified when things happen in WordPress.
  • hey-notify/trunk/readme.txt

    r3115315 r3115944  
    55Tested up to: 6.6
    66Requires PHP: 7.2
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88License: GPLv2 or later
    99License URI: http://ww.gnu.org/licenses/gpl-2.0.html
     
    7777== Changelog ==
    7878
     79= 2.0.3 =
     80* Added support for Live Preview in the Plugin Directory.
     81* Expanded admin header to add and edit notification pages.
     82* Updated language file for translations.
     83
    7984= 2.0.2 =
    8085* Fixed version.
     
    9095* Updated Slack settings to reflect their new webhook API.
    9196* New Comment notifications are not sent if comment is marked as spam.
    92 
    93 = 1.4.2 =
    94 * Fixed an issue with Post/Page/CPT Updated notifications being triggered.
    95 
    96 = 1.4.1 =
    97 * Fixed a reference to a function that did not exist.
    98 
    99 = 1.4.0 =
    100 * Added support for Microsoft Teams.
    101 * Improved the type of status changes than can be detected for Posts, Pages, and Custom Post Types.
    102 * Reorganized the Settings page.
Note: See TracChangeset for help on using the changeset viewer.