コード例 #1
0
ファイル: slackedd.php プロジェクト: deviodigital/Slackedd
/**
 * Slackedd Notification Codes
 *
 * @since	   1.0.0
 */
function slackedd_notification($payment_id)
{
    $edd_options = edd_get_settings();
    /* Check that the user has all required information added for the plugin to work */
    $enable_slack = isset($edd_options['slackedd_enable_notification']) ? $edd_options['slackedd_enable_notification'] : '';
    $hide_order_number = isset($edd_options['slackedd_hide_order_number']) ? $edd_options['slackedd_hide_order_number'] : '';
    $hide_order_items = isset($edd_options['slackedd_hide_order_items']) ? $edd_options['slackedd_hide_order_items'] : '';
    $hide_payment_gateway = isset($edd_options['slackedd_hide_payment_gateway']) ? $edd_options['slackedd_hide_payment_gateway'] : '';
    $hide_buyer_information = isset($edd_options['slackedd_hide_buyer_information']) ? $edd_options['slackedd_hide_buyer_information'] : '';
    $slack_channel = isset($edd_options['slackedd_channel']) ? $edd_options['slackedd_channel'] : '';
    $webhook_url = isset($edd_options['slackedd_webhook_url']) ? $edd_options['slackedd_webhook_url'] : '';
    if (!($enable_slack && $slack_channel && $webhook_url)) {
        return;
    }
    $enable_slack = isset($edd_options['slackedd_enable_notification']) ? $edd_options['slackedd_enable_notification'] : '';
    $emoji = !empty($edd_options['slackedd_icon_emoji']) ? $edd_options['slackedd_icon_emoji'] : ':moneybag:';
    $bot_name = !empty($edd_options['slackedd_bot_name']) ? $edd_options['slackedd_bot_name'] : 'Slackedd';
    $order_amount = esc_attr(edd_format_amount(edd_get_payment_amount($payment_id)));
    $currency_symbol = edd_currency_symbol($payment_meta['currency']);
    $currency_symbol = html_entity_decode($currency_symbol, ENT_QUOTES, 'UTF-8');
    $payment_meta = edd_get_payment_meta($payment_id);
    $cart_items = edd_get_payment_meta_cart_details($payment_id);
    $items_sold = '';
    $order_id = edd_get_payment_number($payment_id);
    foreach ($cart_items as $key => $cart_item) {
        $name = $cart_item['name'];
        $price = $cart_item['price'];
        $items_sold .= "*Name:* " . $name . " | *Price:* " . $currency_symbol . "" . $price . " \n";
    }
    $gateway = edd_get_payment_gateway($payment_id);
    $payment_method = edd_get_gateway_admin_label($gateway);
    $user_data = $payment_meta['user_info'];
    /* Display the new sale introduction */
    $message = "A new sale has occurred at " . get_bloginfo('name') . " \n\n";
    /* Show or hide order number based on user preference in settings page */
    if (!$hide_order_number) {
        $message .= "*Order* <" . get_bloginfo('home') . "/wp-admin/edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=" . $order_id . "|#" . $order_id . "> \n";
    }
    /* Show the order total */
    $message .= "*Order Total:* " . $currency_symbol . "" . $order_amount . " \n\n";
    /* Show or hide payment gateway based on user preference in settings page */
    if (!$hide_payment_gateway) {
        $message .= "*Payment Method:* " . $payment_method . " \n\n";
    }
    /* Show or hide order items based on user preference in settings page */
    if (!$hide_order_items) {
        $message .= "*" . edd_get_cart_quantity() . " ITEM(S):* \n";
        $message .= $items_sold;
    }
    /* Show or hide order number based on user preference in settings page */
    if (!$hide_buyer_information) {
        $message .= "\n\n *Customer:* " . $user_data['first_name'] . " " . $user_data['last_name'] . " " . $user_data['email'] . "\n";
    }
    $attachment = array();
    $attachment[] = array('color' => 'good', 'fallback' => 'New sale notification of ' . $currency_symbol . '' . $price . ' at ' . get_bloginfo('name'), 'mrkdwn_in' => array('text'), 'text' => $message, 'title' => 'New Sale Notification!');
    $payload = array('attachments' => $attachment, 'channel' => $slack_channel, 'icon_emoji' => $emoji, 'username' => $bot_name);
    $args = array('body' => json_encode($payload), 'timeout' => 30);
    $response = wp_remote_post($webhook_url, $args);
    return;
}
コード例 #2
0
 /**
  * Include required files.
  *
  * @access private
  * @since 1.4
  * @return void
  */
 private function includes()
 {
     global $edd_options;
     require_once EDD_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
     $edd_options = edd_get_settings();
     require_once EDD_PLUGIN_DIR . 'includes/actions.php';
     if (file_exists(EDD_PLUGIN_DIR . 'includes/deprecated-functions.php')) {
         require_once EDD_PLUGIN_DIR . 'includes/deprecated-functions.php';
     }
     require_once EDD_PLUGIN_DIR . 'includes/ajax-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/api/class-edd-api.php';
     require_once EDD_PLUGIN_DIR . 'includes/template-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/checkout/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/checkout/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-db.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-db-customers.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-db-customer-meta.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-customer.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-download.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-cache-helper.php';
     if (defined('WP_CLI') && WP_CLI) {
         require_once EDD_PLUGIN_DIR . 'includes/class-edd-cli.php';
     }
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-cron.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-fees.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-html-elements.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-license-handler.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-logging.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-session.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-stats.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-roles.php';
     require_once EDD_PLUGIN_DIR . 'includes/country-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/formatting.php';
     require_once EDD_PLUGIN_DIR . 'includes/widgets.php';
     require_once EDD_PLUGIN_DIR . 'includes/misc-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/mime-types.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/functions.php';
     if (version_compare(phpversion(), 5.3, '>')) {
         require_once EDD_PLUGIN_DIR . 'includes/gateways/amazon-payments.php';
     }
     require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/manual.php';
     require_once EDD_PLUGIN_DIR . 'includes/discount-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/class-edd-payment.php';
     require_once EDD_PLUGIN_DIR . 'includes/misc-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/download-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/scripts.php';
     require_once EDD_PLUGIN_DIR . 'includes/post-types.php';
     require_once EDD_PLUGIN_DIR . 'includes/plugin-compatibility.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/class-edd-emails.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/class-edd-email-tags.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/error-tracking.php';
     require_once EDD_PLUGIN_DIR . 'includes/user-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/query-filters.php';
     require_once EDD_PLUGIN_DIR . 'includes/tax-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/process-purchase.php';
     require_once EDD_PLUGIN_DIR . 'includes/login-register.php';
     require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
     require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php';
     // Must be loaded on frontend to ensure cron runs
     if (is_admin() || defined('WP_CLI') && WP_CLI) {
         require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-footer.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-notices.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-pages.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/thickbox.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upload-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/dashboard-columns.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customers.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/metabox.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-codes.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/import/import-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/import/import-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/payments/actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/payments/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/reports.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-edd-graph.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-edd-pie-graph.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/welcome.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-heartbeat.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/tools/tools-actions.php';
     } else {
         require_once EDD_PLUGIN_DIR . 'includes/process-download.php';
         require_once EDD_PLUGIN_DIR . 'includes/theme-compatibility.php';
     }
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-register-meta.php';
     require_once EDD_PLUGIN_DIR . 'includes/install.php';
 }
