What does the project do?
The project has been designed to help contributors obtain certain metrics on their nodes.

Key features

  • Estimated playback time: Provides an estimate of the time required to play content.
  • Number of images: Counts the number of images used, including decorative and background images.
  • Title structure validation: Checks the validity of title structures and their depth.

Project link
https://www.drupal.org/project/text_clarity_checker

Comments

pcharrat created an issue. See original summary.

avpaderno’s picture

Assigned: Unassigned » avpaderno
avpaderno’s picture

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
  • For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application.
  • Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

avpaderno’s picture

Title: [1.3.2] Text Clarity Checker » [1.3.x] Text Clarity Checker

Remember to change status, when the project is ready for review, as in this queue Active means Don't review yet the project I am using for this application.

avpaderno’s picture

Assigned: avpaderno » Unassigned
pcharrat’s picture

Status: Active » Needs review
vishal.kadam’s picture

Status: Needs review » Needs work

1. The master branch is not used on drupal.org. The only exception is for the main branch, which is actually not fully supported on drupal.org and should be avoided. For now, the branch names must follow what is reported in Release branches.

2. FILE: text_clarity_checker.info.yml

package: Custom

This line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.

3. FILE: README.md

The README file is missing the required sections - Project name, Requirements, and Configuration.

pcharrat’s picture

Status: Needs work » Needs review
pcharrat’s picture

In 1.3.4 version, I add GenericTest and updated hook_help.

rushikesh raval’s picture

Priority: Normal » Major

I am changing the issue priority as per issue priorities.

avpaderno’s picture

Priority: Major » Normal
Status: Needs review » Needs work
  • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
  • A specific point may just be an example and may apply in other places
  • A review is about code that does not follow the coding standards, contains possible security issue, or does not correctly use the Drupal API
  • The single review points are not ordered, not even by importance

src/Form/TextClarityCheckerSettingsForm.php

ConfigFormBase::__construct() needs to be called. Since its parameters changed in Drupal 10.2, the project cannot be compatible with all the Drupal 10 releases and Drupal 11; it needs to require at least Drupal 10.2.

With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.

    $form['image_toolkit'] = [
      '#type' => 'radios',
      '#title' => $this->t('Select an image processing toolkit'),
      '#config_target' => 'system.image:toolkit',
      '#options' => [],
    ];

Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.

Furthermore, block plugins do not need an external class for their setting form: They return it in their blockForm() method.

src/ProxyConfig.php

/**
 * Create proxy for config access.
 *
 * @property string $text_metrics
 * @property string $images
 * @property string $recommended_image_metrics
 * @property string $links
 * @property string $recommended_link_metrics
 * @property string $recommended_external_link_metrics
 * @property string $titles
 * @property string $recommended_title_metrics
 * @property string $performance
 * @property string $classes
 */

The short description must use a verb declined to the third person singular.
Drupal code does not use @property. The values returned by __get() need to be documented in its documentation comment.

That class is not used by the project, which means it should be removed.

pcharrat’s picture

Thank you for your feedback.
I have revised the architecture by moving the parameters directly into the block, which allows for multiple instances with different configurations depending on user roles. This approach is more in line with Drupal best practices and offers greater flexibility of use.
I have upgraded from version 1.3 to 1.4.

pcharrat’s picture

Title: [1.3.x] Text Clarity Checker » [1.4.x] Text Clarity Checker
Status: Needs work » Needs review
bbu23’s picture

Hi! Quick note: you don't need to tag a new release after every feedback. We're reviewing directly the branch specified in the title of the ticket, in this case 1.4.x.

It is better not to create new releases during these applications, since a review could ask for a change that is not backward compatible with the existing releases. Just using a development version avoids those BC issues.

avpaderno’s picture

It would also be better not to create new branches: Reviewers could need to check again all the files, to understand which changes has been done in the new branch.

avpaderno’s picture

Status: Needs review » Needs work

config

Since the settings form has been removed, the config directory should be removed too: Without a configuration object used by the project, there is no need to define its default values, nor its schema.

tests/src/Functionnal/GenericTest.php

The correct directory is test/src/Functional.

text_clarity_checker.module

For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
It would require increasing the minimum Drupal 10 version supported, but Drupal 10.1 is no longer supported.

pcharrat’s picture

Thank you for your feedback.

pcharrat’s picture

Status: Needs work » Needs review
bbu23’s picture

Assigned: Unassigned » bbu23
bbu23’s picture

Assigned: bbu23 » Unassigned
Status: Needs review » Needs work

Hi! Below you have my feedback:

- There is no dev release. While not mandatory, it's a highly encouraged practice in the Drupal community.

- text_clarity_checker.info.yml:
The translations folder and locale keys should be removed since they are intended for custom modules as described in locale.api.php. Consider contributing the translations for your module to drupal.org. See Contribute to translations.

'interface translation project': text_clarity_checker
'interface translation server pattern': modules/custom/%project/translations/%project.%language.po

- The namespace of the Object Oriented hook classes is wrong: it should be Drupal\text_clarity_checker\Hook instead of Drupal\text_clarity_checker\Hooks. See changelog. The hooks are still called because of the .module procedural hooks that are kept for backwards compatibility. You can disable procedural hooks for Drupal 11+ optionally by setting the following in your services YAML file:

parameters:
  # For Drupal 11.1 and lower.
  MODULENAME.hooks_converted: true
  # For Drupal 11.2 and higher.
  MODULENAME.skip_procedural_hook_scan: true

- src/Plugin/Block/TextClarityCheckerBlock.php: Is there a reason why your block is uncacheable?

  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge(): int {
    return 0;
  }
bbu23’s picture

And since your module already has a logo, I suggest moving the image to the repository to make it compatible with Project Browser and having the icon show next to the module title. In the place of the image you could upload screenshots of the functionality or leave it empty.
See Logo in Project Browser.

pcharrat’s picture

Thank you for your comments. I have adapted my hooks to the requirements of Drupal 11.

pcharrat’s picture

Status: Needs work » Needs review
vishal.kadam’s picture

Priority: Normal » Major

I am changing priority as per Issue priorities.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also all the reviewers for helping with these applications.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

pcharrat’s picture

Thank you for your time and feedback. It was very interesting.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.