diff --git a/classes/plugin-template-factory.php b/classes/plugin-template-factory.php index 8b6a9d8df26161baa109c23421b3c15235c3ef69..6e97b07170584223888419f729d73883fd006820 100644 --- a/classes/plugin-template-factory.php +++ b/classes/plugin-template-factory.php @@ -18,7 +18,7 @@ final class WPDesk_Plugin_Template_Factory implements WPDesk_Plugin_Factory_1_10 $wpdesk_plugin_template_plugin_data = array( 'plugin' => plugin_basename( __FILE__ ), 'product_id' => 'WP Desk Plugin Template', - 'version' => '1.0', + 'version' => PLUGIN_TEMPLATE_VERSION, 'config_uri' => admin_url( 'edit.php?post_type=inspire_invoice&page=plugin_template' ) ); diff --git a/plugin-template.php b/plugin-template.php index 89d060fa7fa052e40b9d1013fe9b3d4b3ef6885b..3ab434bef8406beb2d312fd9dc3900b550b868b8 100644 --- a/plugin-template.php +++ b/plugin-template.php @@ -33,6 +33,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly +$plugin_version = '1.0'; + +define( 'PLUGIN_TEMPLATE_VERSION', $plugin_version ); + require_once( dirname( __FILE__ ) . '/classes/wpdesk/class-requirement-checker.php' ); $requirements_checker = new WPDesk_Requirement_Checker_1_10( diff --git a/tests/unit/wpdesk/test-plugin-template-factory.php b/tests/unit/wpdesk/test-plugin-template-factory.php index 2ab9028104427d082d8cdcce74012577f78ca0dd..9d154d010996bd71c7e6d3d02688246debb6b577 100644 --- a/tests/unit/wpdesk/test-plugin-template-factory.php +++ b/tests/unit/wpdesk/test-plugin-template-factory.php @@ -32,6 +32,9 @@ class Test_WPDesk_Plugin_Template_Factory extends TestCase { 'return_arg' => 0 ] ); + $plugin_version = '1.0'; + define( 'PLUGIN_TEMPLATE_VERSION', $plugin_version ); + $factory = new WPDesk_Plugin_Template_Factory(); $this->assertInstanceOf( WPDesk_Plugin_Template_Plugin::class, $factory::build_plugin() ); }