Plugin Directory

Changeset 3247936


Ignore:
Timestamp:
02/27/2025 02:41:34 PM (13 months ago)
Author:
Facebook
Message:

Updating new version 3.4.1

Location:
facebook-for-woocommerce/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • facebook-for-woocommerce/trunk/changelog.txt

    r3243084 r3247936  
    11*** Facebook for WooCommerce Changelog ***
     2
     3= 3.4.1 - 2025-02-27 =
     4* Tweak - Removed custom field definitions by @devbodaghe in #2876
     5* Dev - Improved readability of function prepare_product() in fbproduct.php by @mshymon in #2889
     6* Dev - Enabled PHPUnit code coverage report generation by @carterbruce in #2893
    27
    38= 3.4.0 - 2025-02-19 =
  • facebook-for-woocommerce/trunk/facebook-for-woocommerce.php

    r3243084 r3247936  
    1212 * Author: Facebook
    1313 * Author URI: https://www.facebook.com/
    14  * Version: 3.4.0
     14 * Version: 3.4.1
    1515 * Requires at least: 5.6
    1616 * Requires PHP: 7.4
     
    5050     * @var string the plugin version. This must be in the main plugin file to be automatically bumped by Woorelease.
    5151     */
    52     const PLUGIN_VERSION = '3.4.0'; // WRCS: DEFINED_VERSION.
     52    const PLUGIN_VERSION = '3.4.1'; // WRCS: DEFINED_VERSION.
    5353
    5454    // Minimum PHP version required by this plugin.
  • facebook-for-woocommerce/trunk/i18n/languages/facebook-for-woocommerce.pot

    r3243084 r3247936  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Facebook for WooCommerce 3.4.0\n"
     5"Project-Id-Version: Facebook for WooCommerce 3.4.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/facebook-for-woocommerce\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: 2025-02-19T08:42:54+00:00\n"
     12"POT-Creation-Date: 2025-02-27T14:24:23+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
  • facebook-for-woocommerce/trunk/includes/fbproduct.php

    r3243084 r3247936  
    810810        $image_urls = $this->get_all_image_urls();
    811811
    812         $video_urls = $this->get_all_video_urls();
    813 
    814812        // Replace WordPress sanitization's ampersand with a real ampersand.
    815813        $product_url = str_replace(
     
    823821            $id = $this->get_parent_id();
    824822        }
    825         $categories =
    826         WC_Facebookcommerce_Utils::get_product_categories( $id );
    827 
    828         $custom_fields = $this->get_facebook_specific_fields();
     823
     824        $categories = WC_Facebookcommerce_Utils::get_product_categories( $id );
     825       
     826        $product_data = array();
     827        $product_data[ 'description' ] = $this->get_fb_description();
     828        $product_data[ 'rich_text_description' ] = $this->get_rich_text_description();
     829        $product_data[ 'product_type' ] = $categories['categories'];
     830        $product_data[ 'brand' ] = Helper::str_truncate( $this->get_fb_brand(), 100 );
     831        $product_data[ 'mpn' ] = Helper::str_truncate( $this->get_fb_mpn(), 100 );
     832        $product_data[ 'availability' ] = $this->is_in_stock() ? 'in stock' : 'out of stock';
     833        $product_data[ 'visibility' ] = Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN;
     834        $product_data[ 'retailer_id' ] = $retailer_id;
    829835
    830836        if ( self::PRODUCT_PREP_TYPE_ITEMS_BATCH === $type_to_prepare_for ) {
    831             $product_data   = array(
    832                     'title'                 => WC_Facebookcommerce_Utils::clean_string( $this->get_title() ),
    833                     'description'           => $this->get_fb_description(),
    834                     'rich_text_description' => $this->get_rich_text_description(),
    835                     'image_link'            => $image_urls[0],
    836                     'additional_image_link' => $this->get_additional_image_urls( $image_urls ),
    837                     'link'                  => $product_url,
    838                     'product_type'          => $categories['categories'],
    839                     'brand'                 => Helper::str_truncate( $this->get_fb_brand(), 100 ),
    840                     'mpn'                   => Helper::str_truncate( $this->get_fb_mpn(), 100 ),
    841                     'retailer_id'           => $retailer_id,
    842                     'price'                 => $this->get_fb_price( true ),
    843                     'availability'          => $this->is_in_stock() ? 'in stock' : 'out of stock',
    844                     'visibility'            => Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN,
    845                     'custom_fields'         => $custom_fields,
    846             );
    847             $product_data   = $this->add_sale_price( $product_data, true );
    848             if ( ! empty( $video_urls ) ) {
    849                 $product_data['video'] = $video_urls;
    850             }
     837            $product_data['title'] = WC_Facebookcommerce_Utils::clean_string( $this->get_title() );
     838            $product_data['image_link'] = $image_urls[0];
     839            $product_data['additional_image_link'] = $this->get_additional_image_urls( $image_urls );
     840            $product_data['link'] = $product_url;
     841            $product_data['price'] = $this->get_fb_price( true );
     842
     843            $product_data = $this->add_sale_price( $product_data, true );
    851844        } else {
    852             $product_data = array(
    853                     'name'                  => WC_Facebookcommerce_Utils::clean_string( $this->get_title() ),
    854                     'description'           => $this->get_fb_description(),
    855                     'image_url'             => $image_urls[0],
    856                     'additional_image_urls' => $this->get_additional_image_urls( $image_urls ),
    857                     'url'                   => $product_url,
    858                     'rich_text_description' => $this->get_rich_text_description(),
    859                     /**
    860                      * 'category' is a required field for creating a ProductItem object when posting to /{product_catalog_id}/products.
    861                      * This field should have the Google product category for the item. Google product category is not a required field
    862                      * in the WooCommerce product editor. Hence, we are setting 'category' to Woo product categories by default and overriding
    863                      * it when a Google product category is set.
    864                      *
    865                      * @see https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/#parameters-2
    866                      * @see https://github.com/woocommerce/facebook-for-woocommerce/pull/2575
    867                      * @see https://github.com/woocommerce/facebook-for-woocommerce/issues/2593
    868                      */
    869                     'category'              => $categories['categories'],
    870                     'product_type'          => $categories['categories'],
    871                     'brand'                 => Helper::str_truncate( $this->get_fb_brand(), 100 ),
    872                 'mpn'                   => Helper::str_truncate( $this->get_fb_mpn(), 100 ),
    873                     'retailer_id'           => $retailer_id,
    874                     'price'                 => $this->get_fb_price(),
    875                     'currency'              => get_woocommerce_currency(),
    876                     'availability'          => $this->is_in_stock() ? 'in stock' : 'out of stock',
    877                     'visibility'            => Products::is_product_visible( $this->woo_product ) ? \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_VISIBLE : \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN,
    878                     'custom_fields'         => $custom_fields
    879             );
    880 
    881             if ( self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for && ! empty( $video_urls ) ) {
    882                 $product_data['video'] = $video_urls;
    883             }
     845            $product_data['name'] = WC_Facebookcommerce_Utils::clean_string( $this->get_title() );
     846            $product_data['image_url'] = $image_urls[0];
     847            $product_data['additional_image_urls'] = $this->get_additional_image_urls( $image_urls );
     848            $product_data['url'] = $product_url;
     849            $product_data['price']                 = $this->get_fb_price();
     850            $product_data['currency']              = get_woocommerce_currency();
     851           
     852            /**
     853             * 'category' is a required field for creating a ProductItem object when posting to /{product_catalog_id}/products.
     854             * This field should have the Google product category for the item. Google product category is not a required field
     855             * in the WooCommerce product editor. Hence, we are setting 'category' to Woo product categories by default and overriding
     856             * it when a Google product category is set.
     857             *
     858             * @see https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/#parameters-2
     859             * @see https://github.com/woocommerce/facebook-for-woocommerce/pull/2575
     860             * @see https://github.com/woocommerce/facebook-for-woocommerce/issues/2593
     861             */
     862            $product_data['category'] = $categories['categories'];
     863           
    884864            $product_data   = $this->add_sale_price( $product_data );
    885865        }//end if
     866
     867        $video_urls = $this->get_all_video_urls();
     868        if ( ! empty( $video_urls ) && self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for ) {
     869            $product_data['video'] = $video_urls;
     870        }
    886871
    887872        $google_product_category = Products::get_google_product_category_id( $this->woo_product );
     
    891876
    892877        // Currently only items batch and feed support enhanced catalog fields
    893         if ( self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for && $google_product_category ) {
     878        if ( $google_product_category && self::PRODUCT_PREP_TYPE_NORMAL !== $type_to_prepare_for ) {
    894879            $product_data = $this->apply_enhanced_catalog_fields_from_attributes( $product_data, $google_product_category );
    895880        }
     
    917902        }
    918903
    919         // IF using WPML, set the product to hidden unless it is in the
     904        // If using WPML, set the product to hidden unless it is in the
    920905        // default language. WPML >= 3.2 Supported.
    921906        if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
     
    925910        }
    926911
    927             // Exclude variations that are "virtual" products from export to Facebook &&
    928             // No Visibility Option for Variations
    929             // get_virtual() returns true for "unassembled bundles", so we exclude
    930             // bundles from this check.
     912        // Exclude variations that are "virtual" products from export to Facebook &&
     913        // No Visibility Option for Variations
     914        // get_virtual() returns true for "unassembled bundles", so we exclude
     915        // bundles from this check.
    931916        if ( true === $this->get_virtual() && 'bundle' !== $this->get_type() ) {
    932917            $product_data['visibility'] = \WC_Facebookcommerce_Integration::FB_SHOP_PRODUCT_HIDDEN;
     
    943928
    944929        /**
    945             * Filters the generated product data.
    946             *
    947             * @param int   $id           Woocommerce product id
    948             * @param array $product_data An array of product data
    949             */
     930        * Filters the generated product data.
     931        *
     932        * @param int   $id           Woocommerce product id
     933        * @param array $product_data An array of product data
     934        */
    950935        return apply_filters(
    951936            'facebook_for_woocommerce_integration_prepare_product',
     
    12411226    }
    12421227
    1243     /**
    1244      * Returns information about which fields are using Facebook-specific values.
    1245      *
    1246      * @return array
    1247      */
    1248     private function get_facebook_specific_fields(): array {
    1249         return array(
    1250             'has_fb_description' => (bool) get_post_meta($this->id, self::FB_PRODUCT_DESCRIPTION, true),
    1251             'has_fb_price'       => (bool) get_post_meta($this->id, self::FB_PRODUCT_PRICE, true),
    1252             'has_fb_image'       => (bool) get_post_meta($this->id, self::FB_PRODUCT_IMAGE, true)
    1253         );
    1254     }
    1255 
    12561228}
  • facebook-for-woocommerce/trunk/readme.txt

    r3243084 r3247936  
    4040
    4141== Changelog ==
     42= 3.4.1 - 2025-02-27 =
     43* Tweak - Removed custom field definitions by @devbodaghe in #2876
     44* Dev - Improved readability of function prepare_product() in fbproduct.php by @mshymon in #2889
     45* Dev - Enabled PHPUnit code coverage report generation by @carterbruce in #2893
     46
    4247= 3.4.0 - 2025-02-19 =
    4348* Add - FB product video field to add videos. Also added products sync to support the video field with Batch API by @gurtejrehal in #2874
     
    7580* Fix - Sync stock quantity when available by @mshymon in #2811
    7681* Fix - Sync product GTIN when available by @mshymon in #2810
    77 
    78 = 3.3.0 - 2024-11-07 =
    79 * Add - Extension navigation tabs on Product Sets screens.
    80 * Tweak - Tooltips, config labels, documentation links.
    81 * Tweak - WC 9.4 compatibility.
    82 * Tweak - WP 6.7 compatibility.
  • facebook-for-woocommerce/trunk/vendor/composer/installed.php

    r3243084 r3247936  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '8bcab2089e5b5c5d1584c28bbab5617f8a7bf4ee',
     6        'reference' => '40d5fa6e6982ea496c9ae809d8ff0375a84b7d2a',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2323            'pretty_version' => 'dev-main',
    2424            'version' => 'dev-main',
    25             'reference' => '8bcab2089e5b5c5d1584c28bbab5617f8a7bf4ee',
     25            'reference' => '40d5fa6e6982ea496c9ae809d8ff0375a84b7d2a',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.