Plugin Directory

Changeset 3051678


Ignore:
Timestamp:
03/15/2024 12:06:30 PM (2 years ago)
Author:
stockpack
Message:

Add remote url requests debugging

Location:
stockpack/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • stockpack/trunk/readme.txt

    r2966444 r3051678  
    33Tags: stock images, adobe stock, unsplash, getty, istock, pixabay, pexels
    44Requires at least: 4.6
    5 Tested up to: 6.3.1
    6 Stable tag: 3.3.7
     5Tested up to: 6.4.3
     6Stable tag: 3.3.8
    77License: GPL
    88License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    134134== Changelog ==
    135135
     136= 3.3.8 =
     137Add Url debugging support
     138Updated WordPress compatibility
     139
    136140= 3.3.7 =
    137141Add Bricks builder compatibility
  • stockpack/trunk/src/class-stockpackadmin.php

    r2966444 r3051678  
    391391                    'default' => 30,
    392392                ),
     393                array(
     394                    'name'    => 'url_debugging',
     395                    'label'   => __( 'Enable URL debugging', 'stockpack' ),
     396                    'desc'    => __( 'This will log all external calls made and add them to wp-content/debug.log. Make sure you have space on the disk (a few hundred megabytes) and only keep this enabled for short periods of time', 'stockpack' ),
     397                    'options' => array(
     398                        'yes' => __( 'Yes', 'stockpack' ),
     399                        'no'  => __( 'No', 'stockpack' )
     400                    ),
     401                    'type'    => 'radio',
     402                    'default' => 'no',
     403                ),
    393404            )
    394405        );
  • stockpack/trunk/src/class-stockpackquery.php

    r2966444 r3051678  
    7777            add_action( 'wp_ajax_terms-stockpack', array( $this, 'terms' ) ); // executed when logged in
    7878            add_action( 'wp_ajax_token-stockpack', array( $this, 'token' ) ); // executed when logged in
     79
     80            if($this->settings->get_url_debugging_setting() ==='yes') {
     81                add_action('http_api_debug', array($this, 'debug_wp_remote_post_and_get_request'), 10, 5);
     82            }
    7983        }
    8084
     
    578582
    579583            return $filename;
     584        }
     585
     586        public function debug_wp_remote_post_and_get_request( $response, $context, $class, $r, $url ) {
     587            error_log( '------------------------------' );
     588            error_log( $url );
     589            error_log( json_encode( $response ) );
     590            error_log( $class );
     591            error_log( $context );
     592            error_log( json_encode( $r ) );
    580593        }
    581594
  • stockpack/trunk/src/class-stockpacksettings.php

    r2966444 r3051678  
    4949    }
    5050
     51
    5152    public function get_file_name_change_setting() {
    5253        return $this->get_option( 'file_name_change', 'stockpack_basics' );
     
    6364    public function get_featured_caption_setting() {
    6465        return $this->get_option( 'caption_featured_image', 'stockpack_advanced' );
     66    }
     67
     68    public function get_url_debugging_setting() {
     69        return $this->get_option( 'url_debugging', 'stockpack_debug' );
    6570    }
    6671
  • stockpack/trunk/stockpack.php

    r2966444 r3051678  
    66 * Author: Derikon Development
    77 * Author URI: https://derikon.com/
    8  * Version: 3.3.7
     8 * Version: 3.3.8
    99 * Text Domain: stockpack
    1010 * Domain Path: /languages
Note: See TracChangeset for help on using the changeset viewer.