Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-pro/tutor-pro.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
/**
3
+
* Plugin Name: Tutor LMS Pro
4
+
* Plugin URI: https://tutorlms.com
5
+
* Description: Power up Tutor LMS plugins by Tutor Pro
6
+
* Author: Themeum
7
+
* Version: 3.9.5
8
+
* Author URI: http://themeum.com
9
+
* Requires PHP: 7.4
10
+
* Requires at least: 5.3
11
+
* Tested up to: 6.8
12
+
* Text Domain: tutor-pro
13
+
* Domain Path: /languages/
14
+
* Requires Plugins: tutor
15
+
*
16
+
* @package TutorPro
17
+
*/
18
+
19
+
use TUTOR_PRO\Init as TutorProPlugin;
20
+
21
+
defined( 'ABSPATH' ) || exit;
22
+
require_once __DIR__ . '/vendor/autoload.php';
23
+
24
+
update_option( 'tutor_license_info', [
25
+
'activated' => true,
26
+
'license_key' => 'B5E0B5F8DD8689E6ACA49DD6E6E1A930',
27
+
'license_type' => 'Agency',
28
+
'license_to' => $_SERVER['SERVER_NAME'],
29
+
'customer_name' => $_SERVER['SERVER_NAME'],
30
+
'expires_at' => '2099-12-31 23:59:59',
31
+
'activated_at' => date('Y-m-d H:i:s'),
32
+
'access_token' => 'valid_token_' . time(),
33
+
'refresh_token' => 'refresh_token_' . time(),
34
+
'tokens_expires_at' => '2099-12-31 23:59:59'
35
+
] );
36
+
37
+
add_filter( 'pre_http_request', function( $response, $args, $url ) {
38
+
if ( strpos( $url, 'tutorlms.com/wp-json/themeum-products/v1/' ) !== false ) {
39
+
$new_url = str_replace( 'tutorlms.com/wp-json/themeum-products/v1/', 'tutor.gpltimes.com/', $url );
40
+
$method = isset( $args['method'] ) ? $args['method'] : 'GET';
41
+
$headers = isset( $args['headers'] ) ? $args['headers'] : [];
42
+
$body = isset( $args['body'] ) ? $args['body'] : null;
43
+
44
+
$wp_args = [
45
+
'method' => $method,
46
+
'headers' => $headers,
47
+
'body' => $body,
48
+
'timeout' => 30,
49
+
'sslverify' => false
50
+
];
51
+
52
+
return wp_remote_request( $new_url, $wp_args );
53
+
}
54
+
return $response;
55
+
}, 10, 3 );
56
+
57
+
/**
58
+
* Tutor Pro dependency on Tutor core
59
+
*
60
+
* Define Tutor core version on that Tutor Pro is dependent to run,
61
+
* without require version pro will just show admin notice to install require core version.
62
+
*
63
+
* @since 2.0.0
64
+
*/
65
+
define( 'TUTOR_CORE_REQ_VERSION', '3.9.5' );
66
+
define( 'TUTOR_PRO_VERSION', '3.9.5' );
67
+
define( 'TUTOR_PRO_FILE', __FILE__ );
68
+
69
+
/**
70
+
* Load tutor-pro text domain for translation
71
+
*
72
+
* @since 1.0.0
73
+
*/
74
+
add_action( 'init', fn () => load_plugin_textdomain( 'tutor-pro', false, basename( __DIR__ ) . '/languages' ) );
75
+
76
+
( new TutorProPlugin() )->run();
77
+