slug ) ) { return $response; } $found_plugin = null; // Look through local Woo plugins by slugs. foreach ( WC_Helper::get_local_woo_plugins() as $plugin ) { $slug = dirname( $plugin['_filename'] ); if ( dirname( $plugin['_filename'] ) === $args->slug ) { $plugin['_slug'] = $args->slug; $found_plugin = $plugin; break; } } if ( ! $found_plugin ) { return $response; } // Fetch the product information from the Helper API. $request = WC_Helper_API::get( add_query_arg( array( 'product_id' => absint( $plugin['_product_id'] ), 'product_slug' => rawurlencode( $plugin['_slug'] ), ), 'info' ), array( 'authenticated' => true ) ); $results = json_decode( wp_remote_retrieve_body( $request ), true ); if ( ! empty( $results ) ) { $response = (object) $results; } return $response; } } WC_Helper_Plugin_Info::load();