Feature Language Change PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar pe7er
pe7er
11 Aug 2024

Summary of Changes

This is PR creates mod_redirect, a new Admin Module that displays "Redirects: Links", the links that are displayed in the "Redirects" component.

Example output:
dashboard

Background

Broken links have a negative impact on the user experience and also harm SEO.
Joomla has in the core an excellent Redirects component that administrators can use to manually create "301 redirects" for faulty links.

Administrators can manage faulty links via: System > (under Manage) Redirects.
It makes sense to redirect the most visited unredirected faulty links to working pages.
To display these links in the Redirects component:

  • Go to [Filter Options]
  • Set State to "Disabled"
  • Sort the table by "404 Hits descending"

redirects-links-component

Admin Module: mod_redirect

To simplify the process for admins, this new Redirect Admin Module displays a quick overview of faulty links that can be added to a Dashboard.

By default, the module displays:

  • The top 5 redirects links
  • Links with a "disabled" state
  • Links with an HTTP status code of "301"
  • The list is sorted by the number of hits in descending order, with the most frequently hit links at the top.

This way it's easier to see which faulty links in the website need to be redirected.

Installation

Add the PR to your local environment (e.g. using the Joomla Patchtester Component)

Install the module via: System > Discover > install "Redirects: Links".

  • When this module is added to the Joomla core, we need to update the #__extensions table via /installation/sql/mysql/base.sql + /installation/sql/postgresql/base.sql.
  • This module should NOT be added to the dashboard by default because the Redirect Plugin is not enabled by default.

extension-discover

Create a New module via: Content > Administrator Modules, New

module-new

Configure the Module, add a Title, set the Position to "cpanel" and status to "Published,"

module-config

Sample data

To test the configuration and output of the module, the Redirects Component needs to have some links.

You can create your own faulty links within Joomla:

  • The Redirect Plugin must be enabled
  • In the Redirect component, the 'Collect URLs' option should be enabled
  • Visit faulty links on the front-end to generate entries in the Redirects component

Or you can use the following SQL sample data as "Redirects: Links".
Run the following SQL in your database (e.g. using phpMyAdmin) to create sample records.
You'll need to change the #__ prefix with your Joomla's database prefix.

INSERT INTO `#__redirect_links` (`old_url`, `new_url`, `referer`, `comment`, `hits`, `published`, `created_date`, `modified_date`, `header`) VALUES
('https://local.test.nl/faulty-link', NULL, '', '', 101, 0, '2024-08-08 08:13:29', '2024-08-11 08:10:02', 301),
('https://local.test.nl/faulty-link-archived', NULL, '', '', 1, 2, '2024-08-05 08:10:08', '2024-08-11 08:10:08', 301),
('https://local.test.nl/faulty-link-trashed', NULL, '', '', 1, -2, '2023-08-06 08:10:15', '2024-08-11 08:10:15', 301),
('https://local.test.nl/faulty-link-with-xss-attempt&param=<script>alert(\'xss\')</script>', NULL, '', '', 1001, 0, '2023-07-23 12:11:26', '2024-08-11 08:11:26', 301),
('https://local.test.nl/faulty-link-disabled', NULL, '', '', 1, 0, '2021-01-21 18:12:45', '2024-08-11 08:12:45', 301),
('https://local.test.nl/faulty-link-redirected', 'https://local.test.nl/', '', 'redirect to home', 13, 1, '2024-08-08 08:13:29', '2024-08-11 08:13:29', 301),
('https://local.test.nl/another-faulty-link', NULL, '', '', 1, 0, '2024-08-11 08:13:47', '2024-08-11 08:13:47', 301),
('https://local.test.nl/yet-another-faulty-link', NULL, '', '', 1, 0, '2023-01-01 01:02:03', '2024-08-11 08:13:52', 301),
('https://local.test.nl/what-is-wrong-at-this-site', NULL, '', '', 11, 0, '2024-08-11 08:14:07', '2024-08-11 08:14:07', 301),
('https://local.test.nl/pe7er-was-here', NULL, '', '', 93258, 0, '2024-08-11 10:10:10', '2024-08-11 08:14:15', 301);

