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

The PA is to maintain and take over D8 branch after porting of the Google CSE module. D7 code referred for porting is 7.x-2.x

Code repo: http://cgit.drupalcode.org/google_cse/tree/?h=8.x-2.x

Setting up repository for the first time

git clone --branch 8.x-2.x https://git.drupal.org/project/google_cse.git
cd google_cse

PA Reviews
https://www.drupal.org/node/2840054#comment-11854013
https://www.drupal.org/node/2839668#comment-11864451
https://www.drupal.org/node/2743377#comment-11918506

Second set of reviews
https://www.drupal.org/node/2850757#comment-11940162
https://www.drupal.org/node/2853529#comment-11946250
https://www.drupal.org/node/2851068#comment-11948012

Comments

navneet0693 created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgprojectgoogle_csegit

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.

navneet0693’s picture

Resolve error reported on pareviews node. Please see: https://pareview.sh/node/987, marking it for needs review.

navneet0693’s picture

Status: Needs work » Needs review
navneet0693’s picture

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

Status: Needs review » Needs work

I am changing status to "Needs work" following the comment by Rick Hood here: https://www.drupal.org/node/2387189#comment-11919012

navneet0693’s picture

Status: Needs work » Needs review

Now that the issue is fixed, I am again updating it to "Needs Review".

JayKandari’s picture

Status: Needs review » Needs work

Automated Review

Hi @navneet0693, Found Some minor issues with coder module given below.

FILE: ...MP/htdocs/drupal8/modules/custom/google_cse/google_cse.theme.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 56 | ERROR | [x] Array closing indentation error, expected 2 spaces
    |       |     but found 4
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...s/MAMP/htdocs/drupal8/modules/custom/google_cse/js/google_cse.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...tdocs/drupal8/modules/custom/google_cse/js/google_cse_results.js
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
 10 | ERROR | [x] Inline comments must start with a capital letter
 10 | ERROR | [x] Inline comments must end in full-stops, exclamation
    |       |     marks, colons, question marks, or closing
    |       |     parentheses
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 1.03 secs; Memory: 10Mb

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 the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
Only minor code style issues found. Check Automated review section.

Suggestions:

Overall, the module looks good. I think calls to \Drupal::config() should be done thru Dependency Injection. Following Instances found

src/Plugin/Search/GoogleCSESearch.php:172:    if (!(\Drupal::config('googlcse.settings')->get('configuration')['use_adv'])) {
src/Plugin/Search/GoogleCSESearch.php:228:    if (!\Drupal::config('search.page.google_cse_search')->get('configuration')['use_adv']) {
src/Plugin/Search/GoogleCSESearch.php:236:      'cx' => \Drupal::config('search.page.google_cse_search')->get('configuration')['cx'],
src/Plugin/Search/GoogleCSESearch.php:237:      'cof' => $here ? \Drupal::config('search.page.google_cse_search')->get('configuration')['cof_here'] : \Drupal::config('search.page.google_cse_search')->get('configuration')['cof_google'],

This review uses the Project Application Review Template.

navneet0693’s picture

Status: Needs work » Needs review

@JayKandari Thank you for your reviews! I have implemented and pushed all your suggestions.

denutkarsh’s picture

Status: Needs review » Reviewed & tested by the community

All the issues mention in #9 are solved now. And i manually checked the project, i guess this could get RTBC.

navneet0693’s picture

Title: [D8] Port Google Custom Search Engine to D8 » [D8] Google Custom Search Engine
aloknarwaria’s picture

Hi @navneet0693,

Please find the review report.

1. In your file name "GoogleCSESearch.php" at line number 105, you have hard cord the configuration. I suggest you please write this configuration in your install YAML configuration file.

2. File name "GoogleCSESearch.php" and line number 278 you have hard coded the anchor link "Enter your <a target="_blank" href="http://www.google.com/cse/manage/all">Google CSE unique ID</a> (click on control panel)."
I know drupal url method is complex but please try to use them to create internal and external links.
Similarly, at line number 449 you again use hard coded anchor link "Enter a 2-letter country code, e.g. <em>uk</em>, to boost documents written in a particular country. See the <a target="_blank" href="https://developers.google.com/custom-search/docs/xml_results#glsp"><em>gl</em> parameter</a>."

There are so many places I found the same issue please use "Drupal::l" method for the same.

3. In your file name "google_cse.module" you have used the code "$hl = $config->get('configuration')['hl'];" is wrong way to use the configuration. Recomanded way to use them is like to avoid the undefined variables."

$settings = $config->get('configuration');
$hl = isset($settings['hl'])?$settings['hl']:NULL;

"

Apart from the suggestion, your code looks good. Great work :)

navneet0693’s picture

In your file name "GoogleCSESearch.php" at line number 105, you have hard cord the configuration. I suggest you please write this configuration in your install YAML configuration file.

Google CSE is a new search plugin, which isn't overriding any default's or nor adding any new Google CSE search's. defaultConfigurations() serves the same purpose: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Plug..., as it is done in EmailAction in core. Please correct me, if I am wrong :)

There are so many places I found the same issue please use "Drupal::l" method for the same.

Thanks, it seems like i missed them some how. Now I have used Link::fromTextAndUrl() and Url::fromUri() like used in google_cse.theme.inc as \Drupal::l() is now deprecated.

In your file name "google_cse.module" you have used the code "$hl = $config->get('configuration')['hl'];" is wrong way to use the configuration. Recomanded way to use them is like to avoid the undefined variables."

I am not sure why you said "wrong way". But yes I have added a missing check on return statement.

Thank very much for your review, it improves a lot :)

naveenvalecha’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus

Review:
1) google_cse_theme: Where's the template file for google_cse_adv_results ? Does this todo points to some d.org issue
2) Add @return types of the functions in the class GoogleCSEServices
3) GoogleCSEServices: Use CSEconfig is better name for class property rather than config
4) GoogleCSEServices: Link @TODOs to d.o issues
5) GoogleCSEServices: Inject the services like languageManager
6) GoogleCSEServices: getResponse: Why are you using curl? Why can't you use guzzle i.e. http client service
7) (*) theme_google_cse_search_noresults : Remove html out from translation function

Please take another review bonus for next git admin review.
//Naveen

navneet0693’s picture

Status: Needs work » Needs review

@naveenvalecha Thank you very much for suggestion, I will implement them. Before releasing the stable version of google_cse will go through a lot of changes. TODO's will be resolved on the basis of plans of other maintainers. We are working in issue queues to get them resolved. I have also filed an issue for making no result message configurable, let's see what other maintainers think of it.

Believing that above mentioned suggestions aren't PA blockers, I will mark it again for reviews.

navneet0693’s picture

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

Automated Review

Please correct the Pareview.sh errors.

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 the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
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. (*) No Major finding.
  2. (+) No Release blocker.
  3. Just a recommendation - Correct the automated review errors.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

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.

yogeshmpawar’s picture

Status: Needs review » Reviewed & tested by the community

So there are no release blockers present in this project so marking this project as RTBC.

navneet0693’s picture

Issue summary: View changes
navneet0693’s picture

Priority: Normal » Critical
apaderno’s picture

Assigned: Unassigned » apaderno
Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed
Related issues: -#2843268: [Meta] Port Google Custom Search Engine to Drupal 8, -#2849854: Push code from git repo to 8.x-2.x branch of module, -#2387189: [google_cse] Google Custom Search Engine

Thank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.

I thank all the dedicated reviewers as well.

apaderno’s picture

Status: Fixed » Closed (fixed)

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