Plugin Directory

Changeset 2902189


Ignore:
Timestamp:
04/21/2023 09:13:34 AM (3 years ago)
Author:
viaads
Message:

Performance Update

Location:
viaads
Files:
16 added
3 edited

Legend:

Unmodified
Added
Removed
  • viaads/trunk/readme.txt

    r2900782 r2902189  
    33Tags: ViaAds, ViaBill
    44Requires at least: 5.4
    5 Tested up to: 6.1
    6 Stable tag: 1.1.14
     5Tested up to: 6.2
     6Stable tag: 1.1.15
    77Requires PHP: 7.0
    88License: GPLv3
  • viaads/trunk/sync.php

    r2900782 r2902189  
    3131            $webshop->ApiKey = get_option($name);
    3232            $webshop->Categories = ViaAds_getCategories();
    33             $webshop->Products = ViaAds_getProducts($_GET['full']);
     33            $webshop->Products = ViaAds_getProducts();
    3434            if (isset($_GET['debug']) && $_GET['debug'] == "tEBLZTqKDLzhEjc2Kw9mqu5vrJUB") {
    3535                print_r(ViaAds_PostToUrl("https://sync.viaads.dk/woocommerce/WebShopData", $webshop, true));
     
    7171
    7272
    73 function ViaAds_getProducts($full)
     73function ViaAds_getProducts()
    7474{
    75     if (strtolower($full) == "true") {
    76         $args = array(
    77             'orderby' => 'name',
    78             'limit' => -1,
    79         );
    80     } else {
    81         $args = array(
    82             'orderby' => 'name',
    83             'limit' => -1,
    84             'date_modified' => '>' . (time() - 3 * 24 * 60 * 60),
    85         );
    86     }
     75    $lookBackDays = 7;
     76    if (isset($_GET['lookbackdays']) && is_numeric($_GET['lookbackdays'])) {
     77        $lookBackDays = $_GET['lookbackdays'];
     78    }
     79   
     80    $args = array(
     81        'orderby' => 'name',
     82        'limit' => -1,
     83        'date_modified' => '>' . (time() - $lookBackDays * 24 * 60 * 60),
     84    );
    8785    $productCollection = wc_get_products($args);
    8886    $products = [];
  • viaads/trunk/viaads.php

    r2900782 r2902189  
    33 * Plugin Name: ViaAds
    44 * Description: Plugin der muliggør forbindelsen til ViaAds / Plug-in enabling the connection to ViaAds.
    5  * Version: 1.1.14
     5 * Version: 1.1.15
    66 * Author: ViaAds
    77 * Author URI: https://www.viaads.dk/
Note: See TracChangeset for help on using the changeset viewer.