Plugin Directory

Changeset 3405560


Ignore:
Timestamp:
11/29/2025 02:21:48 AM (4 months ago)
Author:
ipodguy79
Message:

Tested and updated to work with wp 6.9

Location:
ghost-update/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ghost-update/trunk/ghost-update.php

    r3287022 r3405560  
    33 * Plugin Name: Ghost Update
    44 * Description: Keeps your WordPress site fresh by rotating post/page publish dates & pinging Google Search Console.
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * License: GPLv2 or later
    77 * Author: YourName
     
    1111 * Text Domain: 
    1212 * Requires at least: 5.8
    13  * Tested up to: 6.8
     13 * Tested up to: 6.9
    1414 * Requires PHP: 7.2
    1515 * Tested up to PHP: 8.3
  • ghost-update/trunk/includes/admin-ui.php

    r3287022 r3405560  
    11<?php
     2// includes/admin-ui.php
    23defined('ABSPATH') || exit;
    34
     
    78});
    89
    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/';
     12if ( ! file_exists($ghostupdate_dir) ) {
     13    wp_mkdir_p($ghostupdate_dir);
    1314}
    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';
    1717
    1818function ghostupdate_settings_page() {
  • ghost-update/trunk/includes/google-api.php

    r3287022 r3405560  
    11<?php
     2// includes/google-api.php
    23defined('ABSPATH') || exit;
    3 
    4 $upload_dir = wp_upload_dir();
    54
    65require_once plugin_dir_path(__DIR__) . 'vendor/JWT.php';
     
    9089    return $code;
    9190}
    92 
  • ghost-update/trunk/includes/updater.php

    r3287022 r3405560  
    11<?php
     2// includes/updater.php
    23defined('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 
    84
    95function ghostupdate_run_update() {
    106    if (!get_option('ghostupdate_enabled', 1)) {
    11         // ✅ Log it to ghostupdate.log
    127        ghostupdate_log_manual("⏸️ Cron skipped: GhostUpdate is currently disabled.");
    138        return;
     
    4641        update_option('ghostupdate_remaining_ids', $remaining);
    4742
    48         // ✅ NOW call ping & log — next_id is real
    4943        $status = ghostupdate_ping_gsc($next_id);
    5044        ghostupdate_log_action($next_id, $status);
     
    5347    }
    5448}
     49
    5550function ghostupdate_shuffle($array) {
    5651    shuffle($array);
     
    6964    $ids = get_posts($args);
    7065
    71     // Only update posts — delay ping until cooldown passes
    7266    foreach ($ids as $post_id) {
    7367        $now = current_time('mysql');
     
    8175    }
    8276
    83     // Ping GSC for just one — avoids flooding + honors cooldown
    8477    if (!empty($ids)) {
    8578        ghostupdate_ping_gsc($ids[0]);
    8679    }
    8780}
     81
    8882function ghostupdate_log_action($post_id, $gsc_status = null) {
    8983    $post = get_post($post_id);
     
    10296    $log_file = trailingslashit($upload_dir['basedir']) . 'ghostupdate/ghostupdate.log';
    10397
    104     // Append new log line
    10598    file_put_contents($log_file, $log_line, FILE_APPEND);
    10699
    107     // Trim file to last 500 lines
    108100    $lines = file($log_file);
    109101    if (count($lines) > 500) {
     
    112104    }
    113105}
     106
    114107function ghostupdate_log_manual($message) {
    115108    $upload_dir = wp_upload_dir();
     
    121114    file_put_contents($log_file, $log_line, FILE_APPEND);
    122115
    123     // Trim file to last 500 lines
    124116    $lines = file($log_file);
    125117    if (count($lines) > 500) {
     
    128120    }
    129121}
    130 
    131 
    132 
  • ghost-update/trunk/readme.txt

    r3287022 r3405560  
    33Tags: SEO, Indexing API, Scheduled Updates, Recrawl, Post Refresh
    44Requires at least: 5.8
    5 Tested up to: 6.8
     5Tested up to: 6.9
    66Requires PHP: 7.2
    77Tested up to PHP: 8.3
    8 Stable tag: 1.0.0
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    123123== Changelog ==
    124124
     125= 1.1.0 =
     126Tested and updated to work with wp 6.9
     127
    125128= 1.0 =
    126129* Initial release
Note: See TracChangeset for help on using the changeset viewer.