Plugin Directory

Changeset 3217981


Ignore:
Timestamp:
01/06/2025 08:52:01 PM (15 months ago)
Author:
wecantrack
Message:

Release 1.5.0

Location:
wecantrack
Files:
27 added
5 edited

Legend:

Unmodified
Added
Removed
  • wecantrack/trunk/WecantrackApp.php

    r3056236 r3217981  
    8080
    8181    /**
    82      * Responsible for checking if the website can redirect through &afflink parameter. (afflink is default)
    83      * Shouldn't be used if auto tagging is enabled.
     82     * Responsible for checking if the website can redirect through &afflink parameter.
    8483     *
    8584     * @return bool
    8685     */
    8786    private function can_redirect_through_parameter() : bool {
    88         if (! isset($this->options_storage['can_redirect_through_parameter']) || $this->options_storage['can_redirect_through_parameter'] === 1) {
    89             return true;
    90         }
    91 
    92         // if type=session is not found in the snippet, then we have to redirect through parameter
     87        // if not using auto-tagging and there is no explicit setting for we can redirect through parameter then we can redirect
    9388        // else we might break the redirects
    9489        if ($this->snippet && strpos($this->snippet, 'type=session') === false) {
    9590            return true;
     91        }
     92
     93        // default setting is false
     94        if (isset($this->options_storage['can_redirect_through_parameter'])) {
     95            if ($this->options_storage['can_redirect_through_parameter'] == 1) {
     96                return true;
     97            }
    9698        }
    9799
     
    205207        add_filter('wp_redirect', array($this, 'redirect_default'), 99);
    206208
    207         if (!isset($this->options_storage['include_script']) || $this->options_storage['include_script'] === true) {
     209        if (!isset($this->options_storage['include_script']) || $this->options_storage['include_script'] == true) {
    208210            add_action('wp_head', array($this, 'insert_snippet'));
    209211        }
  • wecantrack/trunk/readme.txt

    r3094460 r3217981  
    33Tags: affiliate, publisher, analytics, conversion tracking, sale attribution, dashboard, subid, google analytics, link, google ads, facebook, data studio, we can track, wecantrack, tracking tool
    44Requires at least: 4.6
    5 Tested up to: 6.4
    6 Requires PHP: 7.3
    7 Stable tag: 1.4.9
     5Tested up to: 6.7.1
     6Requires PHP: 7.4
     7Stable tag: 1.5.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    5858== Changelog ==
    5959
     60= 1.5.0 - 6th January 2025 =
     61 * Support WP 6.7.1
     62 * Sync wct script when upgrading plugin
     63 * Set afflink parameter off by default
     64
    6065= 1.4.9 - 29th May 2024 =
    61 * Do not run WCT on a cron job
     66 * Do not run WCT on a cron job
    6267
    6368= 1.4.8 - 20th March 2024 =
    64 * Redirect Through Parameter fix
     69 * Redirect Through Parameter fix
    6570
    6671= 1.4.7 - 28th December 2023 =
    67 * New setting added to disable redirect through parameter
     72 * New setting added to disable redirect through parameter
    6873
    6974= 1.4.6 - 16th October 2023 =
    70 * Detect Elementor's & Divi's page builder mode
     75 * Detect Elementor's & Divi's page builder mode
    7176
    7277= 1.4.5 - 17th August 2023 =
    73 * Do not log relative URLs as faulty
    74 * Wordpress 6.3 support
     78 * Do not log relative URLs as faulty
     79 * Wordpress 6.3 support
    7580
    7681= 1.4.4 - 10th January 2023 =
    77 * Fixed visual bug for disable wct.js script option
     82 * Fixed visual bug for disable wct.js script option
    7883
    7984= 1.4.3 - 21st December 2022 =
    80 * New option to disable wct.js script
     85 * New option to disable wct.js script
    8186
    8287= 1.4.2 - 10th October 2022 =
    83 * Made thrive page builder detection pattern more greedy
     88 * Made thrive page builder detection pattern more greedy
    8489
    8590= 1.4.1 - 31st August 2022 =
    86 * Improved affiliate url pattern matching
     91 * Improved affiliate url pattern matching
    8792
    8893= 1.4.0 - 16th March 2022 =
  • wecantrack/trunk/views/advanced_settings.php

    r3040267 r3217981  
    33$wecantrack_nonce = wp_create_nonce('wecantrack_nonce');
    44$wecantrack_storage = json_decode(get_option('wecantrack_storage'), true);
     5$wecantrack_script = get_option('wecantrack_snippet');
     6// $wecantrack_script = preg_replace('/\s+/', '', $wecantrack_script);
     7
     8$wecantrack_auto_tagging = false;
     9if (strpos($wecantrack_script, "'auto_tagging' : true") !== false) {
     10    $wecantrack_auto_tagging = true;
     11}
    512
    613//plugins status
     
    1623$wecantrack_ssl_status_disabled = !empty($wecantrack_storage['disable_ssl']) ? 'checked="checked"' : null;
    1724
    18 if (! isset($wecantrack_storage['can_redirect_through_parameter']) || $wecantrack_storage['can_redirect_through_parameter'] == true) {
     25if (isset($wecantrack_storage['can_redirect_through_parameter']) && $wecantrack_storage['can_redirect_through_parameter'] == true) {
    1926    $wecantrack_can_redirect_through_parameter_enabled = 'checked="checked"';
    2027    $wecantrack_can_redirect_through_parameter_disabled = null;
     
    145152                        </fieldset>
    146153
    147                         <p class="description">With auto-tagging enabled, the need to redirect through the 'afflink' parameter may become unnecessary, allowing you to disable this feature from your website.</p>
     154                        <p class="description">With auto-tagging enabled, the need to redirect through the 'afflink' parameter becomes irrelevant, this setting is now disabled by standard. We recommend to keep using auto-tagging since the afflink parameter can potentially be exploited by external parties to execute unauthorised redirects if they properly replicate the link and data parameter conditions.</p>
    148155                    </td>
    149156                </tr>
     157
     158                <!-- <tr class="wecantrack-plugin-enforce-turning-off-afflink-parameter">
     159                    <th scope="row">
     160                        <label for=""><?php echo esc_html__('Enforce turning off Redirect Through Parameter even when `Include WCT Script` is disabled', 'wecantrack'); ?></label>
     161                    </th>
     162
     163                    <td>
     164                        <fieldset>
     165                            <p>
     166                                <label>
     167                                    <input name="wecantrack_enforce_turning_off_afflink_parameter" type="radio" value="1">
     168                                    <?php echo esc_html__('Enable', 'wecantrack'); ?>
     169                                </label>
     170                                &nbsp;
     171                                <label>
     172                                    <input name="wecantrack_enforce_turning_off_afflink_parameter" type="radio" value="0">
     173                                    <?php echo esc_html__('Disable', 'wecantrack'); ?>
     174                                </label>
     175                            </p>
     176                        </fieldset>
     177
     178                        <p class="description">please ensure that your manually placed JS tag has auto-tagging enabled, else this setting can break your outgoing URLs.</p>
     179                    </td>
     180                </tr> -->
    150181
    151182                </tbody>
  • wecantrack/trunk/wecantrack.php

    r3094454 r3217981  
    77Plugin URI: https://wecantrack.com/wordpress
    88Description: Integrate all you affiliate sales in Google Analytics, Google Ads, Facebook, Data Studio and more!
    9 Version: 1.4.9
     9Version: 1.5.0
    1010Author: wecantrack.com
    1111Author URI: https://wecantrack.com
    12 Requires PHP: 7.3
     12Requires PHP: 7.4
    1313License: GPLv3
    1414Text Domain: wecantrack
     
    1717if(!defined('ABSPATH')) { die('You are not allowed to call this page directly.'); }
    1818
    19 define('WECANTRACK_VERSION', '1.4.9');
     19define('WECANTRACK_VERSION', '1.5.0');
    2020define('WECANTRACK_PLUGIN_NAME', 'wecantrack');
    2121define('WECANTRACK_PATH', WP_PLUGIN_DIR.'/'.WECANTRACK_PLUGIN_NAME);
     
    4848register_deactivation_hook(__FILE__, 'wecantrack_plugin_deactivation');
    4949register_uninstall_hook(__FILE__, 'wecantrack_plugin_uninstall');
     50add_action('upgrader_process_complete', 'wecantrack_plugin_upgraded', 10, 2);
    5051
    5152function wecantrack_plugin_activation()
     
    8586    delete_option('wecantrack_storage');
    8687}
     88
     89function wecantrack_plugin_upgraded($upgrader_object, $options) {
     90    $current_plugin_path_name = plugin_basename( __FILE__ );
     91   
     92    if ($options['action'] == 'upgrade' && $options['type'] == 'plugin') {
     93       foreach($options['plugins'] as $each_plugin) {
     94          if ($each_plugin == $current_plugin_path_name) {
     95            $api_key = get_option('wecantrack_api_key');
     96
     97            if (empty($api_key)) {
     98                return;
     99            }
     100
     101            // refetch the wecantrack script
     102            $domainURL = home_url();
     103            try {
     104                WecantrackHelper::update_tracking_code($api_key, $domainURL);
     105                WecantrackHelper::update_user_website_information($api_key, $domainURL);
     106            } catch (\Exception $e) {
     107                error_log('WCT Plugin: Error occurred during plugin upgrade. Message: ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine());
     108            }
     109
     110            // set can_redirect_through_parameter to true if include_script is false and can_redirect_through_parameter is not set
     111            $wecantrack_storage = json_decode(get_option('wecantrack_storage'), true);
     112
     113            if (!isset($wecantrack_storage['can_redirect_through_parameter']) || $wecantrack_storage['can_redirect_through_parameter'] === null) {
     114                if (isset($wecantrack_storage['include_script']) && $wecantrack_storage['include_script'] == false) {
     115                    $wecantrack_storage['can_redirect_through_parameter'] = true;
     116                    update_option('wecantrack_storage', json_encode($wecantrack_storage));   
     117                }
     118            }
     119          }
     120       }
     121    }
     122}
  • wecantrack/trunk/wecantrack.pot

    r3094454 r3217981  
    1 # Copyright (C) 2024 wecantrack.com
     1# Copyright (C) 2025 wecantrack.com
    22# This file is distributed under the same license as the WeCanTrack plugin.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WeCanTrack 1.4.9\n"
     5"Project-Id-Version: WeCanTrack 1.5.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wecantrack\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-05-29T09:53:19+00:00\n"
     12"POT-Creation-Date: 2025-01-06T20:39:49+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.4.0\n"
     
    3535msgstr ""
    3636
    37 #: views/advanced_settings.php:57
     37#: views/advanced_settings.php:64
    3838msgid "Include WCT Script"
    3939msgstr ""
    4040
    41 #: views/advanced_settings.php:65
    42 #: views/advanced_settings.php:89
    43 #: views/advanced_settings.php:113
    44 #: views/advanced_settings.php:137
     41#: views/advanced_settings.php:72
     42#: views/advanced_settings.php:96
     43#: views/advanced_settings.php:120
     44#: views/advanced_settings.php:144
     45#: views/advanced_settings.php:168
    4546#: views/redirect_page.php:51
    4647#: views/settings.php:79
     
    4849msgstr ""
    4950
    50 #: views/advanced_settings.php:70
    51 #: views/advanced_settings.php:94
    52 #: views/advanced_settings.php:118
    53 #: views/advanced_settings.php:142
     51#: views/advanced_settings.php:77
     52#: views/advanced_settings.php:101
     53#: views/advanced_settings.php:125
     54#: views/advanced_settings.php:149
     55#: views/advanced_settings.php:173
    5456#: views/redirect_page.php:56
    5557#: views/settings.php:84
     
    5759msgstr ""
    5860
    59 #: views/advanced_settings.php:81
     61#: views/advanced_settings.php:88
    6062msgid "Use WCT referrer cookie"
    6163msgstr ""
    6264
    63 #: views/advanced_settings.php:105
     65#: views/advanced_settings.php:112
    6466msgid "Verify SSL"
    6567msgstr ""
    6668
    67 #: views/advanced_settings.php:129
     69#: views/advanced_settings.php:136
    6870msgid "Redirect Through Parameter (afflink)"
    6971msgstr ""
    7072
    71 #: views/advanced_settings.php:155
     73#: views/advanced_settings.php:160
     74msgid "Enforce turning off Redirect Through Parameter even when `Include WCT Script` is disabled"
     75msgstr ""
     76
     77#: views/advanced_settings.php:186
    7278#: views/redirect_page.php:104
    7379#: views/settings.php:109
Note: See TracChangeset for help on using the changeset viewer.