Plugin Directory

Changeset 3250104


Ignore:
Timestamp:
03/04/2025 07:38:33 AM (13 months ago)
Author:
Marcel-NL
Message:

V.1.0.1 Show an error message if you want to install this plugin, but Woocommerce is not installed

Location:
rtdashboards/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtdashboards/trunk/readme.txt

    r3246600 r3250104  
    44Requires at least: 6.7
    55Tested up to: 6.7
    6 Stable tag: 1.0
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4545== Changelog ==
    4646
     47* v.1.0.1 Show an error message if you want to install this plugin, but Woocommerce is not installed
    4748* v.1.0 First release
  • rtdashboards/trunk/rtdashboards.php

    r3246600 r3250104  
    55 * Description: Lightweight plugin to send orders to rtdashboards.com
    66 * Author: Marcel van Doornen
    7  * Version: 1.0
     7 * Version: 1.0.1
    88 * Author URI: https://webbouwplus.nl
    99 * License: GPL2+
     
    184184    rtdashboards_run();
    185185}
     186else {
     187    // WooCommerce is not active, show an error message.
     188    if (is_admin()) {
     189        add_action('admin_notices', 'rtdashboards_error_notice');
     190    }
     191
     192    deactivate_plugins(plugin_basename(__FILE__));
     193    return; // Terminate and do not load further script.
     194}
     195
     196function rtdashboards_error_notice() {
     197    ?>
     198    <div class="error">
     199        <p><?php _e('Your plugin has been deactivated because it requires WooCommerce to function.', 'rtdashboards'); ?></p>
     200    </div>
     201    <?php
     202}
Note: See TracChangeset for help on using the changeset viewer.