PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.2.13
Post Views Counter v1.2.13
1.7.13 1.7.12 1.7.11 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.2 1.3.2.1 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9
post-views-counter / includes / ajax.php
post-views-counter / includes Last commit date
ajax.php 8 years ago columns.php 8 years ago counter.php 8 years ago crawler-detect.php 8 years ago cron.php 8 years ago dashboard.php 8 years ago frontend.php 8 years ago functions.php 8 years ago query.php 8 years ago settings.php 8 years ago update.php 8 years ago widgets.php 8 years ago
ajax.php
74 lines
1 <?php
2 // mimic the actuall admin-ajax
3 define( 'DOING_AJAX', true );
4
5 if ( ! isset( $_POST['action'] ) )
6 die( '-1' );
7
8 // hide errors if any
9 ini_set( 'html_errors', 0 );
10
11 // we need only basics
12 define( 'SHORTINIT', true );
13
14 // get wp-load.php location
15 $path = explode( 'wp-content', __FILE__ );
16
17 if ( is_file( reset( $path ) . 'wp-load.php' ) ) {
18 require_once( reset( $path ) . 'wp-load.php' );
19 } else {
20 die( '-1' );
21 }
22
23 // typical headers
24 header( 'Content-Type: text/html' );
25 send_nosniff_header();
26
27 // disable caching
28 header( 'Cache-Control: no-cache' );
29 header( 'Pragma: no-cache' );
30
31 // include only the files and function we need
32 require_once( ABSPATH . 'wp-config.php' );
33
34 require_once( ABSPATH . WPINC . '/post.php' );
35 require_once( ABSPATH . WPINC . '/formatting.php' );
36 require_once( ABSPATH . WPINC . '/capabilities.php' );
37 require_once( ABSPATH . WPINC . '/query.php' );
38 require_once( ABSPATH . WPINC . '/taxonomy.php' );
39 require_once( ABSPATH . WPINC . '/meta.php' );
40 require_once( ABSPATH . WPINC . '/functions.php' );
41 require_once( ABSPATH . WPINC . '/link-template.php' );
42 require_once( ABSPATH . WPINC . '/class-wp-post.php' );
43 require_once( ABSPATH . WPINC . '/kses.php' );
44 require_once( ABSPATH . WPINC . '/rest-api.php' );
45 // required for wp user
46 require_once( ABSPATH . WPINC . '/user.php' );
47 require_once( ABSPATH . WPINC . '/vars.php' );
48 require_once( ABSPATH . WPINC . '/class-wp-session-tokens.php' );
49 require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
50 require_once( ABSPATH . WPINC . '/class-wp-roles.php' );
51 require_once( ABSPATH . WPINC . '/class-wp-role.php' );
52 require_once( ABSPATH . WPINC . '/class-wp-user.php' );
53 require_once( ABSPATH . WPINC . '/pluggable.php' );
54
55 // get constants
56 wp_plugin_directory_constants();
57 wp_cookie_constants();
58 wp_ssl_constants();
59
60 // include Post Views Counter core
61 require_once( WP_PLUGIN_DIR . '/post-views-counter/post-views-counter.php' );
62
63 $action = esc_attr( trim( $_POST['action'] ) );
64
65 // a bit of security
66 $allowed_actions = array(
67 'pvc-check-post'
68 );
69
70 if ( in_array( $action, $allowed_actions ) ) {
71 do_action( 'pvc_ajax_' . $action );
72 } else {
73 die( '-1' );
74 }