Plugin Directory

Changeset 2139804


Ignore:
Timestamp:
08/15/2019 01:04:23 AM (7 years ago)
Author:
brewlabs
Message:

Add tracker config

Location:
sendpress/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sendpress/trunk/classes/class-sendpress-email.php

    r2059327 r2139804  
    3636    private $_html = false;
    3737    private $_tracker = true;
     38    private $_link_tracker = true;
     39    private $_open_tracker = true;
    3840
    3941   
     
    5355        $this->_tracker = $tracker;
    5456    }
     57
     58    function open_tracker($tracker = NULL){
     59        if ( ! isset( $tracker ) )
     60            return $this->_open_tracker;
     61        $this->_open_tracker = $tracker;
     62    }
     63
     64    function link_tracker($tracker = NULL){
     65        if ( ! isset( $tracker ) )
     66            return $this->_link_tracker;
     67        $this->_link_tracker = $tracker;
     68    }
    5569
    5670    function subscriber_id($subscriber_id = NULL){
     
    196210                    $pElement->setAttribute('style', ' margin-top:0; margin-bottom:10px; '. $body_font . $body_size . $px );
    197211                }
    198                 if($this->tracker()){
     212                if($this->link_tracker()){
    199213                $aTags = $dom->getElementsByTagName('a');
    200214                foreach ($aTags as $aElement) {
     
    333347
    334348
    335 
    336             if($this->tracker()) {
     349            $tracker = "";
     350            if($this->open_tracker()) {
    337351                $tracker = "<img src='" . $link . "' width='1' height='1'  alt='' border='0' style='height:1px !important; width:1px !important; border-width:0 !important; margin-top:0 !important; margin-bottom:0 !important; margin-right:0 !important; margin-left:0 !important; padding-top:0 !important; padding-bottom:0 !important; padding-right:0 !important; padding-left:0 !important;'/>";
    338352            }
  • sendpress/trunk/classes/class-sendpress-manager.php

    r1975180 r2139804  
    226226            $attempts++;
    227227            SendPress_Data::queue_email_process( $email->id );
    228             $result = SendPress_Manager::send_email_from_queue( $email, $user_tracker );
     228            $result = SendPress_Manager::send_email_from_queue( $email );
    229229           
    230230            if ($result) {
     
    360360    * @return boolean true if mail sent successfully, false if an error
    361361    */
    362     static function send_email_from_queue( $email , $tracker = true ) {
     362    static function send_email_from_queue( $email ) {
     363
     364        $link_tracker =  SendPress_Option::get( 'tracker_off', false);
     365        $user_tracker = true;
     366        if( $link_tracker == "true" ||  $link_tracker ==  true){
     367            $user_tracker = false;
     368        }
     369
     370        $open_tracker =  SendPress_Option::get( 'open_tracker_off', false);
     371        $user_open_tracker = true;
     372        if( $open_tracker == "true" || $open_tracker == true){
     373            $user_open_tracker = false;
     374        }
    363375
    364376        $message = new SendPress_Email();
    365377        $message->id( $email->emailID );
    366378        $message->subscriber_id( $email->subscriberID );
    367         $message->tracker( $tracker );
     379        $message->tracker( $user_tracker );
     380        $message->link_tracker($user_tracker);
     381        $message->open_tracker($user_open_tracker);
    368382        $message->list_id( $email->listID );
    369383        $body = $message->html();
     
    389403    static function send_test_email( $email ) {
    390404        SendPress_Email_Cache::build_cache_for_email($email->emailID);
     405
     406        $link_tracker =  SendPress_Option::get( 'tracker_off', false);
     407        $user_tracker = true;
     408        if( $link_tracker == "true" ||  $link_tracker ==  true){
     409            $user_tracker = false;
     410        }
     411
     412        $open_tracker =  SendPress_Option::get( 'open_tracker_off', false);
     413        $user_open_tracker = true;
     414        if( $open_tracker == "true" || $open_tracker == true){
     415            $user_open_tracker = false;
     416        }
     417
    391418        $message = new SendPress_Email();
    392419        $message->id( $email->emailID );
     
    394421        $message->subscriber_id( $email->subscriberID );
    395422        $message->list_id( $email->listID );
    396 
     423        $message->link_tracker($user_tracker);
     424        $message->open_tracker($user_open_tracker);
    397425        $fromname = '';
    398426        if(isset($email->from_name)){
  • sendpress/trunk/classes/class-sendpress-queue.php

    r1748979 r2139804  
    5555            if( $email != null ) {
    5656
    57                 $tracker_disable =  SendPress_Option::get( 'tracker_off', false);
    58                 $user_tracker = true;
    59                 if( $tracker_disable == "true" ){
    60                     $user_tracker = false;
    61                 }
     57
    6258           
    6359                global $wpdb;
    6460                        if( is_email( trim($email->to_email) ) && ( isset($email->is_confirm) || SendPress_Data::is_subscriber_active_or_unconfirmed($email->subscriberID ) )  ){
    6561                            SendPress_Data::queue_email_process( $email->id );
    66                             $result = SendPress_Manager::send_email_from_queue( $email , $user_tracker);
     62                            $result = SendPress_Manager::send_email_from_queue( $email );
    6763                       
    6864                            if ($result) {
     
    120116               
    121117                    SendPress_Data::queue_email_process( $email->id );
    122                     $result = SendPress_Manager::send_email_from_queue( $email , $user_tracker );
     118                    $result = SendPress_Manager::send_email_from_queue( $email );
    123119                    $email_count++;
    124120                    if ($result) {
  • sendpress/trunk/classes/views/class-sendpress-view-settings-pro-extras.php

    r1957583 r2139804  
    1616            SendPress_Option::set('import_update', false );
    1717        }
     18
     19        if(isset( $post['track_links'] )){
     20            SendPress_Option::set('tracker_off', true );
     21        } else {
     22            SendPress_Option::set('tracker_off', false );
     23        }
     24
     25        if(isset( $post['track_opens'] )){
     26            SendPress_Option::set('open_tracker_off', true );
     27        } else {
     28            SendPress_Option::set('open_tracker_off', false );
     29        }
    1830
    1931        SendPress_Admin::redirect('Settings_Pro_Extras');
     
    4355                <?php $this->panel_end(); ?>
    4456
     57                <?php $this->panel_start( __('Stat Tracking Settings','sendpress') ); ?>
     58                <?php $ctype = SendPress_Option::get('tracker_off'); ?>
     59                <input type="checkbox" name="track_links" value="true" <?php if($ctype){echo "checked='checked'"; } ?> /> &nbsp;<?php _e('Do not track link clicks in emails','sendpress'); ?>
     60                <p> <?php _e('This will disable the link tracker for all emails sent from now on.','sendpress'); ?></p>
     61                <?php $ctype = SendPress_Option::get('open_tracker_off'); ?>
     62                <input type="checkbox" name="track_opens" value="true" <?php if($ctype){echo "checked='checked'"; } ?> /> &nbsp;<?php _e('Do not track email opens','sendpress'); ?>
     63                <p> <?php _e('This will disable the open tracker for all emails sent from now on.','sendpress'); ?></p>
    4564
     65                <?php $this->panel_end(); ?>
    4666
    4767
  • sendpress/trunk/readme.txt

    r2108147 r2139804  
    55Requires at least: 4.4
    66Tested up to: 5.2.1
    7 Stable tag: 1.10.6.18
     7Stable tag: 1.10.8.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    119119Previous releases can be downloaded from [GitHub](https://github.com/brewlabs/sendpress/releases)
    120120
     121= 1.10.8.14 - 2019.8.14 =
     122* update settings for tracking in Pro
     123
    121124= 1.10.6.18 - 2019.6.18 =
    122125* update list import query for better error handling
  • sendpress/trunk/sendpress.php

    r2108147 r2139804  
    22/*
    33Plugin Name: SendPress Newsletters
    4 Version: 1.10.6.18
     4Version: 1.10.8.14
    55Plugin URI: https://sendpress.com
    66Description: Easy to manage Newsletters for WordPress.
     
    2020define( 'SENDPRESS_API_VERSION', 1 );
    2121define( 'SENDPRESS_MINIMUM_WP_VERSION', '3.6' );
    22 define( 'SENDPRESS_VERSION', '1.10.6.18' );
     22define( 'SENDPRESS_VERSION', '1.10.8.14' );
    2323define( 'SENDPRESS_URL', plugin_dir_url( __FILE__ ) );
    2424define( 'SENDPRESS_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.