PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.0.41
Post Grid Gutenberg Blocks – PostX v5.0.41
5.0.41 5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 All 238 releases
ultimate-post / includes / durbin / class-our-plugins.php

class-our-plugins.php in Post Grid Gutenberg Blocks – PostX 5.0.41, at includes/durbin/class-our-plugins.php

44 lines 1008 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ULTP\Includes\Durbin;
4
5 defined( 'ABSPATH' ) || exit;
6 use ULTP\Includes\Durbin\Xpo;
7 class OurPlugins {
8
9
10 /**
11 * Constructor. Hooks into various WordPress actions.
12 */
13 public function __construct() {
14 // Our Plugin Activation Hooks.
15 add_action( 'wp_ajax_ultp_install_plugin', array( $this, 'ultp_install_plugin_callback' ) );
16 }
17
18 /**
19 * Handles plugin installation and activation via AJAX.
20 *
21 * @return void
22 */
23 public function ultp_install_plugin_callback() {
24
25 $nonce = isset( $_POST['wpnonce'] ) ? sanitize_key( wp_unslash( $_POST['wpnonce'] ) ) : '';
26 $plugin = isset( $_POST['plugin'] ) ? $_POST['plugin'] : '';
27
28 if ( ! wp_verify_nonce( $nonce, 'ultp-nonce' ) || ! current_user_can( 'manage_options' ) ) {
29 wp_send_json_error( array( 'message' => 'No plugin specified' ) );
30
31 }
32
33 $res = array( 'message' => 'false' );
34
35 if ( $plugin ) {
36 $res = Xpo::install_and_active_plugin( $plugin );
37 }
38
39 wp_send_json_success( array( 'message' => $res ) );
40
41 die();
42 }
43 }
44