Plugin Directory

Changeset 3163755


Ignore:
Timestamp:
10/06/2024 10:36:57 PM (16 months ago)
Author:
syncio
Message:

version 1.0.16

Location:
syncio-multistore-product-inventory-sync-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • syncio-multistore-product-inventory-sync-for-woocommerce/trunk/Syncio.php

    r3155468 r3163755  
    4444
    4545        add_action('admin_menu', array($this, 'registerMenu'));
     46        add_action('wp_footer', array($this,'add_intercom_chatbot'));
    4647    }
    4748
     
    7172    public function register_scripts()
    7273    {
    73       if (! isset($_GET['page']) && strpos(sanitize_key($_GET['page']), 'syncio') !== true) {
     74        if (! isset($_GET['page']) && strpos(sanitize_key($_GET['page']), 'syncio') !== true) {
    7475            return;
    7576        }
    76        
     77
    7778        wp_enqueue_script(
    7879            'syncio-frontend-js',
     
    166167    }
    167168
    168     // function okToActivateSyncioPlugin()
    169     // {
    170     //     return in_array('woocommerce/woocommerce.php', get_option('active_plugins'));
    171     // }
    172 
    173     // function uninstallSyncioPlugin()
    174     // {
    175     //     if (in_array('Syncio/plugin.php', get_option('active_plugins')))
    176     //         deactivate_plugins(['Syncio/plugin.php']);
    177     //     if (in_array('syncio-global-dropshipping', get_option('active_plugins')))
    178     //         deactivate_plugins(['syncio-global-dropshipping/plugin.php']);
    179     // }
    180 
    181     //function sendErrorMessage($title, $desc)
    182     //{
    183     //    printf('<div class="error">
    184     //          <p>' .
    185     //        esc_html__($title)
    186     //        . '</p>
    187     //          <p>
    188     //           <b>Error: </b>' . esc_html__($desc)
    189     //        . '</p>
    190     //       </div>');
    191     //}
    192 
    193     //function removePluginActivatedMessage()
    194     //{
    195     //    unset($_GET['activate'], $_GET['error']);
    196     //}
    197 
    198     /**
    199      * Place code for your plugin's functionality here.
    200      */
    201     // private function run_plugin()
    202     // {
    203     //     //        if ($this->okToActivateSyncioPlugin()) {
    204        
    205     //     //        } else {
    206     //     //            $this->uninstallSyncioPlugin();
    207     //     //            $this->removePluginActivatedMessage();
    208     //     //            $this->sendErrorMessage('Syncio plugin', 'WooCoommerce needs to be installed and activated before you can activate Syncio plugin.');
    209     //     //        }
    210     // }
     169    function add_intercom_chatbot() {
     170        ?>
     171        <script>
     172            window.intercomSettings = {
     173                api_base: "https://api-iam.intercom.io",
     174                app_id: "<?php echo SYNCIO_INTERCOM_APP_ID; ?>",
     175                //user_id: user.id, // IMPORTANT: Replace "user.id" with the variable you use to capture the user's ID
     176                name: "<?php echo get_option('siteurl'); ?>", // IMPORTANT: Replace "user.name" with the variable you use to capture the user's name
     177                email: "<?php echo get_option('admin_email'); ?>", // IMPORTANT: Replace "syncio_globals.admin_email" with the variable you use to capture the admin's email address
     178                'Platform': 'woo',
     179                'URL': "<?php echo get_option('siteurl'); ?>",
     180            };
     181        </script>
     182
     183        <script>
     184            (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/z6dvdx17';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
     185        </script>
     186        <?php
     187        if(get_option('syncio_plugin_just_activated')) {
     188            ?>
     189            <script>
     190                console.log('plugin activated- intercom event fired');
     191                window.Intercom('trackEvent', 'plugin-installed', {
     192                    plugin_name: 'Syncio-wp-plugin',
     193                    plugin_version: '<?php echo SYNCIO_PLUGIN_VERSION; ?>',
     194                });
     195            </script>
     196            <?php
     197            delete_option('syncio_plugin_just_activated');
     198        }
     199
     200    }
    211201
    212202    private function init_rests()
  • syncio-multistore-product-inventory-sync-for-woocommerce/trunk/View/index.php

    r3155468 r3163755  
    4848    </div>
    4949</div>
     50<?php wp_footer(); ?>
    5051</body>
    5152</html>
  • syncio-multistore-product-inventory-sync-for-woocommerce/trunk/plugin.php

    r3156022 r3163755  
    44Requires Plugins: woocommerce
    55Description: Seamlessly sync inventory and products across multiple WooCommerce and Shopify stores. Efficiently manage WooCommerce multistor
    6 Version: 1.0.15
     6Version: 1.0.16
    77Author: syncio.co
    88Author URI: https://syncio.co
     
    1919
    2020// Define constants.
    21 define( 'SYNCIO_PLUGIN_VERSION', '1.0.15' );
     21define( 'SYNCIO_PLUGIN_VERSION', '1.0.16' );
    2222
    2323
     
    3737define( 'SYNCIO_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
    3838define( 'SYNCIO_RETAILER_REST_PATH', '/wp-json/syncio/retailer/v1/' );
     39define('SYNCIO_INTERCOM_APP_ID', 'z6dvdx17');
     40
     41//register activation hook
     42register_activation_hook( __FILE__, function() {
     43    add_option('syncio_plugin_just_activated',true);
     44});
    3945
    4046
  • syncio-multistore-product-inventory-sync-for-woocommerce/trunk/readme.txt

    r3156022 r3163755  
    1717== Third-Party Libraries
    1818This plugin makes use of the following third-party libraries:
     19- intercom.js: [ npm package](https://www.npmjs.com/package/intercom.js)
     20  - Compressed file: `/js/intercom.min.js` [CDN link](https://unpkg.com/[email protected]/dist/intercom.min.js)
     21  - Uncompressed file: `/assets/js/intercom-uncompressed.js
    1922- SweetAlert.js: [GitHub Repository](https://github.com/t4t5/sweetalert)
    2023  - Compressed file: `/js/sweetalert.min.js` [CDN link](https://unpkg.com/[email protected]/dist/sweetalert.min.js)
     
    131134== Changelog ==
    132135
     136= 1.0.16 =
     137* fixed some security bugs
     138* added intercom for customer support
     139
    133140= 1.0.15 =
    134141* updated readme
Note: See TracChangeset for help on using the changeset viewer.