| 1 |
<?php |
| 2 |
/** |
| 3 |
* Parse.ly |
| 4 |
* |
| 5 |
* @package Parsely\wp-parsely |
| 6 |
* @author Parse.ly |
| 7 |
* @copyright 2012 Parse.ly |
| 8 |
* @license GPL-2.0-or-later |
| 9 |
* |
| 10 |
* @wordpress-plugin |
| 11 |
* Plugin Name: Parse.ly |
| 12 |
* Plugin URI: https://www.parse.ly/help/integration/wordpress |
| 13 |
* Description: This plugin makes it a snap to add Parse.ly tracking code to your WordPress blog. |
| 14 |
* Version: 2.5.2 |
| 15 |
* Author: Parse.ly |
| 16 |
* Author URI: https://www.parse.ly |
| 17 |
* Text Domain: wp-parsely |
| 18 |
* License: GPL-2.0-or-later |
| 19 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 20 |
* GitHub Plugin URI: https://github.com/Parsely/wp-parsely |
| 21 |
* Requires PHP: 5.6 |
| 22 |
* Requires WP: 4.0.0 |
| 23 |
*/ |
| 24 |
|
| 25 |
// If this file is called directly, abort. |
| 26 |
if ( ! defined( 'WPINC' ) ) { |
| 27 |
die; |
| 28 |
} |
| 29 |
|
| 30 |
if ( class_exists( 'Parsely' ) ) { |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
define( 'PARSELY_VERSION', '2.5.2' ); |
| 35 |
|
| 36 |
if ( ! defined( 'PARSELY_PLUGIN_BASENAME' ) ) { |
| 37 |
define( 'PARSELY_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
| 38 |
} |
| 39 |
if ( ! defined( 'PARSELY_PLUGIN_DIR' ) ) { |
| 40 |
define( 'PARSELY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 41 |
} |
| 42 |
if ( ! defined( 'PARSELY_PLUGIN_URL' ) ) { |
| 43 |
define( 'PARSELY_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 44 |
} |
| 45 |
|
| 46 |
require PARSELY_PLUGIN_DIR . 'src/class-parsely.php'; |
| 47 |
|
| 48 |
$GLOBALS['parsely'] = new Parsely(); |
| 49 |
$GLOBALS['parsely']->run(); |
| 50 |
|
| 51 |
require PARSELY_PLUGIN_DIR . 'src/class-parsely-recommended-widget.php'; |
| 52 |
|
| 53 |
add_action( 'widgets_init', 'parsely_recommended_widget_register' ); |
| 54 |
/** |
| 55 |
* Register the Parse.ly Recommended widget. |
| 56 |
*/ |
| 57 |
function parsely_recommended_widget_register() { |
| 58 |
register_widget( 'Parsely_Recommended_Widget' ); |
| 59 |
} |
| 60 |
|
| 61 |
add_action( 'init', 'parsely_load_textdomain' ); |
| 62 |
/** |
| 63 |
* Load plugin textdomain. |
| 64 |
* |
| 65 |
* Only look for WP_LANG_DIR . '/plugins/wp-parsely-' . $locale . '.mo'. |
| 66 |
* WP_LANG_DIR is usually WP_CONTENT_DIR . '/languages/'. |
| 67 |
* No other fallback location is supported. |
| 68 |
* |
| 69 |
* This can be removed once minimum supported WordPress is 4.6 or later. |
| 70 |
* |
| 71 |
* @since 2.5.0 |
| 72 |
*/ |
| 73 |
function parsely_load_textdomain() { |
| 74 |
load_plugin_textdomain( 'wp-parsely' ); |
| 75 |
} |
| 76 |
|