コード例 #3
0
 public function gh_desc()
 {
     $edd_settings = edd_get_settings();
     $gh_access_token = isset($edd_settings['gh_access_token']) ? $edd_settings['gh_access_token'] : '';
     if (!empty($gh_access_token)) {
         $connected = '';
         $disconnected = 'style="display:none;"';
     } else {
         $connected = 'style="display:none;"';
         $disconnected = '';
     }
     $html = '<span class="edd-git-github-connected" ' . $connected . ' ><p>Connected to GitHub.</p></span>';
     $html .= '<span class="edd-git-github-disconnected" ' . $disconnected . ' ><p>Updating from private repositories requires a one-time application setup and authorization. These steps will not need to be repeated for other sites once you receive your access token.</p>
             <p>Follow these steps:</p>
             <ol>
                 <li><a href="https://github.com/settings/applications/new" target="_blank">Create an application</a> with the <strong>Main URL</strong> and <strong>Callback URL</strong> both set to <code>' . get_bloginfo('url') . '</code></li>
                 <li>Copy the <strong>Client ID</strong> and <strong>Client Secret</strong> from your <a href="https://github.com/settings/applications" target="_blank">application details</a> into the fields below.</li>
                 <li>Authorize with GitHub.</li>
             </ol></span>';
     echo $html;
 }
