Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Upgraded Facebook Graph API version
- Fixed an issue where a PHP error was being thrown when posting
  • Loading branch information
vytisbulkevicius authored Aug 28, 2024
2 parents 85fc134 + e3c493a commit b11f3db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/admin/models/class-rop-services-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public function find_account( $account_id ) {

list( $service, $service_id, $user_id ) = $this->handle_underscore_exception( $account_id );

if ( count( $services[ $service . '_' . $service_id ]['available_accounts'] ) >= 1 ) {
if ( ! empty( $services[ $service . '_' . $service_id ]['available_accounts'] ) && count( $services[ $service . '_' . $service_id ]['available_accounts'] ) >= 1 ) {
foreach ( $services[ $service . '_' . $service_id ]['available_accounts'] as $key => $account ) {
if ( $account['id'] == $user_id ) {
$response = array(
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/services/class-rop-facebook-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function set_api( $app_id = '', $secret = '' ) {
array(
'app_id' => $this->strip_whitespace( $app_id ),
'app_secret' => $this->strip_whitespace( $secret ),
'default_graph_version' => 'v16.0',
'default_graph_version' => 'v20.0',
)
);
} catch ( Exception $exception ) {
Expand Down Expand Up @@ -761,9 +761,9 @@ private function try_post( $new_post, $page_id, $token, $post_id, $posting_type
$post_data['access_token'] = $token;

if ( 'video' === $posting_type ) {
$url = 'https://graph-video.facebook.com/v12.0' . $path;
$url = 'https://graph-video.facebook.com/v20.0' . $path;
} else {
$url = 'https://graph.facebook.com/v12.0' . $path;
$url = 'https://graph.facebook.com/v20.0' . $path;
}

// Scrape post URL before sharing
Expand Down

0 comments on commit b11f3db

Please sign in to comment.