Skip to content

Commit

Permalink
Merge commit '468f20304985a225946e85b07b9be21c9dfaae4b' into fix/#82-…
Browse files Browse the repository at this point in the history
…options-page-location-error
  • Loading branch information
jasonbahl committed Sep 5, 2023
2 parents 6f8384e + 468f203 commit 6de8662
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 52 deletions.
43 changes: 32 additions & 11 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
# A set of files you probably don't want in your WordPress.org distribution
*.sql
*.tar.gz
*.yml
*.zip
.DS_Store
.babelrc
.deployignore
.distignore
.editorconfig
.env
.env.dist
.env.testing.dist
.eslintignore
.eslintrc
.git
.gitattributes
.github
.gitignore
.gitlab-ci.yml
.idea
.log
.travis.yml
.DS_Store
.vscode
.wordpress-org
/docker
/docs
/phpstan
/plugin-build
Gruntfile.js
README.md
Thumbs.db
behat.yml
bin
c3.php
circle.yml
composer.json
composer.lock
Gruntfile.js
multisite.xml
multisite.xml.dist
node_modules
package.json
packages
phpcs.xml.dist
phpstan.neon.dist
phpunit.xml
phpunit.xml.dist
multisite.xml
multisite.xml.dist
phpcs.ruleset.xml
README.md
wp-cli.local.yml
tests
node_modules
*.sql
*.tar.gz
*.zip
wp-cli.local.yml
9 changes: 4 additions & 5 deletions .github/workflows/deploy-to-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ jobs:
- name: Create Artifact
run: |
mkdir plugin-build
composer archive -vvv --format=zip --file="plugin-build/wp-graphql-acf"
composer run-script zip
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: wp-graphql-acf
path: plugin-build/wp-graphql-acf.zip
name: wpgraphql-acf
path: plugin-build/wpgraphql-acf.zip

- name: Upload release asset to github
uses: softprops/action-gh-release@v1
with:
files: plugin-build/wp-graphql-acf.zip
files: plugin-build/wpgraphql-acf.zip
2 changes: 1 addition & 1 deletion .github/workflows/testing-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
php: [ '8.1', '8.0' ]
wordpress: [ '6.2', '6.1' ]
acf_pro: [ true, false ]
acf_version: [ 5.12.4, 6.1.6 ]
acf_version: [ 5.12.4, 6.1.8 ]
include:
- php: '8.1'
wordpress: '6.1'
Expand Down
Binary file added .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.0.0-beta.4.1.0

### Chores / Bugfixes

