Plugin Directory

Changeset 2386986


Ignore:
Timestamp:
09/23/2020 09:59:34 AM (5 years ago)
Author:
prosolution
Message:

1.5.21

  • Increase timeout of send application form with upload files
Location:
prosolution-wp-client/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • prosolution-wp-client/trunk/README.txt

    r2380749 r2386986  
    66Tested up to: 4.9.5
    77Requires PHP: 5.6
    8 Stable tag: 1.5.20
     8Stable tag: 1.5.21
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6767== Changelog ==
    6868
     69= 1.5.21 =
     70* Increase timeout of send application form with upload files
     71
    6972= 1.5.20 =
    7073* Fixed email's max character to 200 when sending application
  • prosolution-wp-client/trunk/prosolwpclient.php

    r2380749 r2386986  
    1717     * Plugin URI:        https://prosolution.com/produkte-und-services/workexpert.html
    1818     * Description:       WordPress client for ProSolution
    19      * Version:           1.5.20
     19     * Version:           1.5.21
    2020     * Author:            ProSolution
    2121     * Author URI:        https://www.prosolution.com
     
    3939
    4040    defined('PROSOLWPCLIENT_PLUGIN_NAME') or define('PROSOLWPCLIENT_PLUGIN_NAME', 'prosolwpclient');
    41     defined('PROSOLWPCLIENT_PLUGIN_VERSION') or define('PROSOLWPCLIENT_PLUGIN_VERSION', '1.5.20');
     41    defined('PROSOLWPCLIENT_PLUGIN_VERSION') or define('PROSOLWPCLIENT_PLUGIN_VERSION', '1.5.21');
    4242    defined('PROSOLWPCLIENT_BASE_NAME') or define('PROSOLWPCLIENT_BASE_NAME', plugin_basename(__FILE__));
    4343    defined('PROSOLWPCLIENT_ROOT_PATH') or define('PROSOLWPCLIENT_ROOT_PATH', plugin_dir_path(__FILE__));
     
    272272
    273273    }
     274   
     275    // Setting a custom timeout value for cURL. Using a high value for priority to ensure the function runs after any other added to the same action hook.
     276    function sar_custom_curl_timeout( $handle ){
     277        curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 30 ); // 30 seconds. Too much for production, only for testing.
     278        curl_setopt( $handle, CURLOPT_TIMEOUT, 30 ); // 30 seconds. Too much for production, only for testing.
     279    }
     280
     281    // Setting custom timeout for the HTTP request
     282    function sar_custom_http_request_timeout( $timeout_value ) {
     283        return 30; // 30 seconds. Too much for production, only for testing.
     284    }
     285   
     286    // Setting custom timeout in HTTP request args
     287    function sar_custom_http_request_args( $r ){
     288        $r['timeout'] = 30; // 30 seconds. Too much for production, only for testing.
     289        return $r;
     290    }
    274291
    275292    runProsolwpclient();
  • prosolution-wp-client/trunk/public/class-prosolwpclient-public.php

    r2380749 r2386986  
    14771477                                    $local_files[ $file_key ] = $file_info['name'];
    14781478                                }
     1479                                add_action('http_api_curl', 'sar_custom_curl_timeout', 9999, 1);
     1480                                add_filter( 'http_request_timeout', 'sar_custom_http_request_timeout', 9999 );
     1481                                add_filter('http_request_args', 'sar_custom_http_request_args', 9999, 1);
    14791482                            }
    14801483                        }
Note: See TracChangeset for help on using the changeset viewer.