Changeset 3739617
- Timestamp:
- 10/11/2026 02:42:40 PM (2 weeks ago)
- Location:
- write-auto
- Files:
-
- 2 added
- 6 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from write-auto/trunk )
-
tags/1.2.0/readme.txt (modified) (2 diffs)
-
tags/1.2.0/src/Admin/AdminPages.php (modified) (6 diffs)
-
tags/1.2.0/src/Admin/AutoUpdates.php (added)
-
tags/1.2.0/write-auto.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Admin/AdminPages.php (modified) (6 diffs)
-
trunk/src/Admin/AutoUpdates.php (added)
-
trunk/write-auto.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
write-auto/tags/1.2.0/readme.txt
r3739534 r3739617 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 1.07 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Changelog == 57 57 58 = 1.2.0 = 59 * Keep Write Auto up to date: the Connect screen offers automatic updates (on by default, your choice), and connected sites get a one-click "Turn on automatic updates" button. 60 58 61 = 1.1.0 = 59 62 * Articles arrive with their images: the cover is set as the featured image and the in-article image is placed in its section, both in the Media Library with alt text. Publishing again reuses them instead of uploading twice. -
write-auto/tags/1.2.0/src/Admin/AdminPages.php
r3730724 r3739617 35 35 add_action( 'admin_post_write_auto_disconnect', array( self::class, 'handle_disconnect' ) ); 36 36 add_action( 'admin_post_write_auto_save_author', array( self::class, 'handle_save_author' ) ); 37 add_action( 'admin_post_write_auto_auto_updates', array( self::class, 'handle_auto_updates' ) ); 37 38 add_filter( 'plugin_action_links_' . plugin_basename( WRITE_AUTO_FILE ), array( self::class, 'action_links' ) ); 38 39 } … … 91 92 Settings::update( array( 'author_id' => $author_id ) ); 92 93 94 // The admin's choice on the Connect form (checked by default, and they can untick it). 95 if ( ! empty( $_POST['auto_update'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- verified in authorize(). 96 AutoUpdates::enable(); 97 } 98 93 99 $credentials = Settings::generate_credentials(); 94 100 set_transient( self::new_key_transient(), Settings::connection_key( $credentials ), self::NEW_KEY_TTL ); … … 105 111 delete_transient( self::new_key_transient() ); 106 112 self::redirect( self::SLUG, array( 'wa_notice' => 'disconnected' ) ); 113 } 114 115 /** 116 * Turns on automatic updates for this plugin (the Connection screen's button). 117 */ 118 public static function handle_auto_updates() { 119 self::authorize( 'write_auto_auto_updates' ); 120 $notice = AutoUpdates::enable() ? 'auto_updates_on' : 'auto_updates_unavailable'; 121 self::redirect( self::SLUG, array( 'wa_notice' => $notice ) ); 107 122 } 108 123 … … 149 164 <?php elseif ( 'author_saved' === $notice ) : ?> 150 165 <div class="notice notice-success"><p><?php esc_html_e( 'Author saved.', 'write-auto' ); ?></p></div> 166 <?php elseif ( 'auto_updates_on' === $notice ) : ?> 167 <div class="notice notice-success"><p><?php esc_html_e( 'Automatic updates are on. WordPress will install new versions of Write Auto as they are released.', 'write-auto' ); ?></p></div> 168 <?php elseif ( 'auto_updates_unavailable' === $notice ) : ?> 169 <div class="notice notice-warning"><p><?php esc_html_e( 'Automatic plugin updates are turned off on this site, or your account cannot change them. Update Write Auto from Plugins when a new version is available.', 'write-auto' ); ?></p></div> 151 170 <?php endif; ?> 152 171 … … 187 206 <td><?php echo esc_html( self::seo_label( $adapter->id(), $adapter->version() ) ); ?></td> 188 207 </tr> 208 <?php if ( $credentials ) : ?> 209 <tr> 210 <th scope="row"><?php esc_html_e( 'Automatic updates', 'write-auto' ); ?></th> 211 <td> 212 <?php if ( AutoUpdates::enabled() ) : ?> 213 <strong><?php esc_html_e( 'On', 'write-auto' ); ?></strong> 214 — <?php esc_html_e( 'new versions install themselves.', 'write-auto' ); ?> 215 <?php else : ?> 216 <strong><?php esc_html_e( 'Off', 'write-auto' ); ?></strong> 217 — <?php esc_html_e( 'new features in Write Auto (such as article images) need the latest version of this plugin.', 'write-auto' ); ?> 218 <?php if ( AutoUpdates::available() ) : ?> 219 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" style="display:inline-block;margin-left:8px"> 220 <input type="hidden" name="action" value="write_auto_auto_updates" /> 221 <?php wp_nonce_field( 'write_auto_auto_updates' ); ?> 222 <button type="submit" class="button"><?php esc_html_e( 'Turn on automatic updates', 'write-auto' ); ?></button> 223 </form> 224 <?php endif; ?> 225 <?php endif; ?> 226 </td> 227 </tr> 228 <?php endif; ?> 189 229 </table> 190 230 … … 209 249 </td> 210 250 </tr> 251 <?php if ( ! $credentials && AutoUpdates::available() && ! AutoUpdates::enabled() ) : ?> 252 <tr> 253 <th scope="row"><?php esc_html_e( 'Updates', 'write-auto' ); ?></th> 254 <td> 255 <label for="write-auto-auto-update"> 256 <input type="checkbox" name="auto_update" id="write-auto-auto-update" value="1" checked="checked" /> 257 <?php esc_html_e( 'Keep Write Auto updated automatically (recommended)', 'write-auto' ); ?> 258 </label> 259 <p class="description"><?php esc_html_e( 'New features in Write Auto, such as article images, need the latest version of this plugin. You can turn this off at any time from the Plugins screen.', 'write-auto' ); ?></p> 260 </td> 261 </tr> 262 <?php endif; ?> 211 263 </table> 212 264 <?php submit_button( $credentials ? __( 'Save author', 'write-auto' ) : __( 'Connect', 'write-auto' ) ); ?> -
write-auto/tags/1.2.0/write-auto.php
r3739534 r3739617 3 3 * Plugin Name: Write Auto 4 4 * Description: Publishes articles from Write Auto to this site, including SEO title, meta description, focus keyword and schema for Yoast SEO, Rank Math and All in One SEO. 5 * Version: 1. 1.05 * Version: 1.2.0 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 17 17 defined( 'ABSPATH' ) || exit; 18 18 19 define( 'WRITE_AUTO_VERSION', '1. 1.0' );19 define( 'WRITE_AUTO_VERSION', '1.2.0' ); 20 20 define( 'WRITE_AUTO_FILE', __FILE__ ); 21 21 define( 'WRITE_AUTO_DIR', plugin_dir_path( __FILE__ ) ); -
write-auto/trunk/readme.txt
r3739534 r3739617 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 1.07 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Changelog == 57 57 58 = 1.2.0 = 59 * Keep Write Auto up to date: the Connect screen offers automatic updates (on by default, your choice), and connected sites get a one-click "Turn on automatic updates" button. 60 58 61 = 1.1.0 = 59 62 * Articles arrive with their images: the cover is set as the featured image and the in-article image is placed in its section, both in the Media Library with alt text. Publishing again reuses them instead of uploading twice. -
write-auto/trunk/src/Admin/AdminPages.php
r3730724 r3739617 35 35 add_action( 'admin_post_write_auto_disconnect', array( self::class, 'handle_disconnect' ) ); 36 36 add_action( 'admin_post_write_auto_save_author', array( self::class, 'handle_save_author' ) ); 37 add_action( 'admin_post_write_auto_auto_updates', array( self::class, 'handle_auto_updates' ) ); 37 38 add_filter( 'plugin_action_links_' . plugin_basename( WRITE_AUTO_FILE ), array( self::class, 'action_links' ) ); 38 39 } … … 91 92 Settings::update( array( 'author_id' => $author_id ) ); 92 93 94 // The admin's choice on the Connect form (checked by default, and they can untick it). 95 if ( ! empty( $_POST['auto_update'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- verified in authorize(). 96 AutoUpdates::enable(); 97 } 98 93 99 $credentials = Settings::generate_credentials(); 94 100 set_transient( self::new_key_transient(), Settings::connection_key( $credentials ), self::NEW_KEY_TTL ); … … 105 111 delete_transient( self::new_key_transient() ); 106 112 self::redirect( self::SLUG, array( 'wa_notice' => 'disconnected' ) ); 113 } 114 115 /** 116 * Turns on automatic updates for this plugin (the Connection screen's button). 117 */ 118 public static function handle_auto_updates() { 119 self::authorize( 'write_auto_auto_updates' ); 120 $notice = AutoUpdates::enable() ? 'auto_updates_on' : 'auto_updates_unavailable'; 121 self::redirect( self::SLUG, array( 'wa_notice' => $notice ) ); 107 122 } 108 123 … … 149 164 <?php elseif ( 'author_saved' === $notice ) : ?> 150 165 <div class="notice notice-success"><p><?php esc_html_e( 'Author saved.', 'write-auto' ); ?></p></div> 166 <?php elseif ( 'auto_updates_on' === $notice ) : ?> 167 <div class="notice notice-success"><p><?php esc_html_e( 'Automatic updates are on. WordPress will install new versions of Write Auto as they are released.', 'write-auto' ); ?></p></div> 168 <?php elseif ( 'auto_updates_unavailable' === $notice ) : ?> 169 <div class="notice notice-warning"><p><?php esc_html_e( 'Automatic plugin updates are turned off on this site, or your account cannot change them. Update Write Auto from Plugins when a new version is available.', 'write-auto' ); ?></p></div> 151 170 <?php endif; ?> 152 171 … … 187 206 <td><?php echo esc_html( self::seo_label( $adapter->id(), $adapter->version() ) ); ?></td> 188 207 </tr> 208 <?php if ( $credentials ) : ?> 209 <tr> 210 <th scope="row"><?php esc_html_e( 'Automatic updates', 'write-auto' ); ?></th> 211 <td> 212 <?php if ( AutoUpdates::enabled() ) : ?> 213 <strong><?php esc_html_e( 'On', 'write-auto' ); ?></strong> 214 — <?php esc_html_e( 'new versions install themselves.', 'write-auto' ); ?> 215 <?php else : ?> 216 <strong><?php esc_html_e( 'Off', 'write-auto' ); ?></strong> 217 — <?php esc_html_e( 'new features in Write Auto (such as article images) need the latest version of this plugin.', 'write-auto' ); ?> 218 <?php if ( AutoUpdates::available() ) : ?> 219 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" style="display:inline-block;margin-left:8px"> 220 <input type="hidden" name="action" value="write_auto_auto_updates" /> 221 <?php wp_nonce_field( 'write_auto_auto_updates' ); ?> 222 <button type="submit" class="button"><?php esc_html_e( 'Turn on automatic updates', 'write-auto' ); ?></button> 223 </form> 224 <?php endif; ?> 225 <?php endif; ?> 226 </td> 227 </tr> 228 <?php endif; ?> 189 229 </table> 190 230 … … 209 249 </td> 210 250 </tr> 251 <?php if ( ! $credentials && AutoUpdates::available() && ! AutoUpdates::enabled() ) : ?> 252 <tr> 253 <th scope="row"><?php esc_html_e( 'Updates', 'write-auto' ); ?></th> 254 <td> 255 <label for="write-auto-auto-update"> 256 <input type="checkbox" name="auto_update" id="write-auto-auto-update" value="1" checked="checked" /> 257 <?php esc_html_e( 'Keep Write Auto updated automatically (recommended)', 'write-auto' ); ?> 258 </label> 259 <p class="description"><?php esc_html_e( 'New features in Write Auto, such as article images, need the latest version of this plugin. You can turn this off at any time from the Plugins screen.', 'write-auto' ); ?></p> 260 </td> 261 </tr> 262 <?php endif; ?> 211 263 </table> 212 264 <?php submit_button( $credentials ? __( 'Save author', 'write-auto' ) : __( 'Connect', 'write-auto' ) ); ?> -
write-auto/trunk/write-auto.php
r3739534 r3739617 3 3 * Plugin Name: Write Auto 4 4 * Description: Publishes articles from Write Auto to this site, including SEO title, meta description, focus keyword and schema for Yoast SEO, Rank Math and All in One SEO. 5 * Version: 1. 1.05 * Version: 1.2.0 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 17 17 defined( 'ABSPATH' ) || exit; 18 18 19 define( 'WRITE_AUTO_VERSION', '1. 1.0' );19 define( 'WRITE_AUTO_VERSION', '1.2.0' ); 20 20 define( 'WRITE_AUTO_FILE', __FILE__ ); 21 21 define( 'WRITE_AUTO_DIR', plugin_dir_path( __FILE__ ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)