Plugin Directory

Changeset 2629594


Ignore:
Timestamp:
11/15/2021 07:09:43 AM (4 years ago)
Author:
alphanetbd
Message:

fixing plugin_name issue

Location:
alpha-sms
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • alpha-sms/tags/1.0.0/admin/class-alpha_sms-admin.php

    r2627862 r2629594  
    235235        }
    236236
    237         require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     237        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    238238
    239239        $smsPortal = new AlphaSMS($api_key);
     
    299299        $numbers = implode(',', $numbersArr);
    300300
    301         require_once plugin_dir_path(__DIR__) . 'includes/sms.class.php';
     301        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    302302
    303303        $sms = new AlphaSMS($api_key);
  • alpha-sms/tags/1.0.0/admin/partials/alpha_sms-admin-display_campaign.php

    r2627862 r2629594  
    3333    if (!$options || empty($options['api_key'])) {
    3434        $balance = 'Please configure SMS API first.';
    35     }
     35    } else {
     36        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    3637
    37     require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     38        $smsPortal = new AlphaSMS($options['api_key']);
    3839
    39     $smsPortal = new AlphaSMS($options['api_key']);
     40        $response = $smsPortal->getBalance();
    4041
    41     $response = $smsPortal->getBalance();
    42 
    43     if ($response && $response->error === 0) {
    44         $balance = $response->data->balance;
    45     } elseif ($response && $response->error === 405) {
    46         $balance = 'Please configure SMS API first.';
    47     } else {
    48         $balance = 'Unknown Error, failed to fetch balance';
     42        if ($response && $response->error === 0) {
     43            $balance = $response->data->balance;
     44        } elseif ($response && $response->error === 405) {
     45            $balance = 'Please configure SMS API first.';
     46        } else {
     47            $balance = 'Unknown Error, failed to fetch balance';
     48        }
    4949    }
    5050    ?>
  • alpha-sms/tags/1.0.0/admin/partials/alpha_sms-admin-display_settings.php

    r2629581 r2629594  
    7070
    7171        if (!empty($api_key)) {
    72             require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     72
     73            require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    7374
    7475            $smsPortal = new AlphaSMS($options['api_key']);
  • alpha-sms/tags/1.0.0/alpha_sms.php

    r2627862 r2629594  
    4545}
    4646define("ALPHA_SMS_TIMESTAMP", $date->format('Y-m-d H:i:s'));
     47define( 'ALPHA_SMS_PATH', plugin_dir_path( __FILE__ ) );
    4748
    4849/**
  • alpha-sms/tags/1.0.0/public/class-alpha_sms-public.php

    r2627862 r2629594  
    6262    private function checkAPI($api_key)
    6363    {
    64         require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     64        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    6565
    6666        $smsPortal = new AlphaSMS($api_key);
     
    350350        $sender_id = !empty($this->options['sender_id']) ? trim($this->options['sender_id']) : '';
    351351
    352         require_once plugin_dir_path(__DIR__) . 'includes/sms.class.php';
     352        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    353353
    354354        $sms = new AlphaSMS($api_key);
  • alpha-sms/trunk/admin/class-alpha_sms-admin.php

    r2627862 r2629594  
    235235        }
    236236
    237         require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     237        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    238238
    239239        $smsPortal = new AlphaSMS($api_key);
     
    299299        $numbers = implode(',', $numbersArr);
    300300
    301         require_once plugin_dir_path(__DIR__) . 'includes/sms.class.php';
     301        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    302302
    303303        $sms = new AlphaSMS($api_key);
  • alpha-sms/trunk/admin/partials/alpha_sms-admin-display_campaign.php

    r2627862 r2629594  
    3333    if (!$options || empty($options['api_key'])) {
    3434        $balance = 'Please configure SMS API first.';
    35     }
     35    } else {
     36        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    3637
    37     require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     38        $smsPortal = new AlphaSMS($options['api_key']);
    3839
    39     $smsPortal = new AlphaSMS($options['api_key']);
     40        $response = $smsPortal->getBalance();
    4041
    41     $response = $smsPortal->getBalance();
    42 
    43     if ($response && $response->error === 0) {
    44         $balance = $response->data->balance;
    45     } elseif ($response && $response->error === 405) {
    46         $balance = 'Please configure SMS API first.';
    47     } else {
    48         $balance = 'Unknown Error, failed to fetch balance';
     42        if ($response && $response->error === 0) {
     43            $balance = $response->data->balance;
     44        } elseif ($response && $response->error === 405) {
     45            $balance = 'Please configure SMS API first.';
     46        } else {
     47            $balance = 'Unknown Error, failed to fetch balance';
     48        }
    4949    }
    5050    ?>
  • alpha-sms/trunk/admin/partials/alpha_sms-admin-display_settings.php

    r2629581 r2629594  
    7070
    7171        if (!empty($api_key)) {
    72             require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     72
     73            require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    7374
    7475            $smsPortal = new AlphaSMS($options['api_key']);
  • alpha-sms/trunk/alpha_sms.php

    r2627862 r2629594  
    4545}
    4646define("ALPHA_SMS_TIMESTAMP", $date->format('Y-m-d H:i:s'));
     47define( 'ALPHA_SMS_PATH', plugin_dir_path( __FILE__ ) );
    4748
    4849/**
  • alpha-sms/trunk/public/class-alpha_sms-public.php

    r2627862 r2629594  
    6262    private function checkAPI($api_key)
    6363    {
    64         require_once WP_PLUGIN_DIR . '/' . $this->plugin_name . '/includes/sms.class.php';
     64        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    6565
    6666        $smsPortal = new AlphaSMS($api_key);
     
    350350        $sender_id = !empty($this->options['sender_id']) ? trim($this->options['sender_id']) : '';
    351351
    352         require_once plugin_dir_path(__DIR__) . 'includes/sms.class.php';
     352        require_once ALPHA_SMS_PATH. 'includes/sms.class.php';
    353353
    354354        $sms = new AlphaSMS($api_key);
Note: See TracChangeset for help on using the changeset viewer.