ITG Compare Easy

By IT-Градиент

0+ active installationsVersion 1.5.0

Lightweight product comparison for WooCommerce with AJAX, cookie storage and Elementor widgets.

Description

ITG Compare Easy is a simple, lightweight product comparison plugin for WooCommerce.

Features

  • “Compare” button for product cards and product pages, placed using a shortcode
  • Comparison lists stored in a browser cookie (1 day by default)
  • AJAX add/remove without page reload
  • Comparison table with zebra striping and horizontal scroll
  • “Differences only” toggle — hides matching rows
  • “Remove from compare” button for each product
  • WooCommerce attributes + custom fields (via the itgcoea_meta_fields filter)
  • Two Elementor widgets: ITG Compare Button and ITG Compare Table
  • Configurable product limit in WooCommerce → ITG Compare
  • Developer hooks: itgcoea_button_icon, itgcoea_button_html, itgcoea_product_card_html, itgcoea_table_rows, itgcoea_toast_style, itgcoea_localize_data and more

Compatibility

Basic comparison flows and frontend rendering of both Elementor widgets were tested with WordPress 7.1.5, WooCommerce 11.2.1, Elementor 4.4.2 and PHP 8.4.19. WooCommerce is required; Elementor is optional. Each dependency may have its own WordPress and PHP requirements.

Translations

The plugin uses WordPress.org language packs when translations are available; translations are not bundled. Leave the button text setting blank to use the translated default. Custom button text is not translated automatically.

Privacy

The plugin stores the selected product IDs in the itgcoea_items browser cookie for one day by default. The cookie duration can be changed by a developer using the itgcoea_cookie_days filter. AJAX requests send the selected product ID and a WordPress nonce to this site’s own server. Plugin settings are stored in the WordPress database; comparison lists are not stored there. The plugin does not itself send this data to a third-party service. Site owners should assess their own cookie and privacy obligations.

Button shortcode

Use the button shortcode anywhere you want a compare action button:

  • [itgcoea_compare_button] — icon only by default
  • [itgcoea_compare_button showtext="yes"] — shows the text after the icon (“Compare”)
  • [itgcoea_compare_button showtext="no"] — shows only the icon

Installation

  1. Install and activate WooCommerce.
  2. Upload the itg-compare-easy folder to /wp-content/plugins/ and activate the plugin.
  3. Create a comparison page and add the [itgcoea_compare] shortcode (or the ITG Compare Table Elementor widget).
  4. Place the [itgcoea_compare_button] shortcode in a product template or on a product page; buttons are not inserted automatically.
  5. Link to the comparison page in your menu or with the ITG Compare Button Elementor widget, and configure settings under WooCommerce → ITG Compare.

Developers can set the itgcoea_page_id option to identify the comparison page for page-specific behavior. The itgcoea_compare_page_id and itgcoea_compare_page_url filters customize the resolved comparison link.

Changelog

1.5.0

  • Adopt the unique itgcoea prefix across plugin classes, options, hooks, AJAX actions, shortcodes and Elementor widgets.
  • Keep compatibility migration for existing settings, compare-page IDs and compare cookies.

1.4.12

  • Clarify the maximum-product placeholder for translators.

1.4.11

  • Keep the plural-limit fallback compatible with Plugin Check’s translation-string validation.

1.4.10

  • Load comparison assets when an active Elementor Pro header or footer template uses a comparison widget.

1.4.9

  • Avoid a PHP deprecation when another plugin or theme returns an invalid null value from WordPress’s plural-translation filter.

1.4.8

  • Load comparison assets on WooCommerce product and catalog pages when buttons are rendered by global templates.

1.4.7

  • Check the minimum WooCommerce version at runtime and show an admin notice when it is unsupported.

1.4.6

  • Fix comparison table errors for string attributes returned by product variations.
  • Use the itgcoea prefix for plugin classes, options, hooks, AJAX actions, shortcodes and Elementor widgets. Existing shortcode/widget references and custom integrations must be updated; saved settings, compare-page ID and compare cookies are migrated or read compatibly.
  • Load frontend assets only on the comparison page or pages containing the comparison shortcodes or Elementor widgets.

1.4.5

  • Update tested WordPress and Elementor compatibility information.

1.4.4

  • Make the default button text and nonce error translatable and use plural forms for the comparison limit.
  • Preserve custom button text; an empty setting uses the translated default.

1.4.3

  • Remove bundled translation files and use WordPress.org language packs when available.

1.4.2

  • Update tested WooCommerce and Elementor versions and clarify setup instructions.

1.4.1

  • Exclude unpublished and password-protected products from public comparison and AJAX responses.
  • Validate product IDs and comparison cookies, preserve backslashes in saved settings, and display AJAX errors.
  • Keep comparison row labels and difference highlighting in sync after removing a product.
  • Apply the Elementor table widget’s empty-list message.
  • Document cookie use and update WordPress compatibility metadata.

