Title: Plugin broken
Last modified: August 21, 2016

---

# Plugin broken

 *  Resolved [andregauda](https://wordpress.org/support/users/andregauda/)
 * (@andregauda)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-broken-26/)
 * When I tried to update the plugin, the error occurred:
 * Parse error: syntax error, unexpected T_FUNCTION in /…/wp-content/plugins/widget-
   settings-importexport/widget-data.php on line 49
 * []’s
 * [http://wordpress.org/extend/plugins/widget-settings-importexport/](http://wordpress.org/extend/plugins/widget-settings-importexport/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Darkspire Media](https://wordpress.org/support/users/drewmturner/)
 * (@drewmturner)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-broken-26/#post-3892306)
 * In widget-data.php, I did this:
 * Replace
 *     ```
       add_action( 'admin_enqueue_scripts', function($hook) use ($export_page, $import_page){
       			if( !in_array( $hook, array( $export_page, $import_page ) ) )
       				return;
   
       			wp_enqueue_style( 'widget_data', plugins_url( '/widget-data.css', __FILE__ ) );
       			wp_enqueue_script( 'widget_data', plugins_url( '/widget-data.js', __FILE__ ), array( 'jquery', 'wp-ajax-response' ) );
       			wp_localize_script( 'widget_data', 'widgets_url', get_admin_url( false, 'widgets.php' ) );
       		} );
       ```
   
 * with this
 *     ```
       if(is_admin())
       		{
       			wp_enqueue_style( 'widget_data', plugins_url( '/widget-data.css', __FILE__ ) );
       			wp_enqueue_script( 'widget_data', plugins_url( '/widget-data.js', __FILE__ ), array( 'jquery', 'wp-ajax-response' ) );
       			wp_localize_script( 'widget_data', 'widgets_url', get_admin_url( false, 'widgets.php' ) );
       		}
       ```
   
 * It worked for me. Not the best solution, I’m sure, but it worked.
 *  Plugin Author [Kevin Langley Jr.](https://wordpress.org/support/users/kevinlangleyjr/)
 * (@kevinlangleyjr)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-broken-26/#post-3892332)
 * This issue is due to the PHP version we require for the plugin, which is 5.3.0.
   Anything below that will error out. Usually if you ask your host to upgrade your
   PHP version to 5.3.0, they will do so without an issue and with ease and no interruption
   to your site. If they cannot or you do not want to upgrade, you can always go
   to the “Developers” tab on the plugin page (far right tab), and download version
   1.0 that is compatible with older version of PHP.
 * [@drewmturner](https://wordpress.org/support/users/drewmturner/) – your solution
   definitely works, in the plugin we only want to enqueue those stylesheets and
   javascript files on the specific admin page, and all you’re doing is allowing
   it on all pages. Like you said, its not the best, but it definitely works for
   sure with probably no harm done, its just not best practice for us to release
   the plugin enqueuing the assets on all admin pages.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin broken’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-settings-importexport_d94965.
   svg)
 * [Widget Settings Importer/Exporter](https://wordpress.org/plugins/widget-settings-importexport/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-settings-importexport/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-settings-importexport/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-settings-importexport/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-settings-importexport/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-settings-importexport/reviews/)

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 2 replies
 * 3 participants
 * Last reply from: [Kevin Langley Jr.](https://wordpress.org/support/users/kevinlangleyjr/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-broken-26/#post-3892332)
 * Status: resolved