Plugin Directory

Changeset 3366240


Ignore:
Timestamp:
09/23/2025 06:49:06 AM (6 months ago)
Author:
moceanapiplugin
Message:

change checking for domain is reachable from using status code to is_wp_error so we no need to rely on status code from BE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moceansms-order-sms-notification-for-woocommerce/trunk/admin/class-moceansms-woocommerce-setting.php

    r3365523 r3366240  
    473473        try {
    474474            $this->log->add("MoceanSMS", "Running scheduled checking domain task.");
    475             $response_code = wp_remote_retrieve_response_code( wp_remote_get("https://rest.moceanapi.com/rest/2/account/balance") );
     475            $response = wp_remote_get("https://rest.moceanapi.com/rest/2/account/balance");
    476476            // successfully reached our domain
    477             if($response_code === 400) {
     477            if (!is_wp_error($response)) {
    478478                update_option("moceansms_domain_reachable", true);
    479479                $this->log->add("MoceanSMS", "Domain is reachable. Will be using domain.");
Note: See TracChangeset for help on using the changeset viewer.