Skip to content

fix(autoload): Correct autoloader pathing (#3) and unbundle free version#4

Merged
mavrokordato merged 1 commit intowordpress-premium:masterfrom
drzraf:fix-autoloader
Oct 10, 2025
Merged

fix(autoload): Correct autoloader pathing (#3) and unbundle free version#4
mavrokordato merged 1 commit intowordpress-premium:masterfrom
drzraf:fix-autoloader

Conversation

@drzraf
Copy link
Copy Markdown

@drzraf drzraf commented Oct 10, 2025

  • fix the broken autoloader (fix the broken autoloader #3) regarding acf/ vs ACF/ directories
  • unbundle the free version from the repository
  • use upstream Polylang free plugin version to generate the classmap
  • ... and redump the autoloader

Setup:

  • install the free version of the plugin
  • then this one
  • For a futureproof maintenance free setup for Bedrock/composer WP installation, polylang (free) should come too with an adequate composer.json autoload configuration

- fix the broken autoloader (wordpress-premium#3) regarding acf/ vs ACF/ directories
- unbundle the free version from the repository
- use upstream Polylang free plugin version to generate the classmap
- ... and redump the autoloader

Setup:
- install the free version of the plugin
- then this one
- For a futureproof maintenance free setup for Bedrock/composer WP installation,
  polylang (free) should come too with an adequate composer.json autoload configuration
@mavrokordato
Copy link
Copy Markdown
Contributor

Many thanks for this, @drzraf. I'll have an eye on future releases.

@mavrokordato mavrokordato merged commit b60d362 into wordpress-premium:master Oct 10, 2025
1 check passed
@thaikolja thaikolja changed the title fix broken autoloader (#3) fix(autoload): Correct autoloader pathing (#3) and unbundle free version Oct 10, 2025
@thaikolja thaikolja assigned thaikolja and mavrokordato and unassigned thaikolja Oct 10, 2025
@thaikolja thaikolja added the bug Something isn't working label Oct 10, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes autoloader pathing issues and removes the bundled free version of Polylang in favor of using the upstream version. The changes address issue #3 related to ACF directory case sensitivity and improve the plugin's dependency management.

  • Removed the bundled free version and its direct require statement
  • Added classmap autoloading configuration to include both local directories and the upstream Polylang plugin
  • Configured the setup to work with the free version installed separately

Reviewed Changes

Copilot reviewed 2 out of 475 changed files in this pull request and generated 1 comment.

File Description
polylang.php Removes direct require of bundled Polylang free version
composer.json Adds classmap autoloading for local directories and upstream Polylang

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread composer.json
"localization"
],
"autoload": {
"classmap": ["include/", "integrations/", "modules/", "services/", "../polylang"]
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relative path '../polylang' in the classmap is fragile and assumes a specific directory structure. Consider using a more robust approach like requiring polylang as a composer dependency or documenting the expected directory layout clearly.

Suggested change
"classmap": ["include/", "integrations/", "modules/", "services/", "../polylang"]
"classmap": ["include/", "integrations/", "modules/", "services/"]

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

@drzraf drzraf Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two scenarios:

  • WP zip install
  • composer installation

zip install doesn't depends upon composer install / autoload etc... => out of scope.

Regarding the composer install, the underlying problem is that -pro version depends on classes defined by the free version, aka the free-version autoloader must load before the -pro version which is more about WordPress plugin load order.
Normally it's not a problem because the free and the -pro version would be installed as packages and the same root-level autoloader would be used.

The above is only when doing composer install within polylang-pro directory which is probably not the most common case.

That being said, if PolyLang-free isn't installed, the fact that the -pro version autoloader can't find ../polylang is just another symptom of the same underlying problem which would happen anyway.

@thaikolja thaikolja added the good first issue Good for newcomers label Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants