Plugin Directory

Changeset 3333323


Ignore:
Timestamp:
07/24/2025 07:22:06 AM (7 months ago)
Author:
anmol.12345
Message:

New Verison 1.01
Change Logs
Bug Fixes
Automation Fixes
Layout change for Settigs Page

Location:
wd-post-renew
Files:
27 added
5 edited

Legend:

Unmodified
Added
Removed
  • wd-post-renew/trunk/include/main-class.php

    r3330056 r3333323  
    189189            } ?>
    190190
    191             <div class="wrap card">
    192 
     191            <div class="wrap card" style="max-width: 100%;">
     192                <div class="notice notice-success">
     193                    <p>
     194                        Enjoying <strong>WD Post Renew</strong>? Please <a href="https://wordpress.org/support/plugin/wd-post-renew/reviews/?filter=5" target="_blank" rel="noopener noreferrer">leave us a ★★★★★ review</a> — it helps us grow and improve!
     195                    </p>
     196                </div>
    193197                <h1><?php esc_html__('WD Post Renew', "wd-post-renew"); ?></h1>
    194198                <form method="post">
     
    200204                                <td>
    201205                                    <select name="wdpore_timeframe">
    202                                         <option value="24 HOUR" <?php echo ($timeframedata != '' && $timeframedata[0] == '24 HOUR') ? 'selected' : '' ?>>24 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
    203                                         <option value="48 HOUR" <?php echo ($timeframedata != '' && $timeframedata[0] == '48 HOUR') ? 'selected' : '' ?>>48 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
    204                                         <option value="72 HOUR" <?php echo ($timeframedata != '' && $timeframedata[0] == '72 HOUR') ? 'selected' : '' ?>>72 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
     206                                        <option value="1 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '1 DAY') ? 'selected' : '' ?>>24 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
     207                                        <option value="2 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '2 DAY') ? 'selected' : '' ?>>48 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
     208                                        <option value="3 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '3 DAY') ? 'selected' : '' ?>>72 <?php echo esc_html__('hours', "wd-post-renew"); ?></option>
    205209                                        <option value="7 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '7 DAY') ? 'selected' : '' ?>>7 <?php echo esc_html__('days', "wd-post-renew"); ?></option>
    206210                                        <option value="14 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '14 DAY') ? 'selected' : '' ?>>14 <?php echo esc_html__('days', "wd-post-renew"); ?></option>
     
    210214
    211215                                    </select>
     216                                    <button class="button button-primary" name="savedata" id="wdpore-save">Save Automation</button><br />
    212217                                    <p class="description"><?php echo esc_html__('Select the number of days. All posts older than this will have their publish date updated.', 'wd-post-renew'); ?></p>
     218                                </td>
     219                            <tr>
     220                                <th></th>
     221                                <td>
     222
    213223                                    <button class="button button-secondary" name="runupdate" id="wdpore-run">Update Posts Now</button>
     224                                    <p class="description"><?php echo esc_html__('Run the update process immediately.', 'wd-post-renew'); ?></p>
    214225                                </td>
    215226                            </tr>
    216227
    217228                        </tbody>
    218                         <tfoot>
    219                             <tr>
    220                                 <th scope="row"></th>
    221                                 <td>
    222                                     <button class="button button-primary" name="savedata" id="wdpore-save">Save</button>
    223                                 </td>
    224                             </tr>
    225                         </tfoot>
    226229                    </table>
    227230                </form>
    228231            </div>
     232
    229233
    230234        <?php
  • wd-post-renew/trunk/wd-post-renew.php

    r3330056 r3333323  
    55Plugin URI: https://webdiggers.in
    66Description: This plugin helps you renew your WordPress posts by updating their publish date and time, making them appear as fresh content.
    7 Version: 1.0
     7Version: 1.01
    88Author: Webdiggers
    99Author URI: https://webdiggers.in/wd-post-renew-wordpress-plugin/
     
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1212Requires at least: 4.7
    13 Requires PHP: 8.0
     13Requires PHP: 8.0 or higher
    1414Text Domain: wd-post-renew
     15tags: post renewal, content freshness, WordPress plugin, post management, publish date update, cron job, automatic post renewal, WordPress maintenance, content strategy, SEO optimization
    1516*/
    1617
     
    8182function wdpore_execute_cron()
    8283{
    83     $timeframe = get_option('wdpore_timeframe');
     84
     85
     86    $timeframedata = get_option('wdpore_timeframe');
     87
    8488    global $wpdb;
    8589
    86     if (!is_array($timeframe) || empty($timeframe[0])) {
    87         return;
     90    if (!is_array($timeframedata) || empty($timeframedata[0])) {
     91        $timeframedata = array('1 DAY');
    8892    }
     93    $interval = $timeframedata[0];
    8994
    90     $interval = intval($timeframe[0]);
    91     if ($interval <= 0) return;
     95    $interval_value = intval(preg_replace('/[^0-9]/', '', $interval));
     96    $interval_unit = (stripos($interval, 'HOUR') !== false) ? 'HOUR' : 'DAY';
     97
    9298    $args = array(
    9399        'post_type'      => 'post',
     
    95101        'date_query'     => array(
    96102            array(
    97                 'column' => 'post_date',
    98                 'before' => "$interval days ago",
     103                'column'   => 'post_date',
     104                'before'   => "$interval_value $interval_unit ago",
    99105                'inclusive' => true,
    100106            ),
     
    105111    $posts = get_posts($args);
    106112
     113    if (empty($posts)) {
     114        echo '<div class="notice notice-warning is-dismissible">
     115                <p>No posts found to update.</p>
     116            </div>';
     117        return;
     118    }
    107119    foreach ($posts as $post) {
    108         $newdate = current_time('mysql');
     120        $newdate = gmdate('Y-m-d H:i:s');
    109121        wp_update_post(array(
    110122            'ID'            => $post,
Note: See TracChangeset for help on using the changeset viewer.