OnePass for Drupal
---------------------

Git access
---------------------
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/onepass/2657542.git onepass
cd onepass

CONTENTS OF THIS FILE
---------------------
* About 1Pass
* Basic usage
* Requirements
* Recommended modules
* Installation
* Configuration
* Feed
* Test and Live environments
* Using 1Pass to control access to your content
* Maintainers

About 1Pass
---------------------
1Pass is a platform for single-article sales.

When 1Pass users see an article for sale behind the 1Pass button on a participating
web site, they click it and the article appears. 1Pass takes care of all the
accounting behind the scenes.

This module makes that possible in the following ways:

- It populates the button embed code
- It provides a shortcode to add to posts where the 1Pass embed should appear
- It provides a virtual display suite field which will automatically truncate the posts in case the editor doesn't enter the shortcode
- It provides a built in Atom feed to make your content available to 1Pass

It also provides

- The option to use 1Pass to restrict content
-- This option can be set when creating the content type
-- This option can then be overriden on each nodes

To use the module, you need

* 1Pass API credentials

To get these, enter your email at 1pass.me.

Basic usage
---------------------
This assumes that you already have a paywall or some other means of restricting content. If you want to use 1Pass for this, see _Using 1Pass to control your content_, below.

Requirements
---------------------
* Views

Recommended modules
---------------------
* Display suite

Installation
---------------------
Install the module under sites/all/modules/contrib
Enable the module.

Configuration
---------------------
There, you'll need to fill in your 1Pass publishable key and secret key under : admin/config/content/onepass

Enabling a post for 1Pass :
1) You have to edit a content type and configure it for being enabled with 1Pass integration
2) You may configure the virtual display suite field for automatically truncate 1Pass content each time at the same place
3) You can then choose to activate or not each content for being 1Pass able and so use the shortcode in the content

Feed
---------------------
The feed will update every time you update your website. 1Pass will automatically discover any new content or updates to your existing content.
The feed is managed by the view : onepass_atoms which is restricted to be viewed by 1Pass servers only.

Test and Live environments
---------------------
If you're a developer fine-tuning your 1Pass integration on a staging server, use Dev API host to have 1Pass communicate with the 1Pass test server.
This setting is configured on admin/config/content/onepass

Using 1Pass to control access to your content
---------------------
If your content is currently free-to-air, you can use the 1Pass module to control access. Enable the '1Pass paywall' box on the settings page and on any content type.

Once this setting is checked, you can lock up a piece by adding the `[1pass]` shortcode into the body copy, and ticking the 1Pass checkbox for that piece. This will result in the post content being truncated at that point and the 1Pass button being injected.

Maintainers
---------------------
This project has been sponsored by :
* onepass : https://1pass.me/

Comments

onepass created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

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.

onepass’s picture

Issue summary: View changes
onepass’s picture

Status: Needs work » Needs review
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/httpgitdrupalorgsandboxonepass2657542git

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

dave bagler’s picture

Took a look, here's some thoughts:

Please remove version from the info file, that should be set through creating releases.

I see a number of variable_get calls to 'onepass_node_' { node type } but I don't see any variable_set calls.

If the 'onepass_node_' { node type } variables are being set, they should be deleted in the uninstall hook.

If the 'onepass_node_' { node type } variables aren't being set why are there calls to get them?

antonnavi’s picture

Status: Needs work » Needs review

Thank You for review, Dave Bagler!
Variables 'onepass_node_' { node type } is set automatically with code:

  // Save or reset persistent variable values.
  foreach ($variables as $key => $value) {
    $variable_new = $key . '_' . $type->type;
    $variable_old = $key . '_' . $type->old_type;

    if (is_array($value)) {
      $value = array_keys(array_filter($value));
    }
    variable_set($variable_new, $value);

    if ($variable_new != $variable_old) {
      variable_del($variable_old);
    }
  }

located in node_type_form_submit() function /modules/node/content_types.inc file.
Remove 'onepass_node_' { node type } variables on module uninstall was added.
Version was removed from the .info file.

madan879’s picture

Hi,

