? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
15 Apr 2021

Steps to reproduce the issue

Joomla 4 asks for stats collection after installation.

A user can answer with a click on "NEVER" or "once" button

However this just sets a flag in the params of the plugin, it doesn't actually unpublish the plugin

Expected result

The plugin is then disabled on clicking NEVER/ONCE, so that it doesn't take up any processing time/power/cpu/ms on page load ever again to ensure Joomla remains running a peak performance but the user has the option to reenable the plugin at any time

To test:

install joomla 4
login to admin and ignore the stats message
navigate the plugins screen and search for stats
you can now see the stats message and the status of the stats plugin
click NEVER or once, the page reloads and the message has gone away and you can see instantly that the plugin has been disabled also

Actual result

The PlgSystemStats plugin loads on every page load, runs some checks, takes some time, and in the end doesn't even send stats because we have said never.

There are 7 different if statements run in onAfterInitialise/onAfterDispatch, several of these have 2 conditions to check, objects to retrieve etc...

Retrieving the params from the database is an extra db query that's not needed if NEVER is selected.

avatar PhilETaylor PhilETaylor - open - 15 Apr 2021
avatar PhilETaylor PhilETaylor - change - 15 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2021
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 15 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 15 Apr 2021
avatar PhilETaylor PhilETaylor - change - 15 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 15 Apr 2021
avatar dgrammatiko
dgrammatiko - comment - 16 Apr 2021

@PhilETaylor this is a nice one. Could we abstract the unpublish logic to a trait/helper/something.else? The reason I'm asking this is that the same exact pattern should be applied to the sampledata plugins (once the data is successfully installed the plugin module should be unpublished/disabled automatically, it throws an error message if you try to run it again)

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

Cant really be abstracted much further, but the concept to speed up Joomla could be used for sure.

avatar richard67
richard67 - comment - 16 Apr 2021

The reason I'm asking this is that the same exact pattern should be applied to the sampledata plugins (once the data is successfully installed the plugin module should be unpublished/disabled automatically, it throws an error message if you try to run it again)

@dgrammatiko That's not 100% true. The Blog Sample Data can be installed multiple times when having multiple languages in backend, one time for each language. So at least that one should not be unpublished or disabled after installation.

@PhilETaylor Sorry for that off-topic comment, but I had to correct the above statement.

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

@dgrammatiko That's not 100% true. The Blog Sample Data can be installed multiple times when having multiple languages in backend, one time for each language. So at least that one should not be unpublished or disabled after installation.

You could just republish the module/plugins and run them again :)

avatar dgrammatiko
dgrammatiko - comment - 16 Apr 2021

The Blog Sample Data can be installed multiple times when having multiple languages in backend

If you need to run multiple times (one per language) the sampledata then this is a huge UX fail. The plugin should check the installed languages and do that automatically...

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

hold the comments :) I have a PR about to push and you can chat there, instead of off railing this PR :) :)

avatar dgrammatiko
dgrammatiko - comment - 16 Apr 2021

instead of off railing this PR

oops sorry

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

Please see: #33165

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

For those reading, this PR is still on track and should be tested as normal please :)

avatar Quy Quy - test_item - 16 Apr 2021 - Tested successfully
avatar Quy
Quy - comment - 16 Apr 2021

I have tested this item successfully on 81893f4


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

avatar alikon alikon - test_item - 16 Apr 2021 - Tested successfully
avatar alikon
alikon - comment - 16 Apr 2021

I have tested this item successfully on 81893f4


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

avatar alikon alikon - change - 16 Apr 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 16 Apr 2021

RTC


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

avatar PhilETaylor
PhilETaylor - comment - 16 Apr 2021

Thanks for testing

avatar Quy Quy - change - 16 Apr 2021
Labels Added: ?
avatar rdeutz rdeutz - change - 17 Apr 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-04-17 09:49:52
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 17 Apr 2021
avatar rdeutz rdeutz - merge - 17 Apr 2021

Add a Comment

Login with GitHub to post a comment