Hi @ahmedkaludi the issue is simple :
admin-script.js calls wpColorPicker which is not defined because it is defined in wp-color-picker script which is enqueued (called in the footer of the page).
Src:
“accelerated-mobile-pages/includes/features/functions.php”
Hook: add_action( ‘admin_enqueue_scripts’, ‘ampforwp_add_admin_styling’ );
admin-script.js is registred :
wp_register_script( ‘ampforwp_admin_js’, untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . ‘/includes/admin-script.js’, false, AMPFORWP_VERSION );
then wp-color-picker is enqueued :
wp_enqueue_script( ‘wp-color-picker’ );
A solution is put wp-color-picker in deps of the first script :
wp_register_script( ‘ampforwp_admin_js’, untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . ‘/includes/admin-script.js’, array(‘wp-color-picker’), AMPFORWP_VERSION );
Thanks.