Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Get Started introductory page #284

Merged
merged 6 commits into from
Jul 28, 2024

Conversation

robbiejackson
Copy link
Contributor

@robbiejackson robbiejackson commented Jul 18, 2024

User description

To change the introductory page at https://manual.joomla.org/ to link to sections of the manual which have better content, and avoid linking to sections where content is missing (eg accessibility).

This can be modified in the future as the content in the manual develops.

Because this page is available for all versions, the sections which it links to have to be available for all versions, so I had to copy the module tutorial into 5.0. And because the module tutorial also referenced newer sections, those had to be copied into 5.0 as well. So in the end I just duplicated general-concepts and build-extensions from 5.1 to 5.0. I don't think there's anything in those sections which don't apply to 5.0.

Also I encountered a problem where the subdirectory name is similar to the parent directory name - as in /install-update/install. This was causing broken links to be reported, but strangely only in 5.0. It may be related to facebook/docusaurus#7247.

So I changed the subdirectory name from install to installation, and updated the links in the md files, and it then built ok.


PR Type

Enhancement, Documentation, Formatting


Description

  • Updated the introductory page to link to sections with better content and avoid linking to sections with missing content.
  • Updated quick access links and descriptions on the main page.
  • Reformatted multiple documentation files for consistency and readability.
  • Added new and expanded documentation for various Joomla extension development topics, including manifest files, update servers, custom scripts, and plugins.
  • Addressed an issue with broken links by renaming a subdirectory and updating links accordingly.

Changes walkthrough 📝

Relevant files
Enhancement
1 files
index.js
Update quick access links and descriptions.                           

