Skip to content

Commit

Permalink
⚡ Added fix for PHP notices in stats tab and admin notice for update …
Browse files Browse the repository at this point in the history
…check
  • Loading branch information
jaydeeptrivedi13 committed Oct 29, 2024
1 parent c9ad71a commit 0f56281
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions edwiser-bridge/admin/settings/class-eb-bridge-summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ private function get_edwiser_envirment( $plugin_path ) {
$free_plugin_data = array();
if ( 200 === wp_remote_retrieve_response_code( $response ) ) {
$responce = json_decode( wp_remote_retrieve_body( $response ) );
if ( empty( $responce ) ) {
echo "<h2>" . esc_html__( 'Something went wrong!!! Please refresh and try again.', 'edwiser-bridge' ) . "</h2>";
return;
}
foreach ( $responce as $key => $value ) {
$free_plugin_data[ $key ] = array(
'name' => $value->name,
Expand Down
3 changes: 3 additions & 0 deletions edwiser-bridge/includes/class-eb-admin-notice-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ public function eb_check_mdl_plugin_update() {

if ( 200 === wp_remote_retrieve_response_code( $response ) && $plugin_info ) {
$responce = json_decode( wp_remote_retrieve_body( $response ) );
if ( empty( $responce ) ) {
return;
}
if ( isset( $plugin_info->plugin_name ) && 'edwiser_bridge' === $plugin_info->plugin_name ) {
$update_data[] = array(
'slug' => 'moodle_edwiser_bridge',
Expand Down

0 comments on commit 0f56281

Please sign in to comment.