PluginProbe
Parse.ly / 2.5.1
Parse.ly v2.5.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
← All changes | wp-parsely.php +37 -165 3.18.02.5.1 View file →
@@ -1,18 +1,18 @@
1 1 <?php
2 2 /**
3 3 * Parse.ly
4 4 *
5 - * @package Parsely
6 - * @author Parse.ly
7 - * @copyright 2012 Parse.ly
8 - * @license GPL-2.0-or-later
5 + * @package Parsely\wp-parsely
6 + * @author Parse.ly
7 + * @copyright 2012 Parse.ly
8 + * @license GPL-2.0-or-later
9 9 *
10 10 * @wordpress-plugin
11 11 * Plugin Name: Parse.ly
12 - * Plugin URI: https://docs.parse.ly/wordpress
13 - * Description: This plugin makes it a snap to add Parse.ly tracking code and metadata to your WordPress blog.
14 - * Version: 3.18.0
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.1
15 15 * Author: Parse.ly
16 16 * Author URI: https://www.parse.ly
17 17 * Text Domain: wp-parsely
18 18 * License: GPL-2.0-or-later
@@ -17,186 +17,58 @@
17 17 * Text Domain: wp-parsely
18 18 * License: GPL-2.0-or-later
19 19 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
20 20 * GitHub Plugin URI: https://github.com/Parsely/wp-parsely
21 - * Requires PHP: 7.2
22 - * Requires WP: 5.0.0
21 + * Requires PHP: 5.6
22 + * Requires WP: 4.0.0
23 23 */
24 24
25 -declare(strict_types=1);
25 +// If this file is called directly, abort.
26 +if ( ! defined( 'WPINC' ) ) {
27 + die;
28 +}
26 29
27 -namespace Parsely;
28 -
29 -use Parsely\Content_Helper\Dashboard_Widget;
30 -use Parsely\Content_Helper\Editor_Sidebar;
31 -use Parsely\Content_Helper\Excerpt_Suggestions;
32 -use Parsely\Content_Helper\Post_List_Stats;
33 -use Parsely\Endpoints\GraphQL_Metadata;
34 -use Parsely\Endpoints\Rest_Metadata;
35 -use Parsely\Integrations\Amp;
36 -use Parsely\Integrations\Google_Web_Stories;
37 -use Parsely\Integrations\Integrations;
38 -use Parsely\REST_API\REST_API_Controller;
39 -use Parsely\UI\Admin_Bar;
40 -use Parsely\UI\Admin_Warning;
41 -use Parsely\UI\Metadata_Renderer;
42 -use Parsely\UI\Network_Admin_Sites_List;
43 -use Parsely\UI\Plugins_Actions;
44 -use Parsely\UI\Recommended_Widget;
45 -use Parsely\UI\Row_Actions;
46 -use Parsely\UI\Settings_Page;
47 -use Parsely\UI\Site_Health;
48 -
49 -if ( class_exists( Parsely::class ) ) {
30 +if ( class_exists( 'Parsely' ) ) {
50 31 return;
51 32 }
52 33
53 -const PARSELY_VERSION = '3.18.0';
54 -const PARSELY_FILE = __FILE__;
34 +define( 'PARSELY_VERSION', '2.5.1' );
55 35
56 -if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
57 - require_once __DIR__ . '/vendor/autoload.php';
36 +if ( ! defined( 'PARSELY_PLUGIN_BASENAME' ) ) {
37 + define( 'PARSELY_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
58 38 }
59 -
60 -// Load Telemetry classes.
61 -require_once __DIR__ . '/src/Telemetry/telemetry-init.php';
62 -
63 -add_action( 'plugins_loaded', __NAMESPACE__ . '\\parsely_initialize_plugin' );
64 -/**
65 - * Registers the basic classes to initialize the plugin.
66 - */
67 -function parsely_initialize_plugin(): void {
68 - $GLOBALS['parsely'] = new Parsely();
69 - $GLOBALS['parsely']->run();
70 -
71 - if ( class_exists( 'WPGraphQL' ) ) {
72 - $graphql = new GraphQL_Metadata( $GLOBALS['parsely'] );
73 - $graphql->run();
74 - }
75 -
76 - $scripts = new Scripts( $GLOBALS['parsely'] );
77 - $scripts->run();
78 -
79 - $admin_bar = new Admin_Bar( $GLOBALS['parsely'] );
80 - $admin_bar->run();
81 -
82 - $metadata_renderer = new Metadata_Renderer( $GLOBALS['parsely'] );
83 - $metadata_renderer->run();
39 +if ( ! defined( 'PARSELY_PLUGIN_DIR' ) ) {
40 + define( 'PARSELY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
84 41 }
85 -
86 -add_action( 'admin_init', __NAMESPACE__ . '\\parsely_admin_init_register' );
87 -/**
88 - * Registers the Parse.ly wp-admin warnings, plugin actions and row actions.
89 - */
90 -function parsely_admin_init_register(): void {
91 - $parsely = $GLOBALS['parsely'];
92 -
93 - ( new Admin_Warning( $parsely ) )->run();
94 - ( new Plugins_Actions() )->run();
95 - ( new Row_Actions( $parsely ) )->run();
96 - ( new Post_List_Stats( $parsely ) )->run();
97 - ( new Site_Health( $parsely ) )->run();
98 - ( new Dashboard_Widget( $parsely ) )->run();
42 +if ( ! defined( 'PARSELY_PLUGIN_URL' ) ) {
43 + define( 'PARSELY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
99 44 }
100 45
101 -add_action( 'init', __NAMESPACE__ . '\\parsely_wp_admin_early_register' );
102 -/**
103 - * Registers the additions the Parse.ly wp-admin settings page and Multisite
104 - * Network Admin Sites List table.
105 - */
106 -function parsely_wp_admin_early_register(): void {
107 - $GLOBALS['parsely_settings_page'] = new Settings_Page( $GLOBALS['parsely'] );
108 - $GLOBALS['parsely_settings_page']->run();
46 +require PARSELY_PLUGIN_DIR . 'src/class-parsely.php';
109 47
110 - $network_admin_sites_list = new Network_Admin_Sites_List( $GLOBALS['parsely'] );
111 - $network_admin_sites_list->run();
48 +$GLOBALS['parsely'] = new Parsely();
112 49
113 - // Initialize the REST API Controller.
114 - $rest_api_controller = $GLOBALS['parsely']->get_rest_api_controller();
115 - $rest_api_controller->init();
116 -}
50 +require PARSELY_PLUGIN_DIR . 'src/class-parsely-recommended-widget.php';
117 51
118 -add_action( 'rest_api_init', __NAMESPACE__ . '\\parsely_rest_api_init' );
52 +add_action( 'widgets_init', 'parsely_recommended_widget_register' );
119 53 /**
120 - * Registers REST Endpoints that act as a proxy to the Parse.ly API.
121 - * This is needed to get around CORS issues with Firefox.
122 - *
123 - * @since 3.2.0
54 + * Register the Parse.ly Recommended widget.
124 55 */
125 -function parsely_rest_api_init(): void {
126 - $rest = new Rest_Metadata( $GLOBALS['parsely'] );
127 - $rest->run();
56 +function parsely_recommended_widget_register() {
57 + register_widget( 'Parsely_Recommended_Widget' );
128 58 }
129 59
130 -add_action( 'init', __NAMESPACE__ . '\\init_recommendations_block' );
60 +add_action( 'init', 'parsely_load_textdomain' );
131 61 /**
132 - * Registers the Recommendations Block.
133 - */
134 -function init_recommendations_block(): void {
135 - $recommendations_block = new Recommendations_Block();
136 - $recommendations_block->run();
137 -}
138 -
139 -add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\init_content_helper_editor_sidebar' );
140 -/**
141 - * Inserts the PCH Editor Sidebar.
62 + * Load plugin textdomain.
142 63 *
143 - * @since 3.5.0 Moved from Parsely\Scripts\enqueue_block_editor_assets().
144 - * @since 3.9.0 Renamed from init_content_helper().
145 - */
146 -function init_content_helper_editor_sidebar(): void {
147 - $GLOBALS['parsely_editor_sidebar']->run();
148 -}
149 -
150 -add_action( 'admin_init', __NAMESPACE__ . '\\parsely_content_helper_editor_sidebar_features' );
151 -add_action( 'rest_api_init', __NAMESPACE__ . '\\parsely_content_helper_editor_sidebar_features' );
152 -/**
153 - * Initializes the PCH Editor Sidebar features.
64 + * Only look for WP_LANG_DIR . '/plugins/wp-parsely-' . $locale . '.mo'.
65 + * WP_LANG_DIR is usually WP_CONTENT_DIR . '/languages/'.
66 + * No other fallback location is supported.
154 67 *
155 - * @since 3.16.0
156 - */
157 -function parsely_content_helper_editor_sidebar_features(): void {
158 - if ( ! isset( $GLOBALS['parsely_editor_sidebar'] ) ) {
159 - /**
160 - * The Editor Sidebar instance.
161 - *
162 - * @since 3.16.0
163 - * @var Editor_Sidebar $GLOBALS['parsely_editor_sidebar']
164 - */
165 - $GLOBALS['parsely_editor_sidebar'] = new Editor_Sidebar( $GLOBALS['parsely'] );
166 - $GLOBALS['parsely_editor_sidebar']->init_features();
167 - }
168 -}
169 -
170 -add_action( 'widgets_init', __NAMESPACE__ . '\\parsely_recommended_widget_register' );
171 -/**
172 - * Registers the Parse.ly Recommended widget.
173 - */
174 -function parsely_recommended_widget_register(): void {
175 - register_widget( new Recommended_Widget( $GLOBALS['parsely'] ) );
176 -}
177 -
178 -add_action( 'init', __NAMESPACE__ . '\\parsely_integrations' ); // @phpstan-ignore-line
179 -/**
180 - * Instantiates Integrations collection and registers built-in integrations.
68 + * This can be removed once minimum supported WordPress is 4.6 or later.
181 69 *
182 - * @since 2.6.0
183 - *
184 - * @param Parsely|string|null $parsely The Parsely object to pass to the integrations.
185 - * @return Integrations
70 + * @since 2.5.0
186 71 */
187 -function parsely_integrations( $parsely = null ): Integrations {
188 - // If $parsely value is "", then this function is being called by the init
189 - // hook and we can get the value from $GLOBALS. If $parsely is an instance
190 - // of the Parsely object, then this function is being called by a test.
191 - if ( ! is_object( $parsely ) || get_class( $parsely ) !== Parsely::class ) {
192 - $parsely = $GLOBALS['parsely'];
193 - }
194 -
195 - $parsely_integrations = new Integrations( $parsely );
196 - $parsely_integrations->register( 'amp', Amp::class );
197 - $parsely_integrations->register( 'webstories', Google_Web_Stories::class );
198 - $parsely_integrations = apply_filters( 'wp_parsely_add_integration', $parsely_integrations );
199 - $parsely_integrations->integrate();
200 -
201 - return $parsely_integrations;
72 +function parsely_load_textdomain() {
73 + load_plugin_textdomain( 'wp-parsely' );
202 74 }