Changeset 2909567
- Timestamp:
- 05/08/2023 02:29:39 PM (15 months ago)
- 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 54 54 'Social_Planner\Network_Facebook' => SOCIAL_PLANNER_DIR . '/networks/class-network-facebook.php', 55 55 'Social_Planner\Network_OK' => SOCIAL_PLANNER_DIR . '/networks/class-network-ok.php', 56 56 57 ); 57 58 -
social-planner/tags/1.3.0/networks/class-network-facebook.php
r2903429 r2909567 94 94 } 95 95 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']; 98 98 99 99 if ( empty( $settings['token'] ) ) { … … 101 101 } 102 102 103 $response = self::make_request( $message, $ url, $settings['token'] );103 $response = self::make_request( $message, $, $settings['token'] ); 104 104 105 105 if ( is_wp_error( $response ) ) { … … 128 128 * 129 129 * @param array $message Message data. 130 * @param string $ url Remote API URL.130 * @param string $. 131 131 * @param string $token Access token from settings. 132 132 */ 133 private static function make_request( $message, $ url, $token ) {133 private static function make_request( $message, $, $token ) { 134 134 $body = array( 135 135 'access_token' => $token, … … 143 143 144 144 if ( ! empty( $message['poster'] ) ) { 145 return self::send_poster( $message['poster'], $ url, $excerpt, $body );145 return self::send_poster( $message['poster'], $, $excerpt, $body ); 146 146 } 147 147 … … 151 151 152 152 $body['message'] = $excerpt; 153 154 155 153 156 154 157 /** … … 158 161 * @param array $message Message data. 159 162 * @param string $network Network name. 163 160 164 * 161 165 * @since 1.1.12 166 162 167 */ 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 ); 166 171 } 167 172 … … 193 198 ); 194 199 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 ); 196 213 } 197 214 -
social-planner/tags/1.3.0/networks/class-network-ok.php
r2903429 r2909567 191 191 * @param array $message Message data. 192 192 * @param string $network Network name. 193 193 194 * 194 195 * @since 1.1.12 196 195 197 */ 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 ); 197 199 198 200 return self::send_request( $url, $body ); -
social-planner/tags/1.3.0/networks/class-network-telegram.php
r2903429 r2909567 97 97 98 98 // 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']; 100 100 101 101 if ( empty( $settings['group'] ) ) { … … 103 103 } 104 104 105 $response = self::make_request( $message, $ url, $settings['group'] );105 $response = self::make_request( $message, $, $settings['group'] ); 106 106 107 107 if ( is_wp_error( $response ) ) { … … 140 140 * 141 141 * @param array $message List of message args. 142 * @param string $ url Remote API URL.142 * @param string $. 143 143 * @param string $group Group ID. 144 144 */ 145 private static function make_request( $message, $ url, $group ) {145 private static function make_request( $message, $, $group ) { 146 146 $body = array( 147 147 'parse_mode' => 'HTML', … … 156 156 157 157 if ( ! empty( $message['poster'] ) ) { 158 return self::send_poster( $message['poster'], $ url, $excerpt, $body );158 return self::send_poster( $message['poster'], $, $excerpt, $body ); 159 159 } 160 160 … … 164 164 165 165 $body['text'] = $excerpt; 166 167 168 166 169 167 170 /** … … 171 174 * @param array $message Message data. 172 175 * @param string $network Network name. 176 173 177 * 174 178 * @since 1.1.12 179 175 180 */ 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 ); 179 184 } 180 185 … … 183 188 * 184 189 * @param string $poster Path to local image file. 185 * @param string $ url Remote API URL.190 * @param string $. 186 191 * @param string $excerpt Prepared caption for poster. 187 192 * @param array $body Prepared body array. 188 193 */ 189 private static function send_poster( $poster, $ url, $excerpt, $body ) {194 private static function send_poster( $poster, $, $excerpt, $body ) { 190 195 $boundary = uniqid( 'wp', true ); 191 196 … … 206 211 ); 207 212 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 ); 209 228 } 210 229 -
social-planner/tags/1.3.0/networks/class-network-twitter-v2.php
r2907612 r2909567 181 181 * @param array $message Message data. 182 182 * @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 185 187 */ 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 ); 187 189 188 190 return self::send_request( $url, $body, $headers ); -
social-planner/tags/1.3.0/networks/class-network-twitter.php
r2907612 r2909567 187 187 * @param array $message Message data. 188 188 * @param string $network Network name. 189 189 190 * 190 191 * @since 1.1.12 192 191 193 */ 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 ); 193 195 194 196 return self::send_request( $url, $body, $headers ); -
social-planner/tags/1.3.0/networks/class-network-vk.php
r2903429 r2909567 159 159 ); 160 160 161 162 161 163 /** 162 164 * Filter request body arguments using message data. … … 165 167 * @param array $message Message data. 166 168 * @param string $network Network name. 169 167 170 * 168 171 * @since 1.1.12 172 169 173 */ 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 ); 174 177 } 175 178 -
social-planner/tags/1.3.0/readme.txt
r2907612 r2909567 5 5 Requires at least: 5.3 6 6 Tested up to: 6.2 7 Stable tag: 1. 2.07 Stable tag: 1..0 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 51 51 == Changelog == 52 52 53 54 55 56 53 57 = 1.2.0 = 54 58 * Adding new provider for Twitter API v2. -
social-planner/tags/1.3.0/social-planner.php
r2907612 r2909567 7 7 * Author URI: https://wpset.org 8 8 * Requires at least: 5.3 9 * Tested up to: 5.810 * Version: 1. 2.09 * Tested up to: 10 * Version: 1..0 11 11 * 12 12 * Text Domain: social-planner … … 28 28 * Plugin version. 29 29 */ 30 define( 'SOCIAL_PLANNER_VERSION', '1. 1.12' );30 define( 'SOCIAL_PLANNER_VERSION', '1.' ); 31 31 32 32 /** -
social-planner/trunk/classes/class-core.php
r2907612 r2909567 54 54 'Social_Planner\Network_Facebook' => SOCIAL_PLANNER_DIR . '/networks/class-network-facebook.php', 55 55 'Social_Planner\Network_OK' => SOCIAL_PLANNER_DIR . '/networks/class-network-ok.php', 56 56 57 ); 57 58 -
social-planner/trunk/networks/class-network-facebook.php
r2903429 r2909567 94 94 } 95 95 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']; 98 98 99 99 if ( empty( $settings['token'] ) ) { … … 101 101 } 102 102 103 $response = self::make_request( $message, $ url, $settings['token'] );103 $response = self::make_request( $message, $, $settings['token'] ); 104 104 105 105 if ( is_wp_error( $response ) ) { … … 128 128 * 129 129 * @param array $message Message data. 130 * @param string $ url Remote API URL.130 * @param string $. 131 131 * @param string $token Access token from settings. 132 132 */ 133 private static function make_request( $message, $ url, $token ) {133 private static function make_request( $message, $, $token ) { 134 134 $body = array( 135 135 'access_token' => $token, … … 143 143 144 144 if ( ! empty( $message['poster'] ) ) { 145 return self::send_poster( $message['poster'], $ url, $excerpt, $body );145 return self::send_poster( $message['poster'], $, $excerpt, $body ); 146 146 } 147 147 … … 151 151 152 152 $body['message'] = $excerpt; 153 154 155 153 156 154 157 /** … … 158 161 * @param array $message Message data. 159 162 * @param string $network Network name. 163 160 164 * 161 165 * @since 1.1.12 166 162 167 */ 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 ); 166 171 } 167 172 … … 193 198 ); 194 199 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 ); 196 213 } 197 214 -
social-planner/trunk/networks/class-network-ok.php
r2903429 r2909567 191 191 * @param array $message Message data. 192 192 * @param string $network Network name. 193 193 194 * 194 195 * @since 1.1.12 196 195 197 */ 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 ); 197 199 198 200 return self::send_request( $url, $body ); -
social-planner/trunk/networks/class-network-telegram.php
r2903429 r2909567 97 97 98 98 // 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']; 100 100 101 101 if ( empty( $settings['group'] ) ) { … … 103 103 } 104 104 105 $response = self::make_request( $message, $ url, $settings['group'] );105 $response = self::make_request( $message, $, $settings['group'] ); 106 106 107 107 if ( is_wp_error( $response ) ) { … … 140 140 * 141 141 * @param array $message List of message args. 142 * @param string $ url Remote API URL.142 * @param string $. 143 143 * @param string $group Group ID. 144 144 */ 145 private static function make_request( $message, $ url, $group ) {145 private static function make_request( $message, $, $group ) { 146 146 $body = array( 147 147 'parse_mode' => 'HTML', … … 156 156 157 157 if ( ! empty( $message['poster'] ) ) { 158 return self::send_poster( $message['poster'], $ url, $excerpt, $body );158 return self::send_poster( $message['poster'], $, $excerpt, $body ); 159 159 } 160 160 … … 164 164 165 165 $body['text'] = $excerpt; 166 167 168 166 169 167 170 /** … … 171 174 * @param array $message Message data. 172 175 * @param string $network Network name. 176 173 177 * 174 178 * @since 1.1.12 179 175 180 */ 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 ); 179 184 } 180 185 … … 183 188 * 184 189 * @param string $poster Path to local image file. 185 * @param string $ url Remote API URL.190 * @param string $. 186 191 * @param string $excerpt Prepared caption for poster. 187 192 * @param array $body Prepared body array. 188 193 */ 189 private static function send_poster( $poster, $ url, $excerpt, $body ) {194 private static function send_poster( $poster, $, $excerpt, $body ) { 190 195 $boundary = uniqid( 'wp', true ); 191 196 … … 206 211 ); 207 212 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 ); 209 228 } 210 229 -
social-planner/trunk/networks/class-network-twitter-v2.php
r2907612 r2909567 181 181 * @param array $message Message data. 182 182 * @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 185 187 */ 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 ); 187 189 188 190 return self::send_request( $url, $body, $headers ); -
social-planner/trunk/networks/class-network-twitter.php
r2907612 r2909567 187 187 * @param array $message Message data. 188 188 * @param string $network Network name. 189 189 190 * 190 191 * @since 1.1.12 192 191 193 */ 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 ); 193 195 194 196 return self::send_request( $url, $body, $headers ); -
social-planner/trunk/networks/class-network-vk.php
r2903429 r2909567 159 159 ); 160 160 161 162 161 163 /** 162 164 * Filter request body arguments using message data. … … 165 167 * @param array $message Message data. 166 168 * @param string $network Network name. 169 167 170 * 168 171 * @since 1.1.12 172 169 173 */ 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 ); 174 177 } 175 178 -
social-planner/trunk/readme.txt
r2907612 r2909567 5 5 Requires at least: 5.3 6 6 Tested up to: 6.2 7 Stable tag: 1. 2.07 Stable tag: 1..0 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 51 51 == Changelog == 52 52 53 54 55 56 53 57 = 1.2.0 = 54 58 * Adding new provider for Twitter API v2. -
social-planner/trunk/social-planner.php
r2907612 r2909567 7 7 * Author URI: https://wpset.org 8 8 * Requires at least: 5.3 9 * Tested up to: 5.810 * Version: 1. 2.09 * Tested up to: 10 * Version: 1..0 11 11 * 12 12 * Text Domain: social-planner … … 28 28 * Plugin version. 29 29 */ 30 define( 'SOCIAL_PLANNER_VERSION', '1. 1.12' );30 define( 'SOCIAL_PLANNER_VERSION', '1.' ); 31 31 32 32 /**
Note: See TracChangeset
for help on using the changeset viewer.