Testing Instructions

  • Test changes in the Redirect component. Modify the state of some links. Check how these changes reflect in the "Redirects: Links" Module.
  • Test changes in the module configuration. Check if those are displayed correctly on the Dashboard
  • Test that the displayed links are sanitized against vulnerabilities like JavaScript URL injection.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org: Documentation needs to be created. I'll create documentation after this feature has been merged

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2024
Category Administration Language & Strings Modules
avatar pe7er pe7er - open - 11 Aug 2024
avatar pe7er pe7er - change - 11 Aug 2024
Status New Pending
avatar richard67
richard67 - comment - 11 Aug 2024

When this module is added to the Joomla core, we need to update the #__extensions table via /installation/sql/mysql/base.sql + /installation/sql/postgresql/base.sql.

@pe7er This will not be enough. It will also need an update SQL script for each database type for adding the module to the extensions table, and as long both (update SQL and base.sql) is not done, this PR is not ready. We cannot merge it when it needs a discovery installation to install the extension.

avatar brianteeman
brianteeman - comment - 11 Aug 2024

It also needs to be added to the list of core extensions

// Core module extensions - administrator

avatar richard67
richard67 - comment - 11 Aug 2024

If necessary I can help with the missing stuff, but during the week only in the evenings after work, if I am not too tired. Or next weekend.

avatar brianteeman
brianteeman - comment - 11 Aug 2024

This needs a LOT of further work before it is useful (personally I dont see the point as I dont see what benefit it offers and it could easily be something on the JED )

For example

  1. If the redirect system plugin is not enabled there is no notification of this in the module and it will always be empty
  2. If the redirect system plugin is enabled but the collect urls option is not enabled there is no notification of this in the module and it will always be empty
  3. The module has an option to filter on the http status but this option is only applicable if the component has advanced mode enabled
  4. why would you ever want to display a redirect link that is trashed
  5. it doesnt take any acl into account when providing the links to edit the url in the redirect component
  6. it is very confusing to have sort options for the module for data that is not presented in the table (for example what use is it to sort by referring page if the module never displays that info)
  7. Accessibility - the main column in a row (in this case the old_url) should be a th with a scope of row
  8. Update sql missing
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2024
Category Administration Language & Strings Modules Administration Language & Strings Modules SQL Installation Postgresql Libraries
avatar pe7er pe7er - change - 13 Aug 2024
Labels Added: Feature Language Change PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2024
Category Administration Language & Strings Modules SQL Installation Postgresql Libraries Administration Language & Strings Modules SQL Installation Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2024
Category Administration Language & Strings Modules SQL Installation Libraries Administration Language & Strings Modules SQL Installation Postgresql Libraries
avatar brianteeman
brianteeman - comment - 15 Aug 2024

Will you be addressing the oustanding issues?

avatar pe7er
pe7er - comment - 15 Aug 2024

Yes

If the redirect system plugin is not enabled there is no notification of this in the module and it will always be empty
If the redirect system plugin is enabled but the collect urls option is not enabled there is no notification of this in the module and it will always be empty

IMHO not necessary. Check the out put of other core modules when they don't contain records:
Recently Added Articles, Privacy Dashboard and Popular Articles all display: "No Articles have been created yet."

If you are not using the Articles (because of using only 3rd party webshop or page builder extension),
or no-one every used the Privacy function, those won't change either.

The module has an option to filter on the http status but this option is only applicable if the component has advanced mode enabled

I don't think that there's an option to filter the "Redirect" form type options on the mode of the Redirects component.

why would you ever want to display a redirect link that is trashed

true. fixed

it doesnt take any acl into account when providing the links to edit the url in the redirect component

Actually, it did. The whole module was only visible by users with core.admin rights:

