@@ -46,6 +46,37 @@ public static function instance() {
4646 return self ::$ instance ;
4747 }
4848
49+ /**
50+ * Registers available blocks.
51+ *
52+ * @since 1.0.0
53+ */
54+ public function set_up_ajax () {
55+ $ ajax_js = '../scripts/scan-runner.js ' ;
56+
57+ global $ wp_query ;
58+
59+ wp_register_script ( 'tide-checker ' , plugins_url ( $ ajax_js , __FILE__ ), array ( 'jquery ' ), '1.0 ' , true );
60+
61+ wp_enqueue_script (
62+ 'tide-checker ' ,
63+ plugins_url ( $ ajax_js , __FILE__ ),
64+ array ( 'jquery ' ),
65+ '1.0 ' ,
66+ true
67+ );
68+
69+ wp_localize_script (
70+ 'tide-checker ' ,
71+ 'checkerList ' ,
72+ array (
73+ 'pluginList ' => $ this ->generate_directory_list (),
74+ 'themeList ' => 'tbd ' ,
75+ 'userOptions ' => 'some user options ' ,
76+ )
77+ );
78+ }
79+
4980 /**
5081 * Tool Page initialization.
5182 */
@@ -60,6 +91,7 @@ public function init() {
6091
6192 // Load our JavaScript.
6293 add_action ( 'admin_enqueue_scripts ' , array ( $ instance , 'admin_enqueue ' ) );
94+ add_action ( 'admin_enqueue_scripts ' , array ( $ instance , 'set_up_ajax ' ) );
6395
6496 // The action to run the compatibility test.
6597 // add_action( 'wp_ajax_wpephpcompat_start_test', array( $instance, 'start_test' ) );
@@ -452,7 +484,7 @@ public function admin_enqueue( $hook ) {
452484 wp_enqueue_style ( 'wpephpcompat-style ' , plugins_url ( '/styles/css/style.css ' , __FILE__ ), array (), $ version );
453485
454486 // Scripts.
455- wp_enqueue_script ( 'wpephpcompat-ajax ' , plugins_url ( '/scripts/starter-script.js ' , __FILE__ ), array ( 'jquery ' ), $ version );
487+ // wp_enqueue_script( 'wpephpcompat-ajax', plugins_url( '/scripts/starter-script.js', __FILE__ ), array( 'jquery' ), $version );
456488
457489 /**
458490 * Strings for i18n.
0 commit comments