PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.7
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Module/Frontend.php +9 -2 3.4.63.4.7 View file →
@@ -107,9 +107,10 @@
107 107 register_rest_route(
108 108 'visualizer/v' . VISUALIZER_REST_VERSION,
109 109 '/action/(?P<chart>\d+)/(?P<type>.+)/',
110 110 array(
111 - 'methods' => 'GET',
111 + // POST is required for save/cancel, GET for all others
112 + 'methods' => array( 'POST', 'GET' ),
112 113 'args' => array(
113 114 'chart' => array(
114 115 'required' => true,
115 116 'sanitize_callback' => function( $param ) {
@@ -118,13 +119,19 @@
118 119 ),
119 120 'type' => array(
120 121 'required' => true,
121 122 'type' => 'string',
122 - 'enum' => array_keys( $this->get_actions() ),
123 + 'enum' => array_merge( array( 'save', 'cancel' ), array_keys( $this->get_actions() ) ),
123 124 ),
124 125 ),
125 126 'permission_callback' => function ( WP_REST_Request $request ) {
126 127 $chart_id = filter_var( sanitize_text_field( $request->get_param( 'chart' ), FILTER_VALIDATE_INT ) );
128 + if ( ! empty( $chart_id ) && in_array( $request->get_param( 'type' ), array( 'save', 'cancel' ), true ) ) {
129 + // let save and cancel go without any check as past version of pro
130 + // did not send the X-WP-Nonce
131 + // we can change this at a later date.
132 + return true;
133 + }
127 134 return ! empty( $chart_id ) && apply_filters( 'visualizer_pro_show_chart', true, $chart_id );
128 135 },
129 136 'callback' => array( $this, 'perform_action' ),
130 137 )