public function dispatch()
    {
        if (!$this->getApplication()->getIdentity()->authorise('core.admin')) {
            return;
        }

I've change that so that the whole module is only visible for users that have edit rights in the redirect component:

        if (!Factory::getApplication()->getIdentity()->authorise('core.edit', 'com_redirect')) {

it is very confusing to have sort options for the module for data that is not presented in the table (for example what use is it to sort by referring page if the module never displays that info)

true. fixed

Accessibility - the main column in a row (in this case the old_url) should be a th with a scope of row

thanks. fixed

Update sql missing

Was already fixed.

avatar brianteeman
brianteeman - comment - 15 Aug 2024

Update sql missing

Was already fixed.

No it is not

avatar brianteeman
brianteeman - comment - 15 Aug 2024

If the redirect system plugin is not enabled there is no notification of this in the module and it will always be empty
If the redirect system plugin is enabled but the collect urls option is not enabled there is no notification of this in the module and it will always be empty

IMHO not necessary. Check the out put of other core modules when they don't contain records:
Recently Added Articles, Privacy Dashboard and Popular Articles all display: "No Articles have been created yet."

If you are not using the Articles (because of using only 3rd party webshop or page builder extension),
or no-one every used the Privacy function, those won't change either.

Not true - just because the plugin is not enabled and/or the collect urls is not enabled does not mean that there are no redirects

-- still not seen anyone say that they wanted this module

avatar pe7er
pe7er - comment - 15 Aug 2024

-- still not seen anyone say that they wanted this module

Not every Joomla user has a github account or dares to participate in discussions there.

I have spoken to quite a few Joomla users who think this is a welcome feature for the Joomla core.

avatar pe7er
pe7er - comment - 15 Aug 2024

Update sql missing

Was already fixed.

No it is not

Yes it was. Please check the commit before your "Will you be addressing the oustanding issues?" question:
1f3c733

avatar brianteeman
brianteeman - comment - 15 Aug 2024
avatar brianteeman brianteeman - test_item - 15 Aug 2024 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 15 Aug 2024

I have tested this item ? unsuccessfully on 0dee7fa

Does not work on any updated site


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

avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2024
Category Administration Language & Strings Modules SQL Installation Libraries Postgresql SQL Administration com_admin Postgresql Language & Strings Modules Installation Libraries
avatar brianteeman brianteeman - test_item - 16 Aug 2024 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 16 Aug 2024

I have tested this item ? unsuccessfully on 503b7d5

Tested again with both an update and a clean install of this branch

In both cases the admin module is created and is listed in the module manager for admin modules and is unpublished. (not sure if that is intentional)

After publishing the module it is still not displayed at all on the admin control panel


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

avatar brianteeman
brianteeman - comment - 16 Aug 2024
chrome_GSVbrkx4mM.mp4
avatar pe7er
pe7er - comment - 17 Aug 2024

In both cases the admin module is created and is listed in the module manager for admin modules and is unpublished. (not sure if that is intentional)

Yes, it is intentionally unpublished.
Admins need to manually switch on the Redirects Plugin for com_redirects to gather links.
So it seemed logical that they only publish the module when they use com_redirects.

avatar brianteeman
brianteeman - comment - 17 Aug 2024

Might be logical but its not consistent with all other admin modules. Anyway it doesnt appear when published as shown in the video

avatar sandewt
sandewt - comment - 17 Aug 2024

Install the module via: System > Discover > install "Redirects: Links".

Schermafbeelding 2024-08-17 124831

avatar pe7er pe7er - close - 17 Aug 2024
avatar pe7er
pe7er - comment - 17 Aug 2024

Thanks @richard67 @brianteeman @sandewt for testing and improvements.

As I wasn't able to convince all the other maintainers to include it in the core at this time, I decided to make this Joomla 5 version available as installable module: https://github.com/pe7er/mod_redirect

avatar pe7er pe7er - change - 17 Aug 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-08-17 13:12:20
Closed_By pe7er
avatar sandewt
sandewt - comment - 17 Aug 2024

As I wasn't able to convince all the other maintainers to include it in the core at this time

To avoid disappointments, there should be some kind of checklist with minimum requirements that an extension must meet to be included in the Joomla core. At the moment, it seems to depend too much on the maintainers. Don't get me wrong, I'm not saying anything here to the detriment of the maintainers. I know of a case where the designer turned away from Joomla in frustration. The more objective the criteria for admission to the core, the better.

Is there such a checklist available now? If not, is it possible that this will come?

Add a Comment

Login with GitHub to post a comment