Plugin automatic-ai-posts (v2.0.0) - Pipeline completo: coleta de feeds RSS/Atom, filtro por IA, reescrita, categoria, imagem de capa e agendamento - Página de configuração com teste real do provedor de IA - Editor: botão para refazer imagem de capa e metadados, textos em PT-BR - Ajuda com botão Pix (copia-e-cola + QR) e sem nota de avaliação - Cache-busting por mtime nos assets do admin Tema gustavoo-portfolio - Marca do cabeçalho reduzida a "Gustavo" - Suporte a título próprio da marca Setup (docker/wp-init.sh, compose.yaml) - Plugins de terceiros (Post Views Counter, Rank Math, Site Kit) instalados do WordPress.org em vez de versionados - Falha explícita ao final se algum plugin obrigatório não instalar - WPCLI_UID/WPCLI_GID configuráveis Seeder do tema - Links permanentes "Dia e nome" e avatar "Iniciais" aplicados apenas em instalação nova, com regravação do .htaccess
58 lines
2.1 KiB
PHP
58 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Automatic AI Posts
|
|
* Plugin URI: https://gustavoo.me/
|
|
* Description: Modular AI content pipeline: RSS/GNews → AI rewrite → image → post.
|
|
* Version: 2.0.0
|
|
* Author: Gustavo
|
|
* Author URI: https://gustavoo.me/
|
|
* Text Domain: automatic-ai-posts
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
define('AAP_VERSION', '2.0.0');
|
|
define('AAP_PLUGIN_FILE', __FILE__);
|
|
define('AAP_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
define('AAP_PLUGIN_URL', plugin_dir_url(__FILE__));
|
|
|
|
require_once AAP_PLUGIN_DIR . 'src/Core/Autoloader.php';
|
|
|
|
AAP\Core\Autoloader::register(AAP_PLUGIN_DIR . 'src/');
|
|
|
|
require_once AAP_PLUGIN_DIR . 'src/Core/Options.php';
|
|
|
|
/**
|
|
* Module tree. Order here is irrelevant: the registry resolves dependencies.
|
|
* Each entry must be a class extending AAP\Core\Module.
|
|
*/
|
|
add_action('plugins_loaded', static function (): void {
|
|
AAP\Core\Registry::add(new AAP\Modules\I18n\I18nModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Logs\LogsModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Ai\AiModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Feeds\FeedsModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Content\ContentModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Images\ImagesModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Posts\PostsModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Pipeline\PipelineModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Schedule\ScheduleModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Admin\AdminModule());
|
|
AAP\Core\Registry::add(new AAP\Modules\Editor\EditorModule());
|
|
|
|
AAP\Core\Registry::boot();
|
|
}, 5);
|
|
|
|
register_activation_hook(__FILE__, static function (): void {
|
|
AAP\Core\Options::install_defaults();
|
|
AAP\Modules\Logs\LogRepository::install();
|
|
AAP\Modules\Logs\Logger::info('Plugin activated.', 'lifecycle');
|
|
});
|
|
|
|
register_deactivation_hook(__FILE__, static function (): void {
|
|
AAP\Core\Options::set('aap_auto_enabled', false);
|
|
delete_option('aap_next_auto_run');
|
|
delete_transient('aap_auto_spawn_lock');
|
|
wp_clear_scheduled_hook('aap_auto_run');
|
|
AAP\Modules\Logs\Logger::info('Plugin deactivated.', 'lifecycle');
|
|
});
|