Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Feel free to test out the extension using this [GraphiQL Playground](https://woo

(*) I have a tendency to forget to update the playground between releases :sweat_smile:, so if you believe this to be the case look me up somewhere on this page and lemme know :man_shrugging:

## Wanna help support WooGraphQL's future.
## Wanna help support WooGraphQL's future

- Sponsor **@kidunot89** *(WooGraphQL Creator/Developer)* on **[Github](https://github.com/sponsors/kidunot89)**
- Sponsor **WooGraphQL** on **[OpenCollective](https://opencollective.com/woographql)**
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requires PHP: 7.1
Requires WooCommerce: 4.8.0
Requires WPGraphQL: 1.3.9+
Works with WPGraphQL-JWT-Authentication: 0.4.0+
Stable tag: 0.10.0
Stable tag: 0.10.1
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Maintained at: https://github.com/wp-graphql/wp-graphql-woocommerce
Expand Down
3 changes: 3 additions & 0 deletions access-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*
* @package WPGraphQL\WooCommerce
* @since 0.0.1
* @deprecated v0.10.2
*
* Will be removed in v0.11.0. Some functions will be relocated.
*/

/**
Expand Down
3 changes: 3 additions & 0 deletions class-woographql-inflect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @link https://gist.github.com/tbrianjones/ba0460cc1d55f357e00b
* @package WPGraphQL\WooCommerce
* @since 0.0.4
* @deprecated v0.10.2
*
* Will be removed in v0.11.0. Functionality will be no longer in use.
*/

if ( ! class_exists( 'WooGraphQL_Inflect' ) ) :
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 45 additions & 3 deletions includes/class-wp-graphql-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,56 @@ public function __wakeup() {
*/
private function includes() {

// Autoload Required Classes.
if ( defined( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD' ) && false !== WPGRAPHQL_WOOCOMMERCE_AUTOLOAD ) {
require_once WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'vendor/autoload.php';
/**
* WPGRAPHQL_AUTOLOAD can be set to "false" to prevent the autoloader from running.
* In most cases, this is not something that should be disabled, but some environments
* may bootstrap their dependencies in a global autoloader that will autoload files
* before we get to this point, and requiring the autoloader again can trigger fatal errors.
*
* The codeception tests are an example of an environment where adding the autoloader again causes issues
* so this is set to false for tests.
*/
if ( defined( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD' ) && true === WPGRAPHQL_WOOCOMMERCE_AUTOLOAD ) {
if ( file_exists( WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'vendor/autoload.php' ) ) {
// Autoload Required Classes.
require_once WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'vendor/autoload.php';
}

/**
* If GraphQL class doesn't exist, then dependencies cannot be
* detected. This likely means the user cloned the repo from Github
* but did not run `composer install`
*/
if ( ! class_exists( 'Firebase\JWT\JWT' ) ) {
add_action(
'admin_notices',
function () {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}

echo sprintf(
'<div class="notice notice-error">' .
'<p>%s</p>' .
'</div>',
esc_html__(
'WooGraphQL appears to have been installed without it\'s dependencies. It will not work properly until dependencies are installed. This likely means you have cloned WPGraphQL from Github and need to run the command `composer install`.',
'wp-graphql-woocommerce'
)
);
}
);

return false;
}
}

// Required non-autoloaded classes.
require_once WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'access-functions.php';
require_once WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'class-woographql-inflect.php';
require_once WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR . 'includes/functions.php';

return true;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*
* @package WPGraphQL\WooCommerce
* @since 0.3.1
* @deprecated v0.10.2
*
* Will be removed in v0.11.0
*/

namespace WPGraphQL\WooCommerce\Functions;
Expand Down
2 changes: 1 addition & 1 deletion tests/_data/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

if ( ! defined( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD' ) && false !== getenv( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD' ) ) {
define( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD', getenv( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD' ) );
define( 'WPGRAPHQL_WOOCOMMERCE_AUTOLOAD', true );
}

if ( ! defined( 'GRAPHQL_JWT_AUTH_SECRET_KEY' ) ) {
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WPGraphQL WooCommerce (WooGraphQL)
* Plugin URI: https://github.com/wp-graphql/wp-graphql-woocommerce
* Description: Adds Woocommerce Functionality to WPGraphQL schema.
* Version: 0.10.0
* Version: 0.10.1
* Author: kidunot89
* Author URI: https://axistaylor.com
* Text Domain: wp-graphql-woocommerce
Expand All @@ -29,7 +29,7 @@
function woographql_constants() {
// Plugin version.
if ( ! defined( 'WPGRAPHQL_WOOCOMMERCE_VERSION' ) ) {
define( 'WPGRAPHQL_WOOCOMMERCE_VERSION', '0.10.0' );
define( 'WPGRAPHQL_WOOCOMMERCE_VERSION', '0.10.1' );
}
// Plugin Folder Path.
if ( ! defined( 'WPGRAPHQL_WOOCOMMERCE_PLUGIN_DIR' ) ) {
Expand Down