| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Orderable - Local Ordering System |
| 4 | 4 | * Author URI: https://orderable.com |
| 5 | 5 | * Description: Take local online ordering to a whole new level with Orderable. |
| 6 | - * Version: 1.2.0 | |
| 6 | + * Version: 0.2.0 | |
| 7 | 7 | * Author: Orderable |
| 8 | 8 | * Text Domain: orderable |
| 9 | 9 | * WC requires at least: 5.4.0 |
| 10 | - * WC tested up to: 6.1.1 | |
| 10 | + * WC tested up to: 5.7.1 | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | defined( 'ABSPATH' ) || exit; |
| 14 | 14 | |
| @@ -18,14 +18,14 @@ | ||
| 18 | 18 | class Orderable { |
| 19 | 19 | /** |
| 20 | 20 | * @var string Plugin version. |
| 21 | 21 | */ |
| 22 | - public static $version = '1.2.0'; | |
| 22 | + public static $version = '0.2.0'; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @var string Required pro version. |
| 26 | 26 | */ |
| 27 | - public static $required_pro_version = '1.2.0'; | |
| 27 | + public static $required_pro_version = '0.2.0'; | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Construct the plugin. |
| 31 | 31 | */ |
| @@ -33,11 +33,8 @@ | ||
| 33 | 33 | $this->define_constants(); |
| 34 | 34 | |
| 35 | 35 | add_action( 'init', array( $this, 'load_textdomain' ), 0 ); |
| 36 | 36 | add_action( 'plugins_loaded', array( $this, 'run' ), 20 ); |
| 37 | - | |
| 38 | - // Redirect to settings page on activate. | |
| 39 | - add_action( 'activated_plugin', array( $this, 'activate' ), 20 ); | |
| 40 | 37 | } |
| 41 | 38 | |
| 42 | 39 | /** |
| 43 | 40 | * Load Textdomain. |
| @@ -49,13 +46,12 @@ | ||
| 49 | 46 | /** |
| 50 | 47 | * Run. |
| 51 | 48 | */ |
| 52 | 49 | public function run() { |
| 53 | - if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', (array) get_option( 'active_plugins' ) ), true ) | |
| 54 | - && ! in_array( 'woocommerce/woocommerce.php', array_keys( (array) get_site_option( 'active_sitewide_plugins' ), true ) ) ) { | |
| 50 | + if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) | |
| 51 | + && ! in_array( 'woocommerce/woocommerce.php', array_keys( get_site_option( 'active_sitewide_plugins' ), true ) ) ) { | |
| 55 | 52 | add_action( 'admin_notices', array( __CLASS__, 'orderable_notice_woocommerce' ) ); |
| 56 | 53 | |
| 57 | - // If Woo is not active, don't run Orderable. | |
| 58 | 54 | return; |
| 59 | 55 | } |
| 60 | 56 | |
| 61 | 57 | $this->load_classes(); |
| @@ -69,24 +65,8 @@ | ||
| 69 | 65 | |
| 70 | 66 | do_action( 'orderable_init' ); |
| 71 | 67 | } |
| 72 | 68 | |
| 73 | - public function activate( $plugin ) { | |
| 74 | - $checked = isset( $_REQUEST['checked'] ) ? $_REQUEST['checked'] : []; | |
| 75 | - | |
| 76 | - // Ensure we are not doing a bulk activation. | |
| 77 | - if ( is_array( $checked ) && count( $checked ) > 1 ) { | |
| 78 | - return; | |
| 79 | - } | |
| 80 | - | |
| 81 | - if ( ORDERABLE_BASENAME !== $plugin ) { | |
| 82 | - return; | |
| 83 | - } | |
| 84 | - | |
| 85 | - wp_redirect( admin_url( 'admin.php?page=orderable-settings' ) ); | |
| 86 | - exit; | |
| 87 | - } | |
| 88 | - | |
| 89 | 69 | /** |
| 90 | 70 | * Run script sif plugin version has changed. |
| 91 | 71 | */ |
| 92 | 72 | private function update_check() { |
| @@ -165,9 +145,8 @@ | ||
| 165 | 145 | require_once ORDERABLE_INC_PATH . 'class-products.php'; |
| 166 | 146 | require_once ORDERABLE_INC_PATH . 'class-ajax.php'; |
| 167 | 147 | require_once ORDERABLE_INC_PATH . 'class-orders.php'; |
| 168 | 148 | require_once ORDERABLE_INC_PATH . 'class-admin-notices.php'; |
| 169 | - require_once ORDERABLE_INC_PATH . 'class-webhooks.php'; | |
| 170 | 149 | |
| 171 | 150 | Orderable_Settings::run(); |
| 172 | 151 | Orderable_Assets::run(); |
| 173 | 152 | Orderable_Modules::run(); |