[1.0.x] Buy Me a Coffee

Created on 15 May 2024, about 1 month ago
Updated 14 June 2024, 12 days ago

The Buy Me a Coffee module for Drupal allows users to easily integrate the Buy Me a Coffee donation platform into their websites

Project link

https://www.drupal.org/project/bmc →

📌 Task
Status

Fixed

Component

module

Created by

🇺🇦Ukraine darkdim Kyiv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @darkdim
  • 🇮🇳India vishal.kadam Mumbai

    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, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • 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 won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • 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.
    • 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 → .

  • 🇮🇳India vishal.kadam Mumbai

    Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

  • Status changed to Needs review 27 days ago
  • 🇺🇦Ukraine darkdim Kyiv
  • Status changed to Needs work 27 days ago
  • 🇮🇳India vishal.kadam Mumbai

    1. main is a wrong name for a branch. Release branch names always end with the literal .x as described in Release branches → . The only exception is for the main branch, which is actually not fully supported on drupal.org and should be avoided.

    2. Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bmc
    
    FILE: bmc/bmc.module
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ----------------------------------------------------------------------
     1 | ERROR | [x] Missing file doc comment
     3 | ERROR | [x] When importing a class with "use", do not include a leading \
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bmc/README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
    ----------------------------------------------------------------------
      3 | WARNING | Line exceeds 80 characters; contains 301 characters
     27 | WARNING | Line exceeds 80 characters; contains 100 characters
     29 | WARNING | Line exceeds 80 characters; contains 200 characters
     33 | WARNING | Line exceeds 80 characters; contains 126 characters
     35 | WARNING | Line exceeds 80 characters; contains 93 characters
     37 | WARNING | Line exceeds 80 characters; contains 98 characters
     39 | WARNING | Line exceeds 80 characters; contains 121 characters
     41 | WARNING | Line exceeds 80 characters; contains 104 characters
     43 | WARNING | Line exceeds 80 characters; contains 126 characters
     56 | WARNING | Line exceeds 80 characters; contains 125 characters
     60 | WARNING | Line exceeds 80 characters; contains 92 characters
    ----------------------------------------------------------------------
    
    FILE: bmc/src/Plugin/Block/BmcButtonBlock.php
    ----------------------------------------------------------------------
    FOUND 8 ERRORS AFFECTING 6 LINES
    ----------------------------------------------------------------------
     20 | ERROR | Missing short description in doc comment
     25 | ERROR | Missing short description in doc comment
     26 | ERROR | Missing parameter comment
     27 | ERROR | Missing parameter comment
     27 | ERROR | Missing parameter type
     28 | ERROR | Missing parameter comment
     28 | ERROR | Missing parameter type
     29 | ERROR | Missing parameter comment
    ----------------------------------------------------------------------
    
    FILE: bmc/src/Form/BmcConfigurationForm.php
    ----------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------
       8 | ERROR | [x] Missing class doc comment
     231 | ERROR | [x] Expected 1 blank line after function; 0 found
     232 | ERROR | [x] Expected 1 newline at end of file; 2 found
     232 | ERROR | [x] The closing brace for the class must have an empty line before it
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bmc/src/Controller/BmcHelpController.php
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ----------------------------------------------------------------------
     23 | ERROR | [x] Expected 1 blank line after function; 0 found
     24 | ERROR | [x] The closing brace for the class must have an empty line before it
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bmc/bmc.routing.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     15 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    3. Add README.md file and follow the content and formatting described in README.md template → .

    4. FILE: bmc.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.

    5. FILE: bmc.module

    /**
     * Implements hook_help().
     */
    function bmc_help($route_name, RouteMatchInterface $route_match) {
      // Stubs for Module overviews block.
    }

    Remove empty hook.

    6. FILE: src/Plugin/Block/BmcButtonBlock.php

      /**
       * @param array $configuration
       * @param $plugin_id
       * @param $plugin_definition
       * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
       */
      public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory) {

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.

    7. FILE: templates/bmc.html.twig

        <style>
          .bmc-btn {
            min-width: 210px;
            color: #FFFFFF !important;
            background-color: {{ background_color }} !important;
            height: 60px;
            border-radius: 12px;
            font-size: 28px !important;
            font-weight: Normal;
            border: none;
            padding: 0px 24px;
            line-height: 27px;
            text-decoration: none !important;
            display: inline-flex !important;
            align-items: center;
            font-family: {{ font_family }} !important;
            -webkit-box-sizing: border-box !important;
            box-sizing: border-box !important;
            text-align: left !important;
          }
    
          .bmc-btn-text {
            margin-left: 8px;
            display: inline;
            line-height: 0;
          }
    
          .bmc-btn svg {
            height: 32px !important;
            margin-bottom: 0px !important;
            box-shadow: none !important;
            border: none !important;
            vertical-align: middle !important;
            transform: scale(0.9);
          }
    
          @media (max-width: 1200px) {
            .bmc-btn {
              font-size: 24px !important;
            }
            .bmc-btn svg {
              height: 28px !important;
            }
    
          }
          .bmc-button img {
            box-shadow: none !important;
            vertical-align:
              middle !important;
          }
    
          .bmc-button {
            display:
              inline-block !important;
            padding:0px 10px  !important;
            color:
              #FFFFFF !important;
            background-color:
          {{ background_color }} !important;
            border-radius: 3px !important;
            border: 1px solid transparent !important;
            font-size: 28px !important;
            box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;
            -webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
            -webkit-transition: 0.3s all linear !important;
            transition: 0.3s all linear !important;
            margin: 0 auto !important;
            font-family: "{{ font_family }}"
            !important;
          }
    
          .bmc-button: hover,
          .bmc-button: active,
          .bmc-button: focus {
            -webkit-box-shadow: 0 4px 16px 0 rgba(190, 190, 190, .45) !important;
            box-shadow: 0 4px 16px 0 rgba(190, 190, 190, .45) !important;
            opacity: 0.85 !important;
            color:
              #FFFFFF !important;
          }
        </style>
    
        <link href="https://fonts.googleapis.com/css?family={{ font_family }}" rel="stylesheet">

    In Drupal 8 and later versions, stylesheets (CSS) and JavaScript (JS) are loaded through asset libraries → .

    <span class="bmc-btn-text">{{ custom_text|t }}</span>

    Variable translation should be handled in render array.

  • Status changed to Needs review 13 days ago
  • 🇺🇦Ukraine darkdim Kyiv
  • Status changed to RTBC 13 days ago
  • 🇮🇳India vishal.kadam Mumbai

    Rest looks fine to me.

    Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

  • Status changed to Fixed 12 days ago
  • 🇦🇹Austria klausi 🇦🇹 Vienna
    1. config schema is missing, see https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-... →
    2. Is there a reason why the permission "administer bmc" is marked as "restrict access"? Can you do arbitrary code execution with it? I see the config parameters being use with Drupal attributes, so everything should be escaped correctly. If there is no arbitrary code execution risk you could remove "restrict access" from the permission.

    Otherwise looks good to me.

    Thanks for your contribution, Dmitry!

    I updated your account so you can opt into security advisory coverage now.

    Here are some recommended readings to help with excellent maintainership:

    You can find lots more contributors chatting on Slack → or IRC → in #drupal-contribute. So, come hang out and stay involved → !

    Thanks, also, for your patience with the review process. 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.

    Thanks to the dedicated reviewer(s) as well.

Production build 0.69.0 2024