Plugin Directory

Changeset 3449195


Ignore:
Timestamp:
01/29/2026 04:23:52 AM (2 months ago)
Author:
socialpostflow
Message:

Update to version 1.2.1 from GitHub

Location:
social-post-flow
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • social-post-flow/tags/1.2.1/includes/class-social-post-flow-admin.php

    r3447070 r3449195  
    5555
    5656        // If a code is included in the request, exchange it for an access token.
    57         if ( ! filter_has_var( INPUT_GET, 'code' ) ) {
     57        if ( ! filter_has_var( INPUT_GET, 'social-post-flow-code' ) ) {
    5858            return;
    5959        }
     
    6363
    6464        // Sanitize token.
    65         $authorization_code = filter_input( INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     65        $authorization_code = filter_input( INPUT_GET, 'social-post-flow-code', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    6666
    6767        // Exchange the authorization code and verifier for an access token.
  • social-post-flow/tags/1.2.1/includes/class-social-post-flow-publish.php

    r3398057 r3449195  
    26762676
    26772677    /**
    2678      * Parses the status' Google Business configuration to return an array of compatible
    2679      * arguments that can be used to send the status.
    2680      *
    2681      * @since   1.0.0
    2682      *
    2683      * @param   WP_Post $post               Post.
    2684      * @param   array   $status             Status.
    2685      * @return  bool|array                  Google Business Profile status configuration
    2686      */
    2687     public function parse_google_business( $post, $status ) {
    2688 
    2689         // Bail if no Google Business configuration exists in the status.
    2690         if ( ! isset( $status['googlebusiness'] ) ) {
    2691             return false;
    2692         }
    2693         if ( ! is_array( $status['googlebusiness'] ) ) {
    2694             return false;
    2695         }
    2696         if ( ! isset( $status['googlebusiness']['post_type'] ) ) {
    2697             return false;
    2698         }
    2699 
    2700         // Start building arguments.
    2701         $google_business_args = array(
    2702             'post_type' => $status['googlebusiness']['post_type'],
    2703             'link'      => $this->get_permalink( $post ),
    2704         );
    2705 
    2706         // Depending on the Google Business Post Type, build arguments.
    2707         switch ( $status['googlebusiness']['post_type'] ) {
    2708             case 'offer':
    2709             case 'event':
    2710                 // Title.
    2711                 $google_business_args['title'] = $this->parse_text( $post, $status['googlebusiness']['title'] );
    2712 
    2713                 // Code and Terms: Offers.
    2714                 if ( $status['googlebusiness']['post_type'] === 'offer' ) {
    2715                     $google_business_args = array_merge(
    2716                         $google_business_args,
    2717                         array(
    2718                             'code'  => $this->parse_text( $post, $status['googlebusiness']['code'] ),
    2719                             'terms' => $this->parse_text( $post, $status['googlebusiness']['terms'] ),
    2720                         )
    2721                     );
    2722                 } else {
    2723                     // Event: Button.
    2724                     $google_business_args['cta'] = $status['googlebusiness']['cta'];
    2725                 }
    2726 
    2727                 // Start Date.
    2728                 switch ( $status['googlebusiness']['start_date_option'] ) {
    2729                     /**
    2730                      * Custom Post Meta
    2731                      */
    2732                     case 'custom':
    2733                         // Fetch the Post's Meta Value based on the given Custom Field Key.
    2734                         $date = get_post_meta( $post->ID, $status['googlebusiness']['start_date'], true );
    2735 
    2736                         // If the post date is numeric, it's most likely a timestamp
    2737                         // Convert it to a date and time.
    2738                         if ( is_numeric( $date ) ) {
    2739                             $date = date( 'Y-m-d H:i:s', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2740                         }
    2741 
    2742                         // Set start date.
    2743                         $google_business_args['start_date'] = strtotime( $date );
    2744                         $google_business_args['start_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2745                         break;
    2746 
    2747                     /**
    2748                      * None
    2749                      */
    2750                     case '':
    2751                         break;
    2752 
    2753                     /**
    2754                      * Third Party integrations
    2755                      */
    2756                     default:
    2757                         $date = false;
    2758 
    2759                         /**
    2760                          * Allows integrations to define the status' start date for a Google Business Profile Offer or Event.
    2761                          *
    2762                          * @since   1.0.0
    2763                          *
    2764                          * @param   bool|string $date                   Date (yyyy-mm-dd hh:mm:ss format).
    2765                          * @param   array       $google_business_args   Google Business specific arguments for status.
    2766                          * @param   array       $status                 Status.
    2767                          * @param   WP_Post     $post                   WordPress Post.
    2768                          */
    2769                         $date = apply_filters( 'social_post_flow_publish_parse_google_business_start_date_' . $status['googlebusiness']['start_date_option'], $date, $google_business_args, $status, $post );
    2770 
    2771                         // Ignore if no date defined.
    2772                         if ( ! $date ) {
    2773                             break;
    2774                         }
    2775 
    2776                         // Set start date.
    2777                         $google_business_args['start_date'] = strtotime( $date );
    2778                         $google_business_args['start_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2779                         break;
    2780                 }
    2781 
    2782                 // End Date.
    2783                 switch ( $status['googlebusiness']['end_date_option'] ) {
    2784                     /**
    2785                      * Custom Post Meta
    2786                      */
    2787                     case 'custom':
    2788                         // Fetch the Post's Meta Value based on the given Custom Field Key.
    2789                         $date = get_post_meta( $post->ID, $status['googlebusiness']['end_date'], true );
    2790 
    2791                         // If the post date is numeric, it's most likely a timestamp
    2792                         // Convert it to a date and time.
    2793                         if ( is_numeric( $date ) ) {
    2794                             $date = date( 'Y-m-d H:i:s', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2795                         }
    2796 
    2797                         // Set end date.
    2798                         $google_business_args['end_date'] = strtotime( $date );
    2799                         $google_business_args['end_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2800                         break;
    2801 
    2802                     /**
    2803                      * None
    2804                      */
    2805                     case '':
    2806                         break;
    2807 
    2808                     /**
    2809                      * Third Party integrations
    2810                      */
    2811                     default:
    2812                         $date = false;
    2813 
    2814                         /**
    2815                          * Allows integrations to define the status' end date for a Google Business Profile Offer or Event.
    2816                          *
    2817                          * @since   1.0.0
    2818                          *
    2819                          * @param   bool|string $date                   Date (yyyy-mm-dd hh:mm:ss format).
    2820                          * @param   array       $google_business_args   Google Business specific arguments for status.
    2821                          * @param   array       $status                 Status.
    2822                          * @param   WP_Post     $post                   WordPress Post.
    2823                          */
    2824                         $date = apply_filters( 'social_post_flow_publish_parse_google_business_end_date_' . $status['googlebusiness']['end_date_option'], $date, $google_business_args, $status, $post );
    2825 
    2826                         // Ignore if no date defined.
    2827                         if ( ! $date ) {
    2828                             break;
    2829                         }
    2830 
    2831                         // Set end date.
    2832                         $google_business_args['end_date'] = strtotime( $date );
    2833                         $google_business_args['end_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2834                         break;
    2835                 }
    2836                 break;
    2837 
    2838             case 'whats_new':
    2839             default:
    2840                 $google_business_args['cta'] = $status['googlebusiness']['cta'];
    2841                 break;
    2842         }
    2843 
    2844         return $google_business_args;
    2845 
    2846     }
    2847 
    2848     /**
    28492678     * Returns default tag parameters for the given tag e.g. {title:transformation(args)} or {title}.
    28502679     *
  • social-post-flow/tags/1.2.1/readme.txt

    r3447070 r3449195  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.2.0
     8Stable tag: 1.2.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    443443== Changelog ==
    444444
     445= 1.2.1 (2026-01-29) =
     446* Fix: Authorization: Improved reliability of authorization by using unique code identifier
     447
    445448= 1.2.0 (2026-01-26) =
    446449* Added: TikTok support
  • social-post-flow/tags/1.2.1/social-post-flow.php

    r3447070 r3449195  
    99 * Plugin Name: Social Post Flow
    1010 * Plugin URI: http://www.socialpostflow.com/integrations/wordpress
    11  * Version: 1.2.0
     11 * Version: 1.2.1
    1212 * Author: Social Post Flow
    1313 * Author URI: http://www.socialpostflow.com
     
    2828
    2929// Define Plugin version and build date.
    30 define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.2.0' );
    31 define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-01-26 20:00:00' );
     30define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.2.1' );
     31define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-01-29 13:00:00' );
    3232
    3333// Define Plugin paths.
  • social-post-flow/trunk/includes/class-social-post-flow-admin.php

    r3447070 r3449195  
    5555
    5656        // If a code is included in the request, exchange it for an access token.
    57         if ( ! filter_has_var( INPUT_GET, 'code' ) ) {
     57        if ( ! filter_has_var( INPUT_GET, 'social-post-flow-code' ) ) {
    5858            return;
    5959        }
     
    6363
    6464        // Sanitize token.
    65         $authorization_code = filter_input( INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
     65        $authorization_code = filter_input( INPUT_GET, 'social-post-flow-code', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    6666
    6767        // Exchange the authorization code and verifier for an access token.
  • social-post-flow/trunk/includes/class-social-post-flow-publish.php

    r3398057 r3449195  
    26762676
    26772677    /**
    2678      * Parses the status' Google Business configuration to return an array of compatible
    2679      * arguments that can be used to send the status.
    2680      *
    2681      * @since   1.0.0
    2682      *
    2683      * @param   WP_Post $post               Post.
    2684      * @param   array   $status             Status.
    2685      * @return  bool|array                  Google Business Profile status configuration
    2686      */
    2687     public function parse_google_business( $post, $status ) {
    2688 
    2689         // Bail if no Google Business configuration exists in the status.
    2690         if ( ! isset( $status['googlebusiness'] ) ) {
    2691             return false;
    2692         }
    2693         if ( ! is_array( $status['googlebusiness'] ) ) {
    2694             return false;
    2695         }
    2696         if ( ! isset( $status['googlebusiness']['post_type'] ) ) {
    2697             return false;
    2698         }
    2699 
    2700         // Start building arguments.
    2701         $google_business_args = array(
    2702             'post_type' => $status['googlebusiness']['post_type'],
    2703             'link'      => $this->get_permalink( $post ),
    2704         );
    2705 
    2706         // Depending on the Google Business Post Type, build arguments.
    2707         switch ( $status['googlebusiness']['post_type'] ) {
    2708             case 'offer':
    2709             case 'event':
    2710                 // Title.
    2711                 $google_business_args['title'] = $this->parse_text( $post, $status['googlebusiness']['title'] );
    2712 
    2713                 // Code and Terms: Offers.
    2714                 if ( $status['googlebusiness']['post_type'] === 'offer' ) {
    2715                     $google_business_args = array_merge(
    2716                         $google_business_args,
    2717                         array(
    2718                             'code'  => $this->parse_text( $post, $status['googlebusiness']['code'] ),
    2719                             'terms' => $this->parse_text( $post, $status['googlebusiness']['terms'] ),
    2720                         )
    2721                     );
    2722                 } else {
    2723                     // Event: Button.
    2724                     $google_business_args['cta'] = $status['googlebusiness']['cta'];
    2725                 }
    2726 
    2727                 // Start Date.
    2728                 switch ( $status['googlebusiness']['start_date_option'] ) {
    2729                     /**
    2730                      * Custom Post Meta
    2731                      */
    2732                     case 'custom':
    2733                         // Fetch the Post's Meta Value based on the given Custom Field Key.
    2734                         $date = get_post_meta( $post->ID, $status['googlebusiness']['start_date'], true );
    2735 
    2736                         // If the post date is numeric, it's most likely a timestamp
    2737                         // Convert it to a date and time.
    2738                         if ( is_numeric( $date ) ) {
    2739                             $date = date( 'Y-m-d H:i:s', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2740                         }
    2741 
    2742                         // Set start date.
    2743                         $google_business_args['start_date'] = strtotime( $date );
    2744                         $google_business_args['start_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2745                         break;
    2746 
    2747                     /**
    2748                      * None
    2749                      */
    2750                     case '':
    2751                         break;
    2752 
    2753                     /**
    2754                      * Third Party integrations
    2755                      */
    2756                     default:
    2757                         $date = false;
    2758 
    2759                         /**
    2760                          * Allows integrations to define the status' start date for a Google Business Profile Offer or Event.
    2761                          *
    2762                          * @since   1.0.0
    2763                          *
    2764                          * @param   bool|string $date                   Date (yyyy-mm-dd hh:mm:ss format).
    2765                          * @param   array       $google_business_args   Google Business specific arguments for status.
    2766                          * @param   array       $status                 Status.
    2767                          * @param   WP_Post     $post                   WordPress Post.
    2768                          */
    2769                         $date = apply_filters( 'social_post_flow_publish_parse_google_business_start_date_' . $status['googlebusiness']['start_date_option'], $date, $google_business_args, $status, $post );
    2770 
    2771                         // Ignore if no date defined.
    2772                         if ( ! $date ) {
    2773                             break;
    2774                         }
    2775 
    2776                         // Set start date.
    2777                         $google_business_args['start_date'] = strtotime( $date );
    2778                         $google_business_args['start_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2779                         break;
    2780                 }
    2781 
    2782                 // End Date.
    2783                 switch ( $status['googlebusiness']['end_date_option'] ) {
    2784                     /**
    2785                      * Custom Post Meta
    2786                      */
    2787                     case 'custom':
    2788                         // Fetch the Post's Meta Value based on the given Custom Field Key.
    2789                         $date = get_post_meta( $post->ID, $status['googlebusiness']['end_date'], true );
    2790 
    2791                         // If the post date is numeric, it's most likely a timestamp
    2792                         // Convert it to a date and time.
    2793                         if ( is_numeric( $date ) ) {
    2794                             $date = date( 'Y-m-d H:i:s', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2795                         }
    2796 
    2797                         // Set end date.
    2798                         $google_business_args['end_date'] = strtotime( $date );
    2799                         $google_business_args['end_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2800                         break;
    2801 
    2802                     /**
    2803                      * None
    2804                      */
    2805                     case '':
    2806                         break;
    2807 
    2808                     /**
    2809                      * Third Party integrations
    2810                      */
    2811                     default:
    2812                         $date = false;
    2813 
    2814                         /**
    2815                          * Allows integrations to define the status' end date for a Google Business Profile Offer or Event.
    2816                          *
    2817                          * @since   1.0.0
    2818                          *
    2819                          * @param   bool|string $date                   Date (yyyy-mm-dd hh:mm:ss format).
    2820                          * @param   array       $google_business_args   Google Business specific arguments for status.
    2821                          * @param   array       $status                 Status.
    2822                          * @param   WP_Post     $post                   WordPress Post.
    2823                          */
    2824                         $date = apply_filters( 'social_post_flow_publish_parse_google_business_end_date_' . $status['googlebusiness']['end_date_option'], $date, $google_business_args, $status, $post );
    2825 
    2826                         // Ignore if no date defined.
    2827                         if ( ! $date ) {
    2828                             break;
    2829                         }
    2830 
    2831                         // Set end date.
    2832                         $google_business_args['end_date'] = strtotime( $date );
    2833                         $google_business_args['end_time'] = date( 'H:i', strtotime( $date ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    2834                         break;
    2835                 }
    2836                 break;
    2837 
    2838             case 'whats_new':
    2839             default:
    2840                 $google_business_args['cta'] = $status['googlebusiness']['cta'];
    2841                 break;
    2842         }
    2843 
    2844         return $google_business_args;
    2845 
    2846     }
    2847 
    2848     /**
    28492678     * Returns default tag parameters for the given tag e.g. {title:transformation(args)} or {title}.
    28502679     *
  • social-post-flow/trunk/readme.txt

    r3447070 r3449195  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.2.0
     8Stable tag: 1.2.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    443443== Changelog ==
    444444
     445= 1.2.1 (2026-01-29) =
     446* Fix: Authorization: Improved reliability of authorization by using unique code identifier
     447
    445448= 1.2.0 (2026-01-26) =
    446449* Added: TikTok support
  • social-post-flow/trunk/social-post-flow.php

    r3447070 r3449195  
    99 * Plugin Name: Social Post Flow
    1010 * Plugin URI: http://www.socialpostflow.com/integrations/wordpress
    11  * Version: 1.2.0
     11 * Version: 1.2.1
    1212 * Author: Social Post Flow
    1313 * Author URI: http://www.socialpostflow.com
     
    2828
    2929// Define Plugin version and build date.
    30 define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.2.0' );
    31 define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-01-26 20:00:00' );
     30define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.2.1' );
     31define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-01-29 13:00:00' );
    3232
    3333// Define Plugin paths.
Note: See TracChangeset for help on using the changeset viewer.