diff --git a/.env.dist b/.env.dist index d3d655b..068eee2 100644 --- a/.env.dist +++ b/.env.dist @@ -4,8 +4,8 @@ MARIADB_USER=user MARIADB_PASSWORD= MARIADB_DATABASE=wordpress -#https://it.wordpress.org/download/releases/ -#https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/ +# https://it.wordpress.org/download/releases/ +# https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/ # 5.6.2 -> 22 Febbraio 2021, PHP 7.4.16, Composer 1.10.20 # 5.7.2 -> 24 Luglio 2021, PHP 7.4.21, Composer 2.1.3 # 5.8.3 -> 6 Marzo 2022, PHP 7.4.27, Composer 2.2.4 @@ -62,12 +62,18 @@ MAILPIT_MAX_MESSAGES=5000 OPENAI_KEY= -#https://github.com/phpstan/phpstan/issues/3245#issuecomment-702016844 +# https://github.com/phpstan/phpstan/issues/3245#issuecomment-702016844 PHPSTAN_PRO_WEB_PORT=11111 # https://nono.ma/github-oauth-token-for-github-com-contains-invalid-characters-on-composer-install GITHUB_TOKEN= +# https://developers.google.com/youtube/terms/developer-policies#d.-accessing-youtube-api-services +# If your API Client needs to create API Credentials to access or use YouTube API Services, +# you must create exactly one (1) API Project for that API Client. +# Those API Credentials are intended to be used exclusively by the associated API Client, +# which means that you must not use that one (1) API Project for multiple API Clients. FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_ID= FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_SECRET= + FRUGAN_UFTYFACF_CACHE_BUSTING_ENABLED=false diff --git a/upload-field-to-youtube-for-acf/include_from.txt b/upload-field-to-youtube-for-acf/include_from.txt index ee1d21f..86416bb 100644 --- a/upload-field-to-youtube-for-acf/include_from.txt +++ b/upload-field-to-youtube-for-acf/include_from.txt @@ -6,7 +6,9 @@ + src/** + vendor/ - vendor/bin/ +- vendor/symfony/console/Resources/ + vendor/** ++ composer.json + readme.txt + upload-field-to-youtube-for-acf.php - * diff --git a/upload-field-to-youtube-for-acf/readme.txt b/upload-field-to-youtube-for-acf/readme.txt index 5a960e8..5a584e5 100644 --- a/upload-field-to-youtube-for-acf/readme.txt +++ b/upload-field-to-youtube-for-acf/readme.txt @@ -3,7 +3,7 @@ Contributors: Frugan Tags: acf, fields, repeater, upload, youtube Requires at least: 5.6.0 Tested up to: 6.6.1 -Stable tag: 0.1.0 +Stable tag: 0.1.1 Requires PHP: 8.0 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/upload-field-to-youtube-for-acf/src/Field.php b/upload-field-to-youtube-for-acf/src/Field.php index 8226de7..00d4980 100644 --- a/upload-field-to-youtube-for-acf/src/Field.php +++ b/upload-field-to-youtube-for-acf/src/Field.php @@ -161,24 +161,20 @@ public function __construct() add_action(FRUGAN_UFTYFACF_NAME.'__check_oauth_token', [$this, 'check_oauth_token']); } + // https://developers.google.com/youtube/terms/branding-guidelines + // https://www.youtube.com/yt/about/brand-resources/#logos-icons-colors + // YouTube's ToS only allow custom icons; dashicons like `dashicons-video-alt3` are not allowed. public function admin_menu(): void { - if (current_user_can('manage_options')) { + if (current_user_can('manage_options') || current_user_can('manage_'.$this->name)) { + $capability = current_user_can('manage_options') ? 'manage_options' : 'manage_'.$this->name; + add_options_page( $this->label, // Page title $this->label, // Menu title - 'manage_options', // Capability - $this->name, // Menu slug - [$this, 'settings_page'], // Callback function - ); - } elseif (current_user_can('manage_'.$this->name)) { - add_menu_page( - $this->label, // Page title - $this->label, // Menu title - 'manage_'.$this->name, // Capability + $capability, // Capability $this->name, // Menu slug [$this, 'settings_page'], // Callback function - 'dashicons-video-alt3' // Icon (optional) ); } } diff --git a/upload-field-to-youtube-for-acf/upload-field-to-youtube-for-acf.php b/upload-field-to-youtube-for-acf/upload-field-to-youtube-for-acf.php index 978e951..ae39e3e 100644 --- a/upload-field-to-youtube-for-acf/upload-field-to-youtube-for-acf.php +++ b/upload-field-to-youtube-for-acf/upload-field-to-youtube-for-acf.php @@ -17,7 +17,8 @@ * Plugin Name: Upload Field to YouTube for ACF * Plugin URI: https://github.com/frugan-dev/upload-field-to-youtube-for-acf * Description: Upload Field to YouTube for ACF is a WordPress plugin that allows you to upload videos directly to YouTube via API from the WordPress admin area and/or select existing videos on your YouTube channel based on playlists. - * Version: 0.1.0 + * Version: 0.1.1 + * Requires Plugins: advanced-custom-fields * Requires PHP: 8.0 * Author: Frugan * Author URI: https://frugan.it @@ -34,7 +35,7 @@ require __DIR__.'/vendor/autoload.php'; } -define('FRUGAN_UFTYFACF_VERSION', '0.1.0'); +define('FRUGAN_UFTYFACF_VERSION', '0.1.1'); define('FRUGAN_UFTYFACF_BASENAME', plugin_basename(__FILE__)); define('FRUGAN_UFTYFACF_NAME', dirname(FRUGAN_UFTYFACF_BASENAME)); define('FRUGAN_UFTYFACF_NAME_UNDERSCORE', str_replace('-', '_', FRUGAN_UFTYFACF_NAME));