Skip to content

Commit

Permalink
style: compliance to YouTube and Wordpress ToS
Browse files Browse the repository at this point in the history
  • Loading branch information
frugan-dev committed Nov 11, 2024
1 parent db46060 commit 7ca7898
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
12 changes: 9 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions upload-field-to-youtube-for-acf/include_from.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
+ src/**
+ vendor/
- vendor/bin/
- vendor/symfony/console/Resources/
+ vendor/**
+ composer.json
+ readme.txt
+ upload-field-to-youtube-for-acf.php
- *
2 changes: 1 addition & 1 deletion upload-field-to-youtube-for-acf/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 7 additions & 11 deletions upload-field-to-youtube-for-acf/src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down

0 comments on commit 7ca7898

Please sign in to comment.