@@ -106,6 +106,8 @@ private function filters() {
106106
107107 if ( ! $ this ->_fs ->has_any_active_valid_license () ) {
108108 add_action ( 'admin_head ' , array ( &$ this , 'catch_plugin_information_dialog_contents ' ) );
109+ } else {
110+ add_action ( 'admin_footer ' , array ( &$ this , '_add_fs_allow_updater_and_dialog_request_param ' ) );
109111 }
110112
111113 if ( ! WP_FS__IS_PRODUCTION_MODE ) {
@@ -129,15 +131,48 @@ private function filters() {
129131 }
130132 }
131133
134+ /**
135+ * @author Leo Fajardo (@leorw)
136+ * @since 2.7.4
137+ */
138+ function _add_fs_allow_updater_and_dialog_request_param () {
139+ if ( ! $ this ->is_plugin_information_dialog_for_plugin () ) {
140+ return ;
141+ }
142+ ?>
143+ <script type="text/javascript">
144+ if ( typeof jQuery !== 'undefined' ) {
145+ jQuery( document ).on( 'wp-plugin-updating', function( event, args ) {
146+ if ( typeof args === 'object' && args.slug && typeof args.slug === 'string' ) {
147+ if ( <?php echo json_encode ( $ this ->_fs ->get_slug () ) ?> === args.slug ) {
148+ args.fs_allow_updater_and_dialog = true;
149+ }
150+ }
151+ } );
152+ }
153+ </script>
154+ <?php
155+ }
156+
157+ /**
158+ * @author Leo Fajardo (@leorw)
159+ * @since 2.7.4
160+ *
161+ * @return bool
162+ */
163+ private function is_plugin_information_dialog_for_plugin () {
164+ return (
165+ 'plugin-information ' === fs_request_get ( 'tab ' , false ) &&
166+ $ this ->_fs ->get_slug () === fs_request_get_raw ( 'plugin ' , false )
167+ );
168+ }
169+
132170 /**
133171 * @author Leo Fajardo (@leorw)
134172 * @since 2.1.4
135173 */
136174 function catch_plugin_information_dialog_contents () {
137- if (
138- 'plugin-information ' !== fs_request_get ( 'tab ' , false ) ||
139- $ this ->_fs ->get_slug () !== fs_request_get_raw ( 'plugin ' , false )
140- ) {
175+ if ( ! $ this ->is_plugin_information_dialog_for_plugin () ) {
141176 return ;
142177 }
143178
0 commit comments