Description

Basically the Boost Mobile module adds mobile support to the Boost module.

The Boost module provides static page caching for Drupal. It is designed to serve cached pages per domain.
So what if you want two versions of your website (let's say a desktop and mobile version) on the same domain name but still cached with boost ?

This is what the Boost mobile module is for. All Drupal users who already use the Boost module and want to have a mobile version of their website on the same domain name will be happy with this module.

Users will just have to choose a different Drupal theme for the mobile version.

Technically, we use the same logic as boost and generate some Apache rewrite rules to paste in .htaccess file. It's where we do all of the detection of user agent, cookies management and check of $_GET parameters.

Practically you just have to choose a Drupal theme to be associated to the mobile version of the site.

You also have a switcher block to switch between desktop and mobile version.
To use it, Just add this block in the region you want in desktop/mobile theme.

Project Page and git repository

https://drupal.org/sandbox/davidpetit/2153807
git clone --branch 7.x-1.x DavidPetit@git.drupal.org:sandbox/DavidPetit/2153807.git boost_mobile

Reviews of other projects

https://drupal.org/comment/8692729#comment-8692729
https://drupal.org/comment/8692509#comment-8692509
https://drupal.org/comment/8267277#comment-8267277

Comments

davidpetit’s picture

Issue summary: View changes
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.

davidpetit’s picture

Issue summary: View changes
federiko_’s picture

First I installed the module

I activated switcher block and all seemed to work well on my mobile and on my desktop devices. The right theme is displayed in both use cases. Boost mobile directory is created and Boost is serving cached pages as I could verify in source code.

Just a few comments:
I changed the Mobile cache directory value in configuration form and the old directory is still existing.
Also, I wonder if there is an alternative to editing settings.php

----

Then I did some code review.

Code looks all right for me. I'm not a Boost expert but all seems well structured from my point of view.

Some little corrections in your module files:

- In the README file
line 27 : "assiocated" (associated)
line 46 : "like any other modules" (like any other module)

- In boost_mobile.admin.inc
line 135 : "extesion" (extension)

federiko_’s picture

Status: Needs review » Needs work
davidpetit’s picture

Hi federiko, thanks for your feedback.

I changed the Mobile cache directory value in configuration form and the old directory is still existing.

Yes. It is already the same behaviour with Boost alone but it's not really a problem.

Also, I wonder if there is an alternative to editing settings.php

I already tried other solutions with hook_boot or hook_init. I also tried to dynamically change the directories in $_boost too but it can't work because boost module overwrite everything.
Since there are no hooks available in the boost module to dynamically alter the $_boost variable, it's the only way for now.

I made all the corrections you stated.

Moreover, pareview return 2 false positives:

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/boost_mobile.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
108 | ERROR | The $text argument to l() should be enclosed within t() so that
| | it is translatable
--------------------------------------------------------------------------------

The text passed in this l() function is a path and not a translatable string so we don't need to put t().

DrupalPractice has found some issues with your code, but could be false positives.
FILE: /var/www/drupal-7-pareview/pareview_temp/boost_mobile.blocks.inc
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 4 WARNING(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
25 | WARNING | #options values usually have to run through t() for translation
28 | WARNING | #options values usually have to run through t() for translation
40 | WARNING | #options values usually have to run through t() for translation
43 | WARNING | #options values usually have to run through t() for translation

Those are not translatable strings. We have some ID attributes and some query options which are not translatable and the same string in every language.

davidpetit’s picture

Status: Needs work » Needs review
federiko_’s picture

I'm ok with your answers David. Let's see what others have to say.

Alexxikon’s picture

Hi, DavidPetit,

I looked into this issue, about which federiko_ was asking for other opinions:

Moreover, pareview return 2 false positives:

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/boost_mobile.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
108 | ERROR | The $text argument to l() should be enclosed within t() so that
| | it is translatable
--------------------------------------------------------------------------------

The text passed in this l() function is a path and not a translatable string so we don't need to put t().

DrupalPractice has found some issues with your code, but could be false positives.
FILE: /var/www/drupal-7-pareview/pareview_temp/boost_mobile.blocks.inc
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 4 WARNING(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
25 | WARNING | #options values usually have to run through t() for translation
28 | WARNING | #options values usually have to run through t() for translation
40 | WARNING | #options values usually have to run through t() for translation
43 | WARNING | #options values usually have to run through t() for translation

Those are not translatable strings. We have some ID attributes and some query options which are not translatable and the same string in every language.

I agree that these are not translatable strings. You say "we don't need to put t()". In fact, I would say you must not use t(), lest they get translated and break your module in languages other than English. I would recommend adding a comment near each of these strings, to prevent accidental future modification by other maintainers.

davidpetit’s picture

Hi Alexxikon,

thanks for the feedback.

I commited the changes you suggest, thank you.

federiko_’s picture

Status: Needs review » Reviewed & tested by the community

Nothing to add David. Code is well written and remaining warnings and error are false positives. Looks RTBC. This is a useful module to implement some cached mobile version into the same domain than the desktop one.

davidpetit’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
Issue tags: +PAreview: review bonus
scotthooker’s picture

Further testing of this module.

1. Code is good and clean and the issues from the code check are not real issues
2. The results when using the module are good. https://developers.google.com/speed/pagespeed/ - the module does what it should do an improves speed and also improves the performance of my site according to google page speed.

klausi’s picture

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

Review of the 7.x-1.x branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/boost_mobile.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     5 | ERROR | Doc comment short description must end with a full stop
    --------------------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/boost_mobile.blocks.inc
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | Doc comment long description must start with a capital letter
    --------------------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/boost_mobile.admin.inc
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      19 | ERROR | Doc comment short description must end with a full stop
      24 | ERROR | Doc comment short description must end with a full stop
     120 | ERROR | Doc comment long description must start with a capital letter
    --------------------------------------------------------------------------------
    

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.

manual review:

  • boost_mobile_form_submit_handler(): why is this function in the module file and not in the admin.inc file?

But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to patrickd as he might have time to take a final look at this.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, DavidPetit!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on 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.

davidpetit’s picture

Hi klausi,

first of all thanks very much for helping in reviewing this project and for updating my account.

Also I commited all the changes you proposed in the previous post.

Many thanks to all the reviewers for this project.

Status: Fixed » Closed (fixed)

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