コード例 #4
0
 function submit_login_form($args = array())
 {
     check_ajax_referer('fes-form-login');
     @header('Content-Type: application/json; charset=' . get_option('blog_charset'));
     $form_id = isset($_POST['form_id']) ? intval($_POST['form_id']) : 12;
     if ($form_id != EDD_FES()->helper->get_option('fes-login-form', false)) {
         $this->signal_error(__('Form ID mismatch', 'edd_fes'));
     }
     $form_vars = $this->get_input_fields($form_id);
     $form_settings = get_post_meta($form_id, 'fes-form_settings', true);
     list($user_vars, $taxonomy_vars, $meta_vars) = $form_vars;
     $user_id = get_current_user_id();
     $userdata = array('ID' => $user_id);
     if (EDD_FES()->helper->get_option('fes-login-captcha', false)) {
         if ($this->search_array($form_vars, 'input_type', 'recaptcha')) {
             $this->validate_re_captcha();
         }
     }
     // user_vars contains the radio toggle
     // meta_vars contains the user_login and password fields
     if ($this->search_array($meta_vars, 'name', 'user_login')) {
         $userdata['username'] = sanitize_user($_REQUEST['user_login']);
     }
     if ($this->search_array($meta_vars, 'name', 'password')) {
         $userdata['password'] = sanitize_text_field($_REQUEST['pass1']);
     }
     if (!isset($userdata['username']) || !isset($userdata['password'])) {
         $this->signal_error(__('Please fill out the login form!', 'edd_fes'));
     }
     $user = get_user_by('login', $userdata['username']);
     if ($user) {
         $password = wp_check_password($userdata['password'], $user->data->user_pass, $user->ID);
         if ($password) {
             wp_set_auth_cookie($user->ID, true);
             wp_set_current_user($user->ID, $userdata['username']);
             do_action('wp_login', $userdata['username']);
             do_action('fes_login_form');
             $url = get_permalink(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false));
             if (isset($_REQUEST['fes_login_radio_button']) && $_REQUEST['fes_login_radio_button'] == 'Customer') {
                 $url = get_permalink(edd_get_settings('purchase_history_page'));
             }
             do_action('fes_vendor_contact_form_success', $userdata);
             $response = array('success' => true, 'redirect_to' => $url, 'message' => __('Logged in!', 'edd_fes'), 'is_post' => true);
             $response = apply_filters('fes_login_form_success_redirect', $response, $userdata);
             echo json_encode($response);
             exit;
         } else {
             $this->signal_error(__('Password is wrong!', 'edd_fes'));
         }
     } else {
         $this->signal_error(__('Username is wrong!', 'edd_fes'));
     }
 }
