Plugin Directory

Changeset 2044569


Ignore:
Timestamp:
03/05/2019 01:02:46 PM (7 years ago)
Author:
iteras
Message:

Show paywalled content to editors + indication of paywalled content in list + fixed problem with default paywall configuration

Location:
iteras/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • iteras/trunk/DEVELOPMENT.txt

    r2035229 r2044569  
    2121== Translation ==
    2222
    23 Extracting and compiling new translation messages (rerun after translation:
     23Extracting and compiling new translation messages (rerun after translation):
    2424
    2525   xgettext --indent --default-domain=iteras --language=PHP --keyword=__ --keyword=_e --sort-by-file --package-name=iteras --package-version=0.3 --msgid-bugs-address="team@iteras.dk" --output=languages/iteras-da_DK.pot `svn status -v -q | sed -e 's/  */ /g' | cut -d ' ' -f 5 | grep '.php$'` && msgmerge -o languages/iteras-da_DK.pox languages/iteras-da_DK.po languages/iteras-da_DK.pot && mv languages/iteras-da_DK.pox languages/iteras-da_DK.po && msgfmt -o languages/iteras-da_DK.mo languages/iteras-da_DK.po
  • iteras/trunk/README.txt

    r2035311 r2044569  
    33Requires at least: 3.5.1
    44Tested up to: 5.1
    5 Stable tag: 1.2.1
     5Stable tag: 1.3.0
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7070
    7171== Changelog ==
     72= 1.3.0 =
     73* Show paywalled content for editors
     74* Added indication if content is paywalled on post list view
     75* Fixed problem with default paywall configuration
     76
    7277= 1.2.1 =
    7378* Tested with WordPress 5.1
  • iteras/trunk/admin/assets/css/admin.css

    r1641255 r2044569  
    2828  color: #777;
    2929}
     30
     31table tr .column-iteras-paywalled {
     32  width: 60px;
     33  text-align: center;
     34}
     35
  • iteras/trunk/admin/iteras-admin.php

    r1880949 r2044569  
    4343    add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
    4444
     45    // Add column on post list
     46    add_filter( 'manage_post_posts_columns', array( $this, 'add_paywall_post_columns' ) );
     47    add_action( 'manage_post_posts_custom_column', array( $this, 'populate_paywall_post_columns' ), 10, 2 );
     48   
    4549    add_action( 'load-post.php', array( $this, 'paywall_post_meta_boxes_setup' ) );
    4650    add_action( 'load-post-new.php', array( $this, 'paywall_post_meta_boxes_setup' ) );
     
    8286
    8387
     88  function add_paywall_post_columns( $columns ) {
     89    $columns["iteras-paywalled"] = __("Paywall");
     90    return $columns;
     91  }
     92
     93 
     94  function populate_paywall_post_columns( $column, $post_id ) {
     95    if ($column == "iteras-paywalled") {
     96      $paywalled = !!get_post_meta($post_id, Iteras::POST_META_KEY, true);
     97      echo '<div class="dashicons dashicons-'. ($paywalled ? "yes" : "no") .'"></div>';     
     98    }
     99  }
     100
     101 
    84102  function paywall_post_meta_box( $post, $box ) {
    85103    $settings = $this->plugin->settings;
    86104    $domain = $this->plugin_slug;
    87 
    88     $enabled_paywalls = get_post_meta($post->ID, Iteras::POST_META_KEY, true);
    89105
    90106    $default_paywall = array();
     
    92108    if ($default_access != "")
    93109      $default_paywall = array($default_access);
     110
     111    // check if the post has ITERAS metadata
     112    if(in_array(Iteras::POST_META_KEY, get_post_custom_keys($post->ID))) {
     113      $enabled_paywalls = get_post_meta($post->ID, Iteras::POST_META_KEY, true);
     114    }
     115    else {
     116      $enabled_paywalls = $default_paywall;
     117    }
    94118
    95119    // backwards compatibility
     
    157181
    158182    $screen = get_current_screen();
    159     if ( in_array($screen->id, array("post", "settings_page_iteras")) ) {
     183    if ( in_array($screen->id, array("edit-post", "post", "settings_page_iteras")) ) {
    160184      wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), Iteras::VERSION );
    161185    }
  • iteras/trunk/iteras.php

    r2035311 r2044569  
    1313 * Plugin URI:        https://app.iteras.dk
    1414 * Description:       Integration with ITERAS, a cloud-based state-of-the-art system for managing subscriptions/memberships and payments.
    15  * Version:           1.2.1
     15 * Version:           1.3.0
    1616 * Author:            ITERAS
    1717 * Author URI:        https://www.iteras.dk
  • iteras/trunk/languages/iteras-da_DK.po

    r1880949 r2044569  
    66"Project-Id-Version: iteras\n"
    77"Report-Msgid-Bugs-To: team@iteras.dk\n"
    8 "POT-Creation-Date: 2018-05-24 18:24+0200\n"
    9 "PO-Revision-Date: 2018-05-24 18:24+0200\n"
     8"POT-Creation-Date: 2019-03-05 13:52+0100\n"
     9"PO-Revision-Date: 2019-03-05 13:51+0100\n"
    1010"Last-Translator: Ole Laursen <olau@iteras.dk>\n"
    1111"Language-Team: da\n"
     
    1515"Content-Transfer-Encoding: 8bit\n"
    1616
    17 #: admin/iteras-admin.php:51
     17#: admin/iteras-admin.php:55
    1818msgid "Everybody"
    1919msgstr "Alle"
    2020
    21 #: admin/iteras-admin.php:57
     21#: admin/iteras-admin.php:61
    2222msgid "Redirect to subscribe landing page"
    2323msgstr "Omdiriger til abonnér-landingsside"
    2424
    25 #: admin/iteras-admin.php:58
     25#: admin/iteras-admin.php:62
    2626msgid "Cut text and add call-to-action box"
    2727msgstr "Beskær tekst og tilføj call to action-boks"
    2828
    29 #: admin/iteras-admin.php:62
     29#: admin/iteras-admin.php:66
    3030msgid "Automatic"
    3131msgstr "Automatisk"
    3232
    33 #: admin/iteras-admin.php:63
     33#: admin/iteras-admin.php:67
    3434msgid "Custom"
    3535msgstr "Specialudviklet"
    3636
    37 #: admin/iteras-admin.php:80
     37#: admin/iteras-admin.php:84
    3838msgid "ITERAS Paywall"
    3939msgstr "ITERAS-paywall"
    4040
    41 #: admin/iteras-admin.php:109
     41#: admin/iteras-admin.php:89
     42msgid "Paywall"
     43msgstr "Betalingsmur"
     44
     45#: admin/iteras-admin.php:133
    4246msgid "Does not restrict visitors, everyone can see the content"
    4347msgstr "Begrænser ingen besøgende, alle kan se indholdet"
    4448
    45 #: admin/iteras-admin.php:110
     49#: admin/iteras-admin.php:134
    4650msgid ""
    4751"Content restricted to visitors who are in the subscriber database (but they "
     
    5155"have et aktivt abonnement)"
    5256
    53 #: admin/iteras-admin.php:111
     57#: admin/iteras-admin.php:135
    5458msgid "Content restricted to visitors with an active subscription"
    5559msgstr "Indhold begrænset til besøgende i abonnentdatabasen"
    5660
    57 #: admin/iteras-admin.php:179
     61#: admin/iteras-admin.php:203
    5862msgid "ITERAS configuration"
    5963msgstr "ITERAS-konfiguration"
    6064
    61 #: admin/iteras-admin.php:180
     65#: admin/iteras-admin.php:204
    6266msgid "ITERAS"
    6367msgstr "ITERAS"
    6468
    65 #: admin/iteras-admin.php:219
     69#: admin/iteras-admin.php:243
    6670msgid "Synchronization of paywalls from ITERAS complete"
    6771msgstr "Synkronisering af betalingsmure fra ITERAS gennemført"
    6872
    69 #: admin/iteras-admin.php:225
     73#: admin/iteras-admin.php:249
    7074msgid "Couldn't synchronize paywalls from ITERAS"
    7175msgstr "Kunne ikke synkronisere betalingsmure fra ITERAS"
    7276
    73 #: admin/iteras-admin.php:257
     77#: admin/iteras-admin.php:281
    7478msgid "Settings"
    7579msgstr "Indstillinger"
     
    278282"%'>siden med indstillinger</a> for at rette dem."
    279283
    280 #: public/iteras-public.php:402
     284#: public/iteras-public.php:397
     285msgid "This content is paywalled"
     286msgstr "Dette indhold er bag betalingsmur"
     287
     288#: public/iteras-public.php:397
     289msgid "You are seeing the content because you are logged into WordPress admin"
     290msgstr "Du ser indholdet da du er logget ind i WordPress admin"
     291
     292#: public/iteras-public.php:406
    281293msgid "ITERAS plugin improperly configured. Paywall box content is missing"
    282294msgstr ""
  • iteras/trunk/public/assets/css/public.css

    r1171668 r2044569  
    2222  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-8 */
    2323}
     24
     25.iteras-paywall-notice {
     26  background-color: #d43939;
     27  color: #fff;
     28  padding: 15px;
     29  line-height: 1.5;
     30  text-align: center;
     31  font-family: sans-serif;
     32  border-radius: 3px;
     33}
  • iteras/trunk/public/iteras-public.php

    r2035311 r2044569  
    1616class Iteras {
    1717
    18   const VERSION = '1.2.1';
     18  const VERSION = '1.3.0';
    1919
    2020  const SETTINGS_KEY = "iteras_settings";
     
    357357    if ($computed_hmac !== false && $key &&
    358358        (function_exists("hash_equals") ? !hash_equals($computed_hmac, $hmac) : $computed_hmac != $hmac))
    359       return false;   
     359      return false;
    360360
    361361    $parts = explode("|", $data);
     
    393393
    394394    $extra = "";
     395    // show message without paywall for editors
     396    if (current_user_can('edit_pages') && !empty($paywall_ids)) {
     397      $content = '<div class="iteras-paywall-notice"><b>'.__("This content is paywalled").'</b><br>'.__("You are seeing the content because you are logged into WordPress admin").'</div>'.$content;
     398    }
    395399    // paywall the content
    396     if (!empty($paywall_ids)) {
     400    else if (!empty($paywall_ids)) {
    397401      if ($this->settings['paywall_display_type'] == "samepage") {
    398402
     
    417421      if ($this->settings['paywall_server_side_validation'] &&
    418422          !(isset($_COOKIE['iteraspass'])
    419             && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings['api_key']))) {
     423         && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings['api_key']))) {
    420424        $content = truncate_html($content, array_get($this->settings, 'paywall_snippet_size', self::DEFAULT_ARTICLE_SNIPPET_SIZE));
    421425        $truncate_class = "iteras-content-truncated";
Note: See TracChangeset for help on using the changeset viewer.