PluginProbe
Enable CORS / trunk
Enable CORS vtrunk
2.1.0 2.0.4 trunk 1.2.2 1.2.3 1.2.4 2.0.0 2.0.1 2.0.2 2.0.3
enable-cors / enable-cors.php

enable-cors.php in Enable CORS trunk, at enable-cors.php

58 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Enable CORS
4 *
5 * @package Enable\Cors
6 * @author Dev Kabir
7 * @copyright 2023 Dev Kabir
8 * @license GPL-2.0-or-later
9 *
10 * @wordpress-plugin
11 * Plugin Name: Enable CORS
12 * Plugin URI: https://www.fiverr.com/share/7kXeLW
13 * Description: Enable Cross-Origin Resource Sharing for any or specific origin.
14 * Version: 2.1.0
15 * Requires at least: 4.7
16 * Tested up to: 7.0
17 * Requires PHP: 7.1
18 * Author: Dev Kabir
19 * Author URI: https://devkabir.github.io/
20 * Text Domain: enable-cors
21 * License: GPL v2 or later
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23 */
24
25 /*
26 |--------------------------------------------------------------------------
27 | If this file is called directly, abort.
28 |--------------------------------------------------------------------------
29 */
30 if ( ! defined( 'WPINC' ) ) {
31 exit;
32 }
33
34 /*
35 |--------------------------------------------------------------------------
36 | Load class autoloader, constants.
37 |--------------------------------------------------------------------------
38 */
39 require_once __DIR__ . '/vendor/autoload.php';
40 require_once __DIR__ . '/constants.php';
41 use Enable\Cors\Plugin;
42
43 /*
44 |--------------------------------------------------------------------------
45 | Activation, deactivation and uninstall event.
46 |--------------------------------------------------------------------------
47 */
48 register_activation_hook( __FILE__, array( Plugin::class, 'activate' ) );
49 register_deactivation_hook( __FILE__, array( Plugin::class, 'deactivate' ) );
50 register_uninstall_hook( __FILE__, array( Plugin::class, 'deactivate' ) );
51
52 /*
53 |--------------------------------------------------------------------------
54 | Start the plugin
55 |--------------------------------------------------------------------------
56 */
57 add_action( 'plugins_loaded', array( Plugin::class, 'init' ) );
58