Plugin Directory

Changeset 2314056


Ignore:
Timestamp:
05/28/2020 10:23:30 PM (6 years ago)
Author:
wecantrack
Message:

Optimisation fix

Location:
wecantrack
Files:
21 added
4 edited

Legend:

Unmodified
Added
Removed
  • wecantrack/trunk/WecantrackApp.php

    r2310737 r2314056  
    117117        try {
    118118            if (!self::is_affiliate_link($api_key, $original_affiliate_url)) {
    119                 throw new \Exception('wecantrack: will not process, it is not an affiliate URL');
     119                //wecantrack: will not process URL, it is not an affiliate URL (do not log it)
     120                return $original_affiliate_url;
    120121            }
    121122
     
    159160     * We cache the affiliate url patterns so that we do not have to send every URL to the WeCanTrack API
    160161     * @param $api_key
    161      * @param bool $force
    162162     * @return bool|mixed|void|null
    163163     */
    164     private static function wecantrack_get_domain_patterns($api_key, $force = false) {
     164    private static function wecantrack_get_domain_patterns($api_key) {
    165165        try {
    166166            $domain_patterns = unserialize(get_option('wecantrack_domain_patterns'));
     
    169169            $expired = !$wecantrack_fetch_expiration || time() > $wecantrack_fetch_expiration;
    170170
    171             if (!$expired || !$force || !isset($domain_patterns['origins'])) {
    172                 return $domain_patterns;
    173             } else {
     171            if ($expired || !isset($domain_patterns['origins'])) {
    174172                $response = wp_remote_get("https://app.wecantrack.com/api/v1/domain_patterns?api_key={$api_key}");
    175173                $status = wp_remote_retrieve_response_code($response);
     
    184182                    throw new \Exception('Invalid response');
    185183                }
    186             }
     184            } else {
     185                return $domain_patterns;
     186            }
     187
    187188        } catch (\Exception $e) {
    188189            error_log('wecantrack_update_data_fetch() error: ' . $e->getMessage());
  • wecantrack/trunk/readme.txt

    r2312147 r2314056  
    55Tested up to: 5.4
    66Requires PHP: 5.6.20
    7 Stable tag: 1.0.7
     7Stable tag: 1.0.8
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    6262== Changelog ==
    6363
     64= 1.0.8 - 29th May 2020 =
     65 * Optimisations
     66
    6467= 1.0.7 - 26th May 2020 =
    6568 * Fixed admin HTML issue
  • wecantrack/trunk/wecantrack.php

    r2312147 r2314056  
    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.0.7
     9Version: 1.0.8
    1010Author: wecantrack.com
    1111Author URI: https://wecantrack.com
     
    1717if(!defined('ABSPATH')) { die('You are not allowed to call this page directly.'); }
    1818
    19 define('WECANTRACK_VERSION', '1.0.6');
     19define('WECANTRACK_VERSION', '1.0.8');
    2020define('WECANTRACK_PLUGIN_NAME', 'wecantrack');
    2121define('WECANTRACK_PATH', WP_PLUGIN_DIR.'/'.WECANTRACK_PLUGIN_NAME);
  • wecantrack/trunk/wecantrack.pot

    r2312147 r2314056  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WeCanTrack 1.0.7\n"
     5"Project-Id-Version: WeCanTrack 1.0.8\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: 2020-05-25T13:46:46+00:00\n"
     12"POT-Creation-Date: 2020-05-28T22:12:23+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.4.0\n"
Note: See TracChangeset for help on using the changeset viewer.