diff --git a/src/admin/class-admin.php b/src/admin/class-admin.php index 49ec24f..e81fdcd 100644 --- a/src/admin/class-admin.php +++ b/src/admin/class-admin.php @@ -90,14 +90,14 @@ class Admin { /** * The class responsible for WYSIWYG editor integration. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wysiwyg.php'; + require_once plugin_dir_path( __DIR__ ) . 'admin/class-wysiwyg.php'; $this->wysiwyg = new WYSIWYG( $this->plugin_name ); /** * The class responsible for constructing the plugin dashboard page(s). */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-init.php'; + require_once plugin_dir_path( __DIR__ ) . 'admin/layout/class-init.php'; new layout\Init( $this->plugin_name ); } diff --git a/src/admin/layout/class-engine.php b/src/admin/layout/class-engine.php index c03d6e1..ec6dff2 100644 --- a/src/admin/layout/class-engine.php +++ b/src/admin/layout/class-engine.php @@ -19,7 +19,7 @@ namespace footnotes\admin\layout; use footnotes\includes as Includes; -require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-init.php'; +require_once plugin_dir_path( __DIR__ ) . 'layout/class-init.php'; /** * Class to be extended by page layout sub-classes. diff --git a/src/admin/layout/class-init.php b/src/admin/layout/class-init.php index 5d8afb4..00a2b89 100644 --- a/src/admin/layout/class-init.php +++ b/src/admin/layout/class-init.php @@ -125,7 +125,7 @@ class Init { /** * Represents the plugin settings dashboard page. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-settings.php'; + require_once plugin_dir_path( __DIR__ ) . 'layout/class-settings.php'; } /** diff --git a/src/admin/layout/class-settings.php b/src/admin/layout/class-settings.php index 53ec42d..64f0010 100644 --- a/src/admin/layout/class-settings.php +++ b/src/admin/layout/class-settings.php @@ -23,7 +23,7 @@ use footnotes\general as General; /** * Provides the abstract class to be extended for page layouts. */ -require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-engine.php'; +require_once plugin_dir_path( __DIR__ ) . 'layout/class-engine.php'; /** * Class to initialise all defined page layouts. diff --git a/src/includes/class-core.php b/src/includes/class-core.php index 69a02a9..95f91d1 100644 --- a/src/includes/class-core.php +++ b/src/includes/class-core.php @@ -124,32 +124,32 @@ class Core { * The class responsible for orchestrating the actions and filters of the * core plugin. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-loader.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-loader.php'; /** * The class responsible for defining internationalization functionality * of the plugin. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-i18n.php'; /** * The various utility classes. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-template.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-settings.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-template.php'; /** * The class responsible for defining all actions that occur in the admin area. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php'; + require_once plugin_dir_path( __DIR__ ) . 'admin/class-admin.php'; /** * The class responsible for defining all actions that occur in the public-facing * side of the site. */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-general.php'; + require_once plugin_dir_path( __DIR__ ) . 'public/class-general.php'; $this->loader = new Loader(); diff --git a/src/includes/class-i18n.php b/src/includes/class-i18n.php index 626596b..af4275a 100644 --- a/src/includes/class-i18n.php +++ b/src/includes/class-i18n.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace footnotes\includes; -require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php'; +require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php'; /** * Class providing internationalization functionality. diff --git a/src/includes/class-settings.php b/src/includes/class-settings.php index 7a279fd..46fd25e 100644 --- a/src/includes/class-settings.php +++ b/src/includes/class-settings.php @@ -17,7 +17,7 @@ namespace footnotes\includes; * * @todo Move to {@see Loader}. */ -require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php'; +require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php'; /** * Class defining configurable plugin settings. diff --git a/src/includes/class-template.php b/src/includes/class-template.php index a05d810..bcba85c 100644 --- a/src/includes/class-template.php +++ b/src/includes/class-template.php @@ -91,7 +91,7 @@ class Template { return; } - $this->plugin_directory = plugin_dir_path( dirname( __FILE__ ) ); + $this->plugin_directory = plugin_dir_path( __DIR__ ); $template = $this->get_template( $p_str_file_type, $p_str_file_name, $p_str_extension ); if ( $template ) { diff --git a/src/public/class-parser.php b/src/public/class-parser.php index 194a4e7..3a536aa 100644 --- a/src/public/class-parser.php +++ b/src/public/class-parser.php @@ -268,10 +268,10 @@ class Parser { */ public function __construct() { // TODO: Reorg dependencies. - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php'; - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-template.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-settings.php'; + require_once plugin_dir_path( __DIR__ ) . 'includes/class-template.php'; // TODO: Move to `General`. $this->register_hooks();