Plugin Directory

Changeset 2925192


Ignore:
Timestamp:
06/13/2023 10:01:05 AM (3 years ago)
Author:
notix
Message:

Notix web push notifications - release 1.1.9

Location:
notix-web-push-notifications
Files:
40 added
7 edited

Legend:

Unmodified
Added
Removed
  • notix-web-push-notifications/trunk/README.txt

    r2894245 r2925192  
    55Requires at least: 4.9.4
    66Tested up to: 6.2.0
    7 Stable tag: 1.1.8
     7Stable tag: 1.1.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8383== Changelog ==
    8484
     85= 1.1.9 =
     86- Added service worker in site root feature
     87- Fix resetting status for edit scheduled post
     88
    8589= 1.1.8 =
    8690- Handling scheduled posts feature
  • notix-web-push-notifications/trunk/admin/class-notix-admin.php

    r2894245 r2925192  
    9090        $this->utils->register_setting(Notix::$NOTIX_API_TOKEN_SETTINGS_KEY, 'Notix API Token');
    9191        $this->utils->register_setting(Notix::$NOTIX_AUTO_SEND_FEATURE_ENABLED, 'Notix Auto Send feature');
     92        $this->utils->register_setting(Notix::$NOTIX_ROOT_SW_FETURE_ENABLED, 'Notix service worker uploaded in site root directory feature');
    9293        $this->utils->register_setting('notix_error_notices', 'Notix API Token');
    9394    }
     
    141142        $isSended = isset($postStatusSend) && is_array($postStatusSend) && count($postStatusSend) > 0 && $postStatusSend[0] == "true";
    142143
    143         $isAutoSendEnabledCheckboxStatus = esc_attr(get_option(Notix::$NOTIX_AUTO_SEND_FEATURE_ENABLED)) == "on" ? 'checked': "";
     144        $isAutoSendEnabledCheckboxStatus = esc_attr(get_option(Notix::$NOTIX_AUTO_SEND_FEATURE_ENABLED)) == "on";
     145
     146        $postSendPushChecked = get_post_meta($post->ID, 'notix_send_checkbox');
     147        $isChecked = isset($postSendPushChecked) && is_array($postSendPushChecked) && count($postSendPushChecked) > 0 && $postSendPushChecked[0] == "on";
     148
     149        $postIsFuture = get_post_status($post) && get_post_status($post) == 'future';
     150
     151        $currentCheckboxStatus = ($isAutoSendEnabledCheckboxStatus || ($isChecked && $postIsFuture)) ? 'checked': "";
    144152
    145153        if ($isSended) {
     
    151159        <input type="button" style="<?php if (!$postPublished) echo 'display: none;' ?>" name="notix_send_button" id="notix_send_button" value="<?php echo $sendButtonText; ?>" />
    152160        <label for="notix_send_button" id="notix_send_button_label"  style="<?php if (!$postPublished) { echo 'display: none;'; } else {echo 'display: block;'; } ?>"><?php echo $sendButtonLabel; ?></label>
    153 
    154         <input type="checkbox"  id="notix_send_checkbox" style="<?php if ($postPublished) echo 'display: none;' ?>" <?php echo $isAutoSendEnabledCheckboxStatus?> name="notix_send_checkbox"/>
     161        <input type="checkbox"  id="notix_send_checkbox" style="<?php if ($postPublished) echo 'display: none;' ?>" <?php echo $currentCheckboxStatus?> name="notix_send_checkbox"/>
    155162        <label for="notix_send_checkbox" id="notix_send_checkbox_label"  style="<?php if ($postPublished) echo 'display: none;' ?>">Send push</label>
    156163
  • notix-web-push-notifications/trunk/admin/css/notix-admin.css

    r2601847 r2925192  
    121121}
    122122
     123.notix-tooltip {
     124    position: relative;
     125    display: inline-block;
     126}
     127
     128.notix-tooltip .notix-tooltiptext {
     129    visibility: hidden;
     130
     131    width: 200px;
     132    background-color: rgba(0,0,0,0.7);
     133    color: #fff;
     134    text-align: center;
     135    padding: 5px;
     136    border-radius: 6px;
     137
     138    bottom: 100%;
     139    left: 50%;
     140    margin-left: -60px;
     141    font-size: 14px;
     142    position: absolute;
     143    z-index: 1;
     144}
     145
     146.notix-tooltip:hover .notix-tooltiptext {
     147    visibility: visible;
     148}
  • notix-web-push-notifications/trunk/admin/partials/notix-admin-settings-display.php

    r2875338 r2925192  
    1212    }
    1313
    14     function view_setting($key, $name, $type = 'text') {
     14    function drawTooltip($tooltip = '') {
     15        if ($tooltip != '') {
     16            echo "<div class='notix-tooltip'>
     17                        <svg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 512 512'><path d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z'/></svg>
     18                        <span class='notix-tooltiptext'>" . $tooltip . "</span>
     19                    </div>";
     20        }
     21    }
     22
     23    function view_setting($key, $name, $type = 'text', $tooltip = '') {
    1524        $option = get_option($key);
    1625        echo '<div class="notix-options-block">';
     
    2231                    echo "<label for='" . esc_attr($key) . "' class='notix-plugin-label'>" . $name . "</label>";
    2332                }
     33                drawTooltip($tooltip);
    2434                echo "<input class='notix-options-block-input'  id=" . esc_attr($key) . "' size='54' name='" . esc_attr($key) . "' type='text' value='" . sanitize_text_field($option) . "' />";
    2535                echo '</div>';
     
    3040
    3141                echo "<label for='" . esc_attr($key) . "' class='notix-plugin-label'>" . $name . "</label>";
     42                drawTooltip($tooltip);
    3243                echo "<input class='notix-options-block-input'  id=" . esc_attr($key) . "' name='" . esc_attr($key) . "' type='checkbox' " . $checked . "/>";
    3344
     
    199210                view_setting(Notix::$NOTIX_AUTO_SEND_FEATURE_ENABLED, 'Automatic push sending for new posts', 'checkbox');
    200211                ?>
     212
     213                <?php
     214                view_setting(Notix::$NOTIX_ROOT_SW_FETURE_ENABLED, 'Service worker uploaded in site root directory', 'checkbox', 'I downloaded sw.enot.js file from my dashboard and uploaded to the root directory');
     215                ?>
    201216            </div>
    202217
  • notix-web-push-notifications/trunk/includes/class-notix.php

    r2894245 r2925192  
    88    public static $NOTIX_TAGS_NOTIFY_FEATURE_SUBSCRIBE_ELEMENT_SELECTOR = 'notix_tag_notify_feature_subscribe_element_selector';
    99    public static $NOTIX_AUTO_SEND_FEATURE_ENABLED = 'notix_auto_send_feature_enabled_setting';
     10    public static $NOTIX_ROOT_SW_FETURE_ENABLED = 'notix_root_sw_feature_enabled_setting';
    1011
    1112    protected $loader;
     
    1920            $this->version = NOTIX_VERSION;
    2021        } else {
    21             $this->version = '1.1.8';
     22            $this->version = '1.1.9';
    2223        }
    2324        $this->notix = 'notix';
  • notix-web-push-notifications/trunk/notix.php

    r2894245 r2925192  
    44 *
    55 * @link              https://notix.co/
    6  * @since             1.1.8
     6 * @since             1.1.9
    77 * @package           Notix
    88 *
     
    1010 * Plugin Name:       Notix Push Notifications
    1111 * Description:       Bring more repeat traffic to your WordPress site with Notix. Best engine for web push subscribers collection and notifications delivery.
    12  * Version:           1.1.8
     12 * Version:           1.1.9
    1313 * Author:            Notix
    1414 * Author URI:        https://notix.co/
     
    2323}
    2424
    25 define( 'NOTIX_VERSION', '1.1.1' );
     25define( 'NOTIX_VERSION', '1.1.9' );
    2626
    2727function activate_notix() {
  • notix-web-push-notifications/trunk/public/partials/notix-public-display-tag.php

    r2549580 r2925192  
    44    s.onload = (sdk) => {
    55        sdk.startInstall({
    6             sw: {
    7               url: "<?php echo plugins_url( 'sw.enot.js', __DIR__) ?>"
     6            <?php
     7                if (esc_attr(get_option(Notix::$NOTIX_ROOT_SW_FETURE_ENABLED)) != "on") { ?>
     8sw: {
     9                url: "<?php echo plugins_url( 'sw.enot.js', __DIR__) ?>"
    810            },
    9             appId: "<?php echo esc_attr(get_option(Notix::$NOTIX_APP_ID_SETTINGS_KEY))?>",
     11            <?php
     12}
     13            ?>
     14appId: "<?php echo esc_attr(get_option(Notix::$NOTIX_APP_ID_SETTINGS_KEY))?>",
    1015            loadSettings: true
    1116        })
Note: See TracChangeset for help on using the changeset viewer.