Files
wp-plugin-starter-template-…/includes/class-plugin.php
marcusquinn 67c6c65611 Fix camelCase naming and superglobal access issues
- Renamed methods to follow camelCase convention (initialize_hooks -> initializeHooks, enqueue_admin_assets -> enqueueAdminAssets)
- Renamed variables to follow camelCase convention (plugin_version -> pluginVersion)
- Replaced direct  superglobal access with filter_input() for better security
- Simplified commented-out code with a clear TODO comment
2025-04-21 15:14:15 +01:00

65 lines
1.1 KiB
PHP

<?php
/**
* Main plugin class
*
* @package WPALLSTARS\PluginStarterTemplate
*/
namespace WPALLSTARS\PluginStarterTemplate;
use WPALLSTARS\PluginStarterTemplate\Admin\Admin;
/**
* Plugin class
*/
class Plugin {
/**
* Core instance
*
* @var Core
*/
private $core;
/**
* Admin instance
*
* @var Admin
*/
private $admin;
/**
* Plugin file path
*
* @var string
*/
private string $pluginFile;
/**
* Plugin version
*
* @var string
*/
private $version;
/**
* Constructor
*
* @param string $plugin_file Main plugin file path.
* @param string $version Plugin version.
*/
public function __construct( string $pluginFile, string $version ) {
$this->pluginFile = $pluginFile;
$this->version = $version;
$this->core = new Core( $version );
$this->admin = new Admin( $this->core );
}
/**
* Initialize the plugin
*/
public function init() {
// Initialization logic goes here.
}
}