get_json_params(); $section = ! empty( $body['section'] ) ? sanitize_text_field( $body['section'] ) : null; $wizard = ! empty( $body['wizard'] ) ? $body['wizard'] : null; $network = ! empty( $body['network'] ) ? $body['network'] : false; if ( 'additionalInformation' === $section && ! empty( $wizard['additionalInformation'] ) ) { $additionalInformation = $wizard['additionalInformation']; if ( ! empty( $additionalInformation['socialShareImage'] ) ) { aioseo()->options->social->facebook->general->defaultImageTerms = $additionalInformation['socialShareImage']; aioseo()->options->social->twitter->general->defaultImageTerms = $additionalInformation['socialShareImage']; } } if ( ( 'features' === $section || 'license-key' === $section ) && ! empty( $wizard['features'] ) ) { $features = $wizard['features']; $cantInstall = []; $addons = aioseo()->addons->getAddonSkus(); foreach ( $addons as $sku ) { if ( in_array( $sku, $features, true ) ) { $addon = aioseo()->addons->getAddon( $sku, true ); if ( ! $addon->isActive && ! $addon->requiresUpgrade ) { if ( $addon->installed || $addon->canInstall ) { aioseo()->addons->installAddon( $addon->basename, $network ); } else { $cantInstall[] = $addon->name; } } } } if ( ! empty( $cantInstall ) ) { $notification = Models\Notification::getNotificationByName( 'install-addons' ); if ( ! $notification->exists() ) { $content = ''; foreach ( $cantInstall as $pluginName ) { $content .= '
  • ' . $pluginName . '
  • '; } Models\Notification::addNotification( [ 'slug' => uniqid(), 'notification_name' => 'install-addons', 'title' => sprintf( // Translators: 1 - The plugin short name ("AIOSEO"). __( 'Install %1$s Addons', 'aioseo-pro' ), AIOSEO_PLUGIN_SHORT_NAME ), 'content' => sprintf( // Translators: 1 - The plugin short name ("AIOSEO"), 2 - A list of addons. __( 'You selected to install the following addons during the setup of %1$s, but there was an issue during installation:%2$s', 'aioseo-pro' ), AIOSEO_PLUGIN_SHORT_NAME, '' ), 'type' => 'info', 'level' => [ 'all' ], 'button1_label' => __( 'Install Addons', 'aioseo-pro' ), 'button1_action' => aioseo()->helpers->decodeHtmlEntities( aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'account/downloads/', 'wizard-features', 'cant-install-addons' ) ), 'button2_label' => __( 'Remind Me Later', 'aioseo-pro' ), 'button2_action' => 'http://action#notification/install-addons-reminder', 'start' => gmdate( 'Y-m-d H:i:s' ) ] ); } } } return $response; } }