Plugin Directory

Changeset 3194824


Ignore:
Timestamp:
11/22/2024 10:12:14 AM (16 months ago)
Author:
melioze
Message:

1.4.1 - Fix : Resolved an issue where the banner notification was displayed on unintended admin pages.

Location:
my-easy-compta
Files:
1592 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • my-easy-compta/trunk/includes/Modules/App.php

    r3190628 r3194824  
    1313        add_action('admin_menu', array($this, 'add_admin_menu'));
    1414        add_action('admin_notices', array($this, 'my_easy_compta_admin_notification'));
    15         add_action('admin_footer', array($this, 'my_easy_compta_admin_notification_script'));
    1615        add_action('wp_ajax_my_easy_compta_admin_notification_hide', array($this, 'my_easy_compta_admin_notification_hide'));
    1716        add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
     
    7069        wp_enqueue_style('fontawesome', ECWP_URL . '/assets/css/all.min.css', array(), ECWP_VERSION);
    7170        wp_enqueue_script('my-easy-compta-admin', ECWP_URL . '/assets/dist/app.min.js', array(), ECWP_VERSION, true);
    72         wp_enqueue_script('my-easy-compta-custom', ECWP_URL . '/assets/js/custom.js', array(), ECWP_VERSION, true);
     71        wp_enqueue_script('my-easy-compta-custom', ECWP_URL . '/assets/js/notif-ads.js', array(), ECWP_VERSION, true);
    7372        wp_enqueue_script('chartjs', ECWP_URL . '/assets/js/chart.min.js', array(), ECWP_VERSION, true);
    7473        add_filter('script_loader_tag', array($this, 'add_type_attribute'), 10, 2);
     
    452451    public function my_easy_compta_admin_notification()
    453452    {
     453        $allowed_pages = array(
     454            'toplevel_page_my-easy-compta',
     455            'myeasycompta_page_my-easy-compta-clients',
     456            'myeasycompta_page_my-easy-compta-quotes',
     457            'myeasycompta_page_my-easy-compta-invoices',
     458            'myeasycompta_page_my-easy-compta-planning',
     459            'myeasycompta_page_my-easy-compta-credits',
     460            'myeasycompta_page_my-easy-compta-payments',
     461            'myeasycompta_page_my-easy-compta-expenses',
     462            'myeasycompta_page_my-easy-compta-settings',
     463            'myeasycompta_page_my-easy-compta-addons',
     464            'dashboard_page_my-easy-compta-setup',
     465        );
     466
     467        $current_screen = get_current_screen();
     468
     469        if (!in_array($current_screen->id, $allowed_pages)) {
     470            return;
     471        }
     472
    454473        if (get_user_meta(get_current_user_id(), 'my_easy_compta_banner_dismissed', true)) {
    455474            return;
    456475        }
     476
    457477        if (isset($_COOKIE['my_easy_compta_banner_closed'])) {
    458478            return;
     
    492512        wp_die();
    493513    }
    494     public function my_easy_compta_admin_notification_script()
    495     {
    496         ?>
    497     <script>
    498     (function($) {
    499         $(document).ready(function() {
    500             $('.my-easy-compta-banner-close').on('click', function() {
    501                 var banner = $(this).closest('.my-easy-compta-banner-container');
    502                 banner.fadeOut('slow', function() {
    503                     document.cookie = "my_easy_compta_banner_closed=1; path=/";
    504                 });
    505             });
    506 
    507             $('.my-easy-compta-banner-never-show').on('click', function() {
    508                 var banner = $(this).closest('.my-easy-compta-banner-container');
    509                 banner.fadeOut('slow', function() {
    510                     $.post(ajaxurl, { action: 'my_easy_compta_admin_notification_hide', never_show: true });
    511                 });
    512             });
    513         });
    514 
    515         function getCookie(name) {
    516             var value = "; " + document.cookie;
    517             var parts = value.split("; " + name + "=");
    518             if (parts.length === 2) return parts.pop().split(";").shift();
    519         }
    520 
    521         if (getCookie('my_easy_compta_banner_closed')) {
    522             $('.my-easy-compta-banner-banner').hide();
    523         }
    524     })(jQuery);
    525     </script>
    526     <?php
     514
    527515}
    528 
    529 }
  • my-easy-compta/trunk/my-easy-compta.php

    r3190628 r3194824  
    33 * Plugin Name: myEasyCompta
    44 * Description: Streamline your financial management with myEasyCompta, an all-in-one accounting plugin. Effortlessly handle quotes, invoices, expenses, and more, all within a sleek, user-friendly interface. Perfect for freelancers and small businesses looking to simplify their accounting processes.
    5  * Version: 1.4.0
     5 * Version: 1.4.1
    66 * Author: MELIOZ.dev
    77 * Author URI: https://myeasycompta.com
     
    2222 *
    2323 * @package myEasyCompta
    24  * @since 1.4.0
     24 * @since 1.4.1
    2525 */
    2626
     
    3737     * @var string
    3838     */
    39     public $version = '1.4.0';
    40     private $version_migration_db = true;
     39    public $version = '1.4.1';
     40    private $version_migration_db = false;
    4141
    4242    /**
  • my-easy-compta/trunk/readme.txt

    r3190628 r3194824  
    44Tested up to: 6.6.1
    55Requires PHP: 8.0
    6 Stable tag: 1.4.0
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    8080== Changelog ==
    8181
     82= 1.4.1 =
     83* Fix: Resolved an issue where the banner notification was displayed on unintended admin pages.
     84
    8285= 1.4.0 =
    8386* Add: Loader during auto-completion in quotes and invoices.
Note: See TracChangeset for help on using the changeset viewer.