Changeset 3463890
- Timestamp:
- 02/17/2026 11:09:10 PM (6 weeks ago)
- Location:
- rank-authority
- Files:
-
- 10 added
- 3 edited
-
tags/1.0.17 (added)
-
tags/1.0.17/assets (added)
-
tags/1.0.17/assets/icon.svg (added)
-
tags/1.0.17/rank-authority.php (added)
-
tags/1.0.17/readme.txt (added)
-
tags/1.0.17/templates (added)
-
tags/1.0.17/templates/category-geo.php (added)
-
tags/1.0.17/uninstall.php (added)
-
trunk/rank-authority.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates (added)
-
trunk/templates/category-geo.php (added)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rank-authority/trunk/rank-authority.php
r3459448 r3463890 4 4 * Plugin URI: https://rankauthority.com/plugins/rankauthority 5 5 * Description: Secure API connector to publish posts / overwrite posts from the RA Dashboard to WordPress. Token reset now available to all administrators. 6 * Version: 1.0.1 66 * Version: 1.0.17 7 7 * Author: Rank Authority 8 8 * Author URI: https://rankauthority.com … … 23 23 private $option_website_id = 'ra_wp_connector_website_id'; 24 24 private $option_script_enabled = 'ra_wp_connector_script_enabled'; 25 private $option_geo_category_id = 'ra_geo_category_id'; 26 private $option_version = 'ra_plugin_version'; 25 27 26 28 public function __construct() { 27 29 register_activation_hook(__FILE__, [$this, 'activate']); 30 add_action('init', [$this, 'maybe_run_upgrade'], 5); 31 add_filter('template_include', [$this, 'geo_category_template'], 99); 28 32 add_action('admin_menu', [$this, 'admin_menu']); 29 33 add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']); … … 56 60 update_option($this->option_script_enabled, '0'); 57 61 } 62 63 $this->ensure_geo_category(); 64 $this->update_plugin_version(); 65 } 66 67 /** Run upgrade logic when plugin version changes */ 68 public function maybe_run_upgrade() { 69 $current_version = get_file_data(__FILE__, array('Version' => 'Version'), false)['Version'] ?? '1.0.0'; 70 $saved_version = get_option($this->option_version, '0'); 71 if (version_compare($saved_version, $current_version, '<')) { 72 $this->ensure_geo_category(); 73 $this->update_plugin_version(); 74 } 75 } 76 77 /** Update stored plugin version */ 78 private function update_plugin_version() { 79 $version = get_file_data(__FILE__, array('Version' => 'Version'), false)['Version'] ?? '1.0.0'; 80 update_option($this->option_version, $version); 81 } 82 83 /** Create Geo category for GEO (Generative Engine Optimization) content if not exists */ 84 private function ensure_geo_category() { 85 $existing_id = get_option($this->option_geo_category_id); 86 if ($existing_id) { 87 $term = get_term($existing_id, 'category'); 88 if ($term && !is_wp_error($term)) { 89 return (int) $existing_id; 90 } 91 } 92 $term = get_term_by('slug', 'geo', 'category'); 93 if ($term && !is_wp_error($term)) { 94 update_option($this->option_geo_category_id, $term->term_id); 95 return (int) $term->term_id; 96 } 97 $result = wp_insert_term( 98 'Geo', 99 'category', 100 array( 101 'slug' => 'geo', 102 'description' => __('AI-optimized content (Generative Engine Optimization). Text-focused posts without featured images.', 'rank-authority') 103 ) 104 ); 105 if (!is_wp_error($result)) { 106 update_option($this->option_geo_category_id, $result['term_id']); 107 return (int) $result['term_id']; 108 } 109 return 0; 110 } 111 112 /** Use custom template for Geo category archive (no thumbnails) */ 113 public function geo_category_template($template) { 114 if (is_category('geo')) { 115 $plugin_template = plugin_dir_path(__FILE__) . 'templates/category-geo.php'; 116 if (file_exists($plugin_template)) { 117 return $plugin_template; 118 } 119 } 120 return $template; 58 121 } 59 122 … … 1026 1089 'callback' => [$this, 'disconnect'], 1027 1090 'permission_callback' => [$this, 'authenticate'], 1091 ]); 1092 1093 register_rest_route('ra/v1', '/geo-category', [ 1094 'methods' => 'GET', 1095 'callback' => [$this, 'get_geo_category'], 1096 'permission_callback' => [$this, 'authenticate'], 1097 ]); 1098 } 1099 1100 /** Return Geo category ID for GEO (Generative Engine Optimization) content */ 1101 public function get_geo_category() { 1102 $id = get_option($this->option_geo_category_id); 1103 if (!$id) { 1104 $id = $this->ensure_geo_category(); 1105 } 1106 return rest_ensure_response([ 1107 'category_id' => $id ? (int) $id : null, 1108 'slug' => 'geo', 1109 'name' => 'Geo', 1028 1110 ]); 1029 1111 } -
rank-authority/trunk/readme.txt
r3459448 r3463890 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0.1 67 Stable tag: 1.0.17 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 137 137 138 138 == Changelog == 139 140 = 1.0.17 = 141 * Added Geo category for Generative Engine Optimization (GEO) content 142 * Auto-creates "Geo" category on plugin install and update 143 * Geo category archive uses custom template - text-only list without thumbnails 144 * Added GET /ra/v1/geo-category API endpoint to fetch Geo category ID for Dashboard 145 * Use Geo category for AI-optimized posts without featured images 139 146 140 147 = 1.0.16 = -
rank-authority/trunk/uninstall.php
r3438857 r3463890 7 7 delete_option('ra_wp_connector_website_id'); 8 8 delete_option('ra_wp_connector_script_enabled'); 9 delete_option('ra_geo_category_id'); 10 delete_option('ra_plugin_version');
Note: See TracChangeset
for help on using the changeset viewer.