Submit
Path:
~
/
home
/
getwphos
/
public_html
/
seasons-newtheme
/
wp-content
/
plugins
/
learnpress
/
inc
/
File Content:
lp-webhooks.php
<?php /** * Common functions to process the webhooks * * @author ThimPress * @package LearnPress/Functions * @version 1.0 * @deprecated 4.2.5.4 Addon learnpress-2checkout-payment v4.0.1 is using */ defined( 'ABSPATH' ) || exit(); /** * Register a webhook * * @param $key * @param $param */ function learn_press_register_web_hook( $key, $param ) { if ( ! $key ) { return; } if ( empty( $GLOBALS['learn_press']['web_hooks'] ) ) { $GLOBALS['learn_press']['web_hooks'] = array(); } $GLOBALS['learn_press']['web_hooks'][ $key ] = $param; do_action( 'learn_press_register_web_hook', $key, $param ); } /** * Return all registered webhooks * * @return mixed|void */ function learn_press_get_web_hooks() { $web_hooks = empty( $GLOBALS['learn_press']['web_hooks'] ) ? array() : (array) $GLOBALS['learn_press']['web_hooks']; return apply_filters( 'learn_press_web_hooks', $web_hooks ); } /** * Return a registered webhook by it's name * * @param $key * * @return mixed|void */ function learn_press_get_web_hook( $key ) { $web_hooks = learn_press_get_web_hooks(); $web_hook = empty( $web_hooks[ $key ] ) ? false : $web_hooks[ $key ]; return apply_filters( 'learn_press_web_hook', $web_hook, $key ); } /** * Process all registered webhooks */ function learn_press_process_web_hooks() { $web_hooks = learn_press_get_web_hooks(); $web_hooks_processed = array(); foreach ( $web_hooks as $key => $param ) { if ( ! empty( $_REQUEST[ $param ] ) ) { // $web_hooks_processed = true; $request_scheme = is_ssl() ? 'https://' : 'http://'; $requested_web_hook_url = untrailingslashit( $request_scheme . esc_url_raw( $_SERVER['HTTP_HOST'] ) ) . esc_url_raw( $_SERVER['REQUEST_URI'] ); $parsed_requested_web_hook_url = parse_url( $requested_web_hook_url ); $required_web_hook_url = add_query_arg( $param, '1', trailingslashit( get_home_url() /* SITE_URL */ ) ); $parsed_required_web_hook_url = parse_url( $required_web_hook_url ); $web_hook_diff = array_diff_assoc( $parsed_requested_web_hook_url, $parsed_required_web_hook_url ); if ( empty( $web_hook_diff ) ) { do_action( 'learn_press_web_hook_' . $param, $_REQUEST ); } else { } $web_hooks_processed[ $param ] = LP_Helper::sanitize_params_submitted( $_REQUEST ); break; } } if ( $web_hooks_processed ) { do_action( 'learn_press_web_hooks_processed' ); ob_start(); foreach ( $web_hooks_processed as $k => $v ) { echo "\n===============================================================\n<br />"; printf( __( 'LearnPress webhook %s process completed', 'learnpress' ), $k ); echo "\n<pre>"; print_r( $v ); echo "</pre>\n===============================================================\n"; } $output = ob_get_clean(); wp_die( $output, __( 'The LearnPress webhook process is complete', 'learnpress' ), array( 'response' => 200 ) ); } } add_action( 'wp_loaded', 'learn_press_process_web_hooks', 999 );
Submit
FILE
FOLDER
Name
Size
Permission
Action
Ajax
---
0755
Databases
---
0755
ExternalPlugin
---
0755
Filters
---
0755
Helpers
---
0755
MetaBox
---
0755
Models
---
0755
Shortcodes
---
0755
TemplateHooks
---
0755
Widgets
---
0755
abstracts
---
0755
admin
---
0755
background-process
---
0755
block-template
---
0755
cache
---
0755
cart
---
0755
course
---
0755
curds
---
0755
custom-post-types
---
0755
emails
---
0755
gateways
---
0755
handle-steps
---
0755
interfaces
---
0755
jwt
---
0755
lesson
---
0755
libraries
---
0755
order
---
0755
question
---
0755
quiz
---
0755
rest-api
---
0755
settings
---
0755
templates
---
0755
updates
---
0755
user
---
0755
user-item
---
0755
abstract-settings.php
5132 bytes
0644
cache.php
14474 bytes
0644
class-lp-ajax.php
8184 bytes
0644
class-lp-asset-key.php
1965 bytes
0644
class-lp-assets.php
14992 bytes
0644
class-lp-autoloader.php
2589 bytes
0644
class-lp-breadcrumb.php
10259 bytes
0644
class-lp-checkout.php
15740 bytes
0644
class-lp-course-query.php
3498 bytes
0644
class-lp-datetime.php
9095 bytes
0644
class-lp-debug.php
2683 bytes
0644
class-lp-duration.php
3677 bytes
0644
class-lp-emails.php
6138 bytes
0644
class-lp-file-system.php
7258 bytes
0644
class-lp-forms-handler.php
16138 bytes
0644
class-lp-global.php
6526 bytes
0644
class-lp-helper.php
15158 bytes
0644
class-lp-install.php
7769 bytes
0644
class-lp-manager-addons.php
8444 bytes
0644
class-lp-page-controller.php
34571 bytes
0644
class-lp-query-list-table.php
4395 bytes
0644
class-lp-query.php
9694 bytes
0644
class-lp-request-handler.php
11768 bytes
0644
class-lp-session-handler.php
10119 bytes
0644
class-lp-settings.php
12006 bytes
0644
class-lp-shortcodes.php
7207 bytes
0644
class-lp-strings.php
1907 bytes
0644
class-lp-template.php
1542 bytes
0644
class-lp-thumbnail-helper.php
1222 bytes
0644
class-lp-widget.php
12938 bytes
0644
index.php
28 bytes
0644
lp-constants.php
4290 bytes
0644
lp-core-functions.php
69852 bytes
0644
lp-custom-hooks.php
1025 bytes
0644
lp-deprecated.php
29619 bytes
0644
lp-template-functions.php
45987 bytes
0644
lp-template-hooks.php
18193 bytes
0644
lp-webhooks.php
3015 bytes
0644
lp-widget-functions.php
1585 bytes
0644
N4ST4R_ID | Naxtarrr