Plugin Directory

Changeset 2909567

Timestamp:
05/08/2023 02:29:39 PM (15 months ago)
Author:
antonlukin
Message:

Update to version 1.3.0 from GitHub

Location:
social-planner
Files:
2 added
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • social-planner/tags/1.3.0/classes/class-core.php

    r2907612 r2909567  
    5454            'Social_Planner\Network_Facebook'   => SOCIAL_PLANNER_DIR . '/networks/class-network-facebook.php',
    5555            'Social_Planner\Network_OK'         => SOCIAL_PLANNER_DIR . '/networks/class-network-ok.php',
     56
    5657        );
    5758
  • social-planner/tags/1.3.0/networks/class-network-facebook.php

    r2903429 r2909567  
    9494        }
    9595
    96         // Get API URL using group id from settings.
    97         $url = 'https://graph.facebook.com/v9.0/' . $settings['group'];
     96        // Get API URL using group id from settings.
     97        $ = 'https://graph.facebook.com/v9.0/' . $settings['group'];
    9898
    9999        if ( empty( $settings['token'] ) ) {
     
    101101        }
    102102
    103         $response = self::make_request( $message, $url, $settings['token'] );
     103        $response = self::make_request( $message, $, $settings['token'] );
    104104
    105105        if ( is_wp_error( $response ) ) {
     
    128128     *
    129129     * @param array  $message Message data.
    130      * @param string $url     Remote API URL.
     130     * @param string $.
    131131     * @param string $token   Access token from settings.
    132132     */
    133     private static function make_request( $message, $url, $token ) {
     133    private static function make_request( $message, $, $token ) {
    134134        $body = array(
    135135            'access_token' => $token,
     
    143143
    144144        if ( ! empty( $message['poster'] ) ) {
    145             return self::send_poster( $message['poster'], $url, $excerpt, $body );
     145            return self::send_poster( $message['poster'], $, $excerpt, $body );
    146146        }
    147147
     
    151151
    152152        $body['message'] = $excerpt;
     153
     154
     155
    153156
    154157        /**
     
    158161         * @param array  $message Message data.
    159162         * @param string $network Network name.
     163
    160164         *
    161165         * @since 1.1.12
     166
    162167         */
    163         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    164 
    165         return self::send_request( $url . '/feed', $body );
     168        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     169
     170        return self::send_request( $url, $body );
    166171    }
    167172
     
    193198        );
    194199
    195         return self::send_request( $url . '/photos', $body, $headers );
     200        /**
     201         * Filter request body arguments using message data.
     202         *
     203         * @param string $body    Request body arguments.
     204         * @param array  $message Message data.
     205         * @param string $network Network name.
     206         * @param string $url     Remote API URL.
     207         *
     208         * @since 1.3.0
     209         */
     210        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     211
     212        return self::send_request( $url, $body, $headers );
    196213    }
    197214
  • social-planner/tags/1.3.0/networks/class-network-ok.php

    r2903429 r2909567  
    191191         * @param array  $message Message data.
    192192         * @param string $network Network name.
     193
    193194         *
    194195         * @since 1.1.12
     196
    195197         */
    196         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     198        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    197199
    198200        return self::send_request( $url, $body );
  • social-planner/tags/1.3.0/networks/class-network-telegram.php

    r2903429 r2909567  
    9797
    9898        // Get API URL using bot token from settings.
    99         $url = 'https://api.telegram.org/bot' . $settings['token'];
     99        $ = 'https://api.telegram.org/bot' . $settings['token'];
    100100
    101101        if ( empty( $settings['group'] ) ) {
     
    103103        }
    104104
    105         $response = self::make_request( $message, $url, $settings['group'] );
     105        $response = self::make_request( $message, $, $settings['group'] );
    106106
    107107        if ( is_wp_error( $response ) ) {
     
    140140     *
    141141     * @param array  $message List of message args.
    142      * @param string $url     Remote API URL.
     142     * @param string $.
    143143     * @param string $group   Group ID.
    144144     */
    145     private static function make_request( $message, $url, $group ) {
     145    private static function make_request( $message, $, $group ) {
    146146        $body = array(
    147147            'parse_mode' => 'HTML',
     
    156156
    157157        if ( ! empty( $message['poster'] ) ) {
    158             return self::send_poster( $message['poster'], $url, $excerpt, $body );
     158            return self::send_poster( $message['poster'], $, $excerpt, $body );
    159159        }
    160160
     
    164164
    165165        $body['text'] = $excerpt;
     166
     167
     168
    166169
    167170        /**
     
    171174         * @param array  $message Message data.
    172175         * @param string $network Network name.
     176
    173177         *
    174178         * @since 1.1.12
     179
    175180         */
    176         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    177 
    178         return self::send_request( $url . '/sendMessage', $body );
     181        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     182
     183        return self::send_request( $url, $body );
    179184    }
    180185
     
    183188     *
    184189     * @param string $poster  Path to local image file.
    185      * @param string $url     Remote API URL.
     190     * @param string $.
    186191     * @param string $excerpt Prepared caption for poster.
    187192     * @param array  $body    Prepared body array.
    188193     */
    189     private static function send_poster( $poster, $url, $excerpt, $body ) {
     194    private static function send_poster( $poster, $, $excerpt, $body ) {
    190195        $boundary = uniqid( 'wp', true );
    191196
     
    206211        );
    207212
    208         return self::send_request( $url . '/sendPhoto', $body, $headers );
     213        $url = $path . '/sendPhoto';
     214
     215        /**
     216         * Filter request body arguments using message data.
     217         *
     218         * @param string $body    Request body arguments.
     219         * @param array  $message Message data.
     220         * @param string $network Network name.
     221         * @param string $url     Remote API URL.
     222         *
     223         * @since 1.3.0
     224         */
     225        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     226
     227        return self::send_request( $url, $body, $headers );
    209228    }
    210229
  • social-planner/tags/1.3.0/networks/class-network-twitter-v2.php

    r2907612 r2909567  
    181181         * @param array  $message Message data.
    182182         * @param string $network Network name.
    183          *
    184          * @since 1.1.12
     183         * @param string $url     Remote API URL.
     184         *
     185         * @since 1.2.0
     186         * @version 1.3.0
    185187         */
    186         $body = apply_filters( 'social_planner_filter_request_body', wp_json_encode( $body ), $message, self::NETWORK_NAME );
     188        $body = apply_filters( 'social_planner_filter_request_body', wp_json_encode( $body ), $message, self::NETWORK_NAME );
    187189
    188190        return self::send_request( $url, $body, $headers );
  • social-planner/tags/1.3.0/networks/class-network-twitter.php

    r2907612 r2909567  
    187187         * @param array  $message Message data.
    188188         * @param string $network Network name.
     189
    189190         *
    190191         * @since 1.1.12
     192
    191193         */
    192         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     194        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    193195
    194196        return self::send_request( $url, $body, $headers );
  • social-planner/tags/1.3.0/networks/class-network-vk.php

    r2903429 r2909567  
    159159        );
    160160
     161
     162
    161163        /**
    162164         * Filter request body arguments using message data.
     
    165167         * @param array  $message Message data.
    166168         * @param string $network Network name.
     169
    167170         *
    168171         * @since 1.1.12
     172
    169173         */
    170         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    171 
    172         // Publish message.
    173         return self::send_request( 'https://api.vk.com/method/wall.post', $body );
     174        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     175
     176        return self::send_request( $url, $body );
    174177    }
    175178
  • social-planner/tags/1.3.0/readme.txt

    r2907612 r2909567  
    55Requires at least: 5.3
    66Tested up to: 6.2
    7 Stable tag: 1.2.0
     7Stable tag: 1..0
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    5151== Changelog ==
    5252
     53
     54
     55
     56
    5357= 1.2.0 =
    5458* Adding new provider for Twitter API v2.
  • social-planner/tags/1.3.0/social-planner.php

    r2907612 r2909567  
    77 * Author URI: https://wpset.org
    88 * Requires at least: 5.3
    9  * Tested up to: 5.8
    10  * Version: 1.2.0
     9 * Tested up to:
     10 * Version: 1..0
    1111 *
    1212 * Text Domain: social-planner
     
    2828 * Plugin version.
    2929 */
    30 define( 'SOCIAL_PLANNER_VERSION', '1.1.12' );
     30define( 'SOCIAL_PLANNER_VERSION', '1.' );
    3131
    3232/**
  • social-planner/trunk/classes/class-core.php

    r2907612 r2909567  
    5454            'Social_Planner\Network_Facebook'   => SOCIAL_PLANNER_DIR . '/networks/class-network-facebook.php',
    5555            'Social_Planner\Network_OK'         => SOCIAL_PLANNER_DIR . '/networks/class-network-ok.php',
     56
    5657        );
    5758
  • social-planner/trunk/networks/class-network-facebook.php

    r2903429 r2909567  
    9494        }
    9595
    96         // Get API URL using group id from settings.
    97         $url = 'https://graph.facebook.com/v9.0/' . $settings['group'];
     96        // Get API URL using group id from settings.
     97        $ = 'https://graph.facebook.com/v9.0/' . $settings['group'];
    9898
    9999        if ( empty( $settings['token'] ) ) {
     
    101101        }
    102102
    103         $response = self::make_request( $message, $url, $settings['token'] );
     103        $response = self::make_request( $message, $, $settings['token'] );
    104104
    105105        if ( is_wp_error( $response ) ) {
     
    128128     *
    129129     * @param array  $message Message data.
    130      * @param string $url     Remote API URL.
     130     * @param string $.
    131131     * @param string $token   Access token from settings.
    132132     */
    133     private static function make_request( $message, $url, $token ) {
     133    private static function make_request( $message, $, $token ) {
    134134        $body = array(
    135135            'access_token' => $token,
     
    143143
    144144        if ( ! empty( $message['poster'] ) ) {
    145             return self::send_poster( $message['poster'], $url, $excerpt, $body );
     145            return self::send_poster( $message['poster'], $, $excerpt, $body );
    146146        }
    147147
     
    151151
    152152        $body['message'] = $excerpt;
     153
     154
     155
    153156
    154157        /**
     
    158161         * @param array  $message Message data.
    159162         * @param string $network Network name.
     163
    160164         *
    161165         * @since 1.1.12
     166
    162167         */
    163         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    164 
    165         return self::send_request( $url . '/feed', $body );
     168        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     169
     170        return self::send_request( $url, $body );
    166171    }
    167172
     
    193198        );
    194199
    195         return self::send_request( $url . '/photos', $body, $headers );
     200        /**
     201         * Filter request body arguments using message data.
     202         *
     203         * @param string $body    Request body arguments.
     204         * @param array  $message Message data.
     205         * @param string $network Network name.
     206         * @param string $url     Remote API URL.
     207         *
     208         * @since 1.3.0
     209         */
     210        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     211
     212        return self::send_request( $url, $body, $headers );
    196213    }
    197214
  • social-planner/trunk/networks/class-network-ok.php

    r2903429 r2909567  
    191191         * @param array  $message Message data.
    192192         * @param string $network Network name.
     193
    193194         *
    194195         * @since 1.1.12
     196
    195197         */
    196         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     198        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    197199
    198200        return self::send_request( $url, $body );
  • social-planner/trunk/networks/class-network-telegram.php

    r2903429 r2909567  
    9797
    9898        // Get API URL using bot token from settings.
    99         $url = 'https://api.telegram.org/bot' . $settings['token'];
     99        $ = 'https://api.telegram.org/bot' . $settings['token'];
    100100
    101101        if ( empty( $settings['group'] ) ) {
     
    103103        }
    104104
    105         $response = self::make_request( $message, $url, $settings['group'] );
     105        $response = self::make_request( $message, $, $settings['group'] );
    106106
    107107        if ( is_wp_error( $response ) ) {
     
    140140     *
    141141     * @param array  $message List of message args.
    142      * @param string $url     Remote API URL.
     142     * @param string $.
    143143     * @param string $group   Group ID.
    144144     */
    145     private static function make_request( $message, $url, $group ) {
     145    private static function make_request( $message, $, $group ) {
    146146        $body = array(
    147147            'parse_mode' => 'HTML',
     
    156156
    157157        if ( ! empty( $message['poster'] ) ) {
    158             return self::send_poster( $message['poster'], $url, $excerpt, $body );
     158            return self::send_poster( $message['poster'], $, $excerpt, $body );
    159159        }
    160160
     
    164164
    165165        $body['text'] = $excerpt;
     166
     167
     168
    166169
    167170        /**
     
    171174         * @param array  $message Message data.
    172175         * @param string $network Network name.
     176
    173177         *
    174178         * @since 1.1.12
     179
    175180         */
    176         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    177 
    178         return self::send_request( $url . '/sendMessage', $body );
     181        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     182
     183        return self::send_request( $url, $body );
    179184    }
    180185
     
    183188     *
    184189     * @param string $poster  Path to local image file.
    185      * @param string $url     Remote API URL.
     190     * @param string $.
    186191     * @param string $excerpt Prepared caption for poster.
    187192     * @param array  $body    Prepared body array.
    188193     */
    189     private static function send_poster( $poster, $url, $excerpt, $body ) {
     194    private static function send_poster( $poster, $, $excerpt, $body ) {
    190195        $boundary = uniqid( 'wp', true );
    191196
     
    206211        );
    207212
    208         return self::send_request( $url . '/sendPhoto', $body, $headers );
     213        $url = $path . '/sendPhoto';
     214
     215        /**
     216         * Filter request body arguments using message data.
     217         *
     218         * @param string $body    Request body arguments.
     219         * @param array  $message Message data.
     220         * @param string $network Network name.
     221         * @param string $url     Remote API URL.
     222         *
     223         * @since 1.3.0
     224         */
     225        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     226
     227        return self::send_request( $url, $body, $headers );
    209228    }
    210229
  • social-planner/trunk/networks/class-network-twitter-v2.php

    r2907612 r2909567  
    181181         * @param array  $message Message data.
    182182         * @param string $network Network name.
    183          *
    184          * @since 1.1.12
     183         * @param string $url     Remote API URL.
     184         *
     185         * @since 1.2.0
     186         * @version 1.3.0
    185187         */
    186         $body = apply_filters( 'social_planner_filter_request_body', wp_json_encode( $body ), $message, self::NETWORK_NAME );
     188        $body = apply_filters( 'social_planner_filter_request_body', wp_json_encode( $body ), $message, self::NETWORK_NAME );
    187189
    188190        return self::send_request( $url, $body, $headers );
  • social-planner/trunk/networks/class-network-twitter.php

    r2907612 r2909567  
    187187         * @param array  $message Message data.
    188188         * @param string $network Network name.
     189
    189190         *
    190191         * @since 1.1.12
     192
    191193         */
    192         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
     194        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    193195
    194196        return self::send_request( $url, $body, $headers );
  • social-planner/trunk/networks/class-network-vk.php

    r2903429 r2909567  
    159159        );
    160160
     161
     162
    161163        /**
    162164         * Filter request body arguments using message data.
     
    165167         * @param array  $message Message data.
    166168         * @param string $network Network name.
     169
    167170         *
    168171         * @since 1.1.12
     172
    169173         */
    170         $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME );
    171 
    172         // Publish message.
    173         return self::send_request( 'https://api.vk.com/method/wall.post', $body );
     174        $body = apply_filters( 'social_planner_filter_request_body', $body, $message, self::NETWORK_NAME, $url );
     175
     176        return self::send_request( $url, $body );
    174177    }
    175178
  • social-planner/trunk/readme.txt

    r2907612 r2909567  
    55Requires at least: 5.3
    66Tested up to: 6.2
    7 Stable tag: 1.2.0
     7Stable tag: 1..0
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    5151== Changelog ==
    5252
     53
     54
     55
     56
    5357= 1.2.0 =
    5458* Adding new provider for Twitter API v2.
  • social-planner/trunk/social-planner.php

    r2907612 r2909567  
    77 * Author URI: https://wpset.org
    88 * Requires at least: 5.3
    9  * Tested up to: 5.8
    10  * Version: 1.2.0
     9 * Tested up to:
     10 * Version: 1..0
    1111 *
    1212 * Text Domain: social-planner
     
    2828 * Plugin version.
    2929 */
    30 define( 'SOCIAL_PLANNER_VERSION', '1.1.12' );
     30define( 'SOCIAL_PLANNER_VERSION', '1.' );
    3131
    3232/**
Note: See TracChangeset for help on using the changeset viewer.