Plugin Directory

Changeset 3062775


Ignore:
Timestamp:
04/02/2024 03:26:05 PM (22 months ago)
Author:
dreamfox
Message:

Version 3.3.1

Location:
woocommerce-product-payments
Files:
309 added
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-product-payments/trunk/readme.txt

    r3025576 r3062775  
    11=== Payment gateway per Product for WooCommerce ===
    2 Contributors: dreamfox
     2Contributors: dreamfox, freemius
    33Tags: WooCommerce, payment gateway, product
    44Requires at least: 6.0
    55Requires PHP: 7.4
    66Tested up to: 6.4.2
    7 Stable tag: 3.3.0
     7Stable tag: 3.3.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7373
    7474== Changelog ==
     75= 3.3.1 =
     76* tested with latest woocommerce
     77* tested with latest wordpress
     78* minor changes
     79
    7580
    7681= 3.3.0 =
  • woocommerce-product-payments/trunk/woocommerce-product-payments.php

    r3025576 r3062775  
    55* Plugin URI: https://www.dreamfoxmedia.com/project/woocommerce-payment-gateway-per-product-premium/
    66* Description: Extend WooCommerce plugin to add different payments methods to a product
    7 * Version: 3.3.0
     7* Version: 3.3.1
    88 * WC tested up to: 7.8
    99 * WC tested up to: 8.5.1
    1010* Author: Dreamfox
    1111* Author URI: www.dreamfoxmedia.com
    12 * Text Domain: dreamfoxmedia
    13 * Domain Path: /languages
     12* Text Domain: dfm-payment-gateway-per-product-for-woocommerce
     13* Domain Path: /languages/
    1414* @Developer : Hoang Xuan Hao / Marco van Loghum Slaterus ( Dreamfoxmedia )
    1515*/
     
    1717    exit;
    1818}
     19define( 'DFM_PGPPFW__FILE__', __FILE__ );
    1920require_once dirname( __FILE__ ) . '/inc/functions.php';
     21require_once dirname( __FILE__ ) . '/inc/settings.php';
    2022
    2123if ( function_exists( 'dfm_pgppfw_fs' ) ) {
     
    5052                    'menu'            => array(
    5153                    'slug'        => 'dfm-pgppfw',
    52                     'contact'     => false,
     54                    'contact'     => true,
    5355                    'support'     => false,
    5456                    'affiliation' => false,
     
    7072    }
    7173
     74}
     75
     76dfm_pgppfw_fs()->add_filter( 'hide_account_tabs', 'dfm_pgppfw_hide_account_tabs' );
     77function dfm_pgppfw_hide_account_tabs()
     78{
     79    return true;
    7280}
    7381
     
    110118        add_submenu_page(
    111119            'woocommerce',
    112             __( 'Product Payment', 'softsdev' ),
    113             __( 'Product Payment', 'softsdev' ),
     120            __( 'Product Payment', 'dfm-payment-gateway-per-product-for-woocommerce' ),
     121            __( 'Product Payment', 'dfm-payment-gateway-per-product-for-woocommerce' ),
    114122            'manage_options',
    115123            'dfm-pgppfw',
     
    150158    {
    151159        if ( isset( $_GET['page'] ) && strpos( plugin_basename( wp_unslash( $_GET['page'] ) ), 'dfm-pgppfw' ) === 0 ) {
    152             $text = 'Version 1.4.3';
     160            $text = 'Version 3.3.1';
    153161        }
    154162        return $text;
     
    161169        function softsdev_notice( $message, $type )
    162170        {
    163             $html = <<<EOD
    164         <div class="{$type} notice">
    165         <p>{$message}</p>
    166         </div>
    167 EOD;
    168             echo  $html ;
     171            ?>
     172            <div class="<?php
     173            echo  $type ;
     174            ?> notice">
     175            <p><?php
     176            echo  $message ;
     177            ?></p>
     178            </div>
     179            <?php
    169180        }
    170181   
     
    413424        ?>
    414425
    415 <select class="js-softsdev_selected_cats" name="sdwpp_setting[softsdev_selected_cats][]" multiple="multiple" style="width: 100%;">
    416     <?php
     426        <select class="js-softsdev_selected_cats" name="sdwpp_setting[softsdev_selected_cats][]" multiple="multiple" style="width: 100%;">
     427            <?php
    417428        foreach ( $categories as $category ) {
    418429            ?>
    419         <option value="<?php
     430                <option value="<?php
    420431            echo  $category->term_id ;
    421432            ?>"<?php
     
    424435            echo  $category->name ;
    425436            ?></option>
    426     <?php
     437            <?php
    427438        }
    428439        ?>
    429 </select>
    430 <p>You can select any 2 categories for this functionality due to free plugin.</p>
    431 
    432 <script>
    433     (function($) {
    434         var softsdev = {
    435             select2: function() {
    436                 $('.js-softsdev_selected_cats').select2({
    437                     maximumSelectionLength: 2
     440        </select>
     441        <p>You can select any 2 categories for this functionality due to free plugin.</p>
     442
     443        <script>
     444            (function($) {
     445                var softsdev = {
     446                    select2: function() {
     447                        $('.js-softsdev_selected_cats').select2({
     448                            maximumSelectionLength: 2
     449                        });
     450                    },
     451                }
     452
     453                $(document).ready(function() {
     454                    for (var func in softsdev) {
     455                        if (softsdev[func] instanceof Function) {
     456                            softsdev[func]();
     457                        }
     458                    }
    438459                });
    439             },
    440         }
    441 
    442         $(document).ready(function() {
    443             for (var func in softsdev) {
    444                 if (softsdev[func] instanceof Function) {
    445                     softsdev[func]();
    446                 }
    447             }
    448         });
    449     })(jQuery);
    450 </script>
    451 <?php
     460            })(jQuery);
     461        </script>
     462        <?php
    452463        $additional_html = ob_get_clean();
    453464        softsdev_product_payments_settings_part( $additional_html );
     
    465476    }
    466477   
    467     function softsdev_product_payments_settings_part( $additional_html = '' )
    468     {
    469         wp_enqueue_style( 'softsdev_select2_css', plugins_url( '/vendor/select2/css/select2.min.css', __FILE__ ) );
    470         wp_enqueue_script( 'softsdev_select2_js', plugins_url( '/vendor/select2/js/select2.min.js', __FILE__ ) );
    471         wp_register_script( 'dd_horztab_script', plugins_url( '/js/dd_horizontal_tabs.js', __FILE__ ) );
    472         wp_enqueue_script( 'dd_horztab_script' );
    473         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    474         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    475         echo  '<div class="wrap fs-section fs-full-size-wrapper wrap-mc-paid" id="dd-wc-product-payments"><div id="icon-tools" class="icon32"></div>' ;
    476         $setting_url = get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=dfm-pgppfw';
    477         echo  <<<EOD
    478           <h2 class="nav-tab-wrapper" id="settings">
    479             <a href="{$setting_url}" class="nav-tab fs-tab nav-tab-active home">Settings</a>
    480           </h2>
    481 EOD
    482  ;
    483         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments', 'softsdev' ) . '</h2>' ;
    484         ?>
    485 
    486 <div class="left-dd-paid ">
    487     <div class="left_box_container">
    488         <ul class="horz_tabs">
    489             <li <?php
    490         if ( !isset( $_GET['tab'] ) ) {
    491             ?> class="active"  <?php
    492         }
    493         ?> id="payment_information">
    494                 <a href="javascript:;">Information</a>
    495             </li>
    496             <li id="payment_settings" <?php
    497         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_settings' ) {
    498             ?>class="active"  <?php
    499         }
    500         ?>>
    501                 <a href="javascript:;">Settings</a>
    502             </li>
    503             <li id="payment_per_categories" <?php
    504         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_per_categories' ) {
    505             ?>class="active"  <?php
    506         }
    507         ?>>
    508                 <a href="javascript:;">Per Categories</a>
    509             </li>
    510             <li id="payment_per_tags" <?php
    511         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_per_tags' ) {
    512             ?>class="active"  <?php
    513         }
    514         ?>>
    515                 <a href="javascript:;">Per Tags</a>
    516             </li>
    517             <li id="payment_newsletter" <?php
    518         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_newsletter' ) {
    519             ?>class="active"  <?php
    520         }
    521         ?>>
    522                 <a href="javascript:;">Newsletter</a>
    523             </li>
    524             <li id="payment_faq" >
    525                 <a href="javascript:;">FAQ</a>
    526             </li>
    527             <li id="payment_support" <?php
    528         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_support' ) {
    529             ?>class="active"  <?php
    530         }
    531         ?>>
    532                 <a href="javascript:;">Support</a>
    533             </li>
    534             <li id="payment_dfmplugins">
    535                 <a href="javascript:;">DFM Plugins</a>
    536             </li>
    537         </ul>
    538     </div>
    539 </div>
    540 
    541 <div class="right-dd-paid ">
    542   <div id="tab_payment_information" class="postbox <?php
    543         if ( !isset( $_GET['tab'] ) ) {
    544             ?>active<?php
    545         }
    546         ?>" style="padding: 10px; margin: 10px 0px;">
    547       <?php
    548         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    549         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    550         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    551         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - Information', 'softsdev' ) . '</h2>' ;
    552         ?>
    553                         <img src="<?php
    554         echo  plugins_url( 'img/attention.png', __FILE__ ) ;
    555         ?>"><br>
    556             IMPORTANT: We are using a new license system. If you have trouble with your license then see this link:<br>
    557             <a href="https://dreamfoxmedia.freshdesk.com/support/solutions/articles/72000533747-transferring-our-licenses-from-dreamfoxmedia-to-freemius" target="_blank">Click here to see the complete article</a>
    558 
    559       <p>This plugin for WooCommerce Payment Gateway per Product, by tag or per category and lets you select the available payment method for each (individual) product.<br>
    560       This plugin will allow the admin to select the available payment gateway for each individual product. This is done by <a href="edit.php?post_type=product" >products</a><br>
    561       <p><img src="<?php
    562         echo  plugins_url( 'img/pgpp1.png', __FILE__ ) ;
    563         ?>">&nbsp;&nbsp;&nbsp;<img src="<?php
    564         echo  plugins_url( 'img/pgpp2.png', __FILE__ ) ;
    565         ?>"></p>
    566       For TAG and CATEGORIES you can set these by clicking the menu items on the left.<br>
    567       Admin can select for each (individual) product the payment gateway that will be used by checkout. If no selection is made, then the default payment gateways are displayed.<br>
    568       If you for example only select paypal then only paypal will available for that product by checking out.</p>
    569 
    570   </div>
    571 
    572   <div id="tab_payment_settings" class="postbox <?php
    573         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_settings' ) {
    574             ?>active<?php
    575         }
    576         ?>" style="padding: 10px; margin: 10px 0px;">
    577     <?php
    578         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    579         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    580         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    581         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - Settings', 'softsdev' ) . '</h2>' ;
    582         ?>
    583 
    584 
    585     <?php
    586         /**
    587          * Settings default
    588          */
    589         $softsdev_wpp_plugin_settings = get_option( 'sdwpp_plugin_settings', array(
    590             'softsdev_selected_cats' => '',
    591             'default_payment'        => '',
    592         ) );
    593         $default_payment = unserialize( $softsdev_wpp_plugin_settings['default_payment'] );
    594         ?>
    595     <form id="woo_sdwpp" action="<?php
    596         echo  get_admin_url( null, 'admin.php' ) . '?page=dfm-pgppfw&tab=payment_settings' ;
    597         ?>" method="post">
    598         <div style="padding: 10px 0; margin: 10px 0px;">
    599           <?php
    600         echo  $additional_html ;
    601         ?>
    602 
    603 
    604 
    605         <h3 class="hndle"><?php
    606         echo  __( 'Default Payment option( If not match any.)', 'softsdev' ) ;
    607         ?></h3>
    608         <?php
    609         $woo = new WC_Payment_Gateways();
    610         $payments = $woo->payment_gateways;
    611         ?>
    612         <select id="sdwpp_default_payment" name="sdwpp_setting[default_payment]">
    613             <option value="none" <?php
    614         selected( $default_payment, 'none' );
    615         ?>>None</option>
    616             <?php
    617         foreach ( $payments as $pay ) {
    618             /**
    619              *  skip if payment in disbled from admin
    620              */
    621             if ( $pay->enabled === 'no' ) {
    622                 continue;
    623             }
    624             echo  "<option value = '" . $pay->id . "' " . selected( $default_payment, $pay->id ) . ">" . $pay->title . "</option>" ;
    625         }
    626         ?>
    627         </select>
    628         <br />
    629         <small><?php
    630         echo  __( 'If in some case payment option not show then this will default one set', 'softsdev' ) ;
    631         ?></small>
    632         </div>
    633         <input class="button-large button-primary" type="submit" value="Save changes" />
    634     </form>
    635   </div>
    636     <?php
    637         ?>
    638     <p>This option is a premium feature</p>
    639     <?php
    640         ?>
    641   <div id="tab_payment_newsletter" class="postbox" style="padding: 10px; margin: 10px 0px;">
    642     <?php
    643         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    644         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    645         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    646         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - Newsletter', 'softsdev' ) . '</h2>' ;
    647         ?>
    648     <!-- Begin Sendinblue Form -->
    649     <iframe width="540" height="505" src="https://322fdba5.sibforms.com/serve/MUIEADPSqc91xZQAhD93GZEuPI0STBa6IDtiRPRy1s2sWDXpIahq0YCn_hTynzANungZ-IBXlkdiqtxS5LWTX2PnNO4HXf3zdrDPhYfqPMOU5dTl_slePr-U4hKHdS0HY622pFWMdMMfj40dLxrwCm1gCkrwuC5SLHSNKOfjzFKVX5WkfG6W2aOhHybGkbdXqxCZmXoHswZbB_uJ" frameborder="0" scrolling="auto" allowfullscreen style="display: block;margin-left: auto;margin-right: auto;max-width: 100%;"></iframe>
    650     <!--  END - Sendinblue form -->
    651   </div>
    652 
    653   <div id="tab_payment_faq" class="postbox" style="padding: 10px; margin: 10px 0px;">
    654     <?php
    655         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    656         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    657         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    658         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - FAQ', 'softsdev' ) . '</h2>' ;
    659         ?>
    660     <h4 class="mc4wp-title"><?php
    661         echo  __( 'Looking for help?', 'Woocommerce Payment Gateway Per Product' ) ;
    662         ?></h4>
    663     <p>Below you see the link to the complete FAQ available at: <a href="https://dreamfoxmedia.com?utm_source=wp-plugin&utm_medium=wcpgpp-p&utm_campaign=faqall" target="_blank">dreamfoxmedia.com</a></p>
    664     <ul class="ul-square">
    665     <li><a href="https://dreamfoxmedia.freshdesk.com/support/solutions?utm_source=wp-plugin&utm_medium=wcpgpp-p&utm_campaign=faqall" target="_blank">Click here to see the complete FAQ section</a></li>
    666     </ul>
    667 
    668     <p>Or see this link to the most read FAQs for the payment plugin available at: <a href="https://dreamfoxmedia.freshdesk.com/support/solutions/72000275598?utm_source=wp-plugin&utm_medium=wcpgpp-p&utm_campaign=faqall" target="_blank">Dreamfoxmedia.com</a></p>
    669 
    670 
    671     <p><?php
    672         echo  sprintf( __( 'If your answer can not be found in the resources listed above, please use our supportsystem <a href="%s">here</a>.' ), 'https://support.dreamfoxmedia.com' ) ;
    673         ?></p>
    674     <p>Found a bug? Please open an issue <a href="https://dreamfoxmedia.freshdesk.com/support/tickets/new#utm_source=wp-plugin&utm_medium=wcpgpp-p&utm_campaign=issue" target="_blank">here.</a></p>
    675   </div>
    676 
    677   <div id="tab_payment_support" class="postbox <?php
    678         if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'payment_support' ) {
    679             ?>active<?php
    680         }
    681         ?>" style="padding: 10px; margin: 10px 0px;">
    682     <?php
    683         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    684         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    685         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    686         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - Support Form', 'softsdev' ) . '</h2>' ;
    687         $user = wp_get_current_user();
    688         $plugin_data = get_plugin_data( __FILE__ );
    689         ?>
    690     <div class="supportform" style="display:block; background-color:#FFF; margin:20px; padding:10px;">
    691     <form action="admin.php?page=dfm-pgppfw&tab=payment_support" id="support_form" method="post" class="mymail-form-2 mymail-form mymail-form-submit extern">
    692 
    693     <table width="100%" class="form-table">
    694     <tr>
    695     <th>
    696     <label><?php
    697         echo  __( 'Name', 'dreamfox_dd' ) ;
    698         ?></label>
    699     <img width="16" height="16" src="<?php
    700         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    701         ?>" class="help_tip" title="<?php
    702         echo  __( 'Name', 'dreamfox_dd' ) ;
    703         ?>">
    704     </th>
    705     <td>
    706     <input id="name" name="name" type="textbox" size="30" value="<?php
    707         echo  $user->data->user_nicename ;
    708         ?>" />
    709     </td>
    710     </tr>
    711 
    712 
    713     <tr>
    714     <th>
    715     <label><?php
    716         echo  __( 'Email', 'dreamfox_dd' ) ;
    717         ?></label>
    718     <img width="16" height="16" src="<?php
    719         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    720         ?>" class="help_tip" title="<?php
    721         echo  __( 'Email', 'dreamfox_dd' ) ;
    722         ?>">
    723     </th>
    724     <td>
    725     <input id="email" name="email" type="textbox" size="30" value="<?php
    726         echo  $user->data->user_email ;
    727         ?>" />
    728     </td>
    729     </tr>
    730     <tr>
    731     <th>
    732     <label><?php
    733         echo  __( 'Plugin Name', 'dreamfox_dd' ) ;
    734         ?></label>
    735     <img width="16" height="16" src="<?php
    736         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    737         ?>" class="help_tip" title="<?php
    738         echo  __( 'Plugin Name', 'dreamfox_dd' ) ;
    739         ?>">
    740     </th>
    741     <td>
    742     <input readonly id="plugin_name" name="plugin_name" type="textbox"  size="60" value="Woocommerce Payment Gateway Per Product Premium" />
    743 
    744     </td>
    745     </tr>
    746     <tr>
    747     <th>
    748     <label><?php
    749         echo  __( 'Version Number', 'dreamfox_dd' ) ;
    750         ?></label>
    751     <img width="16" height="16" src="<?php
    752         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    753         ?>" class="help_tip" title="<?php
    754         echo  __( 'Plugin Name', 'dreamfox_dd' ) ;
    755         ?>">
    756     </th>
    757     <td>
    758     <input readonly id="version_number" name="version_number" type="textbox"  size="30" value="<?php
    759         echo  $plugin_data['Version'] ;
    760         ?>
    761     " />
    762 
    763     </td>
    764     </tr>
    765     <tr>
    766     <th>
    767     <label><?php
    768         echo  __( 'License', 'dreamfox_dd' ) ;
    769         ?></label>
    770     <img width="16" height="16" src="<?php
    771         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    772         ?>" class="help_tip" title="<?php
    773         echo  __( 'License', 'dreamfox_dd' ) ;
    774         ?>">
    775     </th>
    776     <td>
    777     <input readonly id="license" name="license" type="textbox"  size="30" value="<?php
    778         echo  get_option( 'product_payments_license_key' ) ;
    779         ?>" />
    780 
    781     </td>
    782     </tr>
    783 
    784     <tr>
    785     <th>
    786     <label><?php
    787         echo  __( 'Details of Problem', 'dreamfox_dd' ) ;
    788         ?></label>
    789     <img width="16" height="16" src="<?php
    790         echo  plugins_url( 'img/help.png', __FILE__ ) ;
    791         ?>" class="help_tip" title="<?php
    792         echo  __( 'Details of Problem', 'dreamfox_dd' ) ;
    793         ?>">
    794     </th>
    795     <td>
    796 
    797     <textarea name="detail_problem" id="detail_problem" style="width:300px;height:300px"></textarea>
    798     <input type="hidden" name="action" value="raise_product_payment_support_email" />
    799     </td>
    800     </tr>
    801 
    802     <tr>
    803     <th>&nbsp;</th>
    804     <td align="left">
    805     <button onclick="support_form();" type="button" class="button-large button-primary">Submit Support Ticket</button>
    806     </td>
    807     </tr>
    808     </table>
    809 
    810     </form>
    811     </div>
    812   </div>
    813 
    814   <div id="tab_payment_dfmplugins" class="postbox" style="padding: 10px; margin: 10px 0px;">
    815     <?php
    816         add_filter( 'admin_footer_text', 'softsdev_product_payments_footer_text' );
    817         add_filter( 'update_footer', 'softsdev_product_payments_update_footer' );
    818         echo  '<div class="wrap wrap-mc-paid"><div id="icon-tools" class="icon32"></div></div>' ;
    819         echo  '<h2 class="title">' . __( 'Woocommerce Product Payments - Dreamfox Media Plugins', 'softsdev' ) . '</h2>' ;
    820         ?>
    821     <?php
    822         $url = 'https://raw.githubusercontent.com/dreamfoxmedia/dreamfoxmedia/gh-pages/plugins/dfmplugins.json';
    823         $response = wp_remote_get( $url, array() );
    824         $response_code = wp_remote_retrieve_response_code( $response );
    825         $response_body = wp_remote_retrieve_body( $response );
    826        
    827         if ( $response_code != 200 || is_wp_error( $response ) ) {
    828             echo  '<div class="error below-h2"><p>There was an error retrieving the list from the server.</p></div>' ;
    829             switch ( $response_code ) {
    830                 case '403':
    831                     echo  '<div class="error below-h2"><p>Seems your host is blocking <strong>' . dirname( $url ) . '</strong>. Please request to white list this domain </p></div>' ;
    832                     break;
    833             }
    834             wp_die();
    835         }
    836        
    837         $addons = json_decode( $response_body );
    838         // set_transient( 'mymail_addons', $addons, 3600 );
    839         $plugin_http_path = plugins_url();
    840         ?>
    841     <div class="wrap">
    842         <h3>Here you see our great Free and Premium Plugins of Dreamfox Media</h3>
    843         <link href="<?php
    844         echo  $plugin_http_path ;
    845         ?>/woocommerce-delivery-date-premium/css/addons-style.min.css?ver=2.1.23" rel="stylesheet" type="text/css">
    846 
    847         <ul class="addons-wrap">
    848             <?php
    849         foreach ( $addons as $addon ) {
    850             if ( !empty($addon->hidden) ) {
    851                 continue;
    852             }
    853             $addon->link = ( isset( $addon->link ) ? add_query_arg( array(
    854                 'utm_source'   => 'Dreamfox Media Plugin Page',
    855                 'utm_medium'   => 'link',
    856                 'utm_campaign' => 'Dreamfox Plugins Add Ons',
    857             ), $addon->link ) : '' );
    858             ?>
    859                 <li class="mymail-addon <?php
    860             if ( !empty($addon->is_free) ) {
    861                 echo  ' is-free' ;
    862             }
    863             if ( !empty($addon->is_feature) ) {
    864                 echo  ' is-feature' ;
    865             }
    866            
    867             if ( isset( $addon->image ) ) {
    868                 $image = str_replace( 'http//', '//', $addon->image );
    869             } elseif ( isset( $addon->image_ ) ) {
    870                 $image = str_replace( 'http//', '//', $addon->image_ );
    871             }
    872            
    873             ?>">
    874                 <div class="bgimage" style="min-height: 500px; background-repeat: no-repeat; background-image:url(<?php
    875             echo  $image ;
    876             ?>)">
    877                 <?php
    878            
    879             if ( isset( $addon->wpslug ) ) {
    880                 ?>
    881                 <a href="plugin-install.php?tab=plugin-information&plugin=<?php
    882                 echo  dirname( $addon->wpslug ) ;
    883                 ?>&from=import&TB_iframe=true&width=745&height=745" class="thickbox">&nbsp;</a>
    884                 <?php
    885             } else {
    886                 ?>
    887                 <a href="<?php
    888                 echo  $addon->link ;
    889                 ?>">&nbsp;</a>
    890                 <?php
    891             }
    892            
    893             ?>
    894                 </div>
    895                 <h4><?php
    896             echo  $addon->name ;
    897             ?></h4>
    898                 <p class="author">by
    899                 <?php
    900            
    901             if ( $addon->author_url ) {
    902                 echo  '<a href="' . $addon->author_url . '">' . $addon->author . '</a>' ;
    903             } else {
    904                 echo  $addon->author ;
    905             }
    906            
    907             ?>
    908                 </p>
    909                 <p class="description"><?php
    910             echo  $addon->description ;
    911             ?></p>
    912                 <div class="action-links">
    913                 <?php
    914            
    915             if ( !empty($addon->wpslug) ) {
    916                 ?>
    917                 <?php
    918                
    919                 if ( is_dir( dirname( WP_PLUGIN_DIR . '/' . $addon->wpslug ) ) ) {
    920                     ?>
    921                 <?php
    922                    
    923                     if ( is_plugin_active( $addon->wpslug ) ) {
    924                         ?>
    925                 <a class="button" href="<?php
    926                         echo  wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $addon->wpslug, 'deactivate-plugin_' . $addon->wpslug ) ;
    927                         ?>"><?php
    928                         _e( 'Deactivate', 'mymail' );
    929                         ?></a>
    930                 <?php
    931                     } elseif ( is_plugin_inactive( $addon->wpslug ) ) {
    932                         ?>
    933                 <a class="button" href="<?php
    934                         echo  wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $addon->wpslug, 'activate-plugin_' . $addon->wpslug ) ;
    935                         ?>"><?php
    936                         _e( 'Activate', 'mymail' );
    937                         ?></a>
    938                 <?php
    939                     }
    940                    
    941                     ?>
    942                 <?php
    943                 } else {
    944                     ?>
    945                 <?php
    946                    
    947                     if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
    948                         ?>
    949                 <a class="button button-primary" href="<?php
    950                         echo  wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . dirname( $addon->wpslug ) . '&mymail-addon' ), 'install-plugin_' . dirname( $addon->wpslug ) ) ;
    951                         ?>"><?php
    952                         _e( 'Install', 'mymail' );
    953                         ?></a>
    954                 <?php
    955                     }
    956                    
    957                     ?>
    958                 <?php
    959                 }
    960                
    961                 ?>
    962                 <?php
    963             } else {
    964                 ?>
    965                 <a class="button button-primary" href="<?php
    966                 echo  $addon->link ;
    967                 ?>"><?php
    968                 _e( 'Purchase', 'mymail' );
    969                 ?></a>
    970                 <?php
    971             }
    972            
    973             ?>
    974                 </div>
    975                 </li>
    976             <?php
    977         }
    978         ?>
    979         </ul>
    980     </div>
    981   </div>
    982 </div>
    983 
    984 
    985 
    986 <?php
    987     }
    988    
    989     function product_payment_support_email()
    990     {
    991         global  $dreamfox_dd_version ;
    992        
    993         if ( isset( $_POST['action'] ) && $_POST['action'] == 'raise_product_payment_support_email' ) {
    994             $name = $_POST['name'];
    995             $email = $_POST['email'];
    996             $plugin_name = $_POST['plugin_name'];
    997             $license = $_POST['license'];
    998             $detail_problem = $_POST['detail_problem'];
    999             $to_email = '[email protected]';
    1000             $sep = "\n\n";
    1001             $subject = 'Support Ticket for the Plugin : Woocommerce Payment Gateway Per Product Premium';
    1002             $message = "Hi there," . $sep . "Here are the details of the support ticket : " . $sep . " Name : " . $name . $sep . " Email : " . $email . $sep . " Plugin : " . $plugin_name . $sep . " Version : " . $dreamfox_dd_version . $sep . " License Code : " . $license . $sep . " Details of Problem : " . $sep . $detail_problem . $sep . " Thanks," . $sep . "Admin";
    1003             wp_mail( $to_email, $subject, $message );
    1004             softsdev_notice( 'Support email has been sent successfully', 'updated' );
    1005             reset( $_POST );
    1006         }
    1007    
    1008     }
    1009    
    1010     add_action( 'init', 'product_payment_support_email' );
    1011478    /**
    1012479     *
Note: See TracChangeset for help on using the changeset viewer.