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/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..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,7 +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 ) { - return false !== stripos( $request->get_header( 'referer' ), 'page=nfd-onboarding' ); + $referrer = $request->get_header( 'referer' ); + if ( ! $referrer ) { + return false; + } + return false !== stripos( $referrer, 'page=' . WP_Admin::$slug ); } /** 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,