<?php

namespace BrownPaperTickets\Modules;

use BrownPaperTickets\BptWordpress as Utilities;
require_once Utilities::plugin_root_dir() . 'lib/BptAPI/vendor/autoload.php';
class ModuleApi
{
    protected $dev_id;
    protected $client_id;
    public function __construct()
    {
        $this->dev_id = get_option('_bpt_dev_id');
        $this->client_id = get_option('_bpt_client_id');
    }
}
<?php

namespace BrownPaperTickets\Modules\EventList;

use BrownPaperTickets\BptWordpress as Utilities;
require_once Utilities::plugin_root_dir() . 'src/modules/bpt-module-api.php';
class Api extends \BrownPaperTickets\Modules\ModuleApi
{
    public function get_events($client_id = null, $event_id = null)
    {
        if (!$client_id) {
            $client_id = $this->client_id;
        }
        if (!$event_id) {
            $event_id = null;
        }
        /**
         * Get Event List Setting Options
         *
         */
        $show_dates = get_option('_bpt_show_dates');
        $show_prices = get_option('_bpt_show_prices');
        $show_past_dates = get_option('_bpt_show_past_dates');
        $show_sold_out_dates = get_option('_bpt_show_sold_out_dates');
        $show_sold_out_prices = get_option('_bpt_show_sold_out_prices');
        $event_info = new \BrownPaperTickets\APIv2\EventInfo($this->dev_id);
        if ($event_id) {
            $client_id = null;
            $event_id = explode(' ', $event_id);
            $events = array();
            foreach ($event_id as $id) {
<?php

namespace BrownPaperTickets\Modules;

require_once plugin_dir_path(__FILE__) . '../bpt-module-class.php';
require_once plugin_dir_path(__FILE__) . '/purchase-inputs.php';
require_once plugin_dir_path(__FILE__) . '/purchase-ajax.php';
require_once \BrownPaperTickets\BptWordpress::plugin_root_dir() . 'lib/BptAPI/vendor/autoload.php';
use BrownPaperTickets\APIv2\ManageCart;
use BrownPaperTickets\APIv2\CartInfo;
class Purchase extends Module
{
    public function register_settings()
    {
        register_setting(self::$menu_slug, self::$setting_prefix . 'purchase_settings');
    }
    public function register_sections()
    {
        $section_title = 'Purchase Settings';
        $section_suffix = '_purchase';
        $inputs = new Purchase\Inputs();
        add_settings_section($section_title, $section_title, array($inputs, 'section'), self::$menu_slug . $section_suffix);
        add_settings_field(self::$setting_prefix . 'enable_sales', 'Enable Sales', array($inputs, 'enable_sales'), self::$menu_slug . $section_suffix, $section_title);
    }
    public function load_public_js($hook)
    {
        global $post;
        $options = get_option('_bpt_purchase_settings');
        $sales_enabled = isset($options['enable_sales']) ? $options['enable_sales'] : false;
        $require_all_info = isset($options['require_all_info']) ? $options['require_all_info'] : false;
        if (is_a($post, 'WP_Post') && (has_shortcode($post->post_content, 'list-events') || has_shortcode($post->post_content, 'list_events')) && $sales_enabled) {