Plugin Directory

Changeset 3240682


Ignore:
Timestamp:
02/14/2025 03:00:31 PM (13 months ago)
Author:
partnero
Message:

Updated featured image, screenshots and descriptions

Location:
partnero
Files:
13 added
4 deleted
2 edited
25 copied

Legend:

Unmodified
Added
Removed
  • partnero/trunk/README.txt

    r3182198 r3240682  
    44Requires at least: 5.3
    55Tested up to: 6.6
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    4444
    4545== Screenshots ==
    46 1. Review key program metrics and manage your program from the main dashboard.
    47 2. Decide when and how your partners will be rewarded, finetune every setting, and align the program with your business goals.
    48 3. Decide how the partner dashboard will look like. Include what’s important, change the layout, and add custom blocks.
    49 4. Build a unique resource hub and manage it in real-time. Upload various marketing materials, add descriptions, and swap out assets.
     461. Set up and manage affiliate and referral campaigns seamlessly within your WooCommerce store.
     472. Control when and how partners earn rewards, fine-tune every detail, and align the program with your business goals.
     483. Reliable tracking & flexible promotion tools – Track performance accurately with link tracking and unique promo codes for your partners.
     494. Fully customizable partner dashboard – Design the dashboard to match your brand. Add essential details, adjust the layout, and include custom content.
     505. Automated payouts for effortless management – Save time by automating payouts, ensuring partners get paid quickly and accurately.
    5051
    5152== Changelog ==
     53
     54= 2.0.2 =
     55* Remove method type declarations to support PHP 7.4
     56
     57= 2.0.1 =
     58* Added support to sync WooCommerce customers to Partnero Refer-A-Friend program
    5259
    5360= 2.0.0 =
  • partnero/trunk/admin/class-partnero-admin.php

    r3182198 r3240682  
    6060                'all'
    6161            );
    62         }
     62
     63            wp_enqueue_script(
     64                $this->plugin_name,
     65                plugin_dir_url( __FILE__ ) . 'js/partnero-admin.js',
     66                array(),
     67                $this->version,
     68                true // Load in the footer
     69            );
     70        }
     71
    6372    }
    6473
     
    103112            if ( in_array($_POST['program_type'], Partnero_Util::ALL_TYPES, true) ) {
    104113                $this->update_tax_setting($_POST['program_type'], (string)$_POST['tax_setting']);
     114            }
     115        }
     116
     117        if(
     118            $_POST
     119            && array_key_exists( 'program_action', $_POST ) && $_POST['program_action'] === 'update-sync-customers-setting'
     120            && array_key_exists( 'program_type', $_POST ) && !empty($_POST['program_type'])
     121        ) {
     122            if ( $_POST['program_type'] == Partnero_Util::TYPE_REFER_A_FRIEND ) {
     123                $this->update_sync_customers_setting($_POST['program_type'], (string)$_POST['sync_customers_setting']);
    105124            }
    106125        }
     
    186205        $result = Partnero_Api::program_overview_call();
    187206        $tax_setting = Partnero_Util::has_option($active_type, 'tax_setting') ? Partnero_Util::get_option($active_type, 'tax_setting') : 'net';
     207        $sync_customers_setting = Partnero_Util::has_option($active_type, 'sync_customers') ? Partnero_Util::get_option($active_type, 'sync_customers') : 'false';
    188208
    189209        require_once Partnero_Util::get_plugin_directory() . 'admin/template/dashboard.php';
     
    222242     * @since 1.3.1
    223243     */
    224     private function update_tax_setting($program_type, $option_value) {
    225 
     244    private function update_tax_setting($program_type, $option_value): void
     245    {
    226246        $option_key = Partnero_Util::get_option_key($program_type);
    227247
     
    233253        }
    234254    }
     255
     256    /**
     257     * Save sync customers setting to option
     258     *
     259     * @param $program_type
     260     * @param $option_value
     261     * @since 1.3.1
     262     */
     263    private function update_sync_customers_setting($program_type, $option_value): void
     264    {
     265        $option_key = Partnero_Util::get_option_key($program_type);
     266
     267        if ( !empty($option_key) ) {
     268            $current_options = get_option( $option_key );
     269            $current_options['sync_customers'] = $option_value;
     270
     271            update_option( $option_key, $current_options );
     272        }
     273
     274
     275        if ( $option_value === 'true' ) {
     276
     277            // Initialize variables
     278            $batch_size = 100;
     279            $offset = 0;
     280            $counter = 0;
     281            $max_iterations = 1000;
     282
     283            $active_type = self::get_active_type();
     284            Partnero_Api::set_api_key_type($active_type);
     285
     286            do {
     287                // Fetch a batch of customers from WooCommerce
     288                $customers = Partnero_Util::get_woo_commerce_customers($batch_size, $offset);
     289
     290                if (!empty($customers)) {
     291                    Partnero_Api::sync_customers_call($customers);
     292                    $offset += $batch_size;
     293                }
     294            } while (!empty($customers) && $counter++ < $max_iterations);
     295        }
     296
     297    }
    235298}
  • partnero/trunk/admin/css/partnero-admin.css

    r3182198 r3240682  
    478478}
    479479
     480/*Toggle*/
     481
     482/* Container (Switch Button) */
     483.switch-container {
     484    display: flex;
     485    align-items: center;
     486    gap: 10px;
     487}
     488
     489/* Label styling (text next to button) */
     490.switch-label {
     491    font-size: 14px;
     492    color: #333;
     493    white-space: nowrap;
     494    margin: 0;
     495}
     496
     497.switch-button {
     498    position: relative;
     499    display: inline-flex;
     500    flex-shrink: 0;
     501    width: 48px;
     502    height: 26px;
     503    background-color: #d1d5db; /* Tailwind's gray-200 */
     504    border: 2px solid transparent;
     505    border-radius: 9999px;
     506    cursor: pointer;
     507    outline: none;
     508    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
     509}
     510
     511/* Accessibility focus styles */
     512.switch-button:focus {
     513    box-shadow: 0 0 0 1px #e5e7eb, 0 0 0 2px #d1d5db; /* Tailwind's focus:ring-offset-gray-100 and focus:ring-gray-200 */
     514}
     515
     516/* The circle (handle) */
     517.switch-handle {
     518    position: absolute;
     519    top: 1px;
     520    left: 2px;
     521    width: 20px;
     522    height: 20px;
     523    background-color: #ffffff;
     524    border-radius: 50%;
     525    transition: transform 0.2s ease-in-out;
     526    pointer-events: none;
     527}
     528
     529/* Enabled state */
     530.switch-button[aria-checked="true"] {
     531    background-color: #14b8a6; /* Tailwind's teal-500 */
     532}
     533
     534.switch-button[aria-checked="true"] .switch-handle {
     535    transform: translateX(20px); /* Moves the handle to the right */
     536}
     537
    480538@media (min-width: 1280px) {
    481539
  • partnero/trunk/admin/template/includes/dashboard-refer-a-friend.php

    r3182198 r3240682  
    107107
    108108<div class="my-4 p-6 broad-card white-card">
     109    <form action="" method="POST" class="app-settings">
     110        <div class="switch-container">
     111            <button type="button"
     112                    class="switch-button"
     113                    role="switch"
     114                    aria-checked="<?php echo $sync_customers_setting ?>"
     115                    aria-labelledby="availability-label"
     116            >
     117                <span aria-hidden="true" class="switch-handle"></span>
     118            </button>
     119            <label id="availability-label" class="switch-label">Sync customers from WooCommerce directly into the program.</label>
     120        </div>
     121        <div>
     122            <input type='hidden' name='page' value='partnero-admin'/>
     123            <input type='hidden' name='program_action' value='update-sync-customers-setting'/>
     124            <input type="hidden" name="sync_customers_setting" id="sync-customers-setting" value="<?php echo $sync_customers_setting ?>">
     125            <input type='hidden' name='program_type' value='<?php echo esc_html($active_type) ?>'/>
     126            <input type='submit' name='submit' class='btn' value="Save">
     127        </div>
     128    </form>
     129</div>
     130
     131<div class="my-4 p-6 broad-card white-card">
    109132    <form action='' method='POST' class="app-settings">
    110133        <div>
  • partnero/trunk/includes/class-partnero-api.php

    r3182198 r3240682  
    103103        $url = self::$base_url . '/program/overview';
    104104        return self::common_request_call( $url, 'GET');
     105    }
     106
     107    /**
     108     * Sync WooCommerce customers to connected Refer-a-friend program
     109     *
     110     * @since 2.0.1
     111     *
     112     * @param $customers
     113     * @return mixed|null
     114     */
     115    public static function sync_customers_call($customers) {
     116        $url = self::$base_url . '/customers/woocommerce/sync';
     117        $data = ['data' => $customers];
     118
     119        $result = self::common_request_call( $url, 'POST', $data);
     120
     121        return $result;
    105122    }
    106123
  • partnero/trunk/includes/class-partnero-util.php

    r3182198 r3240682  
    256256        return sanitize_text_field('wpt_'. Partnero_Util::get_option( $program_type, 'program_public_id' ) ."_{$id}");
    257257    }
     258
     259    /**
     260     * @param int $batch_size
     261     * @param int $offset
     262     * @return array|object|stdClass[]|null
     263     */
     264    public static function get_woo_commerce_customers(int $batch_size, int $offset)
     265    {
     266        global $wpdb;
     267
     268        return $wpdb->get_results(
     269            $wpdb->prepare(
     270                "SELECT customer_id AS id,
     271                        email,
     272                        first_name,
     273                        last_name,
     274                        date_registered
     275                 FROM wp_wc_customer_lookup
     276                 ORDER BY customer_id ASC
     277                 LIMIT %d OFFSET %d",
     278                $batch_size,
     279                $offset
     280            ),
     281            ARRAY_A
     282        );
     283    }
    258284}
  • partnero/trunk/partnero.php

    r3182198 r3240682  
    66 * Plugin Name: Partnero
    77 * Description: Grow your e-commerce business revenue and customer base with a bespoke affiliate program. Automatically track visits, signups and sales, monitor program performance, and automate payouts.
    8  * Version: 2.0.0
     8 * Version: 2.0.2
    99 * Author: Partnero
    1010 * Author URI: https://www.partnero.com/
     
    2020
    2121// Current plugin version.
    22 define('PARTNERO_VERSION', '2.0.0');
     22define('PARTNERO_VERSION', '2.0.2');
    2323
    2424/**
Note: See TracChangeset for help on using the changeset viewer.