Plugin Directory

Changeset 3739617


Ignore:
Timestamp:
10/11/2026 02:42:40 PM (2 weeks ago)
Author:
writeauto
Message:

Release 1.2.0

Location:
write-auto
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • write-auto/tags/1.2.0/readme.txt

    r3739534 r3739617  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    5656== Changelog ==
    5757
     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
    5861= 1.1.0 =
    5962* 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  
    3535                add_action( 'admin_post_write_auto_disconnect', array( self::class, 'handle_disconnect' ) );
    3636                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' ) );
    3738                add_filter( 'plugin_action_links_' . plugin_basename( WRITE_AUTO_FILE ), array( self::class, 'action_links' ) );
    3839        }
    … …  
    9192                Settings::update( array( 'author_id' => $author_id ) );
    9293
     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
    9399                $credentials = Settings::generate_credentials();
    94100                set_transient( self::new_key_transient(), Settings::connection_key( $credentials ), self::NEW_KEY_TTL );
    … …  
    105111                delete_transient( self::new_key_transient() );
    106112                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 ) );
    107122        }
    108123
    … …  
    149164                        <?php elseif ( 'author_saved' === $notice ) : ?>
    150165                                <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>
    151170                        <?php endif; ?>
    152171
    … …  
    187206                                        <td><?php echo esc_html( self::seo_label( $adapter->id(), $adapter->version() ) ); ?></td>
    188207                                </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; ?>
    189229                        </table>
    190230
    … …  
    209249                                                </td>
    210250                                        </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; ?>
    211263                                </table>
    212264                                <?php submit_button( $credentials ? __( 'Save author', 'write-auto' ) : __( 'Connect', 'write-auto' ) ); ?>
  • write-auto/tags/1.2.0/write-auto.php

    r3739534 r3739617  
    33 * Plugin Name:       Write Auto
    44 * 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.0
     5 * Version:           1.2.0
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    1717defined( 'ABSPATH' ) || exit;
    1818
    19 define( 'WRITE_AUTO_VERSION', '1.1.0' );
     19define( 'WRITE_AUTO_VERSION', '1.2.0' );
    2020define( 'WRITE_AUTO_FILE', __FILE__ );
    2121define( 'WRITE_AUTO_DIR', plugin_dir_path( __FILE__ ) );
  • write-auto/trunk/readme.txt

    r3739534 r3739617  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    5656== Changelog ==
    5757
     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
    5861= 1.1.0 =
    5962* 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  
    3535                add_action( 'admin_post_write_auto_disconnect', array( self::class, 'handle_disconnect' ) );
    3636                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' ) );
    3738                add_filter( 'plugin_action_links_' . plugin_basename( WRITE_AUTO_FILE ), array( self::class, 'action_links' ) );
    3839        }
    … …  
    9192                Settings::update( array( 'author_id' => $author_id ) );
    9293
     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
    9399                $credentials = Settings::generate_credentials();
    94100                set_transient( self::new_key_transient(), Settings::connection_key( $credentials ), self::NEW_KEY_TTL );
    … …  
    105111                delete_transient( self::new_key_transient() );
    106112                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 ) );
    107122        }
    108123
    … …  
    149164                        <?php elseif ( 'author_saved' === $notice ) : ?>
    150165                                <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>
    151170                        <?php endif; ?>
    152171
    … …  
    187206                                        <td><?php echo esc_html( self::seo_label( $adapter->id(), $adapter->version() ) ); ?></td>
    188207                                </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; ?>
    189229                        </table>
    190230
    … …  
    209249                                                </td>
    210250                                        </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; ?>
    211263                                </table>
    212264                                <?php submit_button( $credentials ? __( 'Save author', 'write-auto' ) : __( 'Connect', 'write-auto' ) ); ?>
  • write-auto/trunk/write-auto.php

    r3739534 r3739617  
    33 * Plugin Name:       Write Auto
    44 * 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.0
     5 * Version:           1.2.0
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    1717defined( 'ABSPATH' ) || exit;
    1818
    19 define( 'WRITE_AUTO_VERSION', '1.1.0' );
     19define( 'WRITE_AUTO_VERSION', '1.2.0' );
    2020define( 'WRITE_AUTO_FILE', __FILE__ );
    2121define( 'WRITE_AUTO_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.