PluginProbe
WPGet API – Connect to any external REST API / 1.7.0
WPGet API – Connect to any external REST API v1.7.0
1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.10 2.2.2 2.2.3 All 97 releases
← All changes | wpgetapi.php +26 -66 2.2.101.7.0 View file →
@@ -4,18 +4,16 @@
4 4 * Plugin URI: https://wordpress.org/plugins/wpgetapi/
5 5 * Description: Connect to external API's and display the API data.
6 6 * Author: WPGetAPI
7 7 * Author URI: https://wpgetapi.com/
8 - * Version: 2.2.10
8 + * Version: 1.7.0
9 9 * Text Domain: wpgetapi
10 10 * License: GPL2 or later
11 - *
11 + *
12 12 */
13 13
14 14 // Exit if accessed directly.
15 -if ( ! defined( 'ABSPATH' ) ) {
16 - exit;
17 -}
15 +if ( ! defined( 'ABSPATH' ) ) exit;
18 16
19 17 /**
20 18 * Main Class.
21 19 *
@@ -20,9 +18,9 @@
20 18 * Main Class.
21 19 *
22 20 * @since 1.0.0
23 21 */
24 -final class WP_Get_API {
22 +final class WpGetApi {
25 23
26 24 /**
27 25 * @var The one true instance
28 26 * @since 1.0.0
@@ -28,9 +26,9 @@
28 26 * @since 1.0.0
29 27 */
30 28 protected static $_instance = null;
31 29
32 - public $version = '2.2.10';
30 + public $version = '1.7.0';
33 31
34 32 /**
35 33 * Main Instance.
36 34 */
@@ -60,9 +58,9 @@
60 58 _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'wpgetapi' ), '1.0.0' );
61 59 }
62 60
63 61 /**
64 - *
62 + *
65 63 * @since 1.0.0
66 64 */
67 65 public function __construct() {
68 66 $this->define_constants();
@@ -67,9 +65,9 @@
67 65 public function __construct() {
68 66 $this->define_constants();
69 67 $this->hooks();
70 68 $this->includes();
71 -
69 +
72 70 do_action( 'wpgetapi_loaded' );
73 71 }
74 72
75 73 /**
@@ -76,14 +74,12 @@
76 74 * Define Constants.
77 75 * @since 1.0.0
78 76 */
79 77 private function define_constants() {
80 - $this->define( 'WPGETAPIDIR', plugin_dir_path( __FILE__ ) );
81 - $this->define( 'WPGETAPIURL', plugin_dir_url( __FILE__ ) );
78 + $this->define( 'WPGETAPIDIR',plugin_dir_path( __FILE__ ) );
79 + $this->define( 'WPGETAPIURL',plugin_dir_url( __FILE__ ) );
82 80 $this->define( 'WPGETAPIBASENAME', plugin_basename( __FILE__ ) );
83 81 $this->define( 'WPGETAPIVERSION', $this->version );
84 - $this->define( 'WPGETAPILICENSEPAGE', 'wpgetapi_plugin_licenses' );
85 - $this->define( 'WPGETAPISTOREURL', 'https://wpgetapi.com' );
86 82 }
87 83
88 84 /**
89 85 * Define hooks.
@@ -110,26 +106,20 @@
110 106 * Include required files.
111 107 * @since 1.0.0
112 108 */
113 109 public function includes() {
110 +
111 + require_once ( WPGETAPIDIR . '/lib/cmb2/init.php' );
114 112
115 - if ( isset( $_GET['page'] ) && strpos( $_GET['page'], 'wpgetapi_' ) !== false ) {
116 - require_once WPGETAPIDIR . '/lib/cmb2/init.php';
117 - }
113 + include_once ( WPGETAPIDIR . 'includes/class-encryption.php' );
114 + include_once ( WPGETAPIDIR . 'includes/class-admin-options.php' );
115 +
116 + include_once ( WPGETAPIDIR . 'includes/functions.php' );
117 + include_once ( WPGETAPIDIR . 'includes/class-enqueues.php' );
118 + include_once ( WPGETAPIDIR . 'includes/class-api.php' );
118 119
119 - require_once WPGETAPIDIR . '/includes/block-editor/block-editor.php';
120 -
121 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-encryption.php';
122 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-admin-options.php';
123 -
124 - include_once WPGETAPIDIR . 'includes/functions.php';
125 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-api-enqueues.php';
126 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-api.php';
127 -
128 - include_once WPGETAPIDIR . 'frontend/functions.php';
129 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-license-handler.php';
130 -
131 - include_once WPGETAPIDIR . 'includes/class-wpgetapi-notices.php';
120 + include_once ( WPGETAPIDIR . 'frontend/functions.php' );
121 +
132 122 }
133 123
134 124 /**
135 125 * Filters the array of row meta for each plugin in the Plugins list table.
@@ -137,9 +127,9 @@
137 127 * @param array<int,string> $plugin_meta An array of the plugin row's meta data.
138 128 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
139 129 * @return array<int,string> An array of the plugin row's meta data.
140 130 */
141 - public function filter_plugin_row_meta( array $plugin_meta, $plugin_file ) {
131 + function filter_plugin_row_meta( array $plugin_meta, $plugin_file ) {
142 132 if ( 'wpgetapi/wpgetapi.php' !== $plugin_file ) {
143 133 return $plugin_meta;
144 134 }
145 135
@@ -161,11 +151,11 @@
161 151 * @param mixed[] $plugin_data An array of plugin data.
162 152 * @param string $context The plugin context.
163 153 * @return array<string,string> Array of action links.
164 154 */
165 - public function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
155 + function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
166 156 $new = array(
167 - 'setup' => sprintf(
157 + 'setup' => sprintf(
168 158 '<a href="%s">%s</a>',
169 159 esc_url( admin_url( 'admin.php?page=wpgetapi_setup' ) ),
170 160 esc_html__( 'API Setup', 'wpgetapi' )
171 161 ),
@@ -173,44 +163,14 @@
173 163
174 164 return array_merge( $new, $actions );
175 165 }
176 166
177 - /**
178 - * Whether the current user can manage the WPGetAPI plugin admin
179 - *
180 - * @return Boolean True if the current user can manage the WPGetAPI plugin admin otheriwise false
181 - */
182 - public function current_user_can_manage() {
183 - return current_user_can( 'manage_options' );
184 - }
167 +}
185 168
186 - /**
187 - * Whether the current user can manage the WPGetAPI plugin admin
188 - *
189 - * @return bool
190 - */
191 - public function is_wpgetapi_admin_page() {
192 - $is_wpgetapi_admin_page = false;
193 - if ( $this->current_user_can_manage() && ( isset( $_GET['page'] ) && strpos( $_GET['page'], 'wpgetapi_' ) !== false ) ) {
194 - $is_wpgetapi_admin_page = true;
195 - }
196 169
197 - return $is_wpgetapi_admin_page;
198 - }
199 -
200 - /**
201 - * Check whether any premium addon plugin is active or not.
202 - *
203 - * @return Boolean True if any premium addon plugin is active otherwise false.
204 - */
205 - public function is_any_premium_addon_plugin_active() {
206 - return is_plugin_active( 'wpgetapi-extras/wpgetapi-extras.php' ) || is_plugin_active( 'wpgetapi-api-to-posts/wpgetapi-api-to-posts.php' ) || is_plugin_active( 'wpgetapi-oauth/wpgetapi-oauth.php' );
207 - }
208 -}
209 -
210 170 /**
211 171 * Run the plugin.
212 172 */
213 -function wp_get_api() {
214 - return WP_Get_API::instance();
173 +function WpGetApi() {
174 + return WpGetApi::instance();
215 175 }
216 -wp_get_api();
176 +WpGetApi();