Plugin Directory

Changeset 3313208


Ignore:
Timestamp:
06/17/2025 11:22:13 AM (10 months ago)
Author:
fromdoppler
Message:

update plugin version 1.4.0

Location:
doppler-for-woocommerce
Files:
91 added
4 edited

Legend:

Unmodified
Added
Removed
  • doppler-for-woocommerce/trunk/README.txt

    r3301447 r3313208  
    55Requires at least: 4.9
    66Tested up to: 6.8.1
    7 Stable tag: 1.3.0
     7Stable tag: 1.4.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1212
    1313Submit your WooCommerce customers and buyers to a Doppler List.
     14
     15== Upgrade Notice ==
     16
     17= 1.4.0 =
     18*Important:* This version improves the tracking performance of visited products. Updating is recommended.
     19
     20== Changelog ==
     21
     22= 1.4.0 =
     23* Feat: Add Open Graph metadata.
    1424== 1.3.0 ==
    1525* Feat: Add consent checkbox in checkout.
  • doppler-for-woocommerce/trunk/doppler-for-woocommerce.php

    r3301447 r3313208  
    1717 * Plugin URI:        https://www.fromdoppler.com/
    1818 * Description:       Connect your WooCommerce customers with your Doppler Lists.
    19  * Version:           1.3.0
     19 * Version:           1.4.0
    2020 * Author:            Doppler LLC
    2121 * License:           GPL-2.0+
     
    3535 * Rename this for your plugin and update it as you release new versions.
    3636 */
    37 define('DOPPLER_FOR_WOOCOMMERCE_VERSION', '1.3.0');
     37define('DOPPLER_FOR_WOOCOMMERCE_VERSION', '1.4.0');
    3838define('DOPPLER_FOR_WOOCOMMERCE_URL', plugin_dir_url(__FILE__));
    3939define('DOPPLER_FOR_WOOCOMMERCE_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
  • doppler-for-woocommerce/trunk/includes/class-doppler-for-woocommerce.php

    r3301447 r3313208  
    8282        } else {
    8383            $this->version = '1.0.1';
     84        }
     85       
     86        if (get_option('dplr_wc_open_graph_meta') === false) {
     87            update_option('dplr_wc_open_graph_meta', 1);
    8488        }
    8589       
     
    231235
    232236        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
     237        if (get_option('dplr_wc_open_graph_meta') == 1)
     238        {
     239            $this->loader->add_action('wp_head', $plugin_public, 'add_open_graph_meta_tags');
     240        }
    233241
    234242        if (get_option('dplr_wc_consent') == 1) {
  • doppler-for-woocommerce/trunk/public/class-doppler-for-woocommerce-public.php

    r3008943 r3313208  
    8080    }
    8181
     82    public function add_open_graph_meta_tags()
     83    {
     84        if (!is_product()) {
     85            echo '<meta property="og:type" content="website" />';
     86            return;
     87        }
     88
     89        global $post;
     90        $product = wc_get_product($post->ID);
     91
     92        if (!$product) {
     93            return;
     94        }
     95
     96        $title = get_the_title($post);
     97        $description = get_the_excerpt($post);
     98        $url = get_permalink($post);
     99        $image = wp_get_attachment_url($product->get_image_id());
     100        $price = $product->get_price();
     101        $currency = get_woocommerce_currency();
     102
     103        echo '<meta property="og:type" content="product" />' . "\n";
     104        echo '<meta property="og:title" content="' . esc_attr($title) . '" />' . "\n";
     105        echo '<meta property="og:description" content="' . esc_attr($description) . '" />' . "\n";
     106        echo '<meta property="og:url" content="' . esc_url($url) . '" />' . "\n";
     107        if ($image) {
     108            echo '<meta property="og:image" content="' . esc_url($image) . '" />' . "\n";
     109        }
     110        if ($price) {
     111            echo '<meta property="og:price" content="' . esc_attr($price) . '" />' . "\n";
     112            echo '<meta property="og:currency" content="' . esc_attr($currency) . '" />' . "\n";
     113        }
     114    }
    82115}
Note: See TracChangeset for help on using the changeset viewer.