diff --git a/README.md b/README.md index 2d338ee..35aff9d 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,9 @@ IMPORTANT CRITICAL UPDATE - [x] fix widget variable list - [x] Use javascript+ajax fo variables API - [x] Remove the usage of wp_load -- [ ] Complete name conversion -- [ ] Rewrite API authentication +- [x] Complete name conversion +- [x] External API via WP Ajax +- [x] Fix missing 2 spider images PLEASE diff --git a/images/spider/facebook.png b/images/spider/facebook.png new file mode 100644 index 0000000..482c061 Binary files /dev/null and b/images/spider/facebook.png differ diff --git a/images/spider/proximic.png b/images/spider/proximic.png new file mode 100644 index 0000000..cb0251e Binary files /dev/null and b/images/spider/proximic.png differ diff --git a/includes/js/nsp_overview.js b/includes/js/nsp_overview.js index 54dc64e..ee9fcc1 100644 --- a/includes/js/nsp_overview.js +++ b/includes/js/nsp_overview.js @@ -1,8 +1,9 @@ (function($) { $( "#nsp_error-overview").hide(); - $.post(ExtData.Url, { + $.post(nsp_externalAjax_overview.ajaxurl, { + action : 'nsp_external', VAR: "overview", - KEY: ExtData.Key, + KEY: nsp_externalAjax_overview.Key, PAR: "0", TYP: "HTML" }, diff --git a/includes/nsp_dashboard.php b/includes/nsp_dashboard.php index 0cb49c4..d45b0f7 100644 --- a/includes/nsp_dashboard.php +++ b/includes/nsp_dashboard.php @@ -17,8 +17,6 @@ function nsp_BuildDashboardWidget() { $newstatpress_url=PluginUrl(); wp_enqueue_script('wp_ajax_nsp_js_dashbord', plugins_url('./js/nsp_dashboard.js', __FILE__), array('jquery')); - // wp_enqueue_script('jquery'); - // wp_enqueue_script('wp_ajax_nsp_js_dashbord'); wp_localize_script( 'wp_ajax_nsp_js_dashbord', 'nsp_externalAjax_dashboard', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'Key' => md5(gmdate('m-d-y H i').$api_key) diff --git a/includes/nsp_overview.php b/includes/nsp_overview.php index ff51ea8..ad6225b 100644 --- a/includes/nsp_overview.php +++ b/includes/nsp_overview.php @@ -391,11 +391,9 @@ function nsp_NewStatPressMain() { get_option('newstatpress_externalapi')=='checked' ? $message=$msg_activated:$message=$msg_not_activated; - wp_register_script('wp_ajax_nsp_js_overview', plugins_url('./js/nsp_overview.js', __FILE__), array('jquery')); - wp_enqueue_script('jquery'); - wp_enqueue_script('wp_ajax_nsp_js_overview'); - wp_localize_script( 'wp_ajax_nsp_js_overview', 'ExtData', array( - 'Url' => $url, + wp_enqueue_script('wp_ajax_nsp_js_overview', plugins_url('./js/nsp_overview.js', __FILE__), array('jquery')); + wp_localize_script( 'wp_ajax_nsp_js_overview', 'nsp_externalAjax_overview', array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'Key' => md5(gmdate('m-d-y H i').$api_key) )); @@ -432,14 +430,11 @@ function nsp_NewStatPressMain3() { $_newstatpress_url=PluginUrl(); $url=$_newstatpress_url."/includes/api/external.php"; - wp_register_script('wp_ajax_nsp_js_overview', plugins_url('./js/nsp_overview.js', __FILE__), array('jquery')); - wp_enqueue_script('jquery'); - wp_enqueue_script('wp_ajax_nsp_js_overview'); - wp_localize_script( 'wp_ajax_nsp_js_overview', 'ExtData', array( - 'Url' => $url, - 'Key' => md5(gmdate('m-d-y H i').$api_key) - )); - + wp_enqueue_script('wp_ajax_nsp_js_overview', plugins_url('./js/nsp_overview.js', __FILE__), array('jquery')); + wp_localize_script( 'wp_ajax_nsp_js_overview', 'nsp_externalAjax_overview', array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'Key' => md5(gmdate('m-d-y H i').$api_key) + )); echo "
";