| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name |
| 4 |
* |
| 5 |
* @package WP Post Views |
| 6 |
* @author Ronak J Vanpariya |
| 7 |
* @copyright Ronak J Vanpariya |
| 8 |
* @license GPL-2.0-or-later |
| 9 |
* |
| 10 |
* @wordpress-plugin |
| 11 |
* Plugin Name: WP Post Views - WordPress Post views counter |
| 12 |
* Plugin URI: https://github.com/vanpariyar/wp-post-views |
| 13 |
* Description: WP Post Views - WordPress Post views counter |
| 14 |
* Version: 1.23.3 |
| 15 |
* Requires at least: 5.4 |
| 16 |
* Requires PHP: 7.4 |
| 17 |
* Tested up to: 7.1 |
| 18 |
* Author URI: https://vanpariyar.github.io |
| 19 |
* Text Domain: wp-post-views |
| 20 |
* Domain Path: /languages |
| 21 |
* License: GPL v2 or later |
| 22 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 23 |
*/ |
| 24 |
|
| 25 |
// Make sure we don't expose any info if called directly. |
| 26 |
if ( ! function_exists( 'add_action' ) ) { |
| 27 |
echo esc_html__( 'Hi there! I\'m just a plugin, not much I can do when called directly.', 'wp-post-views' ); |
| 28 |
exit; |
| 29 |
} |
| 30 |
|
| 31 |
/* Plugin Constants */ |
| 32 |
if ( ! defined( 'WP_POST_VIEW_URL' ) ) { |
| 33 |
define( 'WP_POST_VIEW_URL', plugin_dir_url( __FILE__ ) ); |
| 34 |
} |
| 35 |
|
| 36 |
if ( ! defined( 'WP_POST_VIEW_PLUGIN_PATH' ) ) { |
| 37 |
define( 'WP_POST_VIEW_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
| 38 |
} |
| 39 |
|
| 40 |
require_once WP_POST_VIEW_PLUGIN_PATH . '/includes/settings.php'; |
| 41 |
|
| 42 |
require_once WP_POST_VIEW_PLUGIN_PATH . '/includes/shortcodes.php'; |
| 43 |
|
| 44 |
require_once WP_POST_VIEW_PLUGIN_PATH . '/includes/counter.php'; |
| 45 |
|
| 46 |
require_once WP_POST_VIEW_PLUGIN_PATH . '/includes/blocks.php'; |
| 47 |
|
| 48 |
register_activation_hook( __FILE__, array( 'Wp_post_view_settings', 'wppv_activation_hook' ) ); |
| 49 |
|
| 50 |
/** |
| 51 |
* MAIN CLASS |
| 52 |
*/ |
| 53 |
class WP_Post_Views { |
| 54 |
|
| 55 |
/** |
| 56 |
* Initialize the plugin. |
| 57 |
* |
| 58 |
* @return void |
| 59 |
*/ |
| 60 |
public function __construct() { |
| 61 |
$WP_Post_Views_Counter_Functions = new WP_Post_Views_Counter_Functions(); |
| 62 |
Wp_post_view_settings::settings_init(); |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
global $wppv_plugin; |
| 67 |
|
| 68 |
$wppv_plugin = new WP_Post_Views(); |
| 69 |
|