Skip to content

Commit

Permalink
Add AppPresser Bridge and IonTheme to the myappp verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
marioshtika committed Sep 23, 2022
1 parent 4991f20 commit a987bbb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions inc/AppPresser_WPAPI_Mods.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ public function myappp_verify($request)
if (!function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
// Plugins
$plugins = array();
$plugins[]['apppresser'] = AppPresser::VERSION;
$plugins[]['jwt-auth'] = $this->getPluginData('jwt-authentication-for-wp-rest-api/jwt-auth.php');
Expand All @@ -751,7 +752,12 @@ public function myappp_verify($request)
$plugins[]['apppresser-push'] = $this->getAppPushData();
$plugins[]['appsocial'] = $this->getAppSocialData();
$plugins[]['apppresser-camera'] = $this->getAppCameraData();
$plugins[]['apppresser-bridge'] = $this->getAppBridgeData();
$response['plugins'] = $plugins;
// Themes
$themes = array();
$themes[]['ion-theme'] = $this->getIonThemeData();
$response['themes'] = $themes;
$response['success'] = $this->verifySiteSlugAppId($request);

return rest_ensure_response($response);
Expand Down Expand Up @@ -832,6 +838,25 @@ private function getAppCameraData()
return false;
}

private function getAppBridgeData()
{
if (class_exists('AppPresserBridge')) {
return AppPresserBridge::VERSION;
}

return false;
}

private function getIonThemeData()
{
$ionTheme = wp_get_theme('ap3-ion-theme');
if ($ionTheme) {
return $ionTheme->Version;
}

return false;
}

private function verifySiteSlugAppId($request)
{
if (isset($request['ap3_site_slug']) && isset($request['ap3_app_id'])) {
Expand Down

0 comments on commit a987bbb

Please sign in to comment.