PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.4.0
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.4.0
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | common/rest.php +0 -27 0.4.70.4.0 View file →
@@ -62,15 +62,8 @@
62 62 return $ok;
63 63 },
64 64 'callback' => [ $this, 'rest_update_option' ]
65 65 ] );
66 - register_rest_route( $this->namespace, '/installed_plugins/', [
67 - 'methods' => 'POST',
68 - 'permission_callback' => function () {
69 - return current_user_can( 'manage_options' );
70 - },
71 - 'callback' => [ $this, 'rest_installed_plugins' ]
72 - ] );
73 66 }
74 67
75 68 public function file_rand( $filesize ) {
76 69 $tmp_file = tmpfile();
@@ -112,28 +105,8 @@
112 105 }
113 106
114 107 public function rest_all_settings() {
115 108 return new WP_REST_Response( [ 'success' => true, 'data' => $this->get_all_options() ], 200 );
116 - }
117 -
118 - public function rest_installed_plugins() {
119 - if ( !function_exists( 'get_plugins' ) ) {
120 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
121 - }
122 - $all_plugins = get_plugins();
123 - $result = [];
124 - foreach ( $all_plugins as $plugin_file => $plugin_data ) {
125 - // Plugin file looks like "ai-engine/ai-engine.php" — the slug is the
126 - // first path segment. Some plugins live at the root (single file),
127 - // those we just skip; we only care about Meow Apps directories anyway.
128 - $parts = explode( '/', $plugin_file );
129 - if ( count( $parts ) < 2 ) {
130 - continue;
131 - }
132 - $slug = $parts[0];
133 - $result[ $slug ] = is_plugin_active( $plugin_file ) ? 'active' : 'inactive';
134 - }
135 - return new WP_REST_Response( [ 'success' => true, 'data' => $result ], 200 );
136 109 }
137 110
138 111 public function rest_update_option( $request ) {
139 112 $params = $request->get_json_params();