• Resolved info2grow

    (@info2grow)


    Been try to debug this for hours. First off the images were not being created in the track/e/o dir. Likely due to us being on WPEngine and them not allowing to write to the root. That said I could not find the code where the image is copied from the plugin to the dir.

    I added this to line 114 of TrackEmail.php

        public function get_track_code($email_id)
        {
    			
    			$structure = '/track/e/o/'.$email_id."/";
    			
    			$upload = wp_upload_dir();
    			$upload_dir = $upload['basedir'];
    			$upload_dir = $upload_dir . $structure;
    			if (! is_dir($upload_dir)) {
    				 if(!mkdir( $upload_dir, 0777, true )){
    					 echo 'Failed to create folders... '. $structure. '<br>';
    				 }
    			}
    
    			$plugin_file = get_site_url().'/wp-content/plugins/email-tracker/images/tack-log.png';
    			$log_file = $upload_dir."/tack-log.png";
    			
    			if (!copy($plugin_file, $log_file)) {
    				echo "failed to copy $plugin_file to $log_file...<br>";
    			}
    		return "<img />rw_url_email_open.$email_id."/tack-log.png?main_action=track-email.php&action=o&pk='.$email_id>";
    		}

    This creates the file so it shows in the email but opens are still not tracking.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter info2grow

    (@info2grow)

    Updated code email-tracker/model/TrackEmail.php:

    I update the path on line 21
    $this->rw_url_email_open = ‘/wp-content/uploads/track/e/o/’;

    And added code to copy the image over on line 114

    public function get_track_code($email_id)
    {

    $structure = ‘/track/e/o/’.$email_id.”/”;

    $upload = wp_upload_dir();
    $upload_dir = $upload[‘basedir’];
    $upload_dir = $upload_dir . $structure;
    if (! is_dir($upload_dir)) {
    if(!mkdir( $upload_dir, 0777, true )){
    echo ‘Failed to create folders… ‘. $structure. ‘<br>’;
    }
    }

    $plugin_file = get_site_url().’/wp-content/plugins/email-tracker/images/tack-log.png’;
    $log_file = $upload_dir.”/tack-log.png”;

    if (!copy($plugin_file, $log_file)) {
    echo “failed to copy $plugin_file to $log_file…<br>”;
    }
    return “rw_url_email_open.$email_id.”/tack-log.png”‘>”;
    }

    Keep in mind the plugin code has a typo on line 116 where it refers to the image as “track-log.png” when the file is actually named “tack-log.png”

    Plugin Author Prashant Baldha

    (@pmbaldha)

    I have solved the issue in 1.2 version. Thank You for your suggestion. If you need to fix anything else,please generate support ticket. I am always happy to help.

    Thread Starter info2grow

    (@info2grow)

    Still having the problem with the latest version. Could be a permissions issue as your plugin is trying to copy the file to it’s own directory in the root of the site.

    eg. https://www.mywebsite.com/track/e/o/2/track-log.png

    Perhaps this could be bypassed by staying in the WordPress install?

    eg. https://www.mywebsite.com/wp-content/uploads/track/e/o/2/track-log.png

    Plugin Author Prashant Baldha

    (@pmbaldha)

    Can you please visit https://www.mywebsite.com/track/e/o/2/track-log? and let me know can you see small pixel image or not.

    Thank you for your feedback. I am always happy to help.

    Plugin Author Prashant Baldha

    (@pmbaldha)

    I have release Email Tracker 1.2.3 version with fixing issue. Can you please test it? and update me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Image link broken, no tracking’ is closed to new replies.