コード例 #5
0
function edd_textdomain()
{
    // Set filter for plugin's languages directory
    $edd_lang_dir = dirname(plugin_basename(EDD_PLUGIN_FILE)) . '/languages/';
    $edd_lang_dir = apply_filters('edd_languages_directory', $edd_lang_dir);
    // Load the translations
    load_plugin_textdomain('edd', false, $edd_lang_dir);
}
add_action('init', 'edd_textdomain');
/*
|--------------------------------------------------------------------------
| INCLUDES
|--------------------------------------------------------------------------
*/
include_once EDD_PLUGIN_DIR . 'includes/register-settings.php';
$edd_options = edd_get_settings();
include_once EDD_PLUGIN_DIR . 'includes/install.php';
include_once EDD_PLUGIN_DIR . 'includes/actions.php';
include_once EDD_PLUGIN_DIR . 'includes/deprecated-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/template-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/checkout-template.php';
include_once EDD_PLUGIN_DIR . 'includes/cart-template.php';
include_once EDD_PLUGIN_DIR . 'includes/cart-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/cart-actions.php';
include_once EDD_PLUGIN_DIR . 'includes/ajax-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/widgets.php';
include_once EDD_PLUGIN_DIR . 'includes/mime-types.php';
include_once EDD_PLUGIN_DIR . 'includes/gateway-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/discount-actions.php';
include_once EDD_PLUGIN_DIR . 'includes/discount-functions.php';
include_once EDD_PLUGIN_DIR . 'includes/payment-functions.php';
コード例 #6
0
 /**
  * Include required files
  *
  * @access private
  * @since 1.4
  * @return void
  */
 private function includes()
 {
     global $edd_options;
     require_once EDD_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
     $edd_options = edd_get_settings();
     require_once EDD_PLUGIN_DIR . 'includes/install.php';
     require_once EDD_PLUGIN_DIR . 'includes/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/deprecated-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/ajax-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/template-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/checkout/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/checkout/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/cart/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-api.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-fees.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-html-elements.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-logging.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-session.php';
     require_once EDD_PLUGIN_DIR . 'includes/class-edd-roles.php';
     require_once EDD_PLUGIN_DIR . 'includes/formatting.php';
     require_once EDD_PLUGIN_DIR . 'includes/widgets.php';
     require_once EDD_PLUGIN_DIR . 'includes/mime-types.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
     require_once EDD_PLUGIN_DIR . 'includes/gateways/manual.php';
     require_once EDD_PLUGIN_DIR . 'includes/discount-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/payments/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/misc-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/download-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/scripts.php';
     require_once EDD_PLUGIN_DIR . 'includes/post-types.php';
     require_once EDD_PLUGIN_DIR . 'includes/plugin-compatibility.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/template.php';
     require_once EDD_PLUGIN_DIR . 'includes/emails/actions.php';
     require_once EDD_PLUGIN_DIR . 'includes/error-tracking.php';
     require_once EDD_PLUGIN_DIR . 'includes/user-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/query-filters.php';
     require_once EDD_PLUGIN_DIR . 'includes/tax-functions.php';
     require_once EDD_PLUGIN_DIR . 'includes/process-purchase.php';
     require_once EDD_PLUGIN_DIR . 'includes/login-register.php';
     if (is_admin()) {
         require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-notices.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/admin-pages.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/export-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/thickbox.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upload-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/dashboard-columns.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/metabox.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-actions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-codes.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/payments/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/reports.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
         require_once EDD_PLUGIN_DIR . 'includes/admin/welcome.php';
     } else {
         require_once EDD_PLUGIN_DIR . 'includes/process-download.php';
         require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
         require_once EDD_PLUGIN_DIR . 'includes/theme-compatibility.php';
     }
 }
コード例 #7
0
 /**
  * Fetch our tags from GitHub
  * @since  1.0
  * @param  string  $tag_url URL of our repo
  * @return array   $tags
  */
 public function gh_get_tags($tag_url)
 {
     $edd_settings = edd_get_settings();
     $gh_access_token = isset($edd_settings['gh_access_token']) ? $edd_settings['gh_access_token'] : '';
     $tag_url = 'https://api.github.com/repos/' . $tag_url . '/tags?access_token=' . $gh_access_token;
     // var_dump( $tag_url );
     $get_tags = wp_remote_get($tag_url, array('sslverify' => false));
     $tags = json_decode(wp_remote_retrieve_body($get_tags), true);
     $return_tags = array();
     if (is_array($tags) && !isset($tags['message'])) {
         foreach ($tags as $tag) {
             // var_dump( $tag );
             $return_tags[] = $tag['name'];
         }
         usort($return_tags, 'version_compare');
         rsort($return_tags);
     } else {
         $return_tags['error'] = __('Could not find any tags for repository.', 'edd-gi');
     }
     return $return_tags;
 }