esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'assetsUrl' => $dist . 'public/', 'appUrl' => BOOSTLOOP_AEO_APP, 'pageUrl' => admin_url( 'admin.php?page=boostloop' ), ) ); } ); } ); add_filter( 'plugin_action_links_' . plugin_basename( BOOSTLOOP_AEO_FILE ), function ( $links ) { array_unshift( $links, '' . esc_html__( 'Open BoostLoop', 'boostloop' ) . '' ); return $links; } ); add_action( 'admin_post_boostloop_aeo_reset', function () { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Not allowed.', 'boostloop' ), 403 ); } check_admin_referer( 'boostloop_aeo_reset' ); boostloop_aeo_restore_physical(); delete_option( 'boostloop_aeo_artifacts' ); delete_option( 'boostloop_aeo_section' ); delete_option( 'boostloop_aeo_commerce' ); boostloop_aeo_restore_options(); wp_safe_redirect( admin_url( 'admin.php?page=boostloop' ) ); exit; } ); /** Renders the BoostLoop admin screen mount point. */ function boostloop_aeo_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $connected = get_option( 'boostloop_aeo_secret' ) ? true : boostloop_aeo_connect(); if ( is_wp_error( $connected ) ) { /* translators: %s: error message from the connection attempt. */ echo '
' . esc_html( sprintf( __( 'Could not connect this site to BoostLoop: %s', 'boostloop' ), $connected->get_error_message() ) ) . '