From 2b22eee9c549082cd70f7cdc26d1cafa8b1cb18e Mon Sep 17 00:00:00 2001 From: Abhijit Bhatnagar Date: Fri, 21 Apr 2023 13:46:11 +0530 Subject: [PATCH 1/3] fixed php error and warning --- includes/Data/Patterns.php | 2 +- includes/RestApi/RestApiFilter.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Data/Patterns.php b/includes/Data/Patterns.php index 3fed3f9ce..59789e946 100644 --- a/includes/Data/Patterns.php +++ b/includes/Data/Patterns.php @@ -220,7 +220,7 @@ public static function get_pattern_from_slug( $pattern_slug ) { */ private static function replace_header_menu_slug( $patterns, $header_menu_slug ) { foreach ( $patterns as $slug => $slug_details ) { - if ( true === $slug_details['replace'] ) { + if ( isset( $slug_details['replace'] ) && true === $slug_details['replace'] ) { unset( $patterns[ $slug ] ); $patterns = array_merge( array( $header_menu_slug => $slug_details ), $patterns ); } diff --git a/includes/RestApi/RestApiFilter.php b/includes/RestApi/RestApiFilter.php index 7a2b8d3ff..51e447af7 100644 --- a/includes/RestApi/RestApiFilter.php +++ b/includes/RestApi/RestApiFilter.php @@ -131,7 +131,11 @@ public static function header_menu_rename_pages( $response, array $handler, \WP_ * @return boolean */ public static function is_request_from_onboarding_flow( \WP_REST_Request $request ) { - return false !== stripos( $request->get_header( 'referer' ), 'page=nfd-onboarding' ); + if ( ! $request->get_header( 'referer' ) ) { + return false; + } else { + return false !== stripos( $request->get_header( 'referer' ), 'page=nfd-onboarding' ); + } } /** From 94429d37db66ccb123801486cfd9691e36a3ad80 Mon Sep 17 00:00:00 2001 From: Abhijit Bhatnagar Date: Mon, 24 Apr 2023 19:16:32 +0530 Subject: [PATCH 2/3] refactored referer check --- includes/RestApi/RestApiFilter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/RestApi/RestApiFilter.php b/includes/RestApi/RestApiFilter.php index 51e447af7..4b56c9fd6 100644 --- a/includes/RestApi/RestApiFilter.php +++ b/includes/RestApi/RestApiFilter.php @@ -3,6 +3,7 @@ namespace NewfoldLabs\WP\Module\Onboarding\RestApi; use NewfoldLabs\WP\Module\Onboarding\Data\Patterns; +use NewfoldLabs\WP\Module\Onboarding\WP_Admin; /** * Instantiate controllers and register routes. @@ -131,11 +132,11 @@ public static function header_menu_rename_pages( $response, array $handler, \WP_ * @return boolean */ public static function is_request_from_onboarding_flow( \WP_REST_Request $request ) { - if ( ! $request->get_header( 'referer' ) ) { + $referrer = $request->get_header( 'referer' ); + if ( ! $referrer ) { return false; - } else { - return false !== stripos( $request->get_header( 'referer' ), 'page=nfd-onboarding' ); } + return false !== stripos( $referrer, 'page=' . WP_Admin::$slug ); } /** From 8f356fa28a87e05cd2d6b24b4365ef31c2119449 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Tue, 25 Apr 2023 13:36:41 +0530 Subject: [PATCH 3/3] Bump Onboarding to 1.4.1 --- bootstrap.php | 2 +- build/{1.4.0 => 1.4.1}/111.js | 0 build/{1.4.0 => 1.4.1}/135.js | 0 build/{1.4.0 => 1.4.1}/139.js | 0 build/{1.4.0 => 1.4.1}/154.js | 0 build/{1.4.0 => 1.4.1}/179.js | 0 build/{1.4.0 => 1.4.1}/181.js | 0 build/{1.4.0 => 1.4.1}/187.js | 0 build/{1.4.0 => 1.4.1}/193.js | 0 build/{1.4.0 => 1.4.1}/216.js | 0 build/{1.4.0 => 1.4.1}/220.js | 0 build/{1.4.0 => 1.4.1}/253.js | 0 build/{1.4.0 => 1.4.1}/264.js | 0 build/{1.4.0 => 1.4.1}/27.js | 0 build/{1.4.0 => 1.4.1}/310.js | 0 build/{1.4.0 => 1.4.1}/33.js | 0 build/{1.4.0 => 1.4.1}/331.js | 0 build/{1.4.0 => 1.4.1}/338.js | 0 build/{1.4.0 => 1.4.1}/348.js | 0 build/{1.4.0 => 1.4.1}/361.js | 0 build/{1.4.0 => 1.4.1}/378.js | 0 build/{1.4.0 => 1.4.1}/419.js | 0 build/{1.4.0 => 1.4.1}/428.js | 0 build/{1.4.0 => 1.4.1}/437.js | 0 build/{1.4.0 => 1.4.1}/473.js | 0 build/{1.4.0 => 1.4.1}/574.js | 0 build/{1.4.0 => 1.4.1}/577.js | 0 build/{1.4.0 => 1.4.1}/58.js | 0 build/{1.4.0 => 1.4.1}/608.js | 0 build/{1.4.0 => 1.4.1}/61.js | 0 build/{1.4.0 => 1.4.1}/634.js | 0 build/{1.4.0 => 1.4.1}/645.js | 0 build/{1.4.0 => 1.4.1}/657.js | 0 build/{1.4.0 => 1.4.1}/669.js | 0 build/{1.4.0 => 1.4.1}/677.js | 0 build/{1.4.0 => 1.4.1}/69.js | 0 build/{1.4.0 => 1.4.1}/848.js | 0 build/{1.4.0 => 1.4.1}/856.js | 0 build/{1.4.0 => 1.4.1}/858.js | 0 build/{1.4.0 => 1.4.1}/860.js | 0 build/{1.4.0 => 1.4.1}/869.js | 0 build/{1.4.0 => 1.4.1}/880.js | 0 build/{1.4.0 => 1.4.1}/888.js | 0 build/{1.4.0 => 1.4.1}/9.js | 0 build/{1.4.0 => 1.4.1}/932.js | 0 build/{1.4.0 => 1.4.1}/942.js | 0 build/{1.4.0 => 1.4.1}/949.js | 0 build/{1.4.0 => 1.4.1}/958.js | 0 build/{1.4.0 => 1.4.1}/993.js | 0 build/{1.4.0 => 1.4.1}/998.js | 0 build/{1.4.0 => 1.4.1}/images/bluesky.7dd9ca3f.png | Bin build/{1.4.0 => 1.4.1}/images/content.e8b16827.png | Bin build/{1.4.0 => 1.4.1}/images/design.94874863.png | Bin build/{1.4.0 => 1.4.1}/images/features.dab941b3.png | Bin .../images/full-service.b9f4513a.png | Bin build/{1.4.0 => 1.4.1}/images/help.bce996da.png | Bin build/{1.4.0 => 1.4.1}/images/wp-admin.3572d33f.png | Bin build/{1.4.0 => 1.4.1}/images/wp-admin.a72221ed.png | Bin build/{1.4.0 => 1.4.1}/onboarding.asset.php | 0 build/{1.4.0 => 1.4.1}/onboarding.css | 0 build/{1.4.0 => 1.4.1}/onboarding.js | 0 package-lock.json | 4 ++-- package.json | 2 +- 63 files changed, 4 insertions(+), 4 deletions(-) rename build/{1.4.0 => 1.4.1}/111.js (100%) rename build/{1.4.0 => 1.4.1}/135.js (100%) rename build/{1.4.0 => 1.4.1}/139.js (100%) rename build/{1.4.0 => 1.4.1}/154.js (100%) rename build/{1.4.0 => 1.4.1}/179.js (100%) rename build/{1.4.0 => 1.4.1}/181.js (100%) rename build/{1.4.0 => 1.4.1}/187.js (100%) rename build/{1.4.0 => 1.4.1}/193.js (100%) rename build/{1.4.0 => 1.4.1}/216.js (100%) rename build/{1.4.0 => 1.4.1}/220.js (100%) rename build/{1.4.0 => 1.4.1}/253.js (100%) rename build/{1.4.0 => 1.4.1}/264.js (100%) rename build/{1.4.0 => 1.4.1}/27.js (100%) rename build/{1.4.0 => 1.4.1}/310.js (100%) rename build/{1.4.0 => 1.4.1}/33.js (100%) rename build/{1.4.0 => 1.4.1}/331.js (100%) rename build/{1.4.0 => 1.4.1}/338.js (100%) rename build/{1.4.0 => 1.4.1}/348.js (100%) rename build/{1.4.0 => 1.4.1}/361.js (100%) rename build/{1.4.0 => 1.4.1}/378.js (100%) rename build/{1.4.0 => 1.4.1}/419.js (100%) rename build/{1.4.0 => 1.4.1}/428.js (100%) rename build/{1.4.0 => 1.4.1}/437.js (100%) rename build/{1.4.0 => 1.4.1}/473.js (100%) rename build/{1.4.0 => 1.4.1}/574.js (100%) rename build/{1.4.0 => 1.4.1}/577.js (100%) rename build/{1.4.0 => 1.4.1}/58.js (100%) rename build/{1.4.0 => 1.4.1}/608.js (100%) rename build/{1.4.0 => 1.4.1}/61.js (100%) rename build/{1.4.0 => 1.4.1}/634.js (100%) rename build/{1.4.0 => 1.4.1}/645.js (100%) rename build/{1.4.0 => 1.4.1}/657.js (100%) rename build/{1.4.0 => 1.4.1}/669.js (100%) rename build/{1.4.0 => 1.4.1}/677.js (100%) rename build/{1.4.0 => 1.4.1}/69.js (100%) rename build/{1.4.0 => 1.4.1}/848.js (100%) rename build/{1.4.0 => 1.4.1}/856.js (100%) rename build/{1.4.0 => 1.4.1}/858.js (100%) rename build/{1.4.0 => 1.4.1}/860.js (100%) rename build/{1.4.0 => 1.4.1}/869.js (100%) rename build/{1.4.0 => 1.4.1}/880.js (100%) rename build/{1.4.0 => 1.4.1}/888.js (100%) rename build/{1.4.0 => 1.4.1}/9.js (100%) rename build/{1.4.0 => 1.4.1}/932.js (100%) rename build/{1.4.0 => 1.4.1}/942.js (100%) rename build/{1.4.0 => 1.4.1}/949.js (100%) rename build/{1.4.0 => 1.4.1}/958.js (100%) rename build/{1.4.0 => 1.4.1}/993.js (100%) rename build/{1.4.0 => 1.4.1}/998.js (100%) rename build/{1.4.0 => 1.4.1}/images/bluesky.7dd9ca3f.png (100%) rename build/{1.4.0 => 1.4.1}/images/content.e8b16827.png (100%) rename build/{1.4.0 => 1.4.1}/images/design.94874863.png (100%) rename build/{1.4.0 => 1.4.1}/images/features.dab941b3.png (100%) rename build/{1.4.0 => 1.4.1}/images/full-service.b9f4513a.png (100%) rename build/{1.4.0 => 1.4.1}/images/help.bce996da.png (100%) rename build/{1.4.0 => 1.4.1}/images/wp-admin.3572d33f.png (100%) rename build/{1.4.0 => 1.4.1}/images/wp-admin.a72221ed.png (100%) rename build/{1.4.0 => 1.4.1}/onboarding.asset.php (100%) rename build/{1.4.0 => 1.4.1}/onboarding.css (100%) rename build/{1.4.0 => 1.4.1}/onboarding.js (100%) diff --git a/bootstrap.php b/bootstrap.php index bb06e3172..0add211da 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -22,7 +22,7 @@ function nfd_wp_module_onboarding_register() { // Set Global Constants if ( ! defined( 'NFD_ONBOARDING_VERSION' ) ) { - define( 'NFD_ONBOARDING_VERSION', '1.4.0' ); + define( 'NFD_ONBOARDING_VERSION', '1.4.1' ); } if ( ! defined( 'NFD_ONBOARDING_DIR' ) ) { define( 'NFD_ONBOARDING_DIR', __DIR__ ); diff --git a/build/1.4.0/111.js b/build/1.4.1/111.js similarity index 100% rename from build/1.4.0/111.js rename to build/1.4.1/111.js diff --git a/build/1.4.0/135.js b/build/1.4.1/135.js similarity index 100% rename from build/1.4.0/135.js rename to build/1.4.1/135.js diff --git a/build/1.4.0/139.js b/build/1.4.1/139.js similarity index 100% rename from build/1.4.0/139.js rename to build/1.4.1/139.js diff --git a/build/1.4.0/154.js b/build/1.4.1/154.js similarity index 100% rename from build/1.4.0/154.js rename to build/1.4.1/154.js diff --git a/build/1.4.0/179.js b/build/1.4.1/179.js similarity index 100% rename from build/1.4.0/179.js rename to build/1.4.1/179.js diff --git a/build/1.4.0/181.js b/build/1.4.1/181.js similarity index 100% rename from build/1.4.0/181.js rename to build/1.4.1/181.js diff --git a/build/1.4.0/187.js b/build/1.4.1/187.js similarity index 100% rename from build/1.4.0/187.js rename to build/1.4.1/187.js diff --git a/build/1.4.0/193.js b/build/1.4.1/193.js similarity index 100% rename from build/1.4.0/193.js rename to build/1.4.1/193.js diff --git a/build/1.4.0/216.js b/build/1.4.1/216.js similarity index 100% rename from build/1.4.0/216.js rename to build/1.4.1/216.js diff --git a/build/1.4.0/220.js b/build/1.4.1/220.js similarity index 100% rename from build/1.4.0/220.js rename to build/1.4.1/220.js diff --git a/build/1.4.0/253.js b/build/1.4.1/253.js similarity index 100% rename from build/1.4.0/253.js rename to build/1.4.1/253.js diff --git a/build/1.4.0/264.js b/build/1.4.1/264.js similarity index 100% rename from build/1.4.0/264.js rename to build/1.4.1/264.js diff --git a/build/1.4.0/27.js b/build/1.4.1/27.js similarity index 100% rename from build/1.4.0/27.js rename to build/1.4.1/27.js diff --git a/build/1.4.0/310.js b/build/1.4.1/310.js similarity index 100% rename from build/1.4.0/310.js rename to build/1.4.1/310.js diff --git a/build/1.4.0/33.js b/build/1.4.1/33.js similarity index 100% rename from build/1.4.0/33.js rename to build/1.4.1/33.js diff --git a/build/1.4.0/331.js b/build/1.4.1/331.js similarity index 100% rename from build/1.4.0/331.js rename to build/1.4.1/331.js diff --git a/build/1.4.0/338.js b/build/1.4.1/338.js similarity index 100% rename from build/1.4.0/338.js rename to build/1.4.1/338.js diff --git a/build/1.4.0/348.js b/build/1.4.1/348.js similarity index 100% rename from build/1.4.0/348.js rename to build/1.4.1/348.js diff --git a/build/1.4.0/361.js b/build/1.4.1/361.js similarity index 100% rename from build/1.4.0/361.js rename to build/1.4.1/361.js diff --git a/build/1.4.0/378.js b/build/1.4.1/378.js similarity index 100% rename from build/1.4.0/378.js rename to build/1.4.1/378.js diff --git a/build/1.4.0/419.js b/build/1.4.1/419.js similarity index 100% rename from build/1.4.0/419.js rename to build/1.4.1/419.js diff --git a/build/1.4.0/428.js b/build/1.4.1/428.js similarity index 100% rename from build/1.4.0/428.js rename to build/1.4.1/428.js diff --git a/build/1.4.0/437.js b/build/1.4.1/437.js similarity index 100% rename from build/1.4.0/437.js rename to build/1.4.1/437.js diff --git a/build/1.4.0/473.js b/build/1.4.1/473.js similarity index 100% rename from build/1.4.0/473.js rename to build/1.4.1/473.js diff --git a/build/1.4.0/574.js b/build/1.4.1/574.js similarity index 100% rename from build/1.4.0/574.js rename to build/1.4.1/574.js diff --git a/build/1.4.0/577.js b/build/1.4.1/577.js similarity index 100% rename from build/1.4.0/577.js rename to build/1.4.1/577.js diff --git a/build/1.4.0/58.js b/build/1.4.1/58.js similarity index 100% rename from build/1.4.0/58.js rename to build/1.4.1/58.js diff --git a/build/1.4.0/608.js b/build/1.4.1/608.js similarity index 100% rename from build/1.4.0/608.js rename to build/1.4.1/608.js diff --git a/build/1.4.0/61.js b/build/1.4.1/61.js similarity index 100% rename from build/1.4.0/61.js rename to build/1.4.1/61.js diff --git a/build/1.4.0/634.js b/build/1.4.1/634.js similarity index 100% rename from build/1.4.0/634.js rename to build/1.4.1/634.js diff --git a/build/1.4.0/645.js b/build/1.4.1/645.js similarity index 100% rename from build/1.4.0/645.js rename to build/1.4.1/645.js diff --git a/build/1.4.0/657.js b/build/1.4.1/657.js similarity index 100% rename from build/1.4.0/657.js rename to build/1.4.1/657.js diff --git a/build/1.4.0/669.js b/build/1.4.1/669.js similarity index 100% rename from build/1.4.0/669.js rename to build/1.4.1/669.js diff --git a/build/1.4.0/677.js b/build/1.4.1/677.js similarity index 100% rename from build/1.4.0/677.js rename to build/1.4.1/677.js diff --git a/build/1.4.0/69.js b/build/1.4.1/69.js similarity index 100% rename from build/1.4.0/69.js rename to build/1.4.1/69.js diff --git a/build/1.4.0/848.js b/build/1.4.1/848.js similarity index 100% rename from build/1.4.0/848.js rename to build/1.4.1/848.js diff --git a/build/1.4.0/856.js b/build/1.4.1/856.js similarity index 100% rename from build/1.4.0/856.js rename to build/1.4.1/856.js diff --git a/build/1.4.0/858.js b/build/1.4.1/858.js similarity index 100% rename from build/1.4.0/858.js rename to build/1.4.1/858.js diff --git a/build/1.4.0/860.js b/build/1.4.1/860.js similarity index 100% rename from build/1.4.0/860.js rename to build/1.4.1/860.js diff --git a/build/1.4.0/869.js b/build/1.4.1/869.js similarity index 100% rename from build/1.4.0/869.js rename to build/1.4.1/869.js diff --git a/build/1.4.0/880.js b/build/1.4.1/880.js similarity index 100% rename from build/1.4.0/880.js rename to build/1.4.1/880.js diff --git a/build/1.4.0/888.js b/build/1.4.1/888.js similarity index 100% rename from build/1.4.0/888.js rename to build/1.4.1/888.js diff --git a/build/1.4.0/9.js b/build/1.4.1/9.js similarity index 100% rename from build/1.4.0/9.js rename to build/1.4.1/9.js diff --git a/build/1.4.0/932.js b/build/1.4.1/932.js similarity index 100% rename from build/1.4.0/932.js rename to build/1.4.1/932.js diff --git a/build/1.4.0/942.js b/build/1.4.1/942.js similarity index 100% rename from build/1.4.0/942.js rename to build/1.4.1/942.js diff --git a/build/1.4.0/949.js b/build/1.4.1/949.js similarity index 100% rename from build/1.4.0/949.js rename to build/1.4.1/949.js diff --git a/build/1.4.0/958.js b/build/1.4.1/958.js similarity index 100% rename from build/1.4.0/958.js rename to build/1.4.1/958.js diff --git a/build/1.4.0/993.js b/build/1.4.1/993.js similarity index 100% rename from build/1.4.0/993.js rename to build/1.4.1/993.js diff --git a/build/1.4.0/998.js b/build/1.4.1/998.js similarity index 100% rename from build/1.4.0/998.js rename to build/1.4.1/998.js diff --git a/build/1.4.0/images/bluesky.7dd9ca3f.png b/build/1.4.1/images/bluesky.7dd9ca3f.png similarity index 100% rename from build/1.4.0/images/bluesky.7dd9ca3f.png rename to build/1.4.1/images/bluesky.7dd9ca3f.png diff --git a/build/1.4.0/images/content.e8b16827.png b/build/1.4.1/images/content.e8b16827.png similarity index 100% rename from build/1.4.0/images/content.e8b16827.png rename to build/1.4.1/images/content.e8b16827.png diff --git a/build/1.4.0/images/design.94874863.png b/build/1.4.1/images/design.94874863.png similarity index 100% rename from build/1.4.0/images/design.94874863.png rename to build/1.4.1/images/design.94874863.png diff --git a/build/1.4.0/images/features.dab941b3.png b/build/1.4.1/images/features.dab941b3.png similarity index 100% rename from build/1.4.0/images/features.dab941b3.png rename to build/1.4.1/images/features.dab941b3.png diff --git a/build/1.4.0/images/full-service.b9f4513a.png b/build/1.4.1/images/full-service.b9f4513a.png similarity index 100% rename from build/1.4.0/images/full-service.b9f4513a.png rename to build/1.4.1/images/full-service.b9f4513a.png diff --git a/build/1.4.0/images/help.bce996da.png b/build/1.4.1/images/help.bce996da.png similarity index 100% rename from build/1.4.0/images/help.bce996da.png rename to build/1.4.1/images/help.bce996da.png diff --git a/build/1.4.0/images/wp-admin.3572d33f.png b/build/1.4.1/images/wp-admin.3572d33f.png similarity index 100% rename from build/1.4.0/images/wp-admin.3572d33f.png rename to build/1.4.1/images/wp-admin.3572d33f.png diff --git a/build/1.4.0/images/wp-admin.a72221ed.png b/build/1.4.1/images/wp-admin.a72221ed.png similarity index 100% rename from build/1.4.0/images/wp-admin.a72221ed.png rename to build/1.4.1/images/wp-admin.a72221ed.png diff --git a/build/1.4.0/onboarding.asset.php b/build/1.4.1/onboarding.asset.php similarity index 100% rename from build/1.4.0/onboarding.asset.php rename to build/1.4.1/onboarding.asset.php diff --git a/build/1.4.0/onboarding.css b/build/1.4.1/onboarding.css similarity index 100% rename from build/1.4.0/onboarding.css rename to build/1.4.1/onboarding.css diff --git a/build/1.4.0/onboarding.js b/build/1.4.1/onboarding.js similarity index 100% rename from build/1.4.0/onboarding.js rename to build/1.4.1/onboarding.js diff --git a/package-lock.json b/package-lock.json index e7e3f0dd7..cd2a14e90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@newfold-labs/wp-module-onboarding", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@newfold-labs/wp-module-onboarding", - "version": "1.3.0", + "version": "1.4.1", "license": "GPL-2.0-or-later", "dependencies": { "@wordpress/interface": "^4.5.0", diff --git a/package.json b/package.json index 22534ead0..75d347f76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@newfold-labs/wp-module-onboarding", - "version": "1.4.0", + "version": "1.4.1", "description": "Next-generation WordPress Onboarding for WordPress sites at Newfold Digital.", "license": "GPL-2.0-or-later", "private": true,