Plugin Directory

Changeset 3257063


Ignore:
Timestamp:
03/17/2025 10:50:44 AM (13 months ago)
Author:
trackglobal
Message:

Added feedback form on deactivation

Location:
track-global/trunk
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • track-global/trunk/includes/class-track-global.php

    r3223426 r3257063  
    7373        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    7474        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
     75        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ) );
     76        add_action( 'admin_footer', array($this, 'prepare_deactivation_form') );
    7577    }
    7678
     
    8789    public function admin_enqueue_scripts( $hook = '' ) {
    8890        wp_register_script(
     91            $this->plugin_id . '-admin-feedback-form',
     92            esc_url( $this->assets_url ) . 'js/admin/feedback-form' . $this->script_suffix . '.js',
     93            array( 'jquery' ),
     94            $this->_version,
     95            true
     96        );
     97
     98        wp_register_script(
    8999            $this->plugin_id . '-admin-shortcode-builder',
    90100            esc_url( $this->assets_url ) . 'js/admin/shortcode-builder' . $this->script_suffix . '.js',
     
    94104        );
    95105    }
     106
     107    public function admin_enqueue_styles( $hook = '' ) {
     108        wp_register_style(
     109            $this->plugin_id . '-admin-feedback-form',
     110            esc_url( $this->assets_url ) . 'css/admin/feedback-form.css',
     111            array(),
     112            $this->_version
     113        );
     114    }
     115
     116    public function prepare_deactivation_form() {
     117        $screen = get_current_screen();
     118
     119        if ( $screen && ($screen->id === 'plugins') ) {
     120            wp_enqueue_style( $this->plugin_id . '-admin-feedback-form' );
     121            wp_enqueue_script( $this->plugin_id . '-admin-feedback-form' );
     122            $plugin_id = $this->plugin_id;
     123            $version = $this->_version;
     124            $website = get_site_url();
     125            $date = gmdate('Y-m-d');
     126            $feedback_url = 'https://api.track.global/wp-statistic';
     127            $feedback_token = 'cf93c521595df2db2c9a2bea74662d5d354c88fd5b31c5fdc34beab99e170517';
     128
     129            Track_Global::view('admin/feedback-form', compact('plugin_id', 'version', 'website', 'date', 'feedback_url', 'feedback_token'));
     130        }
     131    }
    96132
    97133    /**
  • track-global/trunk/readme.txt

    r3234058 r3257063  
    3232== Changelog ==
    3333
     34= 1.0.3 =
     35* 2025-03-17
     36* Added feedback form on deactivation.
     37
    3438= 1.0.2 =
    3539* 2025-02-03
  • track-global/trunk/track-global.php

    r3234030 r3257063  
    55 * Plugin URI: https://track.global
    66 * Description: Parcel tracking widget for your website.
    7  * Version: 1.0.2
     7 * Version: 1.0.3
    88 * Requires at least: 5.8
    99 * Requires PHP: 7.4
     
    1616}
    1717
    18 define( 'TRACK_GLOBAL_VERSION', '1.0.1' );
     18define( 'TRACK_GLOBAL_VERSION', '1.0.3' );
    1919define( 'TRACK_GLOBAL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2020
Note: See TracChangeset for help on using the changeset viewer.