Changeset 3240682
- Timestamp:
- 02/14/2025 03:00:31 PM (13 months ago)
- Location:
- partnero
- Files:
-
- 13 added
- 4 deleted
- 2 edited
- 25 copied
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
assets/screenshot-1.jpg (deleted)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.jpg (deleted)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.jpg (deleted)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.jpg (deleted)
-
assets/screenshot-4.png (added)
-
assets/screenshot-5.png (added)
-
trunk/LICENSE.txt (copied) (copied from partnero/tags/2.0.1/LICENSE.txt)
-
trunk/README.txt (copied) (copied from partnero/tags/2.0.1/README.txt) (2 diffs)
-
trunk/admin (added)
-
trunk/admin/class-partnero-admin.php (copied) (copied from partnero/tags/2.0.1/admin/class-partnero-admin.php) (5 diffs)
-
trunk/admin/css (added)
-
trunk/admin/css/partnero-admin.css (copied) (copied from partnero/tags/2.0.1/admin/css/partnero-admin.css) (1 diff)
-
trunk/admin/index.php (copied) (copied from partnero/tags/2.0.1/admin/index.php)
-
trunk/admin/js (added)
-
trunk/admin/js/partnero-admin.js (copied) (copied from partnero/tags/2.0.2/admin/js/partnero-admin.js)
-
trunk/admin/template (added)
-
trunk/admin/template/api-key-form.php (copied) (copied from partnero/tags/2.0.1/admin/template/api-key-form.php)
-
trunk/admin/template/dashboard.php (copied) (copied from partnero/tags/2.0.1/admin/template/dashboard.php)
-
trunk/admin/template/includes (added)
-
trunk/admin/template/includes/dashboard-affiliate.php (copied) (copied from partnero/tags/2.0.1/admin/template/includes/dashboard-affiliate.php)
-
trunk/admin/template/includes/dashboard-refer-a-friend.php (copied) (copied from partnero/tags/2.0.1/admin/template/includes/dashboard-refer-a-friend.php) (1 diff)
-
trunk/admin/template/includes/top-bar.php (copied) (copied from partnero/tags/2.0.1/admin/template/includes/top-bar.php)
-
trunk/images (added)
-
trunk/images/logo.svg (copied) (copied from partnero/tags/2.0.1/images/logo.svg)
-
trunk/images/menu-icon.png (copied) (copied from partnero/tags/2.0.1/images/menu-icon.png)
-
trunk/includes (added)
-
trunk/includes/class-partnero-activator.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero-activator.php)
-
trunk/includes/class-partnero-api.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero-api.php) (1 diff)
-
trunk/includes/class-partnero-deactivator.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero-deactivator.php)
-
trunk/includes/class-partnero-loader.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero-loader.php)
-
trunk/includes/class-partnero-util.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero-util.php) (1 diff)
-
trunk/includes/class-partnero.php (copied) (copied from partnero/tags/2.0.1/includes/class-partnero.php)
-
trunk/includes/index.php (copied) (copied from partnero/tags/2.0.1/includes/index.php)
-
trunk/index.php (copied) (copied from partnero/tags/2.0.1/index.php)
-
trunk/partnero.php (copied) (copied from partnero/tags/2.0.1/partnero.php) (2 diffs)
-
trunk/public (added)
-
trunk/public/class-partnero-public.php (copied) (copied from partnero/tags/2.0.1/public/class-partnero-public.php)
-
trunk/public/index.php (copied) (copied from partnero/tags/2.0.1/public/index.php)
-
trunk/uninstall.php (copied) (copied from partnero/tags/2.0.1/uninstall.php)
Legend:
- Unmodified
- Added
- Removed
-
partnero/trunk/README.txt
r3182198 r3240682 4 4 Requires at least: 5.3 5 5 Tested up to: 6.6 6 Stable tag: 2.0. 16 Stable tag: 2.0.3 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 44 44 45 45 == 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. 46 1. Set up and manage affiliate and referral campaigns seamlessly within your WooCommerce store. 47 2. Control when and how partners earn rewards, fine-tune every detail, and align the program with your business goals. 48 3. Reliable tracking & flexible promotion tools – Track performance accurately with link tracking and unique promo codes for your partners. 49 4. Fully customizable partner dashboard – Design the dashboard to match your brand. Add essential details, adjust the layout, and include custom content. 50 5. Automated payouts for effortless management – Save time by automating payouts, ensuring partners get paid quickly and accurately. 50 51 51 52 == 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 52 59 53 60 = 2.0.0 = -
partnero/trunk/admin/class-partnero-admin.php
r3182198 r3240682 60 60 'all' 61 61 ); 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 63 72 } 64 73 … … 103 112 if ( in_array($_POST['program_type'], Partnero_Util::ALL_TYPES, true) ) { 104 113 $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']); 105 124 } 106 125 } … … 186 205 $result = Partnero_Api::program_overview_call(); 187 206 $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'; 188 208 189 209 require_once Partnero_Util::get_plugin_directory() . 'admin/template/dashboard.php'; … … 222 242 * @since 1.3.1 223 243 */ 224 private function update_tax_setting($program_type, $option_value) {225 244 private function update_tax_setting($program_type, $option_value): void 245 { 226 246 $option_key = Partnero_Util::get_option_key($program_type); 227 247 … … 233 253 } 234 254 } 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 } 235 298 } -
partnero/trunk/admin/css/partnero-admin.css
r3182198 r3240682 478 478 } 479 479 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 480 538 @media (min-width: 1280px) { 481 539 -
partnero/trunk/admin/template/includes/dashboard-refer-a-friend.php
r3182198 r3240682 107 107 108 108 <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"> 109 132 <form action='' method='POST' class="app-settings"> 110 133 <div> -
partnero/trunk/includes/class-partnero-api.php
r3182198 r3240682 103 103 $url = self::$base_url . '/program/overview'; 104 104 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; 105 122 } 106 123 -
partnero/trunk/includes/class-partnero-util.php
r3182198 r3240682 256 256 return sanitize_text_field('wpt_'. Partnero_Util::get_option( $program_type, 'program_public_id' ) ."_{$id}"); 257 257 } 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 } 258 284 } -
partnero/trunk/partnero.php
r3182198 r3240682 6 6 * Plugin Name: Partnero 7 7 * 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. 08 * Version: 2.0.2 9 9 * Author: Partnero 10 10 * Author URI: https://www.partnero.com/ … … 20 20 21 21 // Current plugin version. 22 define('PARTNERO_VERSION', '2.0. 0');22 define('PARTNERO_VERSION', '2.0.2'); 23 23 24 24 /**
Note: See TracChangeset
for help on using the changeset viewer.