Channel Publisher (machine name content_syndication) publishes Drupal nodes to external social platforms. The first supported platform is a Facebook Page, through the Graph API. Editors queue a post from the node form. A queue worker then publishes it, with retries, exponential backoff and rate limiting. Optionally, a configured AI provider through the AI module drafts captions and hashtags. Platforms are plugins, so other networks can be added without changing the core queue logic.

About me

I am a solutions architect and technical lead at Riva Solutions Inc., where I build and maintain Drupal web applications for federal government clients, along with the AWS infrastructure and DevOps tooling around them. I have worked with Drupal for 18 years. My Drupal.org username is the-letter-d.

Channel Publisher is my first project submitted for security advisory coverage. It came out of internal work on AI-assisted publishing at Riva, and I released it to share it with the community.

Manual reviews

Project link

https://www.drupal.org/project/content_syndication

Comments

dietric@gmail.com created an issue. See original summary.

dietric@gmail.com’s picture

Issue summary: View changes
dietric@gmail.com’s picture

Issue summary: View changes
vishal.kadam’s picture

Issue summary: View changes
ptmkenny’s picture

Based on the request in Slack, I did a review, and here are my findings:

First, this module appears to be mostly written with AI (at least the documentation and the comments seem like they were written by AI). This is fine, but I think the project page https://www.drupal.org/project/content_syndication should disclose the use of AI; the AI disclosure policy is not completely clear on this point (it mostly talks about making contributions to modules, not a module you yourself contribute), but I think the trend in Drupal is toward more transparency.

In SETUP_GUIDE.md, there are instructions to run the command drush pm:enable content_syndication key node. key and node modules are dependencies of content_syndication, so there is no reason to name the dependencies in pm:enable; the command should just be drush pm:enable content_syndication. The dependencies will be automatically installed.

The PHPStan baseline is ignoring "Access to an undefined property" and "Call to an undefined method"; these should generally be fixed and not ignored, because if you actually call an undefined method Drupal will usually crash. Sometimes this is actually fine and all you have to do is help PHPStan identify the type (for example, with a $object instanceOf class).

The README.md does not follow the Drupal.org README template; instead, it reads more like an AGENTS.md. The README.md is often read by people evaluating whether your module is a good fit for their use case, so it should have a high-level summary of the module. This README has a lot of lists and details which make it find what you're looking for. I would create a new README based on the template, and then move the documentation for agents into an AGENTS.md.

You have a custom exception, which is a good practice. However, that exception is class PublishException extends \Exception {}; PublishException is a pretty generic name, and your module is called content_syndication, so I would create a base ContentSyndicationException and then make PublishException extend ContentSyndicationException. This way, developers with complicated logging needs can easily filter all exceptions from your module.

In your cspell word list, you have "Syndication" and "syndication". This is fine, but you can simplify it to "~syndication".

The account form (https://git.drupalcode.org/project/content_syndication/-/blob/1.0.x/src/...) doesn't have any validation. Generally, forms should always validate when submitted.

In the tests, "Tests: Does something" is OK, but the normal way to write docblocks is "Tests that ..."

Limitations of my review:

I read the code myself and did not run anything. Due to lack of time, I did not dig into how the module sanitizes input, which is an area of concern for a module like this.

avpaderno’s picture

Thank you for applying!

Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.

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, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • 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 will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • 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 project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • For the tools to use for reviewing a project, see Tools to use for reviews.
  • It may be best to have the applicant fix things before further reviews and avoid doing a review when another review is pending.

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

Status: Needs review » Needs work

LICENSE.txt

The LICENSE.txt file is expected to be the same LICENSE.txt file used by Drupal core.

avpaderno’s picture

Issue summary: View changes
vishal.kadam’s picture

1. FILE: content_syndication.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.

2. FILE: src/SyndicationAccountListBuilder.php

  /**
   * The date formatter service.
   *
   * @var \Drupal\Core\Datetime\DateFormatterInterface
   */
  protected DateFormatterInterface $dateFormatter;

  /**
   * Constructs a new SyndicationAccountListBuilder.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
   *   The entity type definition.
   * @param \Drupal\Core\Entity\EntityStorageInterface $storage
   *   The entity storage class.
   * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
   *   The date formatter service.
   */
  public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatterInterface $date_formatter) {
    parent::__construct($entity_type, $storage);
    $this->dateFormatter = $date_formatter;
  }

FILE: src/Service/SyndicationTransformerService.php

  /**
   * The AI provider plugin manager.
   *
   * @var \Drupal\ai\AiProviderPluginManager
   */
  protected AiProviderPluginManager $aiProviderManager;

  /**
   * The logger channel.
   *
   * @var \Drupal\Core\Logger\LoggerChannelInterface
   */
  protected $logger;

  /**
   * Constructor.
   *
   * @param \Drupal\ai\AiProviderPluginManager $ai_provider_manager
   *   The AI provider plugin manager.
   * @param \Drupal\Core\Logger\LoggerChannelInterface $logger
   *   The logger channel.
   */
  public function __construct(
    AiProviderPluginManager $ai_provider_manager,
    LoggerChannelInterface $logger,
  ) {
    $this->aiProviderManager = $ai_provider_manager;
    $this->logger = $logger;
  }

FILE: src/Plugin/PublisherPlatformBase.php

  /**
   * The HTTP client factory.
   *
   * @var \Drupal\Core\Http\ClientFactory
   */
  protected ClientFactory $httpClientFactory;

  /**
   * The logger channel.
   *
   * @var \Drupal\Core\Logger\LoggerChannelInterface
   */
  protected LoggerChannelInterface $logger;

  /**
   * Constructs a PublisherPlatformBase plugin instance.
   *
   * @param array $configuration
   *   Plugin configuration.
   * @param string $plugin_id
   *   The plugin ID.
   * @param mixed $plugin_definition
   *   The plugin definition.
   * @param \Drupal\Core\Http\ClientFactory $http_client_factory
   *   The HTTP client factory.
   * @param \Drupal\Core\Logger\LoggerChannelInterface $logger
   *   The logger channel.
   */
  public function __construct(
    array $configuration,
    $plugin_id,
    $plugin_definition,
    ClientFactory $http_client_factory,
    LoggerChannelInterface $logger,
  ) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->httpClientFactory = $http_client_factory;
    $this->logger = $logger;
  }

Modules which are compatible with Drupal 10 and higher versions are expected to use constructor property promotion.

3. FILE: src/Entity/SyndicationAccount.php, src/Plugin/QueueWorker/SyndicationPublishWorker.php

Projects that are compatible with Drupal 10 or higher versions should use attributes instead of annotations.