Plugin Directory

Changeset 2743923


Ignore:
Timestamp:
06/17/2022 07:07:21 AM (4 years ago)
Author:
sendsmaily
Message:

Release 1.9.2, see readme.txt for the changelog.

Location:
smaily-for-woocommerce
Files:
36 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smaily-for-woocommerce/tags/1.9.2/inc/Api/Api.php

    r2538570 r2743923  
    124124
    125125        // Verify API credentials actually work.
    126         $useragent = 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) . '; WooCommerce/' . WC_VERSION . '; smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION;
    127         $api_call  = wp_remote_get(
     126        $api_call = wp_remote_get(
    128127            'https://' . $api_credentials['subdomain'] . '.sendsmaily.net/api/workflows.php?trigger_type=form_submitted',
    129128            array(
     
    131130                    'Authorization' => 'Basic ' . base64_encode( $api_credentials['username'] . ':' . $api_credentials['password'] ),
    132131                ),
    133                 'user-agent' => $useragent,
     132                'user-agent' => $this->get_user_agent(),
    134133            )
    135134        );
     
    249248
    250249        // Add User-Agent string to data of request.
    251         $useragent = 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) . '; WooCommerce/' . WC_VERSION . '; smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION;
    252         $data      = array_merge( $data, array( 'user-agent' => $useragent ) );
     250        $data = array_merge( $data, array( 'user-agent' => self::get_user_agent() ) );
    253251
    254252        // API call with GET request.
     
    490488        return $rss;
    491489    }
     490
     491    /**
     492     * Compile User-Agent header value for API requests.
     493     *
     494     * @return string
     495     */
     496    protected static function get_user_agent() {
     497        return 'smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION . ' (WordPress/' . get_bloginfo( 'version' ) . '; WooCommerce/' . WC_VERSION . '; +' . get_bloginfo( 'url' ) . ')';
     498    }
    492499}
  • smaily-for-woocommerce/tags/1.9.2/inc/Base/DataHandler.php

    r2417221 r2743923  
    294294     * @param string $rss_order_by Order products by.
    295295     * @param string $rss_order ASC/DESC order
    296      * @return string RSS URL e.g. example.com/smaily-rss-feed?category=uncategorized&limit=250
     296     * @return string
    297297     */
    298298    public static function make_rss_feed_url( $rss_category = null, $rss_limit = null, $rss_order_by = null, $rss_order = null ) {
    299         $parameters   = array();
    300         $rss_url_base = get_site_url() . '/smaily-rss-feed/?';
     299        global $wp_rewrite;
     300
     301        $site_url   = get_site_url( null, 'smaily-rss-feed' );
     302        $parameters = array();
    301303
    302304        if ( isset( $rss_category ) && $rss_category !== '' ) {
     
    309311            $parameters['order_by'] = $rss_order_by;
    310312        }
    311         // Check if providing ?order is even necessary.
    312313        if ( isset( $rss_order ) && $rss_order_by !== 'none' && $rss_order_by !== 'rand' ) {
    313314            $parameters['order'] = $rss_order;
    314315        }
    315316
    316         return add_query_arg( $parameters, get_site_url( null, 'smaily-rss-feed' ) );
     317        // Handle URL when permalinks have not been enabled.
     318        if ( $wp_rewrite->using_permalinks() === false ) {
     319            $site_url                      = get_site_url();
     320            $parameters['smaily-rss-feed'] = 'true';
     321        }
     322
     323        return add_query_arg( $parameters, $site_url );
    317324    }
    318325
  • smaily-for-woocommerce/tags/1.9.2/inc/Rss/SmailyRss.php

    r2346772 r2743923  
    1818     */
    1919    public function register() {
    20         /* Rewrite Rules */
    2120        add_action( 'init', array( $this, 'smaily_rewrite_rules' ) );
    22         /* Query Vars */
    2321        add_filter( 'query_vars', array( $this, 'smaily_register_query_var' ) );
    24         /* Template Include */
    25         add_filter( 'template_include', array( $this, 'smaily_rss_feed_template_include' ) );
    26         /* Frontend settings */
     22        add_filter( 'template_include', array( $this, 'smaily_rss_feed_template_include' ), 100 );
    2723        add_filter( 'smaily_settings', array( $this, 'smaily_rss_settings' ) );
    2824    }
     
    6157     */
    6258    public function smaily_rss_feed_template_include( $template ) {
    63         global $wp_query; // Load $wp_query object.
    64         if ( isset( $wp_query->query_vars['smaily-rss-feed'] ) ) {
    65             // Check for query var "smaily-rss-feed".
    66             $page_value = $wp_query->query_vars['smaily-rss-feed'];
    67             // Verify "smaily-rss-feed" exists and value is "true".
    68             if ( $page_value && $page_value === 'true' ) {
    69                 // Load your template or file.
    70                 return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
    71             }
    72         }
    73         // When rewrite rules database hasn't been refreshed yet.
    74         if ( array_key_exists( 'pagename', $wp_query->query ) && $wp_query->query['pagename'] === 'smaily-rss-feed' ) {
     59        $render_rss_feed = get_query_var( 'smaily-rss-feed', false );
     60        $render_rss_feed = $render_rss_feed === 'true' ? '1' : $render_rss_feed;
     61        $render_rss_feed = (bool) (int) $render_rss_feed;
     62
     63        $pagename = get_query_var( 'pagename' );
     64
     65        // Render products RSS feed, if requested.
     66        if ( $render_rss_feed === true ) {
     67            return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
     68        } elseif ( $pagename === 'smaily-rss-feed' ) {
    7569            return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
    7670        }
     71
    7772        // Load normal template as a fallback.
    7873        return $template;
  • smaily-for-woocommerce/tags/1.9.2/lang/smaily-et.po

    r2575302 r2743923  
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smaily-for-"
    55"woocommerce\n"
    6 "POT-Creation-Date: 2021-07-30 14:14+0300\n"
    7 "PO-Revision-Date: 2021-07-30 14:14+0300\n"
     6"POT-Creation-Date: 2022-06-17 09:58+0300\n"
     7"PO-Revision-Date: 2022-06-17 09:58+0300\n"
    88"Last-Translator: \n"
    99"Language-Team: Estonian\n"
     
    1515"X-Poedit-Basepath: ..\n"
    1616"X-Poedit-KeywordsList: __;_e;esc_html__;esc_attr__;esc_attr_e;esc_html_e\n"
    17 "X-Generator: Poedit 2.3\n"
     17"X-Generator: Poedit 3.0.1\n"
    1818"X-Loco-Version: 2.3.3; wp-5.4.1\n"
    1919"X-Poedit-SearchPath-0: .\n"
     
    5151msgstr "Palun sisesta salasõna!"
    5252
    53 #: inc/Api/Api.php:142
     53#: inc/Api/Api.php:141
    5454msgid "Invalid API credentials, no connection!"
    5555msgstr "Vale kasutajatunnus või parool, ühendus puudub!"
    5656
    57 #: inc/Api/Api.php:149
     57#: inc/Api/Api.php:148
    5858msgid "Invalid subdomain, no connection!"
    5959msgstr "Vale alamdomeen, ühendus puudub!"
    6060
    61 #: inc/Api/Api.php:162
     61#: inc/Api/Api.php:161
    6262msgid "RSS product limit value must be between 1 and 250!"
    6363msgstr "Uudisvoo toodete arvu piirang peab olema 1 ja 250 vahel!"
    6464
    65 #: inc/Api/Api.php:207
     65#: inc/Api/Api.php:206
    6666msgid "Something went wrong saving settings!"
    6767msgstr "Midagi läks sätete salvestamisel valesti!"
    6868
    69 #: inc/Api/Api.php:273
     69#: inc/Api/Api.php:271
    7070msgid "Check details, no connection!"
    7171msgstr "Kontrolli sisselogimisandmeid, ühendus puudub!"
  • smaily-for-woocommerce/tags/1.9.2/lang/smaily-et_EE.po

    r2575302 r2743923  
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smaily-for-"
    55"woocommercewoocommerce\n"
    6 "POT-Creation-Date: 2021-07-30 14:15+0300\n"
    7 "PO-Revision-Date: 2021-07-30 14:15+0300\n"
     6"POT-Creation-Date: 2022-06-17 09:58+0300\n"
     7"PO-Revision-Date: 2022-06-17 09:58+0300\n"
    88"Last-Translator: \n"
    99"Language-Team: Estonian\n"
     
    1515"X-Poedit-Basepath: ..\n"
    1616"X-Poedit-KeywordsList: __;_e;esc_html__;esc_attr__;esc_attr_e;esc_html_e\n"
    17 "X-Generator: Poedit 2.3\n"
     17"X-Generator: Poedit 3.0.1\n"
    1818"X-Loco-Version: 2.3.3; wp-5.4.1\n"
    1919"X-Poedit-SearchPath-0: .\n"
     
    5252msgstr "Palun sisesta salasõna!"
    5353
    54 #: inc/Api/Api.php:142
     54#: inc/Api/Api.php:141
    5555msgid "Invalid API credentials, no connection!"
    5656msgstr "Vale kasutajatunnus või parool, ühendus puudub!"
    5757
    58 #: inc/Api/Api.php:149
     58#: inc/Api/Api.php:148
    5959msgid "Invalid subdomain, no connection!"
    6060msgstr "Vale alamdomeen, ühendus puudub!"
    6161
    62 #: inc/Api/Api.php:162
     62#: inc/Api/Api.php:161
    6363msgid "RSS product limit value must be between 1 and 250!"
    6464msgstr "Uudisvoo toodete arvu piirang peab olema 1 ja 250 vahel!"
    6565
    66 #: inc/Api/Api.php:207
     66#: inc/Api/Api.php:206
    6767msgid "Something went wrong saving settings!"
    6868msgstr "Midagi läks sätete salvestamisel valesti!"
    6969
    70 #: inc/Api/Api.php:273
     70#: inc/Api/Api.php:271
    7171msgid "Check details, no connection!"
    7272msgstr "Kontrolli sisselogimisandmeid, ühendus puudub!"
  • smaily-for-woocommerce/tags/1.9.2/readme.txt

    r2614610 r2743923  
    66Tested up to: 5.8
    77WC tested up to: 4.7.0
    8 Stable tag: 1.9.1
     8Stable tag: 1.9.2
    99License: GPLv3
    1010
     
    152152== Changelog ==
    153153
     154= 1.9.2 =
     155
     156- Generating RSS feed URL takes account permalinks enabled state.
     157- RSS feed template is rendered at a later stage to ensure RSS is rendered.
     158- Use common practice on formatting User-Agent string.
     159
    154160= 1.9.1 =
    155161
  • smaily-for-woocommerce/tags/1.9.2/smaily-for-woocommerce.php

    r2614610 r2743923  
    1414 * Plugin URI: https://github.com/sendsmaily/smaily-woocommerce-plugin
    1515 * Description: Smaily email marketing and automation extension plugin for WooCommerce. Set up easy sync for your contacts, add opt-in subscription form, import products directly to your email template and send abandoned cart reminder emails.
    16  * Version: 1.9.1
     16 * Version: 1.9.2
    1717 * License: GPL3
    1818 * Author: Smaily
     
    4949define( 'SMAILY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    5050define( 'SMAILY_PLUGIN_NAME', plugin_basename( __FILE__ ) );
    51 define( 'SMAILY_PLUGIN_VERSION', '1.9.1' );
     51define( 'SMAILY_PLUGIN_VERSION', '1.9.2' );
    5252
    5353// Required to use functions is_plugin_active and deactivate_plugins.
  • smaily-for-woocommerce/tags/1.9.2/vendor/autoload.php

    r2614610 r2743923  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94::getLoader();
     12return ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a::getLoader();
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/ClassLoader.php

    r2614610 r2743923  
    150150    /**
    151151     * @return string[] Array of classname => path
    152      * @psalm-var array<string, string>
     152     * @psalm-return array<string, string>
    153153     */
    154154    public function getClassMap()
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/InstalledVersions.php

    r2614610 r2743923  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
    2628{
     29    /**
     30     * @var mixed[]|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
     32     */
    2733    private static $installed;
     34
     35    /**
     36     * @var bool|null
     37     */
    2838    private static $canGetVendors;
     39
     40    /**
     41     * @var array[]
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     43     */
    2944    private static $installedByVendor = array();
    3045
     
    229244    /**
    230245     * @return array
    231      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    232247     */
    233248    public static function getRootPackage()
     
    243258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    244259     * @return array[]
    245      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    246261     */
    247262    public static function getRawData()
     
    266281     *
    267282     * @return array[]
    268      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    269284     */
    270285    public static function getAllRawData()
     
    289304     * @return void
    290305     *
    291      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    292307     */
    293308    public static function reload($data)
     
    299314    /**
    300315     * @return array[]
    301      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    302317     */
    303318    private static function getInstalled()
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/autoload_classmap.php

    r2538570 r2743923  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/autoload_namespaces.php

    r1996370 r2743923  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/autoload_psr4.php

    r1996370 r2743923  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/autoload_real.php

    r2614610 r2743923  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94
     5class ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94', 'loadClassLoader'));
     25        spl_autoload_register(array('ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a', 'loadClassLoader'), true, true);
     26        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a', 'loadClassLoader'));
    2828
    29         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    30         if ($useStaticLoader) {
    31             require __DIR__ . '/autoload_static.php';
    32 
    33             call_user_func(\Composer\Autoload\ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::getInitializer($loader));
    34         } else {
    35             $map = require __DIR__ . '/autoload_namespaces.php';
    36             foreach ($map as $namespace => $path) {
    37                 $loader->set($namespace, $path);
    38             }
    39 
    40             $map = require __DIR__ . '/autoload_psr4.php';
    41             foreach ($map as $namespace => $path) {
    42                 $loader->setPsr4($namespace, $path);
    43             }
    44 
    45             $classMap = require __DIR__ . '/autoload_classmap.php';
    46             if ($classMap) {
    47                 $loader->addClassMap($classMap);
    48             }
    49         }
     29        require __DIR__ . '/autoload_static.php';
     30        call_user_func(\Composer\Autoload\ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::getInitializer($loader));
    5031
    5132        $loader->register(true);
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/autoload_static.php

    r2614610 r2743923  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94
     7class ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2828    {
    2929        return \Closure::bind(function () use ($loader) {
    30             $loader->prefixLengthsPsr4 = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$prefixLengthsPsr4;
    31             $loader->prefixDirsPsr4 = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$prefixDirsPsr4;
    32             $loader->classMap = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$classMap;
     30            $loader->prefixLengthsPsr4 = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$prefixLengthsPsr4;
     31            $loader->prefixDirsPsr4 = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$prefixDirsPsr4;
     32            $loader->classMap = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$classMap;
    3333
    3434        }, null, ClassLoader::class);
  • smaily-for-woocommerce/tags/1.9.2/vendor/composer/installed.php

    r2614610 r2743923  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.9.1',
    4         'version' => '1.9.1.0',
     3        'name' => 'smaily/smaily_for_woocommerce',
     4        'pretty_version' => '1.9.2',
     5        'version' => '1.9.2.0',
     6        'reference' => '226e666ca6bfd9cbbc5f9fe21cf89a12222f0c34',
    57        'type' => 'plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '8ff21bb893261b103eb38629a1ef9c04a0873b20',
    9         'name' => 'smaily/smaily_for_woocommerce',
    1010        'dev' => false,
    1111    ),
    1212    'versions' => array(
    1313        'smaily/smaily_for_woocommerce' => array(
    14             'pretty_version' => '1.9.1',
    15             'version' => '1.9.1.0',
     14            'pretty_version' => '1.9.2',
     15            'version' => '1.9.2.0',
     16            'reference' => '226e666ca6bfd9cbbc5f9fe21cf89a12222f0c34',
    1617            'type' => 'plugin',
    1718            'install_path' => __DIR__ . '/../../',
    1819            'aliases' => array(),
    19             'reference' => '8ff21bb893261b103eb38629a1ef9c04a0873b20',
    2020            'dev_requirement' => false,
    2121        ),
  • smaily-for-woocommerce/trunk/inc/Api/Api.php

    r2538570 r2743923  
    124124
    125125        // Verify API credentials actually work.
    126         $useragent = 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) . '; WooCommerce/' . WC_VERSION . '; smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION;
    127         $api_call  = wp_remote_get(
     126        $api_call = wp_remote_get(
    128127            'https://' . $api_credentials['subdomain'] . '.sendsmaily.net/api/workflows.php?trigger_type=form_submitted',
    129128            array(
     
    131130                    'Authorization' => 'Basic ' . base64_encode( $api_credentials['username'] . ':' . $api_credentials['password'] ),
    132131                ),
    133                 'user-agent' => $useragent,
     132                'user-agent' => $this->get_user_agent(),
    134133            )
    135134        );
     
    249248
    250249        // Add User-Agent string to data of request.
    251         $useragent = 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) . '; WooCommerce/' . WC_VERSION . '; smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION;
    252         $data      = array_merge( $data, array( 'user-agent' => $useragent ) );
     250        $data = array_merge( $data, array( 'user-agent' => self::get_user_agent() ) );
    253251
    254252        // API call with GET request.
     
    490488        return $rss;
    491489    }
     490
     491    /**
     492     * Compile User-Agent header value for API requests.
     493     *
     494     * @return string
     495     */
     496    protected static function get_user_agent() {
     497        return 'smaily-for-woocommerce/' . SMAILY_PLUGIN_VERSION . ' (WordPress/' . get_bloginfo( 'version' ) . '; WooCommerce/' . WC_VERSION . '; +' . get_bloginfo( 'url' ) . ')';
     498    }
    492499}
  • smaily-for-woocommerce/trunk/inc/Base/DataHandler.php

    r2417221 r2743923  
    294294     * @param string $rss_order_by Order products by.
    295295     * @param string $rss_order ASC/DESC order
    296      * @return string RSS URL e.g. example.com/smaily-rss-feed?category=uncategorized&limit=250
     296     * @return string
    297297     */
    298298    public static function make_rss_feed_url( $rss_category = null, $rss_limit = null, $rss_order_by = null, $rss_order = null ) {
    299         $parameters   = array();
    300         $rss_url_base = get_site_url() . '/smaily-rss-feed/?';
     299        global $wp_rewrite;
     300
     301        $site_url   = get_site_url( null, 'smaily-rss-feed' );
     302        $parameters = array();
    301303
    302304        if ( isset( $rss_category ) && $rss_category !== '' ) {
     
    309311            $parameters['order_by'] = $rss_order_by;
    310312        }
    311         // Check if providing ?order is even necessary.
    312313        if ( isset( $rss_order ) && $rss_order_by !== 'none' && $rss_order_by !== 'rand' ) {
    313314            $parameters['order'] = $rss_order;
    314315        }
    315316
    316         return add_query_arg( $parameters, get_site_url( null, 'smaily-rss-feed' ) );
     317        // Handle URL when permalinks have not been enabled.
     318        if ( $wp_rewrite->using_permalinks() === false ) {
     319            $site_url                      = get_site_url();
     320            $parameters['smaily-rss-feed'] = 'true';
     321        }
     322
     323        return add_query_arg( $parameters, $site_url );
    317324    }
    318325
  • smaily-for-woocommerce/trunk/inc/Rss/SmailyRss.php

    r2346772 r2743923  
    1818     */
    1919    public function register() {
    20         /* Rewrite Rules */
    2120        add_action( 'init', array( $this, 'smaily_rewrite_rules' ) );
    22         /* Query Vars */
    2321        add_filter( 'query_vars', array( $this, 'smaily_register_query_var' ) );
    24         /* Template Include */
    25         add_filter( 'template_include', array( $this, 'smaily_rss_feed_template_include' ) );
    26         /* Frontend settings */
     22        add_filter( 'template_include', array( $this, 'smaily_rss_feed_template_include' ), 100 );
    2723        add_filter( 'smaily_settings', array( $this, 'smaily_rss_settings' ) );
    2824    }
     
    6157     */
    6258    public function smaily_rss_feed_template_include( $template ) {
    63         global $wp_query; // Load $wp_query object.
    64         if ( isset( $wp_query->query_vars['smaily-rss-feed'] ) ) {
    65             // Check for query var "smaily-rss-feed".
    66             $page_value = $wp_query->query_vars['smaily-rss-feed'];
    67             // Verify "smaily-rss-feed" exists and value is "true".
    68             if ( $page_value && $page_value === 'true' ) {
    69                 // Load your template or file.
    70                 return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
    71             }
    72         }
    73         // When rewrite rules database hasn't been refreshed yet.
    74         if ( array_key_exists( 'pagename', $wp_query->query ) && $wp_query->query['pagename'] === 'smaily-rss-feed' ) {
     59        $render_rss_feed = get_query_var( 'smaily-rss-feed', false );
     60        $render_rss_feed = $render_rss_feed === 'true' ? '1' : $render_rss_feed;
     61        $render_rss_feed = (bool) (int) $render_rss_feed;
     62
     63        $pagename = get_query_var( 'pagename' );
     64
     65        // Render products RSS feed, if requested.
     66        if ( $render_rss_feed === true ) {
     67            return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
     68        } elseif ( $pagename === 'smaily-rss-feed' ) {
    7569            return SMAILY_PLUGIN_PATH . 'templates/smaily-rss-feed.php';
    7670        }
     71
    7772        // Load normal template as a fallback.
    7873        return $template;
  • smaily-for-woocommerce/trunk/lang/smaily-et.po

    r2575302 r2743923  
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smaily-for-"
    55"woocommerce\n"
    6 "POT-Creation-Date: 2021-07-30 14:14+0300\n"
    7 "PO-Revision-Date: 2021-07-30 14:14+0300\n"
     6"POT-Creation-Date: 2022-06-17 09:58+0300\n"
     7"PO-Revision-Date: 2022-06-17 09:58+0300\n"
    88"Last-Translator: \n"
    99"Language-Team: Estonian\n"
     
    1515"X-Poedit-Basepath: ..\n"
    1616"X-Poedit-KeywordsList: __;_e;esc_html__;esc_attr__;esc_attr_e;esc_html_e\n"
    17 "X-Generator: Poedit 2.3\n"
     17"X-Generator: Poedit 3.0.1\n"
    1818"X-Loco-Version: 2.3.3; wp-5.4.1\n"
    1919"X-Poedit-SearchPath-0: .\n"
     
    5151msgstr "Palun sisesta salasõna!"
    5252
    53 #: inc/Api/Api.php:142
     53#: inc/Api/Api.php:141
    5454msgid "Invalid API credentials, no connection!"
    5555msgstr "Vale kasutajatunnus või parool, ühendus puudub!"
    5656
    57 #: inc/Api/Api.php:149
     57#: inc/Api/Api.php:148
    5858msgid "Invalid subdomain, no connection!"
    5959msgstr "Vale alamdomeen, ühendus puudub!"
    6060
    61 #: inc/Api/Api.php:162
     61#: inc/Api/Api.php:161
    6262msgid "RSS product limit value must be between 1 and 250!"
    6363msgstr "Uudisvoo toodete arvu piirang peab olema 1 ja 250 vahel!"
    6464
    65 #: inc/Api/Api.php:207
     65#: inc/Api/Api.php:206
    6666msgid "Something went wrong saving settings!"
    6767msgstr "Midagi läks sätete salvestamisel valesti!"
    6868
    69 #: inc/Api/Api.php:273
     69#: inc/Api/Api.php:271
    7070msgid "Check details, no connection!"
    7171msgstr "Kontrolli sisselogimisandmeid, ühendus puudub!"
  • smaily-for-woocommerce/trunk/lang/smaily-et_EE.po

    r2575302 r2743923  
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smaily-for-"
    55"woocommercewoocommerce\n"
    6 "POT-Creation-Date: 2021-07-30 14:15+0300\n"
    7 "PO-Revision-Date: 2021-07-30 14:15+0300\n"
     6"POT-Creation-Date: 2022-06-17 09:58+0300\n"
     7"PO-Revision-Date: 2022-06-17 09:58+0300\n"
    88"Last-Translator: \n"
    99"Language-Team: Estonian\n"
     
    1515"X-Poedit-Basepath: ..\n"
    1616"X-Poedit-KeywordsList: __;_e;esc_html__;esc_attr__;esc_attr_e;esc_html_e\n"
    17 "X-Generator: Poedit 2.3\n"
     17"X-Generator: Poedit 3.0.1\n"
    1818"X-Loco-Version: 2.3.3; wp-5.4.1\n"
    1919"X-Poedit-SearchPath-0: .\n"
     
    5252msgstr "Palun sisesta salasõna!"
    5353
    54 #: inc/Api/Api.php:142
     54#: inc/Api/Api.php:141
    5555msgid "Invalid API credentials, no connection!"
    5656msgstr "Vale kasutajatunnus või parool, ühendus puudub!"
    5757
    58 #: inc/Api/Api.php:149
     58#: inc/Api/Api.php:148
    5959msgid "Invalid subdomain, no connection!"
    6060msgstr "Vale alamdomeen, ühendus puudub!"
    6161
    62 #: inc/Api/Api.php:162
     62#: inc/Api/Api.php:161
    6363msgid "RSS product limit value must be between 1 and 250!"
    6464msgstr "Uudisvoo toodete arvu piirang peab olema 1 ja 250 vahel!"
    6565
    66 #: inc/Api/Api.php:207
     66#: inc/Api/Api.php:206
    6767msgid "Something went wrong saving settings!"
    6868msgstr "Midagi läks sätete salvestamisel valesti!"
    6969
    70 #: inc/Api/Api.php:273
     70#: inc/Api/Api.php:271
    7171msgid "Check details, no connection!"
    7272msgstr "Kontrolli sisselogimisandmeid, ühendus puudub!"
  • smaily-for-woocommerce/trunk/readme.txt

    r2614610 r2743923  
    66Tested up to: 5.8
    77WC tested up to: 4.7.0
    8 Stable tag: 1.9.1
     8Stable tag: 1.9.2
    99License: GPLv3
    1010
     
    152152== Changelog ==
    153153
     154= 1.9.2 =
     155
     156- Generating RSS feed URL takes account permalinks enabled state.
     157- RSS feed template is rendered at a later stage to ensure RSS is rendered.
     158- Use common practice on formatting User-Agent string.
     159
    154160= 1.9.1 =
    155161
  • smaily-for-woocommerce/trunk/smaily-for-woocommerce.php

    r2614610 r2743923  
    1414 * Plugin URI: https://github.com/sendsmaily/smaily-woocommerce-plugin
    1515 * Description: Smaily email marketing and automation extension plugin for WooCommerce. Set up easy sync for your contacts, add opt-in subscription form, import products directly to your email template and send abandoned cart reminder emails.
    16  * Version: 1.9.1
     16 * Version: 1.9.2
    1717 * License: GPL3
    1818 * Author: Smaily
     
    4949define( 'SMAILY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    5050define( 'SMAILY_PLUGIN_NAME', plugin_basename( __FILE__ ) );
    51 define( 'SMAILY_PLUGIN_VERSION', '1.9.1' );
     51define( 'SMAILY_PLUGIN_VERSION', '1.9.2' );
    5252
    5353// Required to use functions is_plugin_active and deactivate_plugins.
  • smaily-for-woocommerce/trunk/vendor/autoload.php

    r2614610 r2743923  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94::getLoader();
     12return ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a::getLoader();
  • smaily-for-woocommerce/trunk/vendor/composer/ClassLoader.php

    r2614610 r2743923  
    150150    /**
    151151     * @return string[] Array of classname => path
    152      * @psalm-var array<string, string>
     152     * @psalm-return array<string, string>
    153153     */
    154154    public function getClassMap()
  • smaily-for-woocommerce/trunk/vendor/composer/InstalledVersions.php

    r2614610 r2743923  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
    2628{
     29    /**
     30     * @var mixed[]|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
     32     */
    2733    private static $installed;
     34
     35    /**
     36     * @var bool|null
     37     */
    2838    private static $canGetVendors;
     39
     40    /**
     41     * @var array[]
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     43     */
    2944    private static $installedByVendor = array();
    3045
     
    229244    /**
    230245     * @return array
    231      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    232247     */
    233248    public static function getRootPackage()
     
    243258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    244259     * @return array[]
    245      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    246261     */
    247262    public static function getRawData()
     
    266281     *
    267282     * @return array[]
    268      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    269284     */
    270285    public static function getAllRawData()
     
    289304     * @return void
    290305     *
    291      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    292307     */
    293308    public static function reload($data)
     
    299314    /**
    300315     * @return array[]
    301      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    302317     */
    303318    private static function getInstalled()
  • smaily-for-woocommerce/trunk/vendor/composer/autoload_classmap.php

    r2538570 r2743923  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/trunk/vendor/composer/autoload_namespaces.php

    r1996370 r2743923  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/trunk/vendor/composer/autoload_psr4.php

    r1996370 r2743923  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • smaily-for-woocommerce/trunk/vendor/composer/autoload_real.php

    r2614610 r2743923  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94
     5class ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit8bd0bdda306bbc37fd9f66948a284d94', 'loadClassLoader'));
     25        spl_autoload_register(array('ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a', 'loadClassLoader'), true, true);
     26        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit3dcc2f18f5ef89458902d388ae3e171a', 'loadClassLoader'));
    2828
    29         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    30         if ($useStaticLoader) {
    31             require __DIR__ . '/autoload_static.php';
    32 
    33             call_user_func(\Composer\Autoload\ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::getInitializer($loader));
    34         } else {
    35             $map = require __DIR__ . '/autoload_namespaces.php';
    36             foreach ($map as $namespace => $path) {
    37                 $loader->set($namespace, $path);
    38             }
    39 
    40             $map = require __DIR__ . '/autoload_psr4.php';
    41             foreach ($map as $namespace => $path) {
    42                 $loader->setPsr4($namespace, $path);
    43             }
    44 
    45             $classMap = require __DIR__ . '/autoload_classmap.php';
    46             if ($classMap) {
    47                 $loader->addClassMap($classMap);
    48             }
    49         }
     29        require __DIR__ . '/autoload_static.php';
     30        call_user_func(\Composer\Autoload\ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::getInitializer($loader));
    5031
    5132        $loader->register(true);
  • smaily-for-woocommerce/trunk/vendor/composer/autoload_static.php

    r2614610 r2743923  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94
     7class ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2828    {
    2929        return \Closure::bind(function () use ($loader) {
    30             $loader->prefixLengthsPsr4 = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$prefixLengthsPsr4;
    31             $loader->prefixDirsPsr4 = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$prefixDirsPsr4;
    32             $loader->classMap = ComposerStaticInit8bd0bdda306bbc37fd9f66948a284d94::$classMap;
     30            $loader->prefixLengthsPsr4 = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$prefixLengthsPsr4;
     31            $loader->prefixDirsPsr4 = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$prefixDirsPsr4;
     32            $loader->classMap = ComposerStaticInit3dcc2f18f5ef89458902d388ae3e171a::$classMap;
    3333
    3434        }, null, ClassLoader::class);
  • smaily-for-woocommerce/trunk/vendor/composer/installed.php

    r2614610 r2743923  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.9.1',
    4         'version' => '1.9.1.0',
     3        'name' => 'smaily/smaily_for_woocommerce',
     4        'pretty_version' => '1.9.2',
     5        'version' => '1.9.2.0',
     6        'reference' => '226e666ca6bfd9cbbc5f9fe21cf89a12222f0c34',
    57        'type' => 'plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '8ff21bb893261b103eb38629a1ef9c04a0873b20',
    9         'name' => 'smaily/smaily_for_woocommerce',
    1010        'dev' => false,
    1111    ),
    1212    'versions' => array(
    1313        'smaily/smaily_for_woocommerce' => array(
    14             'pretty_version' => '1.9.1',
    15             'version' => '1.9.1.0',
     14            'pretty_version' => '1.9.2',
     15            'version' => '1.9.2.0',
     16            'reference' => '226e666ca6bfd9cbbc5f9fe21cf89a12222f0c34',
    1617            'type' => 'plugin',
    1718            'install_path' => __DIR__ . '/../../',
    1819            'aliases' => array(),
    19             'reference' => '8ff21bb893261b103eb38629a1ef9c04a0873b20',
    2020            'dev_requirement' => false,
    2121        ),
Note: See TracChangeset for help on using the changeset viewer.