PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.3.8
Post Views Counter v1.3.8
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 7 years ago class-admin.php 4 years ago class-columns.php 4 years ago class-counter.php 4 years ago class-crawler-detect.php 4 years ago class-cron.php 4 years ago class-dashboard.php 4 years ago class-frontend.php 4 years ago class-functions.php 4 years ago class-query.php 4 years ago class-settings-api.php 4 years ago class-settings.php 4 years ago class-update.php 4 years ago class-widgets.php 4 years ago columns.php 6 years ago counter.php 6 years ago crawler-detect.php 6 years ago cron.php 6 years ago dashboard.php 6 years ago frontend.php 6 years ago functions.php 4 years ago query.php 6 years ago settings.php 6 years ago update.php 6 years ago widgets.php 6 years ago
ajax.php
90 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 // if PVC_SHORTINIT_INC is defined in wp-config.php load theme/pvc/includes.php file
64 // this allows to perform custom actions, for example hook into pvc_after_count_visit
65 if ( defined( 'PVC_SHORTINIT_INC' ) && PVC_SHORTINIT_INC ) {
66 require_once( ABSPATH . WPINC . '/plugin.php' );
67 require_once( ABSPATH . WPINC . '/theme.php' );
68
69 // get the current theme path
70 $theme_path = get_theme_file_path();
71 // load custom pvc includes file
72 $pvc_file_path = $theme_path . DIRECTORY_SEPARATOR . 'pvc' . DIRECTORY_SEPARATOR . 'includes.php';
73
74 if ( is_file( $pvc_file_path ) ) {
75 require_once( $pvc_file_path );
76 }
77 }
78
79 $action = esc_attr( trim( $_POST['action'] ) );
80
81 // a bit of security
82 $allowed_actions = array(
83 'pvc-check-post'
84 );
85
86 if ( in_array( $action, $allowed_actions ) ) {
87 do_action( 'pvc_ajax_' . $action );
88 } else {
89 die( '-1' );
90 }