Still there are basic issues are remaining to fix based on pareview (http://pareview.sh/pareview/httpgitdrupalorgsandboxonepass2657542git) suggestion.

antonnavi’s picture

Thank You for review, madan879 !
Formatting was updated (fixed issues from http://pareview.sh/pareview/httpgitdrupalorgsandboxonepass2657542git) except:

10 | ERROR | [ ] Method name "onepass_access_plugin::summary_title" is
| | not in lowerCamel format
21 | ERROR | [ ] Method name "onepass_access_plugin::get_access_callback"
| | is not in lowerCamel format

lines because "summary_title" and "get_access_callback" declared with this names in parent class and should be overridden with the same names.

madan879’s picture

Hi,

Manual Review of your module
Please add hook_help in module file, you can link to admin configuration page.

antonnavi’s picture

Hi, madan879!
Thank You for advice!
hook_help was added to module.

sanket1007’s picture

Hey,

I checked the module with pa review and it gave me the following error :

FILE: /var/www/drupal-7-pareview/pareview_temp/onepass.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
449 | ERROR | Type hint "text" missing for $bundle
----------------------------------------------------------------------

FILE: ...review/pareview_temp/includes/views/plugins/onepass_access_plugin.inc
---------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------
10 | ERROR | Doc comment short description must be on a single line,
| | further text should be a separate paragraph
17 | ERROR | Public method name "OnepassAccessPlugin::summary_title" is
| | not in lowerCamel format
40 | ERROR | Public method name
| | "OnepassAccessPlugin::get_access_callback" is not in
| | lowerCamel format
---------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------
21 | WARNING | Line exceeds 80 characters; contains 83 characters
29 | WARNING | Line exceeds 80 characters; contains 135 characters
46 | WARNING | Line exceeds 80 characters; contains 173 characters
63 | WARNING | Line exceeds 80 characters; contains 108 characters
66 | WARNING | Line exceeds 80 characters; contains 93 characters
67 | WARNING | Line exceeds 80 characters; contains 122 characters
68 | WARNING | Line exceeds 80 characters; contains 116 characters
72 | WARNING | Line exceeds 80 characters; contains 143 characters
73 | WARNING | Line exceeds 80 characters; contains 103 characters
77 | WARNING | Line exceeds 80 characters; contains 148 characters
82 | WARNING | Line exceeds 80 characters; contains 166 characters
84 | WARNING | Line exceeds 80 characters; contains 258 characters
----------------------------------------------------------------------

FILE: ...-7-pareview/pareview_temp/theme/onepass-shortcode-placeholder.tpl.php
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 81 characters
---------------------------------------------------------------------------

Please fix it.

antonnavi’s picture

Thank You for review, sanket1007!

Listed issues was fixed except:

FILE: ...review/pareview_temp/includes/views/plugins/onepass_access_plugin.inc
---------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------
16 | ERROR | Public method name "OnepassAccessPlugin::summary_title" is
| | not in lowerCamel format
39 | ERROR | Public method name
| | "OnepassAccessPlugin::get_access_callback" is not in
| | lowerCamel format
---------------------------------------------------------------------------

Because "summary_title" and "get_access_callback" declared with this names in parent class and should be overridden with the same names.

http://pareview.sh/pareview/httpsgitdrupalorgsandboxonepass2657542git

splendidles’s picture

Cool submission, you do have only one blocker issue and that is you are not using an individual user account. I couldn't really find anything that stuck out to me as an issue other than that. I've placed the review below with only one minor suggestion:

Automated Review

Parereview is reporting only 2 errors: http://pareview.sh/pareview/httpsgitdrupalorgsandboxonepass2657542git-7x-1x
Refer to Comment #13.

Manual Review

Individual user account

[No] Does not follow the guidelines for individual user accounts.
You should create a regular user account for this module, not use a company account.

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

This isn't really a blocker, but I noticed you have built your own pagination function, it might be possible to simplify this with Drupals built in pager theme_pager

splendidles’s picture

Status: Needs review » Needs work

Setting to need work, does not meet Individual User Account requirements.

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.