| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | public function registerPage() { |
| 37 | 37 | $this->hook_suffix = add_menu_page( |
| 38 | 38 | __('Depicter', 'depicter'), |
| 39 | 39 | __('Depicter', 'depicter'), |
| 40 | - 'manage_options', | |
| 40 | + 'access_depicter', | |
| 41 | 41 | self::PAGE_ID, |
| 42 | 42 | [ $this, 'render' ], // called to output the content for this page |
| 43 | 43 | \Depicter::core()->assets()->getUrl() . '/resources/images/svg/wp-logo.svg' |
| 44 | 44 | ); |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | add_submenu_page( |
| 47 | 47 | self::PAGE_ID, |
| 48 | 48 | __( 'Dashboard', 'depicter' ), |
| 49 | 49 | __( 'Dashboard', 'depicter' ), |
| 50 | - 'manage_options', | |
| 50 | + 'access_depicter', | |
| 51 | 51 | self::PAGE_ID |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | 54 | add_submenu_page( |
| @@ -54,9 +54,9 @@ | ||
| 54 | 54 | add_submenu_page( |
| 55 | 55 | self::PAGE_ID, |
| 56 | 56 | __( 'Add New', 'depicter' ), |
| 57 | 57 | __( 'Add New', 'depicter' ), |
| 58 | - 'manage_options', | |
| 58 | + 'create_depicter', | |
| 59 | 59 | self::PAGE_ID . '-create-slider', |
| 60 | 60 | [ $this, 'externalPageRedirect' ] |
| 61 | 61 | ); |
| 62 | 62 | |
| @@ -63,9 +63,9 @@ | ||
| 63 | 63 | add_submenu_page( |
| 64 | 64 | self::PAGE_ID, |
| 65 | 65 | __( 'Support', 'depicter' ), |
| 66 | 66 | __( 'Support', 'depicter' ), |
| 67 | - 'manage_options', | |
| 67 | + 'access_depicter', | |
| 68 | 68 | self::PAGE_ID . '-goto-support', |
| 69 | 69 | [ $this, 'externalPageRedirect' ] |
| 70 | 70 | ); |
| 71 | 71 | |
| @@ -171,9 +171,9 @@ | ||
| 171 | 171 | wp_add_inline_script('depicter--dashboard', 'window.depicterEnv = '. JSON::encode( |
| 172 | 172 | [ |
| 173 | 173 | 'wpVersion' => $wp_version, |
| 174 | 174 | "scriptsPath" => \Depicter::core()->assets()->getUrl(). '/resources/scripts/dashboard/', |
| 175 | - 'clientKey' => \Depicter::options()->get( 'client_key', 'anon' ), | |
| 175 | + 'clientKey' => \Depicter::auth()->getClientKey(), | |
| 176 | 176 | 'csrfToken' => \Depicter::csrf()->getToken( CSRF::DASHBOARD_ACTION ), |
| 177 | 177 | 'updateInfo' => [ |
| 178 | 178 | 'from' => \Depicter::options()->get('version_previous') ?: null, |
| 179 | 179 | 'to' => \Depicter::options()->get('version') |
| @@ -183,16 +183,25 @@ | ||
| 183 | 183 | "pluginAPI" => admin_url( 'admin-ajax.php' ), |
| 184 | 184 | "editorPath" => \Depicter::editor()->getEditUrl( '__id__' ), |
| 185 | 185 | "documentPreviewPath" => \Depicter::editor()->getEditUrl( '__id__' ), |
| 186 | 186 | 'user' => [ |
| 187 | - 'tier' => \Depicter::options()->get('user_plan', 'free-user'), | |
| 187 | + 'tier' => \Depicter::auth()->getTier(), | |
| 188 | 188 | 'name' => Escape::html( $currentUser->display_name ), |
| 189 | 189 | 'email' => Escape::html( $currentUser->user_email ), |
| 190 | 190 | 'joinedNewsletter' => !! \Depicter::options()->get('has_subscribed') |
| 191 | 191 | ], |
| 192 | + 'activation' => [ | |
| 193 | + 'status' => \Depicter::auth()->getActivationStatus(), | |
| 194 | + 'errorMessage' => \Depicter::options()->get('activation_error_message', ''), | |
| 195 | + 'expiresAt' => \Depicter::options()->get('subscription_expires_at' , ''), | |
| 196 | + 'isNew' => isset( $_GET['depicter_upgraded'] ) | |
| 197 | + ], | |
| 192 | 198 | 'integrations' => [ |
| 193 | 199 | 'woocommerce' => Plugin::isActive( 'woocommerce/woocommerce.php' ) |
| 194 | - ] | |
| 200 | + ], | |
| 201 | + 'AIWizard' => [ | |
| 202 | + 'introVideoSrc' => 'https://www.youtube.com/embed/kdR9Jw0yWjU?rel=0' | |
| 203 | + ] | |
| 195 | 204 | ] |
| 196 | 205 | ), 'before' ); |
| 197 | 206 | |
| 198 | 207 | } |