This project creates a block in the block layout settings of Drupal 8 which let's a user/editor add a LinkedIn Profile to a website by simply entering the URL and display mode in the block settings.
https://www.drupal.org/sandbox/leanderlindahl/2687063

I would like to promote this Sandbox project to a full/regular project. I believe it will be beneficial to Drupal to provide this type of simple "widget" that provides a quick and simple way to implement this popular functionality.

Git clone command:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/leanderlindahl/2687063.git linkedin_profile

Manual reviews of other projects:
https://www.drupal.org/node/2682243
https://www.drupal.org/node/2686075
https://www.drupal.org/node/2672748

Comments

leanderl created an issue. See original summary.

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2687067

Project 2: https://www.drupal.org/node/2685727

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

vipul.patil7888’s picture

StatusFileSize
new7.68 KB

Hi leanderl,

I have found couple of issues in your project. Please find those issues in "reviewed-module.txt" file attached.

Thanks,
Vipul

leanderl’s picture

@vipul.patil7888 Thanks for helping out in reviewing my module and providing this detailed feedback. What software did you use to generate the report was it coder module? (I'd like to run it through the same process when I've adressed the issues, to make sure they have been fixed.)

leanderl’s picture

@vipul.patil7888 I have now improved the code standard so that it passes the coder 'drupalcs' test and added hook_help() with instructions to the project. Thanks for pointing these things out!

leanderl’s picture

Issue summary: View changes
leanderl’s picture

Issue summary: View changes
utiks’s picture

Hi leanderl,

i think that you shouldn't load scripts like this in your twig template : <script src="//platform.linkedin.com/in.js" type="text/javascript"></script> you can check how to do it in a better way with libraries or the #attached property here : https://www.drupal.org/theme-guide/8/assets

leanderl’s picture

Title: LinkedIn Profile [D8] » [D8] LinkedIn Profile
Status: Needs work » Needs review
leanderl’s picture

Issue summary: View changes
leanderl’s picture

Status: Needs work » Needs review
leanderl’s picture

Issue summary: View changes
leanderl’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
harish b’s picture

Status: Needs review » Needs work

Git errors:

Git default branch is not set, see the documentation on setting a default branch.
Review of the 8.x-1.x branch (commit 29e5b73):

Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
DrupalPractice has found some issues with your code, but could be false positives.
FILE: ...al-7-pareview/pareview_temp/src/Plugin/Block/LinkedinProfileBlock.php
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
57 | WARNING | #description values usually have to run through t() for
| | translation
---------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/linkedin_profile.install
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
14 | WARNING | Unused variable
| | $must_have_some_php_to_pass_coding_standard.
---------------------------------------------------------------------------

Time: 37ms; Memory: 4.25Mb

No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

FILE: ...ar/www/drupal-7-pareview/pareview_temp/linkedin_profile.libraries.yml
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: ...al-7-pareview/pareview_temp/src/Plugin/Block/LinkedinProfileBlock.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
2 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

Time: 96ms; Memory: 6.75Mb

Source: http://pareview.sh/ - PAReview.sh online service

leanderl’s picture

@utiks: I hadn't thoght of that seeing that the markup was a "ready" snippet from LinkedIn. But putting it in libraries.yml is definetly nicer. Thanks for pointing it out.

@harish b: Thank you for the test. I have addressed the default branch issue now and also addressed most of the error messages.

panshulk’s picture

StatusFileSize
new86.52 KB

Automated Review
There are some minor errors & warnings the automated test reports, see http://pareview.sh/pareview/httpgitdrupalorgsandboxleanderlindahl2687063git

Manual Review :

Installed the module, and followed all the steps mentioned in the help. But LinkedIn Profile block with inline as a choice is empty as shown in the screen shot below:
linkedin_marked

leanderl’s picture

Status: Needs work » Needs review

@panshulk Thanks for taking the time to test the module – that's very kind of you.
What settings have you used? I double checked the module and was unable to reproduce your problem. What linkedin url did you enter? If you'd care to take a screenshot of your settings it would be greatly appreciated.

chapabu’s picture

Issue summary: View changes
StatusFileSize
new164.02 KB
new125.96 KB

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[Yes: Follows] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows / No: Does not follow] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows] the guidelines for in-project documentation and/or the README Template.

Seems a little odd having such short lines in the last paragraph and longer lines above, but this isn't a massive thing.

Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.

I think this just passes..it's pretty short, but there's not a lot that can be done about that due to the nature of the module.

Secure code
[Yes: Meets the security requirements.]

Looks good to me.

Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. <?php
    /**
     * @file
     * Contains \Drupal\linkedin_profile\Plugin\Block\LinkedInProfileBlock.
     */
    

    Namespaced classes, interfaces and traits should not begin with a file doc comment

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

There are also a couple of other things I noticed; please see the following:

1. I can replicate the issue found by panshulk in #19. I used my own LinkedIn profile URL as found here: https://www.linkedin.com/in/matt-chapman-92225123. I've attached a screenshot of my configuration.

2. I think 1 may be due to the fact you're including in.js twice. Once in the library definition, and once in the template. There's an error message in the console stating that "duplicate in.js loaded, and parameters will be ignored". This is followed by a bunch of LinkedIn errors. I've attached a screenshot.

3. I'd want to shorten the help text variable. 500 characters long is pretty wide. Perhaps you could split it up as a multiline variable assignment across multiple lines?

4. In linkedin_profile.module you've got the following in your hook_theme implementation:

        'profile_type' => 'Profile type from module file',
        'profile_url' => 'Profile URL from module file',
        'display_mode' => 'Display mode from module file',
        'profile_name' => 'Profile name from module file',

Are these actually the default values for these variables? Seems like they should be empty or NULL

5. I don't think the theme hook name has to be block--linkedin-profile. It's a little confusing as it's not actually a block template..it's the template for the content inside the block. I'd be tempted to rename it to just linkedin-profile.

6. As an aside/personal preference..the if/else blocks in LinkedinProfileBlock::build look a bit overwhelming. It might be more readable if you were to break them up with a little whitespace, or move them to ternary operators on the render array.

7. You don't need the title key in your hook_theme implementation

8. In your info.yml file you've got it listed as being part of the Custom package. Seems like this shouldn't be the case as when released the module will no longer be "Custom".

9. Do you need the '#description' => t('description from block.php'), on line 57 in LinkedinProfileBlock.php?

10. Should line 93 in LinkedinProfileBlock.php read "block" instead of "plugin"?

chapabu’s picture

Status: Needs review » Needs work
chapabu’s picture

Issue summary: View changes
panshulk’s picture

StatusFileSize
new96.21 KB

@leanderl Thanks for the quick heads up. The Settings are as follows :profilescreen

leanderl’s picture

@panshulk Thank you for replying. You've been very helpful. I'm really stuck how to solve the problem though. When I try LinkedIn's own tool for generating the corresponding code snippet it won't render anything with your profile url (https://in.linkedin.com/in/panshul-khurana-0bb26ab3):
https://developer.linkedin.com/plugins/member-profile

I'm puzzled. Am I missing something? Or does this problem reside within LinkedIn's own handling of member profile URL:s?

panshulk’s picture

@leanderl Thank you for looking into it. :)
I suppose this problem resides within LinkedIn's Member profile URL:s , because i tried working out with a different URL and there seems to be no problem with displaying the profile.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.