src/pages/index.js

  • Updated descriptions for quick access sections.
  • Changed titles and links for better content navigation.
  • Replaced 'Components' with 'Tutorials' and updated the icon.
  • Changed 'Accessibility' to 'Concepts' and updated the icon.
  • +13/-11 
    Formatting
    6 files
    manifest.md
    Reformat manifest file documentation for consistency.       

    versioned_docs/version-4.4/building-extensions/install-update/installation/manifest.md

  • Reformatted the entire document for consistency.
  • Ensured proper indentation and spacing.
  • No content changes, purely formatting.
  • +512/-512
    manifest.md
    Reformat manifest file documentation for consistency.       

    versioned_docs/version-5.0/building-extensions/install-update/installation/manifest.md

  • Reformatted the entire document for consistency.
  • Ensured proper indentation and spacing.
  • No content changes, purely formatting.
  • +512/-512
    install-process.md
    Reformatting of Install Process and Script Files Documentation

    versioned_docs/version-4.4/building-extensions/install-update/installation/install-process.md

  • Reformatted the document for better readability and consistency.
  • No changes to the content, only formatting adjustments.
  • +149/-149
    install-process.md
    Reformatting of Install Process and Script Files Documentation

    versioned_docs/version-5.0/building-extensions/install-update/installation/install-process.md

  • Reformatted the document for better readability and consistency.
  • No changes to the content, only formatting adjustments.
  • +149/-149
    install-process.md
    Reformatting of Install Process and Script Files Documentation

    docs/building-extensions/install-update/installation/install-process.md

  • Reformatted the document for better readability and consistency.
  • No changes to the content, only formatting adjustments.
  • +149/-149
    manipulating-forms.md
    Reformatting of Manipulating Forms Documentation                 

    versioned_docs/version-4.4/general-concepts/forms/manipulating-forms.md

  • Reformatted section headers for better readability and consistency.
  • No changes to the content, only formatting adjustments.
  • +11/-11 
    Documentation
    14 files
    manifest.md
    Add new documentation for manifest files.                               

    versioned_docs/version-5.1/building-extensions/install-update/installation/manifest.md

  • Added new documentation for manifest files.
  • Detailed the file naming conventions and structure.
  • Included sections on metadata, front-end files, media files, and more.

  • +512/-0 
    update-server.md
    Expand documentation on update servers.                                   

    versioned_docs/version-5.0/building-extensions/install-update/update-server.md

  • Expanded documentation on update servers.
  • Added detailed steps for setting up an update server.
  • Included examples and explanations for XML file structure.
  • +229/-2 
    basic-script.md
    Update links and remove TODO note in basic script documentation.

    versioned_docs/version-5.0/building-extensions/custom-script/basic-script.md

  • Updated links in the developer notice section.
  • Removed outdated TODO note.
  • +2/-13   
    manifest.md
    Comprehensive Guide on Joomla Manifest Files                         

    docs/building-extensions/install-update/installation/manifest.md

  • Added a new introductory section for manifest files in Joomla.
  • Detailed the file naming conventions for different extension types.
  • Explained the root element and metadata elements in the manifest XML.
  • Included sections on handling front-end files, media files, and
    administration sections.
  • +512/-512
    filesystem-plugin-ftp.md
    Guide to Creating an FTP Filesystem Plugin                             

    versioned_docs/version-5.0/building-extensions/plugins/_assets/filesystem-plugin-ftp.md

  • Introduced a new document on creating an FTP filesystem plugin for
    Joomla.
  • Provided detailed steps for writing the Provider and Adapter classes.
  • Included testing instructions and error handling mechanisms.
  • Added source code examples and configuration details.
  • +937/-0 
    filesystem-plugin-ftp.md
    Guide to Creating an FTP Filesystem Plugin                             

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-ftp.md

  • Introduced a new document on creating an FTP filesystem plugin for
    Joomla.
  • Provided detailed steps for writing the Provider and Adapter classes.
  • Included testing instructions and error handling mechanisms.
  • Added source code examples and configuration details.
  • +937/-0 
    logging-on.md
    Update Developer Notice Links for Custom Scripts                 

    versioned_docs/version-5.0/building-extensions/custom-script/logging-on.md

  • Updated the developer notice to link to the new console and ajax
    plugin documentation within the manual.
  • +2/-8     
    index.md
    Introduction to Installation and Update of Extensions       

    versioned_docs/version-5.0/building-extensions/installupdate/index.md

  • Added a new introductory page for the installation and update section
    of Joomla extensions.
  • +5/-0     
    manifest.md
    Detailed Guide on Joomla Manifest Files and Operations     

    versioned_docs/version-5.0/building-extensions/installupdate/install/manifest.md

  • Added a comprehensive guide on creating and managing Joomla manifest
    files.
  • Included detailed instructions on naming conventions, root elements,
    metadata, and file management.
  • Provided examples for handling media files, administration sections,
    SQL operations, and language files.
  • Explained advanced topics like update servers, changelogs, and
    download keys.
  • +512/-0 
    user.md
    Comprehensive Overview of Joomla User Class and API           

    versioned_docs/version-5.0/general-concepts/user.md

  • Introduced a new page detailing the Joomla User class and its
    functionalities.
  • Explained basic operations, user object properties, and methods for
    determining user status.
  • Included information on user privileges and database operations.
  • Provided a sample module code to demonstrate the use of the Joomla
    User API.
  • +320/-0 
    update-server.md
    Guide to Setting Up Joomla Extension Update Servers           

    versioned_docs/version-5.0/building-extensions/installupdate/update-server.md

  • Added a new document explaining how to set up update servers for
    Joomla extensions.
  • Included steps for creating XML files, storing extension updates, and
    configuring Joomla to use the update server.
  • Provided examples of both collection and extension server types.
  • Detailed the process of installing updates and handling various update
    scenarios.
  • +232/-0 
    filesystem-plugin-basic.md
    Tutorial on Creating a Basic Filesystem Plugin for Joomla

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-basic.md

  • Introduced a tutorial on creating a basic filesystem plugin for
    Joomla.
  • Explained the concept of filesystem providers and adapters.
  • Provided a step-by-step guide on writing a filesystem plugin with
    source code examples.
  • Included instructions on setting up the plugin and creating a
    restricted filesystem adapter.
  • +309/-0 
    step8-dependency-injection.md
    Step-by-Step Guide to Dependency Injection in Joomla Modules

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step8-dependency-injection.md

  • Added a new tutorial step focusing on dependency injection in Joomla
    module development.
  • Explained the principles of Extension and Dispatcher classes.
  • Provided detailed instructions on setting up dependency injection
    using service providers.
  • Included updated code examples for the module manifest, helper, and
    dispatcher classes.
  • +358/-0 
    index.md
    Update Developer Notice for Custom PHP Scripts                     

    versioned_docs/version-5.0/building-extensions/custom-script/index.md

  • Updated the developer notice to recommend creating a console plugin or
    an ajax plugin.
  • Removed outdated links and added relevant internal links.
  • +2/-8     
    Additional files (token-limit)
    58 files
    step9-ajax.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step9-ajax.md

    ...

    +285/-0 
    step5-config.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step5-config.md

    ...

    +239/-0 
    package.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/install-update/installation/package.md

    ...

    +112/-112
    package.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/install-update/installation/package.md

    ...

    +112/-112
    package.md
    ...                                                                                                           

    docs/building-extensions/install-update/installation/package.md

    ...

    +112/-112
    step1-basic-module.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step1-basic-module.md

    ...

    +188/-0 
    change-log.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/install-update/installation/change-log.md

    ...

    +130/-130
    change-log.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/install-update/installation/change-log.md

    ...

    +130/-130
    change-log.md
    ...                                                                                                           

    docs/building-extensions/install-update/installation/change-log.md

    ...

    +130/-130
    ajax-plugin.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/plugins/ajax-plugin.md

    ...

    +187/-0 
    step7-javascript.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step7-javascript.md

    ...

    +197/-0 
    template-details-file.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/templates/template-details-file.md

    ...

    +175/-0 
    step10_abstract_module_dispatcher.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step10_abstract_module_dispatcher.md

    ...

    +180/-0 
    step4-languages.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step4-languages.md

    ...

    +165/-0 
    manipulating-forms.md
    ...                                                                                                           

    versioned_docs/version-5.0/general-concepts/forms/manipulating-forms.md

    ...

    +11/-11 
    manipulating-forms.md
    ...                                                                                                           

    versioned_docs/version-5.1/general-concepts/forms/manipulating-forms.md

    ...

    +11/-11 
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/index.md

    ...

    +58/-5   
    step6-script-file.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step6-script-file.md

    ...

    +149/-0 
    install-process.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/install-update/installation/install-process.md

    ...

    +149/-0 
    install-process.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/installupdate/install/install-process.md

    ...

    +149/-0 
    step11_update_server.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step11_update_server.md

    ...

    +126/-0 
    step2-tmpl-file.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step2-tmpl-file.md

    ...

    +119/-0 
    package.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/install-update/installation/package.md

    ...

    +112/-0 
    package.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/installupdate/install/package.md

    ...

    +112/-0 
    menus-menuitems.md
    ...                                                                                                           

    versioned_docs/version-4.4/general-concepts/menus-menuitems.md

    ...

    +8/-8     
    change-log.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/install-update/installation/change-log.md

    ...

    +130/-0 
    change-log.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/installupdate/install/change-log.md

    ...

    +130/-0 
    menus-menuitems.md
    ...                                                                                                           

    versioned_docs/version-5.0/general-concepts/menus-menuitems.md

    ...

    +8/-8     
    menus-menuitems.md
    ...                                                                                                           

    versioned_docs/version-5.1/general-concepts/menus-menuitems.md

    ...

    +8/-8     
    step3-helper-file.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/step3-helper-file.md

    ...

    +119/-0 
    joomla-dialog.md
    ...                                                                                                           

    versioned_docs/version-5.0/general-concepts/javascript/joomla-dialog.md

    ...

    +17/-1   
    install.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/custom-script/install.md

    ...

    +3/-9     
    index.md
    ...                                                                                                           

    versioned_docs/version-4.4/get-started/index.md

    ...

    +1/-1     
    index.md
    ...                                                                                                           

    docs/get-started/index.md

    ...

    +1/-1     
    color-scheme.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/templates/color-scheme.md

    ...

    +29/-0   
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/get-started/index.md

    ...

    +1/-1     
    index.md
    ...                                                                                                           

    versioned_docs/version-5.1/get-started/index.md

    ...

    +1/-1     
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/general-concepts/index.md

    ...

    +4/-5     
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/modules/module-development-tutorial/index.md

    ...

    +13/-0   
    step4-languages.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/modules/module-development-tutorial/step4-languages.md

    ...

    +1/-1     
    step4-languages.md
    ...                                                                                                           

    docs/building-extensions/modules/module-development-tutorial/step4-languages.md

    ...

    +1/-1     
    step4-languages.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/modules/module-development-tutorial/step4-languages.md

    ...

    +1/-1     
    step1-basic-module.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/modules/module-development-tutorial/step1-basic-module.md

    ...

    +1/-1     
    step6-script-file.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/modules/module-development-tutorial/step6-script-file.md

    ...

    +1/-1     
    step1-basic-module.md
    ...                                                                                                           

    docs/building-extensions/modules/module-development-tutorial/step1-basic-module.md

    ...

    +1/-1     
    step6-script-file.md
    ...                                                                                                           

    docs/building-extensions/modules/module-development-tutorial/step6-script-file.md

    ...

    +1/-1     
    index.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/install-update/installation/index.md

    ...

    +10/-10 
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/install-update/installation/index.md

    ...

    +10/-10 
    index.md
    ...                                                                                                           

    docs/building-extensions/install-update/installation/index.md

    ...

    +10/-10 
    step6-script-file.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/modules/module-development-tutorial/step6-script-file.md

    ...

    +1/-1     
    README.md
    ...                                                                                                           

    README.md

    ...

    +2/-0     
    basic-content-plugin.md
    ...                                                                                                           

    versioned_docs/version-4.4/building-extensions/plugins/basic-content-plugin.md

    ...

    +1/-1     
    step1-basic-module.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/modules/module-development-tutorial/step1-basic-module.md

    ...

    +1/-1     
    basic-content-plugin.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/plugins/basic-content-plugin.md

    ...

    +1/-1     
    basic-content-plugin.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/plugins/basic-content-plugin.md

    ...

    +1/-1     
    basic-content-plugin.md
    ...                                                                                                           

    docs/building-extensions/plugins/basic-content-plugin.md

    ...

    +1/-1     
    index.md
    ...                                                                                                           

    versioned_docs/version-5.1/building-extensions/install-update/installation/index.md

    ...

    +10/-0   
    index.md
    ...                                                                                                           

    versioned_docs/version-5.0/building-extensions/installupdate/install/index.md

    ...

    +10/-0   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Missing Accessibility
    The updated introductory page lacks links to accessibility resources which were present in the old version. Consider re-adding or updating these resources to maintain accessibility support.

    Error Handling
    The error handling in the FTP plugin could be improved by providing more specific error messages and handling potential exceptions more gracefully to enhance stability and user experience.

    Documentation Clarity
    The documentation in 'manifest.md' could be improved for clarity and completeness, particularly in the sections describing the XML manifest file structure and the update process.

    Copy link
    Contributor

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Correct the XML closing tags for filename elements

    Correct the XML closing tag for elements to use the correct closing tag instead of
    .

    versioned_docs/version-4.4/building-extensions/install-update/installation/manifest.md [39-142]

    -<filename module="mod_example">mod_example.php</folder>
    -<filename plugin="example">example.php</folder>
    +<filename module="mod_example">mod_example.php</filename>
    +<filename plugin="example">example.php</filename>
     
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies and fixes a critical XML syntax error, ensuring proper parsing and functionality of the manifest files.

    10
    Fix XML tag mismatch by correcting the closing tag

    Correct the XML tag mismatch in the 'files' section for modules and plugins. The
    closing tag for 'filename' should be instead of .

    versioned_docs/version-5.0/building-extensions/install-update/installation/manifest.md [39-41]

     <files>
    -    <filename module="mod_example">mod_example.php</folder>
    +    <filename module="mod_example">mod_example.php</filename>
         ...
     </files>
     
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies and fixes a critical XML tag mismatch error, which is essential for the proper functioning of the manifest file.

    10
    Best practice
    Use constants for URLs to enhance maintainability

    Avoid using hardcoded URLs in the JSX. Instead, define them as constants at the top
    of the file or in a configuration file to make the codebase easier to maintain and
    update.

    src/pages/index.js [25]

    -href: "/docs/building-extensions/modules/module-development-tutorial/",
    +const MODULE_DEVELOPMENT_TUTORIAL_URL = "/docs/building-extensions/modules/module-development-tutorial/";
    +href: MODULE_DEVELOPMENT_TUTORIAL_URL,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Defining URLs as constants improves maintainability and makes the code easier to update. This is a best practice that can significantly enhance the codebase.

    9
    Replace the error suppression operator with proper error handling

    Replace the error suppression operator (@) with proper error handling to avoid
    hiding potential issues that could affect the stability of the application. Use
    try-catch blocks to handle exceptions and log errors appropriately.

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-ftp.md [28-31]

    -if (!$this->ftp_connection = @ftp_connect($this->ftp_server)) {
    -    ...
    -}
    -if (!@ftp_login($this->ftp_connection, $this->ftp_username, $this->ftp_password)) {
    -    ...
    +try {
    +    $this->ftp_connection = ftp_connect($this->ftp_server);
    +    if (!$this->ftp_connection) {
    +        throw new Exception("Failed to connect to FTP server: {$this->ftp_server}");
    +    }
    +    if (!ftp_login($this->ftp_connection, $this->ftp_username, $this->ftp_password)) {
    +        throw new Exception("Failed to login to FTP server: {$this->ftp_server}");
    +    }
    +} catch (Exception $e) {
    +    Log::add("FTP connection error: " . $e->getMessage(), Log::ERROR, 'ftp');
    +    throw $e;
     }
     
    Suggestion importance[1-10]: 9

    Why: Replacing the error suppression operator with proper error handling improves code reliability and maintainability by ensuring that errors are not silently ignored and are properly logged and managed.

    9
    Replace magic numbers with named constants

    Avoid using magic numbers directly in the code. Define them as named constants at
    the beginning of your class to improve code readability and maintainability.

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-ftp.md [438-439]

    -$obj->width = 0;
    -$obj->height = 0;
    +const DEFAULT_WIDTH = 0;
    +const DEFAULT_HEIGHT = 0;
    +...
    +$obj->width = self::DEFAULT_WIDTH;
    +$obj->height = self::DEFAULT_HEIGHT;
     
    Suggestion importance[1-10]: 7

    Why: Using named constants instead of magic numbers enhances code readability and maintainability by providing meaningful names for the values.

    7
    Maintainability
    Refactor repeated code into a separate method to reduce duplication

    Refactor the repeated code for creating the file object into a separate method to
    reduce duplication and improve code clarity.

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-ftp.md [424-434]

    -$obj = new \stdClass();
    -$obj->type = $file['type'];
    -$obj->name = $file['name'];
    -$obj->path = $path;
    -$obj->extension = $file['type'] == 'file' ? File::getExt($obj->name) : '';
    -$obj->size = $file['type'] == 'file' ? intval($file['size']) : '';
    -$obj->create_date = $this->convertDate($file['modify']);
    -$obj->create_date_formatted = $obj->create_date;
    -$obj->modified_date = $obj->create_date;
    -$obj->modified_date_formatted = $obj->create_date_formatted;
    -$obj->mime_type = $file['type'] == 'file' ? $this->extension_mime_mapper(strrchr($file['name'], ".")) : "directory";
    +private function createFileObject($file, $path) {
    +    $obj = new \stdClass();
    +    $obj->type = $file['type'];
    +    $obj->name = $file['name'];
    +    $obj->path = $path;
    +    $obj->extension = $file['type'] == 'file' ? File::getExt($obj->name) : '';
    +    $obj->size = $file['type'] == 'file' ? intval($file['size']) : '';
    +    $obj->create_date = $this->convertDate($file['modify']);
    +    $obj->create_date_formatted = $obj->create_date;
    +    $obj->modified_date = $obj->create_date;
    +    $obj->modified_date_formatted = $obj->create_date_formatted;
    +    $obj->mime_type = $file['type'] == 'file' ? $this->extension_mime_mapper(strrchr($file['name'], ".")) : "directory";
    +    return $obj;
    +}
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Refactoring repeated code into a separate method reduces duplication, making the code cleaner and easier to maintain.

    8
    Use a constant for the thumbnail path to facilitate easier updates and configuration

    Instead of using a hardcoded path for the thumbnail, consider using a configuration
    parameter or a constant that can be easily changed without modifying the source
    code.

    versioned_docs/version-5.0/building-extensions/plugins/filesystem-plugin-ftp.md [436]

    -$obj->thumb_path = Uri::root() . "images/powered_by.png";
    +const THUMBNAIL_PATH = "images/powered_by.png";
    +...
    +$obj->thumb_path = Uri::root() . self::THUMBNAIL_PATH;
     
    Suggestion importance[1-10]: 7

    Why: Using a constant for the thumbnail path improves maintainability by making it easier to update the path without modifying the source code.

    7
    Improve clarity by using descriptive identifiers in XML tags

    Replace the ambiguous use of 'example' in the dashboard XML tags with a more
    descriptive identifier to improve clarity and maintainability.

    versioned_docs/version-5.0/building-extensions/install-update/installation/manifest.md [223]

    -<dashboard title="Example Dashboard" icon="icon-lock">example</dashboard>
    +<dashboard title="Example Dashboard" icon="icon-lock">unique_dashboard_identifier</dashboard>
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion improves maintainability and clarity by using a more descriptive identifier, which helps in understanding the code better.

    7
    Improve variable naming for better code readability

    Consider using a more descriptive variable name for the icon class to enhance
    readability and maintainability of the code.

    src/pages/index.js [16]

    -iconName: <IconName.BsPlayCircle className="icon--3x" />,
    +iconName: <IconName.BsPlayCircle className="largeIcon" />,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion to change the class name from "icon--3x" to "largeIcon" does improve readability slightly, but the improvement is minor and subjective. The original name is already somewhat descriptive.

    5
    Enhancement
    Use specific HTML tags instead of fragments for better accessibility and SEO

    It's recommended to use a more specific tag than the generic fragment <> for
    wrapping JSX content. This can improve the accessibility and SEO of your page.

    src/pages/index.js [38-40]

    -<>
    +<div>
       Learn how Joomla plugins work. Download and install the different example plugins, all with detailed explanations to help you understand what's going on.
    -</>
    +</div>
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Using specific HTML tags instead of fragments can improve accessibility and SEO. This is a good practice and enhances the semantic structure of the HTML.

    8
    Ensure consistent use of the 'module' attribute in XML tags

    Ensure consistency in the use of the 'module' attribute within the 'files' XML tags.
    The attribute should be consistently used or omitted based on the context provided.

    versioned_docs/version-5.0/building-extensions/install-update/installation/manifest.md [29-33]

     <files>
    -    <folder module="mod_example">services</folder>
    +    <folder>services</folder>
         ...
     </files>
     
    Suggestion importance[1-10]: 5

    Why: While the suggestion aims to improve consistency, the 'module' attribute is contextually necessary for identifying the module, and removing it may lead to confusion or errors.

    5
    Security
    Use HTTPS in URLs to enhance security

    Update the example URL in the tag to use HTTPS for improved security and to avoid
    potential mixed content issues.

    versioned_docs/version-5.0/building-extensions/install-update/installation/manifest.md [470-471]

    -<changelogurl>http://example.com/updates/changelog.xml</changelogurl>
    +<changelogurl>https://example.com/updates/changelog.xml</changelogurl>
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion enhances security by using HTTPS, which is a best practice for avoiding mixed content issues and ensuring secure communication.

    8
    Performance
    Refactor inline JSX to constants for cleaner code and improved performance

    Extract the inline JSX elements to a constant outside the component to clean up the
    component's body and improve performance by reducing the number of re-renders.

    src/pages/index.js [34-41]

    -title: <>Plugins</>,
    -href: "/docs/building-extensions/plugins/",
    -iconName: <IconName.BsPlug className="icon--3x" />,
    -description: (
    -  <>
    -    Learn how Joomla plugins work. Download and install the different example plugins, all with detailed explanations to help you understand what's going on.
    -  </>
    -),
    +const pluginSection = {
    +  title: "Plugins",
    +  href: "/docs/building-extensions/plugins/",
    +  iconName: <IconName.BsPlug className="icon--3x" />,
    +  description: (
    +    <div>
    +      Learn how Joomla plugins work. Download and install the different example plugins, all with detailed explanations to help you understand what's going
    +    </div>
    +  )
    +};
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Extracting inline JSX elements to constants can clean up the component's body and potentially improve performance by reducing re-renders. This is a good practice for maintainability.

    7

    @robbiejackson robbiejackson merged commit 8329637 into joomla:main Jul 28, 2024
    2 checks passed
    @robbiejackson robbiejackson deleted the improve-introduction branch July 28, 2024 08:25
    @HLeithner
    Copy link
    Member

    @robbiejackson maybe it would make sense to check the codiumai code suggestions before merging. At least the critical one. Some of them are useful

    2 wrong xml closing tags or the https instead of http suggestion

    @robbiejackson
    Copy link
    Contributor Author

    @HLeithner in this PR I created just 1 file. Then I had to rename/duplicate >100 files to get all the links to work. So the checker was raising lots of issues, from lots of different contributors, many of them on 5.0 which isn't supposed to be maintained anyway.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants