You are overthinking this. The namespace structure applies at the level of individual package. There is no need or push to treat the whole site as such package.
Also one of the benefits of using autoload in first place is that it makes location of classes in file system largely irrelevant.
So the simple and practical approach is to:
- Handle namespaces at individual package (plugin/theme) level.
- Use PSR-4 support in Composer for simple directory structure inside packages, without excessive folder levels.
Related Posts:
- Why include a composer.json file with my plugin?
- Autoloading in Child Theme
- Customize default settings on new sites on multisite
- Does wordpress allow me to add a php file to the root directory to execute custom scripts?
- Use composer to load custom classes [closed]
- What’s the proper way to use wp_enqueue_script/style?
- How to send user data in json format to another server when user register on wordpress site in PHP
- Change the actual (or viewable) WordPress directory structure
- Accessing site’s root from themes folder
- Custom location for attached images
- Using a `Template Parts` folder instead of an `Includes` folder in a Custom WordPress Theme
- Using WordPress gettext functions in a library outside plugin or theme scope
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Correct folder permissions?
- subdirectory index.php is not working
- Accessing an image folder inside public web directory
- Noscript not working as it should in wordpress site
- Code Executing Too Late?
- PHP in CSS file?
- Plugin development and composer
- How can I search all plugins for composer’s vendor/autoload.php?
- Composer setup-config.php not found
- Using the get_template_part method within an mu-plugin not possible?
- New user – Create a folder
- Autoloading Classes in Plugins
- How to override html codes in wordpress?
- How do I prevent a folder from reappearing in my home directory?
- Resource 404 error on multisite subdirectory install
- Changes in header.php not reflecting
- Removing get_template_part in child theme
- Permission functions within wordpress
- WP white screen of death after duping a site that works fine on same server
- Correct Syntax for uploading files to custom directory in WordPress
- Can I have a php site on subdirectory of WordPress?
- How to add a php package to an existing wordpress website
- Setting $_SERVER[‘HTTPS’]=’on’ prevents access to wp-admin
- Check if a menu is empty?
- Add a wp editor to custom plugin and save data
- How to display content from post_parent
- Second select list values are not saved after clicking update
- Use wc_enqueue_js only on specific pages – nested add_action
- Removing unnecessary wordpress files
- WordPress 3 – how are passwords stored and how do I compare to them?
- Use is_product_category() properly
- Double or Single Quotes in WordPress Content Conflicting With HTML
- How can i display post loop in table format?
- list posts and wrap them alphabetically A-Z
- Link to the parent post in attachment page
- Convert all images to PNG on file upload
- WordPress 5 WP REST routes – No errors
- Using fwrite() and “a” appends multiple times instead of once
- Add prefix to link url
- Selectbox in admin panel function linking to CSS
- wordpress allow user to edit user profile with custom fields
- Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
- WordPress admin dashboard missing icons
- Which field should I edit to make the checkbox marked by default?
- Add filter when image is uploaded?
- How can I save unique user data on my site? [closed]
- Add New User, extra fields which are required?
- Keyword checking in Gravity Forms
- Get URL Parameters from referer
- Using custom tables for old posts
- Adding logo to WordPress header
- add_filter only for front office
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Form Submission Not Working In Custom Theme
- Show metabox only for homepage
- Concatenate Custom Field Value & HTML Value
- How do I properly code my footer? See example
- Use of IF statement in Header file
- apply_filters with several different values?
- Advanced Query posts
- Triggering a timewall after X days
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- echo cutom css code to WordPress page template file ? is this safe?
- PHP `iconv` not working inside a WordPress site
- How to make a “page-option” in WordPress
- Replacing entire tag with shortcode – JavaScript [duplicate]
- How do I visualize the author’s post from the front end?
- How to add a full working piece of website already coded, to a large scale Website design project?
- Query to show average # of months all accounts with specific role have been active
- Use PHP to inject HTML into before page renders?
- Query doesn’t display text data with apostrophes
- WooCommerce Custom Tab with ACF Repeater Field
- My WP Website Shows HTTP ERROR 500
- add menu page in loop menu order
- soap request in wordpress for a fedex pickup request [closed]
- Dynamically Create Posts Via XML File
- pages disable after wordpress update
- How to only fetch certain Tag ID’s
- Create server side text from wordpress page
- How to set a cookie based on a page Get variable?
- Editing the contents of just one div on a page from wordpress
- How to change the menu color
- Display latest 5 posts on homepage
- How do I do so that people can register on my wordpress site?
- Custom taxonomy pagination shows 404
- duplicating page templates
- Upload multiple files via ajax from an HTML file input