Changeset 3333323
- Timestamp:
- 07/24/2025 07:22:06 AM (7 months ago)
- Location:
- wd-post-renew
- Files:
-
- 27 added
- 5 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
tags/1.01 (added)
-
tags/1.01/Gruntfile.js (added)
-
tags/1.01/README.md (added)
-
tags/1.01/assets (added)
-
tags/1.01/assets/dist (added)
-
tags/1.01/assets/dist/css (added)
-
tags/1.01/assets/dist/css/admin-style.css (added)
-
tags/1.01/assets/dist/css/admin-style.css.map (added)
-
tags/1.01/assets/dist/css/user-style.css (added)
-
tags/1.01/assets/dist/css/user-style.css.map (added)
-
tags/1.01/assets/dist/js (added)
-
tags/1.01/assets/dist/js/admin-script.min.js (added)
-
tags/1.01/assets/dist/js/user-script.min.js (added)
-
tags/1.01/assets/src (added)
-
tags/1.01/assets/src/js (added)
-
tags/1.01/assets/src/js/admin-script.js (added)
-
tags/1.01/assets/src/js/user-script.js (added)
-
tags/1.01/assets/src/scss (added)
-
tags/1.01/assets/src/scss/main (added)
-
tags/1.01/assets/src/scss/main/admin-style.scss (added)
-
tags/1.01/assets/src/scss/main/user-style.scss (added)
-
tags/1.01/assets/src/scss/partials (added)
-
tags/1.01/assets/src/scss/partials/media-queries.scss (added)
-
tags/1.01/include (added)
-
tags/1.01/include/main-class.php (added)
-
tags/1.01/package.json (added)
-
tags/1.01/wd-post-renew.php (added)
-
trunk/include/main-class.php (modified) (3 diffs)
-
trunk/wd-post-renew.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wd-post-renew/trunk/include/main-class.php
r3330056 r3333323 189 189 } ?> 190 190 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> 193 197 <h1><?php esc_html__('WD Post Renew', "wd-post-renew"); ?></h1> 194 198 <form method="post"> … … 200 204 <td> 201 205 <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> 205 209 <option value="7 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '7 DAY') ? 'selected' : '' ?>>7 <?php echo esc_html__('days', "wd-post-renew"); ?></option> 206 210 <option value="14 DAY" <?php echo ($timeframedata != '' && $timeframedata[0] == '14 DAY') ? 'selected' : '' ?>>14 <?php echo esc_html__('days', "wd-post-renew"); ?></option> … … 210 214 211 215 </select> 216 <button class="button button-primary" name="savedata" id="wdpore-save">Save Automation</button><br /> 212 217 <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 213 223 <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> 214 225 </td> 215 226 </tr> 216 227 217 228 </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>226 229 </table> 227 230 </form> 228 231 </div> 232 229 233 230 234 <?php -
wd-post-renew/trunk/wd-post-renew.php
r3330056 r3333323 5 5 Plugin URI: https://webdiggers.in 6 6 Description: 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 7 Version: 1.01 8 8 Author: Webdiggers 9 9 Author URI: https://webdiggers.in/wd-post-renew-wordpress-plugin/ … … 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 12 Requires at least: 4.7 13 Requires PHP: 8.0 13 Requires PHP: 8.0 or higher 14 14 Text Domain: wd-post-renew 15 tags: post renewal, content freshness, WordPress plugin, post management, publish date update, cron job, automatic post renewal, WordPress maintenance, content strategy, SEO optimization 15 16 */ 16 17 … … 81 82 function wdpore_execute_cron() 82 83 { 83 $timeframe = get_option('wdpore_timeframe'); 84 85 86 $timeframedata = get_option('wdpore_timeframe'); 87 84 88 global $wpdb; 85 89 86 if (!is_array($timeframe ) || empty($timeframe[0])) {87 return;90 if (!is_array($timeframedata) || empty($timeframedata[0])) { 91 $timeframedata = array('1 DAY'); 88 92 } 93 $interval = $timeframedata[0]; 89 94 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 92 98 $args = array( 93 99 'post_type' => 'post', … … 95 101 'date_query' => array( 96 102 array( 97 'column' => 'post_date',98 'before' => "$interval daysago",103 'column' => 'post_date', 104 'before' => "$interval_value $interval_unit ago", 99 105 'inclusive' => true, 100 106 ), … … 105 111 $posts = get_posts($args); 106 112 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 } 107 119 foreach ($posts as $post) { 108 $newdate = current_time('mysql');120 $newdate = gmdate('Y-m-d H:i:s'); 109 121 wp_update_post(array( 110 122 'ID' => $post,
Note: See TracChangeset
for help on using the changeset viewer.