Skip to content

Commit c39505f

Browse files
committed
lint fixes
1 parent 5f14f95 commit c39505f

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

includes/RestApi/AppController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
use NewfoldLabs\WP\Module\Onboarding\Permissions;
66
use NewfoldLabs\WP\Module\Onboarding\Services\AppService;
77

8+
/**
9+
* AppController class for handling onboarding application REST API endpoints.
10+
*
11+
* This controller manages the REST API routes and handlers for the onboarding
12+
* application functionality. It provides endpoints for starting and completing
13+
* the onboarding process.
14+
*
15+
*/
816
class AppController {
917

1018
/**
@@ -21,6 +29,14 @@ class AppController {
2129
*/
2230
protected $rest_base = '/app';
2331

32+
/**
33+
* Register the REST API routes for the onboarding application.
34+
*
35+
* Registers two main endpoints:
36+
* - /app/start: Initiates the onboarding process
37+
* - /app/complete: Completes the onboarding process with selected homepage
38+
*
39+
*/
2440
public function register_routes() {
2541
\register_rest_route(
2642
$this->namespace,

includes/Services/SiteGenImageService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function upload_images_to_wp_media_library( $image_urls, $post_id
8484
self::connect_to_filesystem();
8585

8686
$uploaded_image_urls = array();
87-
$total_images = count( $image_urls );
87+
$total_images = count( $image_urls );
8888
$successful_uploads = 0;
8989

9090
try {
@@ -204,19 +204,19 @@ public static function update_post_content_with_new_image_urls( $post_id, $url_m
204204
if ( ! empty( $new_url ) ) {
205205
// Use str_replace for exact URL replacement
206206
$new_content = str_replace( $original_url, $new_url, $content );
207-
207+
208208
// If no replacement happened, try with HTML entity encoded version
209209
if ( $new_content === $content ) {
210210
$encoded_url = htmlspecialchars( $original_url, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
211211
$new_content = str_replace( $encoded_url, $new_url, $content );
212212
}
213-
213+
214214
// If still no replacement, try with double-encoded version (common in WordPress)
215215
if ( $new_content === $content ) {
216216
$double_encoded_url = htmlspecialchars( htmlspecialchars( $original_url, ENT_QUOTES | ENT_HTML5, 'UTF-8' ), ENT_QUOTES | ENT_HTML5, 'UTF-8' );
217-
$new_content = str_replace( $double_encoded_url, $new_url, $content );
217+
$new_content = str_replace( $double_encoded_url, $new_url, $content );
218218
}
219-
219+
220220
if ( $new_content !== $content ) {
221221
$content = $new_content;
222222
$updated = true;

0 commit comments

Comments
 (0)