diff --git a/includes/class-plugin.php b/includes/class-plugin.php index 39a7b51..5892269 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -60,7 +60,7 @@ class Plugin { */ public function init(): void { // Register hooks and filters. - add_action('plugins_loaded', array($this, 'load_textdomain')); + add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); // Initialize any other plugin functionality. } @@ -74,7 +74,25 @@ class Plugin { load_plugin_textdomain( 'wp-plugin-starter-template', false, - dirname(plugin_basename($this->pluginFile)) . '/languages/' + dirname( plugin_basename( $this->pluginFile ) ) . '/languages/' ); } + + /** + * Get the plugin version. + * + * @return string The plugin version. + */ + public function get_version(): string { + return $this->version; + } + + /** + * Get the admin instance. + * + * @return Admin The admin instance. + */ + public function get_admin(): Admin { + return $this->admin; + } } diff --git a/mu-plugins/multisite-setup.php b/mu-plugins/multisite-setup.php index 393b5b7..e72c37a 100644 --- a/mu-plugins/multisite-setup.php +++ b/mu-plugins/multisite-setup.php @@ -5,6 +5,8 @@ * Version: 1.0.0 * Author: WPALLSTARS * License: GPL-2.0-or-later + * + * @package WPPluginStarterTemplate */ // Exit if accessed directly. diff --git a/phpstan.neon b/phpstan.neon index 6159714..a885882 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,14 @@ parameters: - admin - wp-plugin-starter-template.php excludePaths: - paths: + analyse: + - vendor + - node_modules + - tests + - bin + - build + - dist + analyseAndScan: - vendor - node_modules - tests diff --git a/wp-plugin-starter-template.php b/wp-plugin-starter-template.php index 66c63b0..fd3fcae 100644 --- a/wp-plugin-starter-template.php +++ b/wp-plugin-starter-template.php @@ -31,7 +31,7 @@ if ( ! defined( 'WPINC' ) ) { die; } -// Define plugin constants +// Define plugin constants. define( 'WP_PLUGIN_STARTER_TEMPLATE_FILE', __FILE__ ); define( 'WP_PLUGIN_STARTER_TEMPLATE_PATH', plugin_dir_path( __FILE__ ) ); define( 'WP_PLUGIN_STARTER_TEMPLATE_URL', plugin_dir_url( __FILE__ ) ); @@ -40,8 +40,8 @@ define( 'WP_PLUGIN_STARTER_TEMPLATE_VERSION', '0.1.13' ); // Load the main plugin class. require_once WP_PLUGIN_STARTER_TEMPLATE_PATH . 'includes/class-plugin.php'; -// Plugin is multisite compatible - see .wiki/Testing-Framework.md for testing instructions -// For multisite-specific functionality, see the includes/Multisite directory +// Plugin is multisite compatible - see .wiki/Testing-Framework.md for testing instructions. +// For multisite-specific functionality, see the includes/Multisite directory. // Initialize the plugin and store the instance in a global variable. $wpst_plugin = new WPALLSTARS\PluginStarterTemplate\Plugin( __FILE__, WP_PLUGIN_STARTER_TEMPLATE_VERSION );