Remove all AI thumbnail generation infrastructure (too expensive, poor results) and rewrite the public-facing article feed as a React SPA mounted via WordPress shortcode. Changes: - Remove thumbnail generation, OG scraping, and image download code from fetcher, LLM, and admin classes - Replace server-rendered PHP templates with React component (PeptideNewsFeed.jsx) using WordPress-bundled React/ReactDOM - Add Babel build pipeline for JSX transpilation - Update REST API to serve ai_summary instead of thumbnail fields - Redesign public CSS: clean card layout, loading skeletons, dark mode, responsive, no thumbnail imagery - Remove dead admin settings (llm_image_model, thumbnail_fallback) - Fix call_openrouter() visibility for Content Filter cross-class use - Bump version to 1.3.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77 lines
2.4 KiB
PHP
77 lines
2.4 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Peptide News Aggregator
|
|
* Plugin URI: https://github.com/peptiderepo/peptide-news-plugin
|
|
* Description: Aggregates and displays the latest peptide research news from multiple sources with click analytics and trend reporting.
|
|
* Version: 1.3.0
|
|
* Author: Peptide News Team
|
|
* Author URI: https://github.com/peptiderepo
|
|
* License: GPL-2.0+
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
|
* Text Domain: peptide-news
|
|
* Domain Path: /languages
|
|
* Requires at least: 5.8
|
|
* Requires PHP: 7.4
|
|
*/
|
|
|
|
// Abort if called directly.
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
die;
|
|
}
|
|
|
|
/**
|
|
* Current plugin version — follows SemVer.
|
|
*/
|
|
define( 'PEPTIDE_NEWS_VERSION', '1.3.0' );
|
|
define( 'PEPTIDE_NEWS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'PEPTIDE_NEWS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
define( 'PEPTIDE_NEWS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
|
|
|
/**
|
|
* Runs during plugin activation.
|
|
*/
|
|
function peptide_news_activate() {
|
|
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news-activator.php';
|
|
Peptide_News_Activator::activate();
|
|
}
|
|
|
|
/**
|
|
* Runs during plugin deactivation.
|
|
*/
|
|
function peptide_news_deactivate() {
|
|
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news-deactivator.php';
|
|
Peptide_News_Deactivator::deactivate();
|
|
}
|
|
|
|
register_activation_hook( __FILE__, 'peptide_news_activate' );
|
|
register_deactivation_hook( __FILE__, 'peptide_news_deactivate' );
|
|
|
|
/**
|
|
* Core plugin class that orchestrates all hooks and dependencies.
|
|
*/
|
|
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news.php';
|
|
|
|
/**
|
|
* Check for database upgrades on every admin load.
|
|
* This handles existing installs that upgrade from 1.0.0 to 1.1.0
|
|
* without re-activating the plugin.
|
|
*/
|
|
function peptide_news_check_db_upgrade() {
|
|
$installed_version = get_option( 'peptide_news_db_version', '1.0.0' );
|
|
if ( version_compare( $installed_version, PEPTIDE_NEWS_VERSION, '<' ) ) {
|
|
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news-activator.php';
|
|
Peptide_News_Activator::activate();
|
|
}
|
|
}
|
|
add_action( 'plugins_loaded', 'peptide_news_check_db_upgrade' );
|
|
|
|
/**
|
|
* Begins execution of the plugin.
|
|
*/
|
|
function peptide_news_run() {
|
|
$plugin = new Peptide_News();
|
|
$plugin->run();
|
|
}
|
|
|
|
peptide_news_run();
|