Plugin Directory

Changeset 2502362


Ignore:
Timestamp:
03/24/2021 08:49:15 AM (5 years ago)
Author:
homanp
Message:

Add debug logging

Location:
request-io
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • request-io/tags/1.0/request-io.php

    r2501781 r2502362  
    1515
    1616    protected function handle() {
     17       
    1718        $url = esc_url_raw($_POST['api_url']);
    1819        $home_url = esc_url_raw($_POST['home_url']);
     20
     21        $pluginlog = plugin_dir_path(__FILE__).'debug.log';
     22        $message = 'API URL:'.$url;
     23        error_log($message, 3, $pluginlog);
     24
     25        $message2 = 'HOME URL:'.$home_url;
     26        error_log($message2, 3, $pluginlog);
    1927
    2028        wp_remote_get("{$home_url}/wp-json/requestio/v1/update-cache?api_url={$url}");
     
    263271
    264272    public function create_background_request() {
    265         global $async_request;
    266         $async_request = new Request_IO_Background_Process();
     273        $this->update_cache_request = new Request_IO_Background_Process();
    267274    }
    268275   
     
    294301            strpos($_SERVER['REQUEST_URI'], '.xml') === false
    295302        ) {
    296             global $async_request;
    297             $async_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
    298             $async_request->dispatch();
     303
     304            // LOGGING
     305
     306            $pluginlog = plugin_dir_path(__FILE__).'debug.log';
     307            $message = 'ELIGABLE';
     308            error_log($message, 3, $pluginlog);
     309
     310            $this->update_cache_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
     311            $this->update_cache_request->dispatch();
    299312        }
    300313       
  • request-io/trunk/request-io.php

    r2501781 r2502362  
    1515
    1616    protected function handle() {
     17       
    1718        $url = esc_url_raw($_POST['api_url']);
    1819        $home_url = esc_url_raw($_POST['home_url']);
     20
     21        $pluginlog = plugin_dir_path(__FILE__).'debug.log';
     22        $message = 'API URL:'.$url;
     23        error_log($message, 3, $pluginlog);
     24
     25        $message2 = 'HOME URL:'.$home_url;
     26        error_log($message2, 3, $pluginlog);
    1927
    2028        wp_remote_get("{$home_url}/wp-json/requestio/v1/update-cache?api_url={$url}");
     
    263271
    264272    public function create_background_request() {
    265         global $async_request;
    266         $async_request = new Request_IO_Background_Process();
     273        $this->update_cache_request = new Request_IO_Background_Process();
    267274    }
    268275   
     
    294301            strpos($_SERVER['REQUEST_URI'], '.xml') === false
    295302        ) {
    296             global $async_request;
    297             $async_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
    298             $async_request->dispatch();
     303
     304            // LOGGING
     305
     306            $pluginlog = plugin_dir_path(__FILE__).'debug.log';
     307            $message = 'ELIGABLE';
     308            error_log($message, 3, $pluginlog);
     309
     310            $this->update_cache_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
     311            $this->update_cache_request->dispatch();
    299312        }
    300313       
Note: See TracChangeset for help on using the changeset viewer.