| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: Faktur Pro |
| 5 |
* Plugin URI: https://www.faktur.pro/ |
| 6 |
* Description: Adds invoice creation functionality to WooCommerce. |
| 7 |
* Version: 3.1.22 |
| 8 |
* Stable tag: 3.1.22 |
| 9 |
* Author: Zweischneider GmbH & Co. KG |
| 10 |
* Author URI: https://www.zweischneider.de |
| 11 |
* |
| 12 |
* Text Domain: fakturpro |
| 13 |
* Domain Path: /languages |
| 14 |
* |
| 15 |
* Requires Plugins: woocommerce |
| 16 |
* Requires at least: 3.0.0 |
| 17 |
* Tested up to: 7.0 |
| 18 |
* Tested PHP up to: 8.5 |
| 19 |
* WC requires at least: 3.2.0 |
| 20 |
* WC tested up to: 10.9.4 |
| 21 |
* |
| 22 |
* @package FakturPro |
| 23 |
* @category Core |
| 24 |
* @author ZWEISCHNEIDER |
| 25 |
*/ |
| 26 |
|
| 27 |
// Exit if accessed directly |
| 28 |
if ( !defined ( 'ABSPATH' ) ) { |
| 29 |
exit; |
| 30 |
} |
| 31 |
|
| 32 |
add_action( 'before_woocommerce_init', function() { |
| 33 |
if ( class_exists( 'Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { |
| 34 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 35 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'product_block_editor', __FILE__, true ); |
| 36 |
} |
| 37 |
} ); |
| 38 |
|
| 39 |
// Get the name of this file in filsystem |
| 40 |
// Get the root path of this plugin in filesystem |
| 41 |
// Get the base URL of this plugin on the server |
| 42 |
$plugin_file = __FILE__; |
| 43 |
$plugin_path = plugin_dir_path( $plugin_file ); |
| 44 |
$plugin_url = plugins_url( '', $plugin_file ); |
| 45 |
|
| 46 |
$custom_config_path = $plugin_path . 'config-path.php'; |
| 47 |
$plugin_config = $plugin_path . 'config/config.php'; |
| 48 |
|
| 49 |
// Require all classes the plugin consists of |
| 50 |
// Include the configuration file for the plugin |
| 51 |
require_once ( |
| 52 |
file_exists( $custom_config_path ) |
| 53 |
&& !empty( include( $custom_config_path ) ) |
| 54 |
&& file_exists( include( $custom_config_path ) ) |
| 55 |
? include( $custom_config_path ) |
| 56 |
: $plugin_config |
| 57 |
); |
| 58 |
require_once ( $plugin_path . 'includes.php' ); |
| 59 |
|
| 60 |
// Create a new instance of the plugin class |
| 61 |
// Run the plugin and register all hooks within WordPress |
| 62 |
$plugin = new FP_Plugin( $plugin_file, $plugin_path, $plugin_url ); |
| 63 |
$plugin->run_plugin(); |
| 64 |
|
| 65 |
// Make the plugin instance global |
| 66 |
$GLOBALS['fakturpro'] = $plugin; |
| 67 |
|
| 68 |
/** |
| 69 |
* Faktur pro global plugin function. |
| 70 |
* |
| 71 |
* @return FP_Plugin |
| 72 |
*/ |
| 73 |
function fakturpro() { |
| 74 |
return $GLOBALS['fakturpro']; |
| 75 |
} |
| 76 |
|