Skip to content

[6.1] Lazyload all plugins except compat plugin#46862

Merged
tecpromotion merged 5 commits intojoomla:6.1-devfrom
HLeithner:6.1/feature/lazy-load-plugins
Feb 13, 2026
Merged

[6.1] Lazyload all plugins except compat plugin#46862
tecpromotion merged 5 commits intojoomla:6.1-devfrom
HLeithner:6.1/feature/lazy-load-plugins

Conversation

@HLeithner
Copy link
Member

Based on the Pull Request #45062 .

Summary of Changes

Add lazy loading to all plugins

Testing Instructions

Test if joomla still works, every situation where a plugin is in the game.

It's unlikely that all cases can be tested. Deeper testing will likely be done in beta1 to rc1.

Also code review should be done.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Still works, with less memory usage and less cpu cycles (fast).

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@HLeithner HLeithner changed the title [6.1] Lazyload all plugins expect combat plugin [6.1] Lazyload all plugins except combat plugin Feb 9, 2026
@tecpromotion tecpromotion changed the title [6.1] Lazyload all plugins except combat plugin [6.1] Lazyload all plugins except compat plugin Feb 10, 2026
@lemuelvdm
Copy link

I have tested this item ✅ successfully on c11d811

Tested these changes on a Joomla 6.1.0-alpha3 system and all the plugins I tested still works as expected.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46862.

@HLeithner HLeithner marked this pull request as draft February 10, 2026 19:16
@HLeithner
Copy link
Member Author

I convert this to draft because there are some language autoloading issues.

@Fedik
Copy link
Member

Fedik commented Feb 10, 2026

You discovered a bug in com_scheduler.
The component should load translations from .sys.ini , in the same way as it don in Plugins component:

protected function translate(&$items)
{
$lang = Factory::getLanguage();
foreach ($items as &$item) {
$source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element;
$extension = 'plg_' . $item->folder . '_' . $item->element;
$lang->load($extension . '.sys', JPATH_ADMINISTRATOR)
|| $lang->load($extension . '.sys', $source);
$item->name = Text::_($item->name);
}
}

@HLeithner
Copy link
Member Author

depends if you see it a bug, actually the plugin is created and loads the language

@Fedik
Copy link
Member

Fedik commented Feb 10, 2026

Plugin should load only language that need for its runtime, nothing more.
That why we have .sys.ini

@Denitz
Copy link
Contributor

Denitz commented Feb 11, 2026

@HLeithner System Logout plugin destroys own cookie in constructor.

To be honest, I don't understand how this cookie can help with plugin behavior:

The system logout plugin enables Joomla to redirect the user to the home page if they choose to logout while they are on a protected access page.

This cookie is only destroyed and set in this plugin and seems like not used anywhere else in the code.

Won't the logic be broken if constructor execution is delayed?

@HLeithner
Copy link
Member Author

@HLeithner System Logout plugin destroys own cookie in constructor.

To be honest, I don't understand how this cookie can help with plugin behavior:

The system logout plugin enables Joomla to redirect the user to the home page if they choose to logout while they are on a protected access page.

This cookie is only destroyed and set in this plugin and seems like not used anywhere else in the code.

Won't the logic be broken if constructor execution is delayed?

I'm not sure what this cookie does... I remove lazyloading from the plugin for now.

the commit messages from the svn was "[#23208] Logout from edit screen gives 403"

earlier it registered an error handler for 403
image

I looked at the PR when JError has been removed.
In this pr the error handler has been remove and if I didn't overlooked something drives this plugin obsolete and can be removed.

@laoneo might remember if the functionality has been recreated somewhere else. (redirect logout users if they are in a protected area)

@brianteeman
Copy link
Contributor

is this relevant #43638

@HLeithner
Copy link
Member Author

HLeithner commented Feb 11, 2026

is this relevant #43638

yes

a Pull request for 7.0 would be good to remove this plugin

@laoneo
Copy link
Member

laoneo commented Feb 11, 2026

@HLeithner don't think so that the functionality has been recreated somewhere else about the error stuff. But not sure.

@Denitz
Copy link
Contributor

Denitz commented Feb 11, 2026

@HLeithner Just curious, did you measure the performance changes with this PR?

@HLeithner
Copy link
Member Author

didn't measured it yet, also performance might not be the main point, we reduce memory footprint, especially when languages are not loaded.

@HLeithner HLeithner marked this pull request as ready for review February 12, 2026 09:57
@tecpromotion tecpromotion added this to the Joomla! 6.1.0 milestone Feb 13, 2026
@tecpromotion tecpromotion merged commit 5ff0099 into joomla:6.1-dev Feb 13, 2026
51 checks passed
@HLeithner HLeithner deleted the 6.1/feature/lazy-load-plugins branch February 13, 2026 08:27
@tecpromotion
Copy link
Contributor

To get more testers and 3rd party devs can test this, we've merged this for the beta1 release.
Thanks @HLeithner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Comments