Plugin Directory

Changeset 3306771


Ignore:
Timestamp:
06/05/2025 12:06:54 AM (9 months ago)
Author:
redefiningtheweb
Message:

version 3.3.0 released

Location:
affiliaa-affiliate-program-with-mlm/trunk
Files:
3 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • affiliaa-affiliate-program-with-mlm/trunk/README.txt

    r3207033 r3306771  
    22Contributors: redefiningtheweb
    33Donate link: https://redefiningtheweb.com
    4 Tags: affiliate, affiliate marketing, affiliates, affiliate program, woocommerce
    5 Requires at least: 3.0.1
    6 Tested up to: 6.7.1
     4Tags: woocommerce affiliate plugin, referral plugin, affiliate marketing, affiliate program, multilevel marketing, mlm, performance marketing, affiliate dashboard
     5Requires at least: 5.0
     6Tested up to: 6.8
    77Requires PHP: 5.6.2
     8WC requires at least: 4.2.0
     9WC tested up to: 9.8.5
    810Stable tag: 3.2.3
    911License: GPLv2 or later
    1012License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1113
     14Launch and manage a powerful affiliate program on your WooCommerce store with Affilia. Create unlimited affiliates, set commission rules, track performance, and boost your sales!
     15
     16
    1217== Description ==
    1318
    14 Affilia can help you run your own affiliate program with WooCommerce affiliate plugin. Track sales, referrals, commissions, make payouts and create commission plans all within a single platform. Empower your affiliates with a dedicated self-care dashboard. Elevate your brand, attract customers, and boost revenue.
    15 
    16 ### AFFILIATE PROGRAM ⚡
    17 
    18 Affiliate marketing program have come to be known as something that happens online. You click a link, which directs you to a page or a product online, and then the link owner gets paid a small amount for that click. But it can also refer to things like when a mechanic gives a customer a discount for referring them to a new customer. The person who is doing the referral is getting paid by getting a discount towards their purchase. It is the same concept, just in the real world.
    19 
    20 Affiliate marketing is a popular tactic to drive sales and generate significant online revenue. You can go with our program **Affilia Lite – Affiliate Program for WooCommerce** if you want to promote your products or services.
    21 
    22 Because affiliate marketing works by spreading the responsibilities of product marketing and creation across parties, it manages to leverage the abilities of a variety of individuals for a more effective marketing strategy while providing contributors with a share of the profit. To make this work, three different parties must be involved:
    23 
    24 * Seller and product creators
    25 * The affiliate or advertiser
    26 * The consumer
    27 
    28 ### Affilia: Affiliate for WooCommerce
    29 
    30 **Affilia - Affiliate Program** helps you to market your products through your affiliate team through which you can generate more income from your eCommerce site by having more visibility and higher traffic.
    31 
    32 One of the benefits of Affiliate marketing is paying commission for referred business links, or money earned from a combination of ad clicks, and referral traffic. Affiliate marketing is mutually beneficial for both parties.
    33 
    34 With our Plugin, you can run an AFFILIATE SYSTEM with MLM (Multilevel marketing) on your web store. By rewarding your Affiliates with different types of commissions and bonuses. By this, you will surely reach the next level with INCREASED SALES. Your products will be marketed through different SOCIAL MEDIA platforms. As a result, your site will get HIGHER TRAFFIC with all these features. You just have to install our plugin and sit back and relax with your friends/family.
     19**Affilia – Affiliate Program for WooCommerce (Lite)** is a free WooCommerce affiliate plugin to create and manage an affiliate system for your WordPress eCommerce store. Easily recruit affiliates, track their referrals, pay commissions, and grow your store’s revenue with the power of performance marketing.
     20
     21This plugin is beginner-friendly, easy to set up, and flexible enough to handle growing affiliate programs. Whether you're just starting out or need a scalable solution, Affilia has you covered.
     22
     23Upgrade to the [**Premium version**](https://woocommerce.com/products/affiliate-and-referral-for-woocommerce/) for advanced features like level-wise commissions, lifetime tracking, subscription support, detailed reporting, affiliate ranking, and more.
     24
     25### 🚀 Top Free Features
     26
     27- **Unlimited Affiliates**: Add and manage unlimited affiliates for your WooCommerce store.
     28- **Referral Tracking**: Track referrals through affiliate links or codes.
     29- **Fixed/Percentage Commission**: Assign fixed or percentage-based commissions for product referrals.
     30- **Affiliate Dashboard**: Clean and simple front-end dashboard for each affiliate to track their performance.
     31- **Manual Commission Entry**: Admin can manually assign commissions.
     32- **Referral Coupon Support**: Assign discount coupons to affiliates.
     33- **Wallet System**: Affiliates can view and redeem their commissions.
     34- **Commission Rules**: Set different commission rules per product or category.
     35- **Email Notifications**: Notify affiliates about commissions, signups, and more.
     36- **Shortcodes**: Use shortcodes for registration, login, dashboard, and more.
     37
     38### 🛠 Easy Integration
     39
     40- Fully compatible with **WooCommerce**
     41- No coding knowledge required
     42- Works seamlessly with popular WordPress themes and builders
     43
     44### 💡 Use Cases
     45
     46- Launch an affiliate program for your online store
     47- Allow influencers and bloggers to promote your products
     48- Offer referral discounts to increase customer engagement
     49
     50== 🔐 GDPR and Security ==
     51We respect user privacy and data protection:
     52- Compliant with GDPR guidelines
     53- No personal data is sent to any third-party services
     54
     55== 📈 Upgrade to PRO ==
     56
     57Unlock advanced features with the [**Premium Version**](https://woocommerce.com/products/affiliate-and-referral-for-woocommerce/):
     58
     59- 🧩 **Level-wise Commission**: Create tiered levels with conditions like sales volume or referral count (Not MLM).
     60- 🔄 **Two-Way Commission**: Reward both affiliates and customers on referral purchases.
     61- 🏷️ **Affiliate Coupons**: Allow affiliates to generate and share discount codes.
     62- 📊 **Advanced Reporting & Charts**: Visualize performance, traffic, and commissions.
     63- 🧾 **Signup & Rank Bonus**: Offer rewards on affiliate sign-up or rank upgrades.
     64- 🔁 **Lifetime Commission**: Track referrals even without cookies for future purchases.
     65- 🔄 **WooCommerce Subscription Support**: Pay commissions on renewals.
     66- 🎯 **Commission by Product Tags**: Assign commissions based on product tags.
     67- 👁️ **Real-time Registration Preview**: Customize registration templates with live preview.
     68- 📥 **Multiple Payout Options**: Pay via PayPal, Stripe, Paystack, or coupons.
     69- 🪪 **Parent-Child Affiliates**: Set parent relationships between affiliates.
     70- ⚙️ **Ajax-based fast page templates** (no page reload).
     71- ✅ **Customizable Emails** and templates
     72- 📱 **Share on Social Media –** With this functionality, an affiliate can share the product’s affiliate link on social media platforms like Facebook, Twitter, Mail, and WhatsApp.
     73- 💰 **Performance Bonuses, Monthly Limits, Device-based Reports**, and much more...
     74
     75👉 [Upgrade Now →](https://woocommerce.com/products/affiliate-and-referral-for-woocommerce/)
     76
     77
     78### Multi Level Marketing ( MLM )
    3579
    3680https://www.youtube.com/watch?v=nGp3miBE6wg
    3781
    38 ### Multi Level Marketing ( MLM )
    39 
    40 You can choose any MLM Matrix from Binary, Forced Matrix and Unilevel and start earning money through your MLM members. You can set a number of child's and levels of the MLM chain. You can even set a commission for each level. Add a multilevel marketing strategy to your affiliate program so that your affiliate will generate new leads which will increase the sale amount even furthermore with the help of 3 Multi level Marketing Matrix - Binary MLM, Forced Matrix MLM, Unilevel MLM.
    41 
    42 #### Key Features
    43 
    44 * **Unlimited Affiliates**
    45   Create as many affiliates as you want to promote your products.
    46 * **Advanced Affiliate Tools**
    47   These tools help affiliates to market your products easily and effectively.
    48 * **Own Referral**
    49   Affiliates can generate commission by buying from their referral link. That means it’s a win-win situation for you and your affiliates.
    50 * **Transparency**
    51   Provide transparency between Admin and Affiliate regarding referral requests.
    52 * **Overview**
    53   Check each and every detail about the referrals from our simple yet beautiful dashboard section.
    54 * **[Premium]** The ability to expand your affiliate marketing with MLM, level base marketing, Direct bank Payment, Create Custom Banner and much more useful feature.
    55 * To explore more about premium version, [visit here](https://woocommerce.com/products/affiliate-and-referral/)
    56 * And for their extensions click here [Social Media Share Addon](https://redefiningtheweb.com/product/social-media-share-addon-for-affiliate-program/1548)
    57 
    58 ### Premium Features 💪
    59 
    60 Make a smart move with [PREMIUM version](https://woocommerce.com/products/affiliate-and-referral/) of Affilia Lite - Affiliate Program With MLM
    61 
    62 WooCommerce Affiliate Program – Advanced, Fast, Easy, Highly Functional, Robust Plugin for WordPress Websites. The WordPress & WooCommerce Affiliate Program is a premium plugin for automated Affiliate Marketing using the concept of Multi-Level Marketing.
    63 
    64 #### Key Features 🎉
    65 
    66 * **Unlimited Affiliates –** Create as many affiliates as you want to promote your products.
    67 * **MLM –** Multi-Level Marketing to boost your income by generating new leads through affiliates.
    68 * **Signup Bonus –** Get more users to your site by providing a signup bonus to Affiliates when someone REGISTER from their referral link.
    69 * **Set Maximum Commission –** You can set a maximum commission limit for a month so that you don’t need to pay your affiliate once that threshold limit is reached.
    70 * **Coupons –** Affiliates can generate coupons for their earning which can be applied while buying a product from your site.
    71 * **Advanced Affiliate Tools –** These tools help the affiliates to market your products easily and effectively.
    72 * **Dynamic & Conditional Commission Rules –** Commission on products can be set at 3 different levels.
    73   * Per Product
    74   * Per Category
    75   * All Products
    76 * **Own Referral –** Affiliate can generate commission by buying from his own referral link also. That means it’s a win-win situation for you and your **affiliate**.
    77 * **Different Commission Types –** 3 different types of commission can be set to a specific product/ a category/ all products.
    78   * Fixed Price Commission
    79   * Percentage Commission
    80   * Fixed + Percentage Commission
    81 * **Different Shortcode Types –** 3 different types of shortcodes can be used to provide a user-friendly interface.
    82   * Affiliate Dashboard
    83   * Affiliate Login
    84   * Affiliate Register
    85 * **Transparency –** Provide transparency between Admin and Affiliate regarding referral requests.
    86 * **Referral Reject Message –** You can provide the Referral reject reason to the Affiliate for better understanding and the Affiliate can view the reason, why their referral request is rejected.
    87 * **Notifications –** You can send the latest commission details via email for different products/ categories with just a single click to all of your affiliates.
    88 * **Referral Notification –** After a successful referral, an email with all the commission details is sent to the affiliate.
    89 * **Reset Password –** An Affiliate can set a password by clicking on the (Reset Password) link that the affiliate gets after a successful registration.
    90 * **Share on Social Media –** With this functionality, an affiliate can share the product’s affiliate link on social media platforms like Facebook, Twitter, Mail, WhatsApp.
    91 * **Performance Bonus –** Provide an extra incentive when the affiliate unlocks an achievement.
    92 * **Withdrawal Fees –** When you do payout with PayPal/Stripe they charge you a fee but don’t worry we've got that covered too. Set the amount which you want to deduct from the affiliate’s total commission before making a final payment.
    93 * **Overview –** Check each and every detail about the referrals from our simple yet beautiful dashboard section.
    94 * **Affiliate Verification –** You can verify the user before they become an affiliate.
    95 * **All Referral Links in one place –** Affiliates can get all the Referral Links of a category in a single file by downloading CSV.
    96 * **Paypal Payouts –** Do multiple payouts with just a single click. All of your affiliates with PayPal accounts will get the payout with just a single click.
    97 * **Stripe Payouts –** Use Stripe’s payment gateway to pay US affiliates.
    98 * **Banner Generation –** Affiliates can generate product banners that they can directly use on their marketing platforms.
    99 * **Link Generation –** Affiliates can create a referral link for any product with just a few clicks.
    100 * **QR code –** Referral links can be shared through QR codes.
    101 * **Opt-in –** Affiliate has an option to opt-in for email notifications.
    102 
    103 ### FURTHER READINGS 📝
    104 
    105 For more information about **[Affiliate and Referral Program for WooCommerce](https://woocommerce.com/products/affiliate-and-referral/)** in documentation form [visit here](https://demo.redefiningtheweb.com/wordpress-woocommerce-affiliate-program/docs/affiliate-program/overview).
     82You can choose any MLM Matrix from Binary, Forced Matrix and Unilevel and start earning money through your MLM members. You can set a number of children and the levels of the MLM chain. You can even set a commission for each level. Add a multilevel marketing strategy to your affiliate program so that your affiliate will generate new leads, which will increase the sale amount even further with the help of 3 Multi-level Marketing Matrix - Binary MLM, Forced Matrix MLM, Unilevel MLM.
     83
     84=== ❌ Features not available in the Lite version: ===
     85 == 🚀 Advanced Commission & Bonus Features ==
     86    - Level-wise commission (multi-level affiliate system)
     87    - Two-way commission (user & affiliate both get a benefit)
     88    - Coupon-based commission (no referral link needed)
     89    - Signup bonus for new affiliates
     90    - Rank bonus system for affiliates
     91    - Lifetime commission (persistent user-affiliate linkage)
     92    - Manual referral/commission assignments
     93    - Subscription renewal commission
     94    - Commission per affiliate, per product tag
     95    - Set parent of affiliates (affiliate hierarchy)
     96
     97 == 📈 Affiliate Tools & Reports ==
     98    - Advanced affiliate tools:
     99    - Dynamic HTML banners
     100    - QR codes for referral links
     101    - Social media sharing
     102    - Dynamic charts: sales overview, earnings, clicks, conversions, etc.
     103    - Advanced reporting tab:
     104    -  Sales/month
     105    - Visits, orders, revenue
     106    - Device-based purchase medium report
     107    - Performance bonus based on affiliate success
     108    - Monthly commission limits
     109    - Separate commission/payout/profile tables per affiliate
     110    -Admin panel with detailed affiliate profiles and traffic info
     111
     112 == 💳 Payout & Wallet Enhancements ==
     113    - Payout options via:
     114    - PayPal
     115    - Stripe
     116    - Paystack
     117    - Bank Transfer
     118    - Ability to shop using wallet balance (via coupons)
     119    - Wallet-based affiliate shopping support
     120    - Allow affiliates to generate coupons from earnings
     121
     122 == 🛠 Admin & Customization Tools ==
     123   = Commission rules based on: =
     124    - All products
     125    - Specific products
     126    - Specific categories
     127    - Fixed/percentage/combined
     128    - Real-time preview of the affiliate registration template
     129    - Reload-free page templates (faster UI)
     130    - Ability to set commission by product category and date range
     131   Customized emails (activate/deactivate affiliate mails)
     132
     133 == 👥 User & Tracking Enhancements ==
     134    - Ability for affiliates to see commission per product
     135    - Show member name in referral tab
     136    - Option for admins to enable/disable referral name display
     137    - Toggle between referral link or referral code tracking
     138
     139== Frequently Asked Questions ==
     140
     141= Does Affilia support WooCommerce HPOS? =
     142Yes, Affilia is fully compatible with the latest WooCommerce HPOS (High-Performance Order Storage) features.
     143
     144= Can I use Affilia with any WordPress theme? =
     145Absolutely! Affilia works with any properly coded WordPress theme.
     146
     147= Is MLM support included in the free version? =
     148No, MLM (Binary, Forced Matrix, Unilevel) is available in the premium version. You can explore it here.
     149
     150= Can affiliates earn from their own purchases? =
     151Yes, Affilia supports "Own Referral" so affiliates can earn from their own orders.
     152
     153= Is Affilia GDPR compliant? =
     154Affilia does not store any personal data outside WordPress and WooCommerce, keeping your store GDPR compliant.
     155
     156= How do affiliates track their performance? =
     157Affiliates get access to a dedicated dashboard with stats, referral links, banners, and QR code tools.
     158
     159= Can I automate payouts? =
     160Yes, premium version supports PayPal & Stripe payouts directly from the dashboard.
     161
     162= Can I create conditional or product-based commissions? =
     163Yes! You can set commissions by product, category, or sitewide—including fixed, percentage, or both.
     164
     165= Does it support multilingual websites? =
     166Yes, Affilia is translation-ready and works with popular multilingual plugins like WPML, Loco Translate, and Polylang.
     167
     168= Can I manually add commissions? =
     169Yes, the plugin allows admins to manually assign commissions.
     170
     171= Can affiliates earn commission on subscription renewals? =
     172This feature is available in the premium version.
     173
     174= Is multi-level marketing (MLM) supported? =
     175Yes, You can choose from Binary, Forced Matrix, Unilevel and Unlimited
     176
     177🚀 Want to unlock MLM, direct payouts, coupons, bonus rewards, and more?
     178Upgrade to Affilia Premium(https://woocommerce.com/products/affiliate-and-referral-for-woocommerce/) and supercharge your affiliate program today!
    106179
    107180== Screenshots ==
     
    126199
    127200* **[Official Website](https://redefiningtheweb.com/)**
     201* **[WooCommerce Portfolio](https://woocommerce.com/vendor/redefiningtheweb/)**
    128202* **[CodeCanyon Portfolio](https://codecanyon.net/user/redefiningtheweb/portfolio)**
    129203* **[Facebook](https://www.facebook.com/redefiningtheweb/)**
     
    150224
    151225== Changelog ==
     226
     227= 3.3.0 – 2025-06-05 =
     228-Added a feature to set commission per affiliate.
     229-Added a feature to set commission per affiliate per category.
     230-Added a feature to set referral automation.
     231-Fixed the issue in csv generation feature.
     232-Other minor bug fixes.
    152233
    153234= 3.2.3 - 2024-12-12 =
  • affiliaa-affiliate-program-with-mlm/trunk/admin/js/rtwalwm-wp-wc-affiliate-program-admin.js

    r3207033 r3306771  
    608608                    action: 'rtwalwm_approve',
    609609                    rtwalwm_security_check: rtwalwm_global_params.rtwalwm_nonce,
    610                     rtwalwm_referral_ids: rtwalwm_referral_ids,
     610                    rtwalwm_referral_ids: JSON.stringify(rtwalwm_referral_ids),
    611611                };
    612612
     
    661661                        action: 'rtwalwm_approve',
    662662                        rtwalwm_security_check: rtwalwm_global_params.rtwalwm_nonce,
    663                         rtwalwm_referral_ids: rtwalwm_referral_ids,
     663                        rtwalwm_referral_ids: JSON.stringify(rtwalwm_referral_ids),
    664664                    };
    665665
     
    697697                    action: 'rtwalwm_reject',
    698698                    rtwalwm_security_check: rtwalwm_global_params.rtwalwm_nonce,
    699                     rtwalwm_referral_ids: rtwalwm_referral_ids,
     699                    rtwalwm_referral_ids: JSON.stringify(rtwalwm_referral_ids),
    700700                };
    701701
     
    735735                        action: 'rtwalwm_reject',
    736736                        rtwalwm_security_check: rtwalwm_global_params.rtwalwm_nonce,
    737                         rtwalwm_referral_ids: rtwalwm_referral_ids,
     737                        rtwalwm_referral_ids: JSON.stringify(rtwalwm_referral_ids),
    738738                    };
    739739
     
    787787                action: 'rtwalwm_aff_approve',
    788788                rtwalwm_security_check: rtwalwm_global_params.rtwalwm_nonce,
    789                 rtwalwm_referral_ids: rtwalwm_referral_ids,
     789                rtwalwm_referral_ids: JSON.stringify(rtwalwm_referral_ids),
    790790            };
    791791
  • affiliaa-affiliate-program-with-mlm/trunk/admin/partials/rtwalwm_tabs/rtwalwm_affiliates.php

    r3207033 r3306771  
    1616    $rtwalwm_comm_base              = isset( $rtwalwm_commission_settings[ 'comm_base' ] ) ? $rtwalwm_commission_settings[ 'comm_base' ] : '1';
    1717
     18    $rtwalwm_get_tab = isset($_GET["page"])? sanitize_text_field(wp_unslash($_GET["page"])):"";
     19
     20    $rtwalwm_redirect_url = admin_url( "admin.php?page=".$rtwalwm_get_tab );
     21
     22    $rtwalwm_affiliate_nonce = wp_create_nonce( 'rtwalwm_security_string_aff_nonce' );
     23
     24    $rtwalwm_updated_url = add_query_arg('rtwalwm_back_end_affiliate_nonce', esc_attr($rtwalwm_affiliate_nonce), esc_url($rtwalwm_redirect_url));
     25
    1826?>
    1927
     
    2331    </a>
    2432
    25     <input type="button" value="<?php esc_attr_e( 'Generate Affiliate CSV', 'affiliaa-affiliate-program-with-mlm' ); ?>" class="rtwalwm-button rtwalwm_generate_csv_affiliate" name="rtwalwm_add_new_affiliate" />
     33    <!-- <input type="button" value="<?php esc_attr_e( 'Generate Affiliate CSV', 'affiliaa-affiliate-program-with-mlm' ); ?>" class="rtwalwm-button rtwalwm_generate_csv_affiliate" name="rtwalwm_add_new_affiliate" /> -->
     34    <a href="<?php echo esc_url( $rtwalwm_updated_url ); ?>">
     35        <input type="button" value="<?php esc_attr_e( 'Generate Affiliate CSV', 'affiliaa-affiliate-program-with-mlm' ); ?>" class="rtwalwm-button" />
     36    </a>
    2637
    2738    <?php
  • affiliaa-affiliate-program-with-mlm/trunk/admin/partials/rtwalwm_tabs/rtwalwm_commission.php

    r3207033 r3306771  
    212212            <td> </td>
    213213        </tr>
    214 
     214        <tr class="rtwalwm_prod_comm ">
     215            <th>
     216                <span id="rtwalwm_th_heading"><?php esc_html_e( 'Commission per Affiliate', 'affiliaa-affiliate-program-with-mlm' ); ?>
     217                        <span id = "rtwalwm_pro_img"><img src="<?php echo esc_url( RTWALWM_URL.'assets/images/PRO.png' ); ?>" alt=""></span>
     218                </span>
     219            </th>
     220       
     221            <td class="tr2">
     222                <table>
     223                    <thead>
     224                        <th>
     225                            <?php esc_html_e( 'Affiliate Name', 'affiliaa-affiliate-program-with-mlm' ); ?>
     226                        </th>
     227                        <th>
     228                            <?php esc_html_e( 'Percentage', 'affiliaa-affiliate-program-with-mlm' ); ?>
     229                        </th>
     230                        <th>
     231                            <?php esc_html_e( 'Fixed Price', 'affiliaa-affiliate-program-with-mlm' ); ?>
     232                        </th>
     233                        <th>
     234                            <?php esc_html_e( 'Add/Remove row', 'affiliaa-affiliate-program-with-mlm' ); ?>
     235                        </th>
     236                    </thead>
     237                    <tbody class="rtwalwm_tbody">
     238                        <tr>
     239                            <td>
     240                                <select class="rtwalwm_select2" multiple="multiple" id="" data-placeholder="<?php echo esc_html__( 'Select affiliate', 'affiliaa-affiliate-program-with-mlm' ); ?>">
     241                                   
     242                                        <option value="" disabled>
     243                                            <?php esc_html_e( 'No affiliate', 'affiliaa-affiliate-program-with-mlm' ); ?>
     244                                        </option>
     245                                   
     246                                </select>
     247                            </td>
     248                            <td>
     249                                <input class="rtwalwm_cat_percentage_commission" type="number" min="0" max="100" disabled/>
     250                            </td>
     251                            <td>
     252                                <input class="rtwalwm_cat_fixed_commission" type="number" min="0" disabled/>
     253                            </td>
     254                            <td>
     255                                <span class="dashicons dashicons-plus-alt rtwalwm_add_new_row" disabled></span>
     256                                <span class="dashicons dashicons-dismiss rtwalwm_remove_row" disabled></span>
     257                            </td>
     258                        </tr>
     259                    </tbody>
     260                </table>
     261            </td>
     262        </tr>
     263        <tr class="rtwalwm_prod_comm ">
     264            <th>
     265                <span id="rtwalwm_th_heading"><?php esc_html_e( 'Commission per Affiliate per Category', 'affiliaa-affiliate-program-with-mlm' ); ?>
     266                        <span id = "rtwalwm_pro_img"><img src="<?php echo esc_url( RTWALWM_URL.'assets/images/PRO.png' ); ?>" alt=""></span>
     267                </span>
     268            </th>
     269       
     270            <td class="tr2">
     271                <table>
     272                    <thead>
     273                        <th>
     274                            <?php esc_html_e( 'Affiliate Name', 'affiliaa-affiliate-program-with-mlm' ); ?>
     275                        </th>
     276                        <th>
     277                            <?php esc_html_e( 'Categories', 'affiliaa-affiliate-program-with-mlm' ); ?>
     278                        </th>
     279                        <th>
     280                            <?php esc_html_e( 'Percentage', 'affiliaa-affiliate-program-with-mlm' ); ?>
     281                        </th>
     282                        <th>
     283                            <?php esc_html_e( 'Fixed Price', 'affiliaa-affiliate-program-with-mlm' ); ?>
     284                        </th>
     285                        <th>
     286                            <?php esc_html_e( 'Add/Remove row', 'affiliaa-affiliate-program-with-mlm' ); ?>
     287                        </th>
     288                    </thead>
     289                    <tbody class="rtwalwm_tbody">
     290                        <tr>
     291                            <td>
     292                                <select class="rtwalwm_select2" multiple="multiple" id="" data-placeholder="<?php echo esc_html__( 'Select affiliate', 'affiliaa-affiliate-program-with-mlm' ); ?>">
     293                                   
     294                                        <option value="" disabled>
     295                                            <?php esc_html_e( 'No affiliate', 'affiliaa-affiliate-program-with-mlm' ); ?>
     296                                        </option>
     297                                   
     298                                </select>
     299                            </td>
     300                            <td>
     301                                <select class="rtwalwm_select2" multiple="multiple" id="" data-placeholder="<?php echo esc_html__( 'Select categories', 'affiliaa-affiliate-program-with-mlm' ); ?>">
     302                                   
     303                                        <option value="" disabled>
     304                                            <?php esc_html_e( 'No Category', 'affiliaa-affiliate-program-with-mlm' ); ?>
     305                                        </option>
     306                                   
     307                                </select>
     308                            </td>
     309                            <td>
     310                                <input class="rtwalwm_cat_percentage_commission" type="number" min="0" max="100" disabled/>
     311                            </td>
     312                            <td>
     313                                <input class="rtwalwm_cat_fixed_commission" type="number" min="0" disabled/>
     314                            </td>
     315                            <td>
     316                                <span class="dashicons dashicons-plus-alt rtwalwm_add_new_row" disabled></span>
     317                                <span class="dashicons dashicons-dismiss rtwalwm_remove_row" disabled></span>
     318                            </td>
     319                        </tr>
     320                    </tbody>
     321                </table>
     322            </td>
     323        </tr>
    215324        <tr class="rtwalwm_prod_comm ">
    216325            <th>
     
    568677            </td>
    569678        </tr>
     679        <tr >
     680            <th>
     681
     682            <span id="rtwalwm_th_heading"><?php esc_html_e( 'Affiliate Referral Automation', 'affiliaa-affiliate-program-with-mlm' ); ?>
     683                <span id = "rtwalwm_pro_img"><img src="<?php echo esc_url( RTWALWM_URL.'assets/images/PRO.png' ); ?>" alt=""></span>
     684                       
     685            </span>
     686            </th>
     687   
     688            <td>
     689                <select class="rtwalwm_select" id="" data-placeholder="<?php echo esc_html__( 'Select option', 'affiliaa-affiliate-program-with-mlm' ); ?>">
     690                   
     691                        <option value="">
     692                            <?php esc_html_e( 'Select option', 'affiliaa-affiliate-program-with-mlm' ); ?>
     693                        </option>
     694                        <option value="" disabled>
     695                            <?php esc_html_e( 'Completed', 'affiliaa-affiliate-program-with-mlm' ); ?>
     696                        </option>
     697                        <option value="" disabled>
     698                            <?php esc_html_e( 'Processing', 'affiliaa-affiliate-program-with-mlm' ); ?>
     699                        </option>
     700                   
     701                </select>
     702            </td>
     703        </tr>
    570704    </tbody>
    571705</table>
  • affiliaa-affiliate-program-with-mlm/trunk/admin/partials/rtwalwm_tabs/rtwalwm_extra_features.php

    r3207033 r3306771  
    266266                <tr>
    267267                    <th><?php esc_html_e( 'QR code for referral links', 'affiliaa-affiliate-program-with-mlm' ); ?></th>
     268                    <td class="tr2">
     269                        <p>
     270                            <span class="rtwalwm-custom-radio">
     271                                <input id="radio-3" type="radio" name="" value="" disabled /><?php esc_html_e( 'On', 'affiliaa-affiliate-program-with-mlm' ); ?>
     272                                <label for="radio-3"></label>
     273                            </span>
     274                        </p>
     275                        <p>
     276                            <span class="rtwalwm-custom-radio">
     277                           
     278                                <input id="radio-4" type="radio" name="" value="" disabled/><?php esc_html_e( 'Off', 'affiliaa-affiliate-program-with-mlm' ); ?>
     279                                <label for="radio-4"></label>
     280                            </span>
     281                        </p>
     282                    </td>
     283                </tr>
     284                <tr>
     285                    <th><?php esc_html_e( 'Commission for subscription renewal', 'affiliaa-affiliate-program-with-mlm' ); ?></th>
    268286                    <td class="tr2">
    269287                        <p>
  • affiliaa-affiliate-program-with-mlm/trunk/admin/rtwalwm-class-wp-wc-affiliate-program-admin.php

    r3207033 r3306771  
    5757        $this->rtwalwm_version = $rtwalwm_version;
    5858
    59         $rtwalwm_generate_aff_csv = isset($_GET['affiliate_csv_download'])? sanitize_text_field($_GET['affiliate_csv_download']): '';
    60         if(!empty($rtwalwm_generate_aff_csv))
    61         {
    62             add_action('init', array($this, 'rtwalwm_download_affiliate_csv'));
    63         }
    64 
    65     }
    66 
    67     public function rtwalwm_download_affiliate_csv(){
    68 
    69         require_once( WP_PLUGIN_DIR."/wp-wc-affiliate-program/third_party/csv-9.8.0/autoload.php");
    70         $rtwalwm_file_name = sanitize_text_field($_GET['affiliate_csv_download']);
    71         if(empty($rtwalwm_file_name )){
    72             wp_die(esc_html__('Invalid file name.','affiliaa-affiliate-program-with-mlm'));
    73         }
    74        
    75         $rtwalwm_file_path = RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name;
    76 
    77         if (!file_exists($rtwalwm_file_path) || strpos(realpath($rtwalwm_file_path), realpath(RTWALWM_DIR . 'assets/csv/')) !== 0) {
    78             wp_die(esc_html__('File does not exist or invalid file path.', 'affiliaa-affiliate-program-with-mlm'));
    79         }
    80 
    81         header('Content-Type: text/csv; charset=UTF-8');
    82         header('Content-Description: File Transfer');
    83         header('Content-Disposition: attachment; filename="'.$rtwalwm_file_name.'"');
    84         $reader = Reader::createFromPath(RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name, 'r');
    85         $reader->output();
    86         wp_die();
    87     }
     59        // $rtwalwm_generate_aff_csv = isset($_GET['affiliate_csv_download'])? sanitize_text_field($_GET['affiliate_csv_download']): '';
     60        // if(!empty($rtwalwm_generate_aff_csv))
     61        // {
     62        // add_action('init', array($this, 'rtwalwm_download_affiliate_csv'));
     63        // }
     64
     65    }
     66
     67    // public function rtwalwm_download_affiliate_csv(){
     68
     69    // require_once( WP_PLUGIN_DIR."/wp-wc-affiliate-program/third_party/csv-9.8.0/autoload.php");
     70    // $rtwalwm_file_name = sanitize_text_field($_GET['affiliate_csv_download']);
     71    // if(empty($rtwalwm_file_name )){
     72    //      wp_die(esc_html__('Invalid file name.','affiliaa-affiliate-program-with-mlm'));
     73    // }
     74       
     75    // $rtwalwm_file_path = RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name;
     76
     77    // if (!file_exists($rtwalwm_file_path) || strpos(realpath($rtwalwm_file_path), realpath(RTWALWM_DIR . 'assets/csv/')) !== 0) {
     78    //      wp_die(esc_html__('File does not exist or invalid file path.', 'affiliaa-affiliate-program-with-mlm'));
     79    // }
     80
     81    // header('Content-Type: text/csv; charset=UTF-8');
     82    // header('Content-Description: File Transfer');
     83    // header('Content-Disposition: attachment; filename="'.$rtwalwm_file_name.'"');
     84    // $reader = Reader::createFromPath(RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name, 'r');
     85    // $reader->output();
     86    // wp_die();
     87    // }
    8888
    8989    /**
     
    263263    */
    264264    function rtwalwm_save_comm( $rtwalwm_option )
    265     {
     265    { 
    266266        $rtwalwm_option[ 'per_cat' ] = array();
    267267        $i = 0;
     
    394394            if( current_user_can( 'manage_options' ) )
    395395            {
    396                 $rtwalwm_user_id    = sanitize_text_field( $_POST[ 'rtwalwm_user_id' ] );
    397                 $rtwalwm_value      = sanitize_text_field( $_POST[ 'rtwalwm_value' ] );
     396                $rtwalwm_user_id    = isset($_POST[ 'rtwalwm_user_id' ]) ? sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_user_id' ]) ) : '';
     397                $rtwalwm_value      = isset($_POST[ 'rtwalwm_value' ]) ? sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_value' ]) ) : '';
    398398                $rtwalwm_updated    = update_user_meta( $rtwalwm_user_id, 'rtwwwap_affiliate', $rtwalwm_value );
    399399                update_user_meta( $rtwalwm_user_id, 'rtwwwap_aff_approved', $rtwalwm_value );
     
    454454        </table>
    455455    <?php
     456    wp_nonce_field( 'rtwalwm_add_affiliate_action', 'rtwalwm_add_affiliate_nonce' );
    456457    }
    457458
     
    460461    */
    461462    function rtwalwm_save_custom_user_profile_fields_add( $rtwalwm_user_id ){
     463        if ( ! isset( $_POST['rtwalwm_add_affiliate_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['rtwalwm_add_affiliate_nonce'] )), 'rtwalwm_add_affiliate_action' ) ) {
     464            return false;
     465        }
    462466
    463467        if( !current_user_can( 'manage_options' ) ){
    464468            return false;
    465469        }
    466         $rtwalwm_value = ( sanitize_text_field( $_POST[ 'rtwalwm_add_affiliate_checkbox' ] ) == 'on' ) ? 1 : 0;
     470        $rtwalwm_value = ( isset( $_POST['rtwalwm_add_affiliate_checkbox'] ) && sanitize_text_field( wp_unslash($_POST['rtwalwm_add_affiliate_checkbox'] )) == 'on' ) ? 1 : 0;
    467471        update_user_meta( $rtwalwm_user_id, 'rtwwwap_affiliate', $rtwalwm_value );
    468472        update_user_meta( $rtwalwm_user_id, 'rtwwwap_aff_approved', $rtwalwm_value );
     
    562566            {
    563567               
    564                 $rtwalwm_post_id    = sanitize_text_field( $_POST[ 'rtwalwm_post_id' ] );
    565                 $rtwalwm_value      = sanitize_text_field( $_POST[ 'rtwalwm_value' ] );
     568                $rtwalwm_post_id    = isset($_POST['rtwalwm_post_id'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_post_id'])): "";
     569                $rtwalwm_value      = isset($_POST['rtwalwm_value'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_value'])): "";
     570                $rtwalwm_mlm_type       = isset($_POST['rtwalwm_type'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_type'])): "";
    566571               
    567572                   
    568                 if( sanitize_text_field( $_POST[ 'rtwalwm_type' ] ) == 'perc_comm' ){
     573                if( $rtwalwm_mlm_type == 'perc_comm' ){
    569574                    $rtwalwm_updated = update_post_meta( $rtwalwm_post_id, 'rtwalwm_percentage_commission_box', $rtwalwm_value );
    570575                }
    571                 elseif( sanitize_text_field( $_POST[ 'rtwalwm_type' ] ) == 'fix_comm' ){
     576                elseif( $rtwalwm_mlm_type == 'fix_comm' ){
    572577                    $rtwalwm_updated = update_post_meta( $rtwalwm_post_id, 'rtwalwm_fixed_commission_box', $rtwalwm_value );
    573578                }
     
    639644    */
    640645    function rtwalwm_save_custom_meta_box( $rtwalwm_post_id, $rtwalwm_post, $rtwalwm_update ) {
    641         if( !isset( $_POST[ 'rtwalwm_meta_box_nonce' ] ) || !wp_verify_nonce( sanitize_text_field( $_POST[ 'rtwalwm_meta_box_nonce' ] ), 'rtwalwm_commission_nonce' ) )
     646        if( !isset( $_POST[ 'rtwalwm_meta_box_nonce' ] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_meta_box_nonce' ]) ), 'rtwalwm_commission_nonce' ) )
    642647        {
    643648            return;
     
    648653        }
    649654        if( isset( $_POST[ 'rtwalwm_fixed_commission_box' ] ) ){
    650             update_post_meta( $rtwalwm_post_id, 'rtwalwm_fixed_commission_box', sanitize_text_field( $_POST[ 'rtwalwm_fixed_commission_box' ] ) );
     655            update_post_meta( $rtwalwm_post_id, 'rtwalwm_fixed_commission_box', sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_fixed_commission_box' ]) ) );
    651656        }
    652657    }
     
    656661    {
    657662
    658         ini_set('display_errors', 1);
    659         ini_set('display_startup_errors', 1);
    660         error_reporting(E_ALL);
     663        // ini_set('display_errors', 1);
     664        // ini_set('display_startup_errors', 1);
     665        // error_reporting(E_ALL);
    661666        $rtwalwm_check_ajax = check_ajax_referer( 'rtwalwm-ajax-security-string', 'rtwalwm_security_check' );
    662667
     
    664669
    665670            global $wpdb;
    666             $rtwalwm_reff_ids       = isset($_POST[ 'rtwalwm_referral_ids' ])? $_POST[ 'rtwalwm_referral_ids' ] :"";
     671            $rtwalwm_reff_ids = isset($_POST[ 'rtwalwm_referral_ids' ])? sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_referral_ids' ])) :"";
     672            $rtwalwm_reff_ids = json_decode(stripslashes($rtwalwm_reff_ids),true);
    667673       
    668674            $rtwalwm_approved_ids   = array();
     
    740746        if ( $rtwalwm_check_ajax ) {
    741747            global $wpdb;
    742            
    743             $rtwalwm_reff_ids       =  sanitize_text_field($_POST['rtwalwm_referral_ids']);
     748            $rtwalwm_reff_ids = isset($_POST[ 'rtwalwm_referral_ids' ])? sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_referral_ids' ])) :"";
     749            $rtwalwm_reff_ids = json_decode(stripslashes($rtwalwm_reff_ids),true);
    744750
    745751            $rtwalwm_rejected_ids   = array();
     
    784790
    785791        if ( $rtwalwm_check_ajax ) {
    786             $rtwalwm_reff_ids       =  sanitize_post( $_POST['rtwalwm_referral_ids'] ) ;
    787 
     792            $rtwalwm_reff_ids       =  isset($_POST[ 'rtwalwm_referral_ids' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_referral_ids' ])): "";
     793            $rtwalwm_reff_ids = json_decode(stripslashes($rtwalwm_reff_ids),true);
    788794            $rtwalwm_approved_ids   = array();
    789795
     
    810816
    811817        if ( $rtwalwm_check_ajax ) {
    812             $rtwalwm_referral_id        =  sanitize_post( $_POST['rtwalwm_referral_id'] ) ;
     818            $rtwalwm_referral_id        =  isset($_POST[ 'rtwalwm_referral_id' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_referral_id' ])): "";
    813819            $rtwalwm_delete_referral    = $wpdb->delete( $wpdb->prefix.'rtwwwap_referrals', array( 'id' => $rtwalwm_referral_id ), array( '%d' ) );
    814820
     
    835841        if ( $rtwalwm_check_ajax ) {
    836842           
    837             $rtwalwm_image_id = sanitize_text_field($_POST[ 'rtwalwm_image_id' ]);
     843            $rtwalwm_image_id = isset($_POST[ 'rtwalwm_image_id' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_image_id' ])): "";
    838844            $rtwalwm_target_link = site_url();
    839             $rtwalwm_image_dimention_width = sanitize_text_field($_POST[ 'rtwalwm_image_dimention_width' ]);
    840             $rtwalwm_image_dimention_height = sanitize_text_field($_POST[ 'rtwalwm_image_dimention_height' ]);
     845            $rtwalwm_image_dimention_width = isset($_POST[ 'rtwalwm_image_dimention_width' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_image_dimention_width' ])): "";
     846            $rtwalwm_image_dimention_height = isset($_POST[ 'rtwalwm_image_dimention_height' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_image_dimention_height' ])): "";
    841847
    842848
     
    879885        if ( $rtwalwm_check_ajax ) {
    880886           
    881             $rtwalwm_image_id = sanitize_text_field($_POST[ 'rtwalwm_image_id' ]) ;
    882             $rtwalwm_target_link = sanitize_text_field($_POST[ 'rtwalwm_target_link' ]);
     887            $rtwalwm_image_id = isset($_POST[ 'rtwalwm_image_id' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_image_id' ])): "";
     888            $rtwalwm_target_link = isset($_POST[ 'rtwalwm_target_link' ]) ? sanitize_text_field(wp_unslash($_POST[ 'rtwalwm_target_link' ])): "";
    883889            $rtwalwm_custom_banner_opt = get_option( 'rtwwwap_custom_banner_opt' );
    884890           
     
    927933            }
    928934        }
    929         else
    930         {
     935        else{
    931936            echo 'No Affiliate users found.';
    932937        }
     
    939944                )
    940945            );
     946        wp_nonce_field( 'rtwalwm_coupon_option_action', 'rtwalwm_coupon_option_nonce' );
    941947    }
    942948
    943949    function woocommerce_save_coupon_callback($post_id)
    944950    {
    945         $rtwalwm_select_affiliate_id = isset( $_POST['rtwalwm_select_affiliate'] ) ?  $_POST['rtwalwm_select_affiliate'] : 0;
     951        if ( ! isset( $_POST['rtwalwm_coupon_option_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['rtwalwm_coupon_option_nonce'] )), 'rtwalwm_coupon_option_action' ) ) {
     952            return false;
     953        }
     954        $rtwalwm_select_affiliate_id = isset( $_POST['rtwalwm_select_affiliate'] ) ?  sanitize_text_field(wp_unslash($_POST['rtwalwm_select_affiliate'])) : 0;
    946955        $rtwalwm_user_meta = update_user_meta($rtwalwm_select_affiliate_id,'rtwalwm_coupon_save',$post_id );
    947956        update_post_meta( $post_id, 'rtwalwm_coupon_aff_id', $rtwalwm_select_affiliate_id );
    948957    }
    949958
    950     function rtwalwm_save_notification_callback()
    951     {
    952         $rtwalwm_not_title   =  isset($_POST['rtwalwm_not_title'])? $_POST['rtwalwm_not_title'] : "" ;
    953         $rtwalwm_noti_content = isset($_POST['rtwalwm_no_text'])? $_POST['rtwalwm_no_text'] : "" ;
    954         $rtwalwm_key = isset($_POST['rtwalwm_key'])? $_POST['rtwalwm_key'] : "" ;
    955 
    956         $rtwalwm_time = gmdate('d/m/y_H:i:s');
    957         $rtwalwm_noti_array = get_option('rtwalwm_noti_arr');
    958        
    959     }
    960     function rtwalwm_generate_csv_affiliate_callback(){
     959    // function rtwalwm_save_notification_callback()
     960    // {
     961    //  $rtwalwm_not_title   =  isset($_POST['rtwalwm_not_title'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_not_title'])) : "";
     962    //  $rtwalwm_noti_content = isset($_POST['rtwalwm_no_text'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_no_text'])) : "";
     963    //  $rtwalwm_key = isset($_POST['rtwalwm_key'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_key'])) : "";
     964
     965    //  $rtwalwm_time = gmdate('d/m/y_H:i:s');
     966    //  $rtwalwm_noti_array = get_option('rtwalwm_noti_arr');
     967       
     968    // }
     969    // function rtwalwm_generate_csv_affiliate_callback(){
     970
     971    //  $rtwalwm_args = array(
     972    //      'meta_key'      => 'rtwwwap_affiliate',
     973    //      'meta_value'    => '1',
     974    //      'orderby'       => 'id',
     975    //      'order'         => 'desc'
     976    //  );
     977    //  $rtwalwm_users = get_users( $rtwalwm_args );
     978
     979    //  $rtwalwm_counter = 0;
     980    //  require_once( WP_PLUGIN_DIR."/affiliaa-affiliate-program-with-mlm/third_party/csv-9.8.0/autoload.php");
     981    //  $rtwalwm_filename   = "export-labels--".time().".csv";
     982    //  $csv = Writer::createFromPath(RTWALWM_DIR.'assets/csv/'.$rtwalwm_filename, 'w+');
     983    //  $header = ['S.NO.','Affiliate ID', 'Affiliate Name', 'Affiliate Email','Parent Id','Parent Name' ];
     984    //  $csv->insertOne($header);
     985    //  if(!empty($rtwalwm_users))
     986    //  {
     987    //      foreach( $rtwalwm_users as $rtwalwm_key => $rtwalwm_user ){
     988    //          global $wpdb;
     989    //          $rtwalwm_parent_id = $wpdb->get_var($wpdb->prepare( "SELECT `parent_id` FROM ".$wpdb->prefix."rtwalwm_mlm WHERE `aff_id` = %d", $rtwalwm_user->ID )) ;
     990
     991    //          $rtwalwm_parent_name = $wpdb->get_var($wpdb->prepare( "SELECT `user_login` FROM ".$wpdb->prefix."users WHERE `ID` = %d", $rtwalwm_parent_id  )) ;
     992    //          $rtwalwm_counter++;
     993    //          $csv->insertOne([$rtwalwm_counter-1, $rtwalwm_user->ID , $rtwalwm_user->data->user_login , $rtwalwm_user->data->user_email,$rtwalwm_parent_id, $rtwalwm_parent_name ]);
     994    //      }
     995    //      echo wp_json_encode( array('status' => true, 'filename' => $rtwalwm_filename) );
     996    //      wp_die();
     997    //  }
     998    //  else{
     999    //      echo wp_json_encode( array('status' => false, 'filename' => esc_html__( "There is no data available in this table", 'affiliaa-affiliate-program-with-mlm' )) );
     1000    //      wp_die();
     1001    //  }
     1002                   
     1003    // }
     1004
     1005    function rtwalwm_generate_affiliate_csv_callback(){
     1006
     1007        if ( ! isset( $_GET['rtwalwm_back_end_affiliate_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['rtwalwm_back_end_affiliate_nonce'] ) ), 'rtwalwm_security_string_aff_nonce' ) ){
     1008            return;
     1009        }
    9611010
    9621011        $rtwalwm_args = array(
     
    9701019        $rtwalwm_counter = 0;
    9711020        require_once( WP_PLUGIN_DIR."/affiliaa-affiliate-program-with-mlm/third_party/csv-9.8.0/autoload.php");
    972         $rtwalwm_filename   = "export-labels--".time().".csv";
    973         $csv = Writer::createFromPath(RTWALWM_DIR.'assets/csv/'.$rtwalwm_filename, 'w+');
     1021        $rtwalwm_file_name  = "export-labels--".time().".csv";
     1022        $csv = Writer::createFromPath(RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name, 'w+');
    9741023        $header = ['S.NO.','Affiliate ID', 'Affiliate Name', 'Affiliate Email','Parent Id','Parent Name' ];
    9751024        $csv->insertOne($header);
     
    9781027            foreach( $rtwalwm_users as $rtwalwm_key => $rtwalwm_user ){
    9791028                global $wpdb;
    980                 $rtwalwm_parent_id = $wpdb->get_var($wpdb->prepare( "SELECT `parent_id` FROM ".$wpdb->prefix."rtwalwm_mlm WHERE `aff_id` = %d", $rtwalwm_user->ID )) ;
     1029                $rtwalwm_parent_id = $wpdb->get_var($wpdb->prepare( "SELECT `parent_id` FROM ".$wpdb->prefix."rtwwwap_mlm WHERE `aff_id` = %d", $rtwalwm_user->ID )) ;
    9811030
    9821031                $rtwalwm_parent_name = $wpdb->get_var($wpdb->prepare( "SELECT `user_login` FROM ".$wpdb->prefix."users WHERE `ID` = %d", $rtwalwm_parent_id  )) ;
     
    9841033                $csv->insertOne([$rtwalwm_counter-1, $rtwalwm_user->ID , $rtwalwm_user->data->user_login , $rtwalwm_user->data->user_email,$rtwalwm_parent_id, $rtwalwm_parent_name ]);
    9851034            }
    986             echo wp_json_encode( array('status' => true, 'filename' => $rtwalwm_filename) );
    987             wp_die();
    988         }
    989         else{
    990             echo wp_json_encode( array('status' => false, 'filename' => esc_html__( "There is no data available in this table", 'affiliaa-affiliate-program-with-mlm' )) );
    991             wp_die();
    992         }
     1035        }
     1036       
     1037        $rtwalwm_file_path = RTWALWM_DIR.'assets/csv/'.$rtwalwm_file_name;
     1038
     1039        if (!file_exists($rtwalwm_file_path) || strpos(realpath($rtwalwm_file_path), realpath(RTWALWM_DIR . 'assets/csv/')) !== 0) {
     1040            wp_die(esc_html__('File does not exist or invalid file path.', 'affiliaa-affiliate-program-with-mlm'));
     1041        }
     1042
     1043        header('Content-Type: text/csv; charset=UTF-8');
     1044        header('Content-Description: File Transfer');
     1045        header('Content-Disposition: attachment; filename="'.$rtwalwm_file_name.'"');
     1046
     1047        $reader = Reader::createFromPath($rtwalwm_file_path, 'r');
     1048        $reader->output();
     1049        wp_delete_file( $rtwalwm_file_path );
     1050        exit;
    9931051                   
    9941052    }
  • affiliaa-affiliate-program-with-mlm/trunk/includes/rtwalwm-class-wp-wc-affiliate-program.php

    r3207033 r3306771  
    190190
    191191       
    192         $this->rtwalwm_loader->rtwalwm_add_action( 'wp_ajax_rtwalwm_generate_csv_affiliate', $rtwalwm_plugin_admin, 'rtwalwm_generate_csv_affiliate_callback' );
     192        // $this->rtwalwm_loader->rtwalwm_add_action( 'wp_ajax_rtwalwm_generate_csv_affiliate', $rtwalwm_plugin_admin, 'rtwalwm_generate_csv_affiliate_callback' );
     193        $this->rtwalwm_loader->rtwalwm_add_action( 'init', $rtwalwm_plugin_admin, 'rtwalwm_generate_affiliate_csv_callback' );
    193194
    194195        // settings initialize
  • affiliaa-affiliate-program-with-mlm/trunk/public/rtwalwm-class-wp-wc-affiliate-program-public.php

    r3207033 r3306771  
    196196
    197197        if ( $rtwalwm_check_ajax ) {
    198             $rtwalwm_user_id    = isset($_POST[ 'rtwalwm_user_id' ])?sanitize_text_field( $_POST[ 'rtwalwm_user_id' ] ):'';
     198            $rtwalwm_user_id    = isset($_POST[ 'rtwalwm_user_id' ])?sanitize_text_field( wp_unslash($_POST[ 'rtwalwm_user_id' ] )):'';
    199199            $rtwalwm_updated    = update_user_meta( $rtwalwm_user_id, 'rtwwwap_affiliate', 1 );
    200200            $rtwalwm_aff_approved = 0;
     
    297297
    298298            if(isset($_GET['action'])){
    299                 $rtwalwm_aff_share = $_GET['action'];
     299                $rtwalwm_aff_share = sanitize_text_field(wp_unslash($_GET['action']));
    300300            }
    301301            else{
     
    303303            }
    304304
    305             $custom_str = $_GET[ 'rtwalwm_aff' ];
     305            $custom_str = sanitize_text_field(wp_unslash($_GET[ 'rtwalwm_aff' ]));
    306306            $rtwalwm_referee_aff = get_users(array(
    307307                'meta_key' => 'rtwalwm_referee_custom_str',
     
    377377    function rtwalwm_url_check_edd(){
    378378        if( isset( $_GET[ 'rtwalwm_aff' ] ) ){
    379             $rtwalwm_aff            = explode( '_', sanitize_text_field($_GET[ 'rtwalwm_aff' ])  );
     379            $rtwalwm_aff            = explode( '_', sanitize_text_field(wp_unslash($_GET[ 'rtwalwm_aff' ]))  );
    380380            $rtwalwm_affiliate_id   = $rtwalwm_aff[1];
    381381            $rtwalwm_aff_share      = isset( $rtwalwm_aff[2] ) ? $rtwalwm_aff[2] : 0;
     
    435435   
    436436
    437         $rtwalwm_cookie = sanitize_text_field( $_COOKIE[ 'rtwalwm_referral' ]);
     437        $rtwalwm_cookie = isset($_COOKIE['rtwalwm_referral'])? sanitize_text_field( wp_unslash($_COOKIE[ 'rtwalwm_referral' ])):'';
    438438
    439439
     
    737737        $rtwalwm_commission_settings = get_option( 'rtwalwm_commission_settings_opt' );
    738738       
    739         $rtwalwm_cookie = sanitize_text_field( $_COOKIE[ 'rtwalwm_referral' ]);
     739        $rtwalwm_cookie = isset($_COOKIE['rtwalwm_referral'])? sanitize_text_field( wp_unslash($_COOKIE[ 'rtwalwm_referral' ])):'';
    740740   
    741741        if( $rtwalwm_cookie )
     
    977977
    978978        if ( $rtwalwm_check_ajax ) {
    979             $rtwalwm_prod_name  = sanitize_text_field( $_POST[ 'rtwalwm_prod_name' ] );
    980             $rtwalwm_cat_id     = sanitize_text_field( $_POST[ 'rtwalwm_cat_id' ] );
     979            $rtwalwm_prod_name = isset($_POST['rtwalwm_prod_name'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_prod_name'])) : "";
     980            $rtwalwm_cat_id = isset($_POST['rtwalwm_cat_id'])? sanitize_text_field(wp_unslash($_POST['rtwalwm_cat_id'])) : "";
    981981
    982982            global $wpdb;
     
    10931093    {
    10941094        $rtwalwm_affiliate_page_id = get_option('rtwalwm_affiliate_page_id');
    1095         $referrer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : $_SERVER['PHP_SELF'];
     1095        $referrer = isset($_SERVER['HTTP_REFERER']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_REFERER'])) : (isset($_SERVER['PHP_SELF']) ? sanitize_text_field(wp_unslash($_SERVER['PHP_SELF'])) : '');
    10961096        if( !empty($rtwalwm_affiliate_page_id) )
    10971097        {
  • affiliaa-affiliate-program-with-mlm/trunk/public/templates/rtwalwm_aff_login_page.php

    r3207033 r3306771  
    1414            if(isset($_GET['login_errors']) && !empty($_GET['login_errors']))
    1515            {   
    16                 $rtwalwm_html .= '<div id="login_error">' . apply_filters( 'login_errors', $_GET['login_errors'] ) . "</div>\n";
     16                $rtwalwm_html .= '<div id="login_error">' . apply_filters( 'login_errors', sanitize_text_field(wp_unslash($_GET['login_errors'] ))) . "</div>\n";
    1717            }
    1818       
  • affiliaa-affiliate-program-with-mlm/trunk/public/templates/rtwalwm_affiliate_body.php

    r3207033 r3306771  
    440440        $rtwalwm_user_id = get_current_user_id();
    441441        if(isset($_POST['rtwalwm_profile_save'])){
    442 
    443             $rtwalwm_first_name = sanitize_text_field($_POST['first_name']);
    444             $rtwalwm_last_name = sanitize_text_field($_POST['last_name']);
     442            if ( ! isset( $_POST['rtwalwm_profile_save_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['rtwalwm_profile_save_nonce'] )), 'rtwalwm_profile_save_action' ) ) {
     443                return;
     444            }
     445
     446            $rtwalwm_first_name = isset($_POST['first_name']) ? sanitize_text_field(wp_unslash($_POST['first_name'])) : '';
     447            $rtwalwm_last_name = isset($_POST['last_name']) ? sanitize_text_field(wp_unslash($_POST['last_name'])) : '';
    445448
    446449            if($rtwalwm_first_name){
     
    469472        $rtwalwm_html1 .=           '<div class="rtwalwm-text"><span class="rtwalwm-text-icon"><i class="fas fa-user"></i></span><input type="text" name="last_name" placeholder="'.esc_attr__( "Last Name", "affiliaa-affiliate-program-with-mlm" ).'" value="'.esc_attr($rtwalwm_userdata['last_name'][0]).'"></div>';
    470473        $rtwalwm_html1 .=       '</div">';
     474        $rtwalwm_html1 .= wp_nonce_field( 'rtwalwm_profile_save_action', 'rtwalwm_profile_save_nonce', true, false );
    471475        $rtwalwm_html1 .=       '<div><input type="submit" class="rtwalwm_profile_save" value="'.esc_attr__( "Update Details", "affiliaa-affiliate-program-with-mlm" ).'" id="rtwalwm_profile_save" name="rtwalwm_profile_save"></div>';
    472476        $rtwalwm_html1 .=   '</form>';
  • affiliaa-affiliate-program-with-mlm/trunk/wp-wc-affiliate-program.php

    r3207033 r3306771  
    1717 * Plugin URI:        https://redefiningtheweb.com/product/wordpress-woocommerce-affiliate-program/1117/
    1818 * Description:       This plugin helps you to turn your E-commerce Site into an Affiliate System, which eventually boost your overall Sales.
    19  * Version:           3.2.3
     19 * Version:           3.3.0
    2020 * Author:            RedefiningTheWeb
    2121 * Author URI:        http://www.redefiningtheweb.com
     
    2424 * Text Domain:       affiliaa-affiliate-program-with-mlm
    2525 * Domain Path:       /languages
    26  * Tested up to:      6.7.1
     26 * Tested up to:      6.8
    2727 * WC requires at least: 4.2.0
    28  * WC tested up to: 9.4.3
     28 * WC tested up to: 9.8.5
    2929 */
    3030
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'RTWALWM_PLUGIN_NAME_VERSION', '3.2.3' );
     40define( 'RTWALWM_PLUGIN_NAME_VERSION', '3.3.0' );
    4141/**
    4242 * The code that runs during plugin activation.
Note: See TracChangeset for help on using the changeset viewer.