From be77ae96e4fa5ec033d9419e654ed0189924d945 Mon Sep 17 00:00:00 2001 From: Micah Wood Date: Thu, 22 Feb 2024 13:49:17 -0500 Subject: [PATCH] Fix issue with undefined function data_get --- composer.json | 3 +- composer.lock | 142 ++++++++++++++++++++++++++++++++++++- includes/LoginRedirect.php | 4 +- 3 files changed, 146 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b94ec31ae..23b7ad5e1 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ "newfold-labs/wp-module-onboarding-data": "^1.1.0", "newfold-labs/wp-module-patterns": "^0.1.14", "newfold-labs/wp-module-install-checker": "^1.0", - "newfold-labs/wp-module-facebook": "^1.0.6" + "newfold-labs/wp-module-facebook": "^1.0.6", + "wp-forge/helpers": "^2.0" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.2", diff --git a/composer.lock b/composer.lock index 711bf6a35..795b818d7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,104 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a809946d3f52838e68cc3b847df3a4a", + "content-hash": "6ae0ca63aeed6afb78a1beee2a23bd5e", "packages": [ + { + "name": "doctrine/inflector", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/1.4.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-04-16T17:34:40+00:00" + }, { "name": "mustache/mustache", "version": "v2.14.2", @@ -670,6 +766,50 @@ }, "time": "2022-08-26T17:38:37+00:00" }, + { + "name": "wp-forge/helpers", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/wp-forge/helpers.git", + "reference": "28ebc09a3390dbff427270a4ed2b93395e8b9b78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-forge/helpers/zipball/28ebc09a3390dbff427270a4ed2b93395e8b9b78", + "reference": "28ebc09a3390dbff427270a4ed2b93395e8b9b78", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.3", + "ext-mbstring": "*" + }, + "type": "library", + "autoload": { + "files": [ + "includes/functions.php" + ], + "psr-4": { + "WP_Forge\\Helpers\\": "includes" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Micah Wood", + "email": "micah@wpscholar.com" + } + ], + "description": "A collection of helpers for WordPress and PHP development.", + "support": { + "issues": "https://github.com/wp-forge/helpers/issues", + "source": "https://github.com/wp-forge/helpers/tree/2.0" + }, + "time": "2022-01-06T13:10:47+00:00" + }, { "name": "wp-forge/wp-htaccess-manager", "version": "1.0", diff --git a/includes/LoginRedirect.php b/includes/LoginRedirect.php index ff2611f48..a608a26c1 100644 --- a/includes/LoginRedirect.php +++ b/includes/LoginRedirect.php @@ -3,7 +3,9 @@ use NewfoldLabs\WP\Module\Onboarding\Data\Data; use NewfoldLabs\WP\Module\Onboarding\Data\Options; + use function NewfoldLabs\WP\ModuleLoader\container; +use function WP_Forge\Helpers\dataGet; /** * Contains functionalities that redirect users to onboarding upon logging into WordPress. @@ -65,7 +67,7 @@ public static function filter_redirect( $original_redirect, $user ) { // Don't redirect to onboarding if onboarding was exited or completed. $flow_data = get_option( Options::get_option_name( 'flow' ), false ); - if ( data_get( $flow_data, 'hasExited' ) || data_get( $flow_data, 'isComplete' ) ) { + if ( dataGet( $flow_data, 'hasExited' ) || dataGet( $flow_data, 'isComplete' ) ) { return $original_redirect; }