- [#77](https://github.com/wp-graphql/wpgraphql-acf/pull/77): fix: js error when clone fields are added to a field group.

## v2.0.0-beta.4.0.0

### Breaking Changes
Expand Down
20 changes: 7 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
],
"build-app": "@docker-build -a",
"build-test": "@docker-build -t",
"build-plugin": "composer install --no-dev && composer run-script zip && composer install",
"run-app": "@docker-run -a",
"run-test": "@docker-run -t",
"lint": "vendor/bin/phpcs",
Expand All @@ -85,19 +86,12 @@
],
"phpstan": [
"phpstan analyze --ansi --memory-limit=1G"
]
},
"archive": {
"exclude": [
"*.yml",
"!vendor/",
"plugin-build/",
"node_modules/",
"!.wordpress-org/",
"docs/",
"wp-graphql.zip",
"!build",
"packages"
],
"zip": [
"mkdir -p plugin-build/wpgraphql-acf",
"rsync -rc --exclude-from=.distignore --exclude=plugin-build . plugin-build/wpgraphql-acf/ --delete --delete-excluded -v",
"cd plugin-build ; zip -r wpgraphql-acf.zip wpgraphql-acf",
"rm -rf plugin-build/wpgraphql-acf/"
]
}
}
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== WPGraphQL for Advanced Custom Fields ===
=== WPGraphQL ACF ===
Contributors: jasonbahl, wpgraphql
Tags: GraphQL, ACF, Advanced Custom Fields, API, NextJS, Faust, Headless, Decoupled, React, Vue, Svelte, Vue, Apollo, JSON, REST
Requires at least: 6.0
Expand Down
4 changes: 2 additions & 2 deletions src/assets/admin/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ $j(document).ready(function () {
return;
}

var $graphqlFieldName = field.$setting('graphql_field_name');
var graphqlFieldName = acf.getInstance($graphqlFieldName).getValue();
var $graphqlFieldName = field?.$setting('graphql_field_name');
var graphqlFieldName = acf?.getInstance($graphqlFieldName)?.getValue() ?? '';

if ( graphqlFieldName === '' ) {
var sanitizedGraphqlFieldName = acf.strCamelCase( acf.strSanitize(name) );
Expand Down
40 changes: 21 additions & 19 deletions wp-graphql-acf.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* Plugin Name: WPGraphQL for Advanced Custom Fields
* Plugin Name: WPGraphQL ACF
* Description: Re-imagining the WPGraphQL for ACF plugin
* Author: WPGraphQL, Jason Bahl
* Author URI: https://www.wpgraphql.com
* Version: 2.0.0-beta.4.0.0
* Version: 2.0.0-beta.4.1.0
* Text Domain: wp-graphql-acf
* Requires PHP: 7.3
* Requires at least: 5.9
Expand All @@ -14,41 +14,42 @@
*/

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
if (!defined('ABSPATH')) {
exit;
}

if ( ! class_exists( 'WPGraphQLAcf' ) ) {
if (!class_exists('WPGraphQLAcf')) {
require_once __DIR__ . '/src/WPGraphQLAcf.php';
}

// If this file doesn't exist, the plugin was likely installed from Composer
// and the autoloader is included in the parent project
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}

if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION' ) ) {
define( 'WPGRAPHQL_FOR_ACF_VERSION', '2.0.0-beta.4.0.0' );
if (!defined('WPGRAPHQL_FOR_ACF_VERSION')) {
define('WPGRAPHQL_FOR_ACF_VERSION', '2.0.0-beta.4.1.0');
}

if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION' ) ) {
define( 'WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION', '1.14.4' );
if (!defined('WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION')) {
define('WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION', '1.14.4');
}

if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION_PLUGIN_DIR' ) ) {
define( 'WPGRAPHQL_FOR_ACF_VERSION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
if (!defined('WPGRAPHQL_FOR_ACF_VERSION_PLUGIN_DIR')) {
define('WPGRAPHQL_FOR_ACF_VERSION_PLUGIN_DIR', plugin_dir_path(__FILE__));
}

if ( ! function_exists( 'graphql_acf_init' ) ) {
if (!function_exists('graphql_acf_init')) {
/**
* Function that instantiates the plugins main class
*
* @return void
*/
function graphql_acf_init() {
function graphql_acf_init()
{
$wp_graphql_acf = new \WPGraphQLAcf();
add_action( 'plugins_loaded', [ $wp_graphql_acf, 'init' ], 50 );
add_action('plugins_loaded', [$wp_graphql_acf, 'init'], 50);
}
}
graphql_acf_init();
Expand All @@ -58,17 +59,18 @@ function graphql_acf_init() {
*
* @return void
*/
function graphql_acf_init_appsero_telemetry() {
function graphql_acf_init_appsero_telemetry()
{
// If the class doesn't exist, or code is being scanned by PHPSTAN, move on.
if ( ! class_exists( 'Appsero\Client' ) || defined( 'PHPSTAN' ) ) {
if (!class_exists('Appsero\Client') || defined('PHPSTAN')) {
return;
}

$client = new Appsero\Client( '4988d797-77ee-4201-84ce-1d610379f843', 'WPGraphQL for Advanced Custom Fields', __FILE__ );
$client = new Appsero\Client('4988d797-77ee-4201-84ce-1d610379f843', 'WPGraphQL for Advanced Custom Fields', __FILE__);
$insights = $client->insights();

// If the Appsero client has the add_plugin_data method, use it
if ( method_exists( $insights, 'add_plugin_data' ) ) {
if (method_exists($insights, 'add_plugin_data')) {
// @phpstan-ignore-next-line
$insights->add_plugin_data();
}
Expand All @@ -77,4 +79,4 @@ function graphql_acf_init_appsero_telemetry() {
$insights->init();
}

graphql_acf_init_appsero_telemetry();
graphql_acf_init_appsero_telemetry();

0 comments on commit 6de8662

Please sign in to comment.