PHP Classes

File: ade-woo-api-auth.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Ade PHP WooCommerce API Authentication   ade-woo-api-auth.php   Download  
File: ade-woo-api-auth.php
Role: Auxiliary script
Content type: text/plain
Description: Plugin functions
Class: Ade PHP WooCommerce API Authentication
Plugin to authenticate API calls with WooCommerce
Author: By
Last change:
Date: 1 year ago
Size: 2,305 bytes
 

Contents

Class file image Download
<?php

/**
 * Plugin Name: Ade Woo API Auth
 * Plugin URI: https://www.adeleyeayodeji.com/
 * Author: Adeleye Ayodeji
 * Author URI: https://www.adeleyeayodeji.com/
 * Description: This plugin allow you to authenticate your woocommerce API request
 * Version: 0.1.0
 * License: GPL-2.0+
 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt
 * text-domain: ade-woo-api-auth
 */
//security
if (!defined('ABSPATH')) {
    exit;
}

//define plugin version
define('ADE_WOO_API_AUTH_VERSION', '0.1.0');
//plugin file
define('ADE_WOO_API_AUTH_FILE', __FILE__);
//plugin folder path
define('ADE_WOO_API_AUTH_PATH', plugin_dir_path(__FILE__));
//plugin folder url
define('ADE_WOO_API_AUTH_URL', plugin_dir_url(__FILE__));

require_once
ADE_WOO_API_AUTH_PATH . 'inc/core.php';

//initialize the class
$ADE_WOO_API_Authentication = new ADE_WOO_API_Authentication();
//decalre global variables
$GLOBALS['ADE_WOO_API_Authentication'] = $ADE_WOO_API_Authentication;

//check if fucntion exist
if (!function_exists('ade_woo_auth')) {
   
/**
     * Function ade_woo_auth()
     *
     * @description: This function is used to authenticate rest api request with query string authentication method on ssl
     *
     * @return mixed
     */
   
function ade_woo_auth()
    {
       
$adewooauth = new ADE_WOO_API_Authentication();
        return
$adewooauth->authenticate();
    }
}

//ade_woo_auth_no_ssl
if (!function_exists('ade_woo_auth_no_ssl')) {
   
/**
     * Function ade_woo_auth_no_ssl()
     *
     * @description: This function is used to authenticate rest api request with query string authentication method on non ssl
     *
     * @return mixed
     */
   
function ade_woo_auth_no_ssl()
    {
       
$adewooauth = new ADE_WOO_API_Authentication();
        return
$adewooauth->authenticate_basic_no_ssl();
    }
}

//ade_oauth_authentication
if (!function_exists('ade_oauth_authentication')) {
   
/**
     * Function ade_oauth_authentication()
     *
     * @description: This function is used to authenticate rest api request with oauth authentication method both ssl and non ssl
     *
     * @return mixed
     */
   
function ade_oauth_authentication()
    {
       
$adewooauth = new ADE_WOO_API_Authentication();
        return
$adewooauth->oauth_authentication_();
    }
}