Plugin Directory

Changeset 3411307


Ignore:
Timestamp:
12/04/2025 06:34:12 PM (3 months ago)
Author:
wpfeedback
Message:

updated to 4.2.1

Location:
atarim-visual-collaboration
Files:
209 added
2 edited

Legend:

Unmodified
Added
Removed
  • atarim-visual-collaboration/trunk/atarim-visual-collaboration.php

    r3320344 r3411307  
    33 * Plugin Name: Atarim: Visual Website Collaboration, Feedback & Workflow Management
    44 * Description: Atarim Visual Collaboration makes it easy and efficient to collaborate on websites with your clients, internal team, contractors…anyone! It’s used by nearly 10,000 agencies and freelancers worldwide on over 120,000 websites.
    5  * Version: 4.2
     5 * Version: 4.2.1
    66 * Requires at least: 5.0
    77 * Require PHP: 7.4
     
    3030}
    3131if ( ! defined( 'WPF_VERSION' ) ) {
    32     define( 'WPF_VERSION', '4.2' );
     32    define( 'WPF_VERSION', '4.2.1' );
    3333}
    3434
     
    4747define( 'WPF_CRM_API', 'https://api.atarim.io/' );
    4848define( 'WPF_LEARN_SITE_URL', 'https://academy.atarim.io' );
     49
     50add_filter( 'site_transient_update_plugins', function( $transient ) {
     51
     52    if ( ! is_admin() ) {
     53        return $transient;
     54    }
     55
     56    global $pagenow;
     57
     58    $plugin_file = 'atarim-visual-collaboration/atarim-visual-collaboration.php';
     59
     60    if ( ! isset( $transient->response[ $plugin_file ] ) ) {
     61        return $transient;
     62    }
     63
     64    // 1) Hide notice completely on update-core.php
     65    if ( $pagenow === 'update-core.php' ) {
     66        if ( isset( $transient->response[ $plugin_file ]->upgrade_notice ) ) {
     67            unset( $transient->response[ $plugin_file ]->upgrade_notice );
     68        }
     69        return $transient;
     70    }
     71
     72    return $transient;
     73} );
     74
     75add_action(
     76    'in_plugin_update_message-' . plugin_basename( __FILE__ ),
     77    'wpf_show_upgrade_notice_boxes',
     78    10,
     79    2
     80);
     81
     82function wpf_show_upgrade_notice_boxes( $plugin_data, $response ) {
     83
     84    if ( empty( $response->upgrade_notice ) ) {
     85        return;
     86    }
     87
     88    // Decode what wp.org sent.
     89    $raw = html_entity_decode(
     90        $response->upgrade_notice,
     91        ENT_QUOTES,
     92        get_bloginfo( 'charset' )
     93    );
     94
     95    // Normalise newlines.
     96    $raw = str_replace( array( "\r\n", "\r" ), "\n", $raw );
     97
     98    // If wp.org wrapped it in <p>, flatten that to plain text with newlines.
     99    if ( strpos( $raw, '<p' ) !== false ) {
     100        $raw = preg_replace( '#</p>\s*<p>#i', "\n\n", $raw ); // paragraph break → blank line
     101        $raw = preg_replace( '#</?p[^>]*>#i', '', $raw );      // remove remaining <p> tags
     102    }
     103
     104    $raw = trim( $raw );
     105    if ( $raw === '' ) {
     106        return;
     107    }
     108
     109    // Find blocks of the form: **Title:** body ... (until next ** or end)
     110    // Each match gives you one "notice box".
     111    $pattern = '/\*\*(.+?)\*\*(.*?)(?=\n\*\*|\z)/s';
     112    if ( ! preg_match_all( $pattern, $raw, $matches, PREG_SET_ORDER ) ) {
     113        // Fallback: no ** sections, treat whole thing as one block.
     114        $matches = array(
     115            array( 0, '', $raw ),
     116        );
     117    }
     118
     119    foreach ( $matches as $match ) {
     120
     121        $title = isset( $match[1] ) ? trim( $match[1] ) : '';
     122        $body  = isset( $match[2] ) ? trim( $match[2] ) : '';
     123
     124        // Strip trailing colon from title if present.
     125        $title = trim( $title, " \t\n\r\0\x0B:" );
     126
     127        // Convert markdown-style links in title/body if present: [text](url)
     128        if ( strpos( $title . $body, '[' ) !== false && strpos( $title . $body, '](' ) !== false ) {
     129            $replace_links = function( $text ) {
     130                return preg_replace(
     131                    '/\[(.+?)\]\((https?:\/\/[^\s)]+)\)/',
     132                    '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>',
     133                    $text
     134                );
     135            };
     136            $title = $replace_links( $title );
     137            $body  = $replace_links( $body );
     138        }
     139
     140        // Convert any remaining newlines in body to <br>.
     141        if ( $body !== '' ) {
     142            $body = nl2br( $body );
     143        }
     144
     145        // Box styling: full-width-ish, default WP-ish yellow.
     146        // Using <span> (phrasing content) with display:block so we stay valid inside core's <p>.
     147        $style  = 'display:block;';
     148        $style .= 'margin-top:8px;';
     149        $style .= 'padding:10px 14px;';
     150        $style .= 'background:#fff8e5;';
     151        $style .= 'border-left:4px solid #d63638;';
     152        $style .= 'border-radius:4px;';
     153        $style .= 'line-height:1.5;';
     154        $style .= 'box-sizing:border-box;';
     155
     156        echo '<span class="atarim-upgrade-notice" style="' . esc_attr( $style ) . '">';
     157
     158        if ( $title !== '' ) {
     159            // Allow links inside the title, nothing else fancy.
     160            echo '<strong>' . wp_kses(
     161                    $title,
     162                    array(
     163                        'a' => array(
     164                            'href'   => array(),
     165                            'target' => array(),
     166                            'rel'    => array(),
     167                        ),
     168                    )
     169                ) . ':</strong>';
     170        }
     171
     172        if ( $body !== '' ) {
     173            echo '<br />';
     174            echo wp_kses(
     175                $body,
     176                array(
     177                    'br' => array(),
     178                    'a'  => array(
     179                        'href'   => array(),
     180                        'target' => array(),
     181                        'rel'    => array(),
     182                    ),
     183                )
     184            );
     185        }
     186
     187        echo '</span>';
     188    }
     189}
    49190
    50191/*
  • atarim-visual-collaboration/trunk/readme.txt

    r3411268 r3411307  
    33Tags: collaboration, feedback, bug tracking, project management, website feedback
    44Requires at least: 5.0
    5 Tested up to: 6.8
    6 Stable tag: 4.2
     5Tested up to: 6.9
     6Stable tag: 4.2.1
    77Requires PHP: 7.4
    88License: GPLv3 or later
     
    370370
    371371== Changelog ==
     372
     373= 4.2.1 =
     374* **Heads up** - This version is preparing the plugin for a major release on the next version: bringing deep AI collaboration to the plugin and fixing security concerns.
     375
    372376
    373377= 4.2 =
Note: See TracChangeset for help on using the changeset viewer.