Changeset 3405560
- Timestamp:
- 11/29/2025 02:21:48 AM (4 months ago)
- Location:
- ghost-update/trunk
- Files:
-
- 5 edited
-
ghost-update.php (modified) (2 diffs)
-
includes/admin-ui.php (modified) (2 diffs)
-
includes/google-api.php (modified) (2 diffs)
-
includes/updater.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ghost-update/trunk/ghost-update.php
r3287022 r3405560 3 3 * Plugin Name: Ghost Update 4 4 * Description: Keeps your WordPress site fresh by rotating post/page publish dates & pinging Google Search Console. 5 * Version: 1. 0.05 * Version: 1.1.0 6 6 * License: GPLv2 or later 7 7 * Author: YourName … … 11 11 * Text Domain: 12 12 * Requires at least: 5.8 13 * Tested up to: 6. 813 * Tested up to: 6.9 14 14 * Requires PHP: 7.2 15 15 * Tested up to PHP: 8.3 -
ghost-update/trunk/includes/admin-ui.php
r3287022 r3405560 1 1 <?php 2 // includes/admin-ui.php 2 3 defined('ABSPATH') || exit; 3 4 … … 7 8 }); 8 9 9 10 $ghost _dir = wp_upload_dir()['basedir'] . '/ghostupdate/';11 if ( ! file_exists($ghost _dir) ) {12 wp_mkdir_p($ghost _dir);10 // Prefix globals to satisfy WordPress.NamingConventions.PrefixAllGlobals 11 $ghostupdate_dir = wp_upload_dir()['basedir'] . '/ghostupdate/'; 12 if ( ! file_exists($ghostupdate_dir) ) { 13 wp_mkdir_p($ghostupdate_dir); 13 14 } 14 15 $log_file = $ghost_dir . 'ghostupdate.log'; 16 $json_file = $ghost_dir . 'gsc-service-account.json'; 15 $ghostupdate_log_file = $ghostupdate_dir . 'ghostupdate.log'; 16 $ghostupdate_json_file = $ghostupdate_dir . 'gsc-service-account.json'; 17 17 18 18 function ghostupdate_settings_page() { -
ghost-update/trunk/includes/google-api.php
r3287022 r3405560 1 1 <?php 2 // includes/google-api.php 2 3 defined('ABSPATH') || exit; 3 4 $upload_dir = wp_upload_dir();5 4 6 5 require_once plugin_dir_path(__DIR__) . 'vendor/JWT.php'; … … 90 89 return $code; 91 90 } 92 -
ghost-update/trunk/includes/updater.php
r3287022 r3405560 1 1 <?php 2 // includes/updater.php 2 3 defined('ABSPATH') || exit; 3 4 $upload_dir = wp_upload_dir();5 $ghost_dir = trailingslashit($upload_dir['basedir']) . 'ghostupdate/';6 $log_file = $ghost_dir . 'ghostupdate.log';7 8 4 9 5 function ghostupdate_run_update() { 10 6 if (!get_option('ghostupdate_enabled', 1)) { 11 // ✅ Log it to ghostupdate.log12 7 ghostupdate_log_manual("⏸️ Cron skipped: GhostUpdate is currently disabled."); 13 8 return; … … 46 41 update_option('ghostupdate_remaining_ids', $remaining); 47 42 48 // ✅ NOW call ping & log — next_id is real49 43 $status = ghostupdate_ping_gsc($next_id); 50 44 ghostupdate_log_action($next_id, $status); … … 53 47 } 54 48 } 49 55 50 function ghostupdate_shuffle($array) { 56 51 shuffle($array); … … 69 64 $ids = get_posts($args); 70 65 71 // Only update posts — delay ping until cooldown passes72 66 foreach ($ids as $post_id) { 73 67 $now = current_time('mysql'); … … 81 75 } 82 76 83 // Ping GSC for just one — avoids flooding + honors cooldown84 77 if (!empty($ids)) { 85 78 ghostupdate_ping_gsc($ids[0]); 86 79 } 87 80 } 81 88 82 function ghostupdate_log_action($post_id, $gsc_status = null) { 89 83 $post = get_post($post_id); … … 102 96 $log_file = trailingslashit($upload_dir['basedir']) . 'ghostupdate/ghostupdate.log'; 103 97 104 // Append new log line105 98 file_put_contents($log_file, $log_line, FILE_APPEND); 106 99 107 // Trim file to last 500 lines108 100 $lines = file($log_file); 109 101 if (count($lines) > 500) { … … 112 104 } 113 105 } 106 114 107 function ghostupdate_log_manual($message) { 115 108 $upload_dir = wp_upload_dir(); … … 121 114 file_put_contents($log_file, $log_line, FILE_APPEND); 122 115 123 // Trim file to last 500 lines124 116 $lines = file($log_file); 125 117 if (count($lines) > 500) { … … 128 120 } 129 121 } 130 131 132 -
ghost-update/trunk/readme.txt
r3287022 r3405560 3 3 Tags: SEO, Indexing API, Scheduled Updates, Recrawl, Post Refresh 4 4 Requires at least: 5.8 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 7.2 7 7 Tested up to PHP: 8.3 8 Stable tag: 1. 0.08 Stable tag: 1.1.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 123 123 == Changelog == 124 124 125 = 1.1.0 = 126 Tested and updated to work with wp 6.9 127 125 128 = 1.0 = 126 129 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.