1.4.0

  • Added support for the optional showtext shortcode attribute on [itgcoea_compare_button] with yes/no values to force text visibility per button instance.
  • Default behavior changed: when the attribute is omitted, the button renders without text.
  • Removed the legacy admin toggle “Show button text” and kept the button label configuration as a simple text field.
  • Documented the shortcode usage examples directly in the settings UI and in the plugin readme.

1.3.8

  • New setting “Rows in the comparison table”: choose which parameters and attributes (Availability + global product attributes) are shown as rows in the comparison table, and in what order. If nothing is selected, every attribute is shown as before. Added the itgcoea_available_rows filter.

1.3.7

  • Compare table: remove button is now a plain grey SVG icon with no background or border, and “Clear compare” is styled as a flat text link matching the “Differences only” label. Both rules are hardened with !important so the theme/WooCommerce button styles (red background, white text) no longer override them.

1.3.6

  • Plugin Check: resolved all remaining warnings — sanitize the compare cookie with sanitize_text_field() on read; unslash the posted product ID and document that the nonce is verified in the shared verify() helper; annotate the read-only settings-updated flag as non-form input.

1.3.5

  • Plugin Check: escaped button URL/label output in the ITG Compare Button widget (esc_url / esc_attr / esc_html at the point of output) and bumped the “Tested up to” header to 7.0.

1.3.4

  • Localized the “Settings” and “Help” settings-tab labels (added translations for all five languages).

1.3.3

  • Removed the explicit load_plugin_textdomain() call — WordPress 4.6+ loads translations automatically (just-in-time).

1.3.2

  • Added translations: Russian, German, French, Spanish, Simplified Chinese.
  • Added a “Help” tab (Overview + For Developers) matching the ITG WishList Easy layout.
  • Relicensed under the GNU General Public License v3 or later; added LICENSE.txt.

1.3.1

  • The compare button is no longer auto-injected on catalog cards or the product page — place it manually with the [itgcoea_compare_button] shortcode.
  • Removed the self-updater and the “Check for updates” admin link.

1.3.0

  • Hardened security: strict product-ID validation in AJAX handlers, sanitized/unslashed inputs, and XSS-safe popup rendering (DOM APIs instead of innerHTML).
  • Added the itgcoea_toast_style hook to customize the popup appearance via CSS custom properties.
  • Added the itgcoea_product_card_html hook (plus before/after actions) to customize the product card on the compare page.
  • Added many developer hooks across cookie, AJAX, frontend, shortcode and settings layers.
  • Translated all in-code strings and comments to English.
  • Performance: cached settings option and added an itgcoea_enqueue_assets filter to control asset loading.

1.2.0

  • Added the “Popup position” setting (Top / Bottom). With “Bottom” the offset is measured from the bottom screen edge.

1.1.9

  • Removed the “Show in the product card” setting; the compare button now always renders on product cards.
  • Added the itgcoea_button_icon filter so a theme or plugin can override the icon markup on the compare buttons.

1.1.8

  • Added a “Settings” link on the Plugins list screen.
  • Added a compare icon template chooser with three variants: bars, scales and layers.
  • Redrew the scales icon as classic balance scales (top loop, beam, two hanging pans, base) in both outline and filled versions.
  • Added a “Fill the icon” option (filled vs outlined icon everywhere).
  • Added a copyable shortcode field for the compare button and registered the [itgcoea_compare_button] shortcode.
  • Renamed the header sub-label from “Cookie” to “Compare”.
  • Renamed the “Display” tab to “Settings”.
  • Added the “Enable badge flash” toggle (pulse animation on/off).
  • Added the “Show in the product card” toggle (hide the loop button when off).
  • Added the “Show the popup window” toggle.
  • Added the IT-Gradient logo linking to https://it-gradient.ru in the settings header.
  • Added the “Popup top offset” setting (distance from the top edge, default 24px).

1.1.7

  • Nudged the counter number up by 1px inside the badge circle for better vertical centring.

1.1.6

  • Nudged the Elementor header counter badge down by 1px (top 0) and matched the widget’s default top position control.

1.1.5

  • Reworked the Elementor header counter badge to match the wishlist/cart badge exactly: same 16px red circle, Montserrat typography, no shadow, and identical position.
  • Added the full set of badge style controls to the compare button widget (background, number colour, size, top/right position, typography, padding, border radius, optional shadow).

1.1.4

  • Redrew the compare (bar-chart) icon so its bars fill the SVG viewBox, matching the optical size of the neighbouring cart and wishlist icons in the header.

1.1.3

  • Added a release build script (build.sh) that bumps the version and produces a distributable zip.

1.0.0

  • Initial release