Changeset 3843836
- Timestamp:
- 12/04/2026 06:44:33 AM (2 days ago)
- Location:
- auto-poster-ai
- Files:
-
- 12 added
- 6 edited
- 4 copied
-
assets/banner-1544x500.png (modified) (1 prop) ( previous)
-
assets/banner-772x250.png (modified) (1 prop) ( previous)
-
assets/icon-128x128.png (modified) (1 prop) ( previous)
-
assets/icon-256x256.png (modified) (1 prop) ( previous)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
tags/1.1.0 (copied) (copied from auto-poster-ai/trunk )
-
tags/1.1.0/auto-poster-ai.php (copied) (copied from auto-poster-ai/trunk/auto-poster-ai.php ) (5 diffs)
-
tags/1.1.0/block (added)
-
tags/1.1.0/block/block.json (added)
-
tags/1.1.0/block/index.asset.php (added)
-
tags/1.1.0/block/index.js (added)
-
tags/1.1.0/readme.txt (copied) (copied from auto-poster-ai/trunk/readme.txt ) (4 diffs)
-
tags/1.1.0/uninstall.php (copied) (copied from auto-poster-ai/trunk/uninstall.php )
-
trunk/auto-poster-ai.php (modified) (5 diffs)
-
trunk/block (added)
-
trunk/block/block.json (added)
-
trunk/block/index.asset.php (added)
-
trunk/block/index.js (added)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
auto-poster-ai/assets/banner-1544x500.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
auto-poster-ai/assets/banner-772x250.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
auto-poster-ai/assets/icon-128x128.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
auto-poster-ai/assets/icon-256x256.png
-
Property svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property svn:mime-type
changed from
-
auto-poster-ai/tags/1.1.0/auto-poster-ai.php
r3841390 r3843836 3 3 * Plugin Name: Auto Poster AI – Share Posts to Social Media 4 4 * Plugin URI: https://autoposter.ai/wordpress 5 * Description: Automatically share new posts to your social media accounts through Auto Poster AI.6 * Version: 1. 0.07 * Requires at least: 6. 25 * Description: Automatically share new posts to your social media accounts and embed Auto Poster AI social feed widgets. 6 * Version: 1.1.0 7 * Requires at least: 6.3 8 8 * Requires PHP: 7.4 9 9 * Author: Auto Poster AI … … 33 33 'post_types' => array( 'post' ), 34 34 'template' => "{title}\n\n{url}", 35 'floating' => '', 35 36 ) 36 37 ); … … 117 118 false 118 119 ); 120 } 121 } 122 123 /* ---------- Website widgets ---------- */ 124 125 const AUTOPOSTERAI_WIDGET_HOST_DEFAULT = 'https://cdn.autoposter.ai'; 126 127 // Override with the AUTOPOSTERAI_WIDGET_HOST constant or the autoposterai_widget_host filter (staging, dev). 128 function autoposterai_widget_host() { 129 $host = defined( 'AUTOPOSTERAI_WIDGET_HOST' ) ? AUTOPOSTERAI_WIDGET_HOST : AUTOPOSTERAI_WIDGET_HOST_DEFAULT; 130 return untrailingslashit( apply_filters( 'autoposterai_widget_host', $host ) ); 131 } 132 133 function autoposterai_widget_id( $id ) { 134 return preg_replace( '/[^A-Za-z0-9_-]/', '', (string) $id ); 135 } 136 137 function autoposterai_enqueue_embed() { 138 wp_enqueue_script( 139 'autoposterai-embed', 140 autoposterai_widget_host() . '/widgets/v1/embed.js', 141 array(), 142 null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- the CDN file is versioned by its /v1/ path. 143 array( 144 'in_footer' => true, 145 'strategy' => 'async', 146 ) 147 ); 148 } 149 150 // embed.js reads its host and the floating widget from its own script tag. 151 add_filter( 'script_loader_tag', 'autoposterai_embed_tag', 10, 2 ); 152 function autoposterai_embed_tag( $tag, $handle ) { 153 if ( 'autoposterai-embed' !== $handle ) { 154 return $tag; 155 } 156 $attrs = ''; 157 $host = autoposterai_widget_host(); 158 $floating = autoposterai_widget_id( autoposterai_settings()['floating'] ); 159 if ( AUTOPOSTERAI_WIDGET_HOST_DEFAULT !== $host ) { 160 $attrs .= ' data-apai-cdn="' . esc_attr( $host ) . '"'; 161 } 162 if ( $floating ) { 163 $attrs .= ' data-apai-floating="' . esc_attr( $floating ) . '"'; 164 } 165 return $attrs ? preg_replace( '/<script\b/', '<script' . $attrs, $tag, 1 ) : $tag; 166 } 167 168 add_shortcode( 'autoposter_widget', 'autoposterai_widget_shortcode' ); 169 function autoposterai_widget_shortcode( $atts ) { 170 $atts = shortcode_atts( array( 'id' => '' ), $atts, 'autoposter_widget' ); 171 $id = autoposterai_widget_id( $atts['id'] ); 172 if ( ! $id ) { 173 return ''; 174 } 175 autoposterai_enqueue_embed(); 176 return '<div data-apai-widget="' . esc_attr( $id ) . '"></div>'; 177 } 178 179 add_action( 'init', 'autoposterai_register_block' ); 180 function autoposterai_register_block() { 181 register_block_type( 182 __DIR__ . '/block', 183 array( 184 'render_callback' => static function ( $attributes ) { 185 return autoposterai_widget_shortcode( array( 'id' => isset( $attributes['widgetId'] ) ? $attributes['widgetId'] : '' ) ); 186 }, 187 ) 188 ); 189 } 190 191 add_action( 'wp_enqueue_scripts', 'autoposterai_enqueue_floating' ); 192 function autoposterai_enqueue_floating() { 193 if ( autoposterai_settings()['floating'] ) { 194 autoposterai_enqueue_embed(); 119 195 } 120 196 } … … 258 334 'post_types' => array_values( array_filter( $list( 'post_types' ), 'post_type_exists' ) ), 259 335 'template' => isset( $input['template'] ) ? sanitize_textarea_field( $input['template'] ) : '', 336 'floating' => isset( $input['floating'] ) ? autoposterai_widget_id( $input['floating'] ) : '', 260 337 ); 261 338 } … … 373 450 </td> 374 451 </tr> 452 <tr> 453 <th scope="row"><label for="autoposterai-floating"><?php esc_html_e( 'Floating widget ID', 'auto-poster-ai' ); ?></label></th> 454 <td> 455 <input id="autoposterai-floating" type="text" class="regular-text" placeholder="wgt_..." name="<?php echo esc_attr( $name ); ?>[floating]" value="<?php echo esc_attr( $settings['floating'] ); ?>"> 456 <p class="description"><?php esc_html_e( 'Optional. Shows a floating widget, such as a chat button, on every page of your site. To place a feed inside a page, use the Auto Poster AI widget block or the [autoposter_widget id="wgt_..."] shortcode.', 'auto-poster-ai' ); ?></p> 457 </td> 458 </tr> 375 459 </table> 376 460 <?php submit_button(); ?> -
auto-poster-ai/tags/1.1.0/readme.txt
r3841390 r3843836 2 2 Contributors: autoposterai 3 3 Tags: social media, auto post, share, scheduler, social sharing 4 Requires at least: 6. 24 Requires at least: 6.3 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Automatically share new posts to your social media accounts throughAuto Poster AI.11 Automatically share new posts to your social media accounts and embed social feed widgets from Auto Poster AI. 12 12 13 13 == Description == … … 23 23 24 24 An Auto Poster AI account on a paid plan is required. 25 26 = Website widgets = 27 28 Show your social posts on your site with Auto Poster AI widgets. Create a widget in Auto Poster AI (Widgets), copy its ID, then: 29 30 * Add the **Auto Poster AI widget** block and paste the widget ID, or 31 * Use the shortcode `[autoposter_widget id="wgt_..."]` anywhere shortcodes work. 32 * For a floating widget, such as a chat button, on every page, enter its ID under Settings → Auto Poster AI → Floating widget ID. 33 34 Layout, theme and the "Powered by" badge are set in the widget's own settings in Auto Poster AI. 25 35 26 36 == Installation == … … 47 57 No. Only posts published after the plugin is set up. 48 58 59 = Do widgets need the API connection? = 60 61 No. The block and shortcode only need the widget ID; the widget's posts are loaded from Auto Poster AI in the visitor's browser. 62 49 63 = Why is the image missing? = 50 64 51 65 The featured image must be reachable from the internet. Images on local or password-protected sites cannot be fetched. 66 67 == Screenshots == 68 69 1. Share settings: pick the accounts and the message for new posts. 70 2. A social feed widget on a page. 71 3. A reviews widget with Google and Facebook reviews. 72 4. The Auto Poster AI widget block in the editor. 52 73 53 74 == External services == … … 59 80 * When a post of a selected content type is published, your API key, the post title, excerpt, permalink and featured image URL are sent to create the social post. 60 81 61 No data is sent until you click Connect or save an API key. The service is provided by Auto Poster AI: [Terms of Service](https://autoposter.ai/terms), [Privacy Policy](https://autoposter.ai/privacy). 82 Website widgets: when a page contains the Auto Poster AI widget block or the `[autoposter_widget]` shortcode, or a floating widget ID is set, the visitor's browser loads the widget script from https://cdn.autoposter.ai and the widget's posts from Auto Poster AI. The widget ID, the page's domain and anonymous view and click counts are sent to Auto Poster AI. No cookies are set. 83 84 No data is sent from WordPress until you click Connect or save an API key, and no widget script is loaded until you add a widget. The service is provided by Auto Poster AI: [Terms of Service](https://autoposter.ai/terms), [Privacy Policy](https://autoposter.ai/privacy). 62 85 63 86 == Changelog == 64 87 88 = 1.1.0 = 89 * New: Auto Poster AI widget block and `[autoposter_widget id="..."]` shortcode to embed social feed widgets. 90 * New: optional floating widget on every page. 91 * Requires WordPress 6.3 or later. 92 65 93 = 1.0.0 = 66 94 * Initial release. -
auto-poster-ai/trunk/auto-poster-ai.php
r3841390 r3843836 3 3 * Plugin Name: Auto Poster AI – Share Posts to Social Media 4 4 * Plugin URI: https://autoposter.ai/wordpress 5 * Description: Automatically share new posts to your social media accounts through Auto Poster AI.6 * Version: 1. 0.07 * Requires at least: 6. 25 * Description: Automatically share new posts to your social media accounts and embed Auto Poster AI social feed widgets. 6 * Version: 1.1.0 7 * Requires at least: 6.3 8 8 * Requires PHP: 7.4 9 9 * Author: Auto Poster AI … … 33 33 'post_types' => array( 'post' ), 34 34 'template' => "{title}\n\n{url}", 35 'floating' => '', 35 36 ) 36 37 ); … … 117 118 false 118 119 ); 120 } 121 } 122 123 /* ---------- Website widgets ---------- */ 124 125 const AUTOPOSTERAI_WIDGET_HOST_DEFAULT = 'https://cdn.autoposter.ai'; 126 127 // Override with the AUTOPOSTERAI_WIDGET_HOST constant or the autoposterai_widget_host filter (staging, dev). 128 function autoposterai_widget_host() { 129 $host = defined( 'AUTOPOSTERAI_WIDGET_HOST' ) ? AUTOPOSTERAI_WIDGET_HOST : AUTOPOSTERAI_WIDGET_HOST_DEFAULT; 130 return untrailingslashit( apply_filters( 'autoposterai_widget_host', $host ) ); 131 } 132 133 function autoposterai_widget_id( $id ) { 134 return preg_replace( '/[^A-Za-z0-9_-]/', '', (string) $id ); 135 } 136 137 function autoposterai_enqueue_embed() { 138 wp_enqueue_script( 139 'autoposterai-embed', 140 autoposterai_widget_host() . '/widgets/v1/embed.js', 141 array(), 142 null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- the CDN file is versioned by its /v1/ path. 143 array( 144 'in_footer' => true, 145 'strategy' => 'async', 146 ) 147 ); 148 } 149 150 // embed.js reads its host and the floating widget from its own script tag. 151 add_filter( 'script_loader_tag', 'autoposterai_embed_tag', 10, 2 ); 152 function autoposterai_embed_tag( $tag, $handle ) { 153 if ( 'autoposterai-embed' !== $handle ) { 154 return $tag; 155 } 156 $attrs = ''; 157 $host = autoposterai_widget_host(); 158 $floating = autoposterai_widget_id( autoposterai_settings()['floating'] ); 159 if ( AUTOPOSTERAI_WIDGET_HOST_DEFAULT !== $host ) { 160 $attrs .= ' data-apai-cdn="' . esc_attr( $host ) . '"'; 161 } 162 if ( $floating ) { 163 $attrs .= ' data-apai-floating="' . esc_attr( $floating ) . '"'; 164 } 165 return $attrs ? preg_replace( '/<script\b/', '<script' . $attrs, $tag, 1 ) : $tag; 166 } 167 168 add_shortcode( 'autoposter_widget', 'autoposterai_widget_shortcode' ); 169 function autoposterai_widget_shortcode( $atts ) { 170 $atts = shortcode_atts( array( 'id' => '' ), $atts, 'autoposter_widget' ); 171 $id = autoposterai_widget_id( $atts['id'] ); 172 if ( ! $id ) { 173 return ''; 174 } 175 autoposterai_enqueue_embed(); 176 return '<div data-apai-widget="' . esc_attr( $id ) . '"></div>'; 177 } 178 179 add_action( 'init', 'autoposterai_register_block' ); 180 function autoposterai_register_block() { 181 register_block_type( 182 __DIR__ . '/block', 183 array( 184 'render_callback' => static function ( $attributes ) { 185 return autoposterai_widget_shortcode( array( 'id' => isset( $attributes['widgetId'] ) ? $attributes['widgetId'] : '' ) ); 186 }, 187 ) 188 ); 189 } 190 191 add_action( 'wp_enqueue_scripts', 'autoposterai_enqueue_floating' ); 192 function autoposterai_enqueue_floating() { 193 if ( autoposterai_settings()['floating'] ) { 194 autoposterai_enqueue_embed(); 119 195 } 120 196 } … … 258 334 'post_types' => array_values( array_filter( $list( 'post_types' ), 'post_type_exists' ) ), 259 335 'template' => isset( $input['template'] ) ? sanitize_textarea_field( $input['template'] ) : '', 336 'floating' => isset( $input['floating'] ) ? autoposterai_widget_id( $input['floating'] ) : '', 260 337 ); 261 338 } … … 373 450 </td> 374 451 </tr> 452 <tr> 453 <th scope="row"><label for="autoposterai-floating"><?php esc_html_e( 'Floating widget ID', 'auto-poster-ai' ); ?></label></th> 454 <td> 455 <input id="autoposterai-floating" type="text" class="regular-text" placeholder="wgt_..." name="<?php echo esc_attr( $name ); ?>[floating]" value="<?php echo esc_attr( $settings['floating'] ); ?>"> 456 <p class="description"><?php esc_html_e( 'Optional. Shows a floating widget, such as a chat button, on every page of your site. To place a feed inside a page, use the Auto Poster AI widget block or the [autoposter_widget id="wgt_..."] shortcode.', 'auto-poster-ai' ); ?></p> 457 </td> 458 </tr> 375 459 </table> 376 460 <?php submit_button(); ?> -
auto-poster-ai/trunk/readme.txt
r3841390 r3843836 2 2 Contributors: autoposterai 3 3 Tags: social media, auto post, share, scheduler, social sharing 4 Requires at least: 6. 24 Requires at least: 6.3 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Automatically share new posts to your social media accounts throughAuto Poster AI.11 Automatically share new posts to your social media accounts and embed social feed widgets from Auto Poster AI. 12 12 13 13 == Description == … … 23 23 24 24 An Auto Poster AI account on a paid plan is required. 25 26 = Website widgets = 27 28 Show your social posts on your site with Auto Poster AI widgets. Create a widget in Auto Poster AI (Widgets), copy its ID, then: 29 30 * Add the **Auto Poster AI widget** block and paste the widget ID, or 31 * Use the shortcode `[autoposter_widget id="wgt_..."]` anywhere shortcodes work. 32 * For a floating widget, such as a chat button, on every page, enter its ID under Settings → Auto Poster AI → Floating widget ID. 33 34 Layout, theme and the "Powered by" badge are set in the widget's own settings in Auto Poster AI. 25 35 26 36 == Installation == … … 47 57 No. Only posts published after the plugin is set up. 48 58 59 = Do widgets need the API connection? = 60 61 No. The block and shortcode only need the widget ID; the widget's posts are loaded from Auto Poster AI in the visitor's browser. 62 49 63 = Why is the image missing? = 50 64 51 65 The featured image must be reachable from the internet. Images on local or password-protected sites cannot be fetched. 66 67 == Screenshots == 68 69 1. Share settings: pick the accounts and the message for new posts. 70 2. A social feed widget on a page. 71 3. A reviews widget with Google and Facebook reviews. 72 4. The Auto Poster AI widget block in the editor. 52 73 53 74 == External services == … … 59 80 * When a post of a selected content type is published, your API key, the post title, excerpt, permalink and featured image URL are sent to create the social post. 60 81 61 No data is sent until you click Connect or save an API key. The service is provided by Auto Poster AI: [Terms of Service](https://autoposter.ai/terms), [Privacy Policy](https://autoposter.ai/privacy). 82 Website widgets: when a page contains the Auto Poster AI widget block or the `[autoposter_widget]` shortcode, or a floating widget ID is set, the visitor's browser loads the widget script from https://cdn.autoposter.ai and the widget's posts from Auto Poster AI. The widget ID, the page's domain and anonymous view and click counts are sent to Auto Poster AI. No cookies are set. 83 84 No data is sent from WordPress until you click Connect or save an API key, and no widget script is loaded until you add a widget. The service is provided by Auto Poster AI: [Terms of Service](https://autoposter.ai/terms), [Privacy Policy](https://autoposter.ai/privacy). 62 85 63 86 == Changelog == 64 87 88 = 1.1.0 = 89 * New: Auto Poster AI widget block and `[autoposter_widget id="..."]` shortcode to embed social feed widgets. 90 * New: optional floating widget on every page. 91 * Requires WordPress 6.3 or later. 92 65 93 = 1.0.0 = 66 94 * Initial release.
Note:
See TracChangeset
for help on using the changeset viewer.