| @@ -52,10 +52,11 @@ | ||
| 52 | 52 | [ |
| 53 | 53 | 'wpVersion' => $wp_version, |
| 54 | 54 | "scriptsPath" => \Depicter::core()->assets()->getUrl(). '/resources/scripts/editor/', |
| 55 | 55 | 'pluginAPI' => admin_url( 'admin-ajax.php' ), |
| 56 | - 'clientKey' => \Depicter::options()->get( 'client_key', 'anon' ), | |
| 56 | + 'clientKey' => \Depicter::auth()->getClientKey(), | |
| 57 | 57 | 'csrfToken' => \Depicter::csrf()->getToken( CSRF::EDITOR_ACTION ), |
| 58 | + 'wpHomepage' => home_url(), | |
| 58 | 59 | 'updateInfo' => [ |
| 59 | 60 | 'from' => \Depicter::options()->get('version_previous') ?: null, |
| 60 | 61 | 'to' => \Depicter::options()->get('version') |
| 61 | 62 | ], |
| @@ -63,12 +64,18 @@ | ||
| 63 | 64 | "wpRestAPI" => Escape::url( get_rest_url() ), |
| 64 | 65 | "dashboardURL"=> Escape::url( menu_page_url('depicter-dashboard', false) ), |
| 65 | 66 | "documentId" => Data::cast( Sanitize::key( $_GET['document'] ), 'int' ), |
| 66 | 67 | 'user' => [ |
| 67 | - 'tier' => \Depicter::options()->get('user_plan', 'free-user'), | |
| 68 | + 'tier' => \Depicter::auth()->getTier(), | |
| 68 | 69 | 'name' => Escape::html( $currentUser->display_name ), |
| 69 | 70 | 'email' => Escape::html( $currentUser->user_email ), |
| 70 | 71 | 'joinedNewsletter' => !! \Depicter::options()->get('has_subscribed') |
| 72 | + ], | |
| 73 | + 'activation' => [ | |
| 74 | + 'status' => \Depicter::auth()->getActivationStatus(), | |
| 75 | + 'errorMessage' => \Depicter::options()->get('activation_error_message', ''), | |
| 76 | + 'expiresAt' => \Depicter::options()->get('subscription_expires_at' , ''), | |
| 77 | + 'isNew' => isset( $_GET['depicter_upgraded'] ) | |
| 71 | 78 | ], |
| 72 | 79 | 'integrations' => [ |
| 73 | 80 | 'woocommerce' => Plugin::isActive( 'woocommerce/woocommerce.php' ) |
| 74 | 81 | ] |