PluginProbe
Parse.ly / 3.0.2
Parse.ly v3.0.2
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
wp-parsely / wp-parsely.php

wp-parsely.php in Parse.ly 3.0.2, at wp-parsely.php

119 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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: 3.0.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: 7.1
22 * Requires WP: 5.0.0
23 */
24
25 declare(strict_types=1);
26
27 namespace Parsely;
28
29 use Parsely\Integrations\Amp;
30 use Parsely\Integrations\Facebook_Instant_Articles;
31 use Parsely\Integrations\Integrations;
32 use Parsely\UI\Admin_Warning;
33 use Parsely\UI\Plugins_Actions;
34 use Parsely\UI\Recommended_Widget;
35 use Parsely\UI\Row_Actions;
36 use Parsely\UI\Settings_Page;
37
38 if ( class_exists( Parsely::class ) ) {
39 return;
40 }
41
42 const PARSELY_VERSION = '3.0.2';
43 const PARSELY_FILE = __FILE__;
44
45 require __DIR__ . '/src/class-parsely.php';
46 require __DIR__ . '/src/class-scripts.php';
47 add_action(
48 'plugins_loaded',
49 function(): void {
50 $GLOBALS['parsely'] = new Parsely();
51 $GLOBALS['parsely']->run();
52
53 $scripts = new Scripts( $GLOBALS['parsely'] );
54 $scripts->run();
55 }
56 );
57
58 // Until auto-loading happens, we need to include this file for tests as well.
59 require __DIR__ . '/src/UI/class-admin-warning.php';
60 require __DIR__ . '/src/UI/class-plugins-actions.php';
61 require __DIR__ . '/src/UI/class-row-actions.php';
62 add_action(
63 'admin_init',
64 function(): void {
65 $admin_warning = new Admin_Warning( $GLOBALS['parsely'] );
66 $admin_warning->run();
67
68 $GLOBALS['parsely_ui_plugins_actions'] = new Plugins_Actions();
69 $GLOBALS['parsely_ui_plugins_actions']->run();
70
71 $row_actions = new Row_Actions( $GLOBALS['parsely'] );
72 $row_actions->run();
73 }
74 );
75
76 require __DIR__ . '/src/UI/class-settings-page.php';
77 add_action(
78 '_admin_menu',
79 function(): void {
80 $settings_page = new Settings_Page( $GLOBALS['parsely'] );
81 $settings_page->run();
82 }
83 );
84
85 require __DIR__ . '/src/UI/class-recommended-widget.php';
86
87 add_action( 'widgets_init', __NAMESPACE__ . '\\parsely_recommended_widget_register' );
88 /**
89 * Register the Parse.ly Recommended widget.
90 *
91 * @return void
92 */
93 function parsely_recommended_widget_register(): void {
94 register_widget( Recommended_Widget::class );
95 }
96
97 require __DIR__ . '/src/Integrations/class-integration.php';
98 require __DIR__ . '/src/Integrations/class-integrations.php';
99 require __DIR__ . '/src/Integrations/class-amp.php';
100 require __DIR__ . '/src/Integrations/class-facebook-instant-articles.php';
101
102 add_action( 'init', __NAMESPACE__ . '\\parsely_integrations' );
103 /**
104 * Instantiate Integrations collection and register built-in integrations.
105 *
106 * @since 2.6.0
107 *
108 * @return Integrations
109 */
110 function parsely_integrations(): Integrations {
111 $parsely_integrations = new Integrations();
112 $parsely_integrations->register( 'amp', Amp::class );
113 $parsely_integrations->register( 'fbia', Facebook_Instant_Articles::class );
114 $parsely_integrations = apply_filters( 'wp_parsely_add_integration', $parsely_integrations );
115 $parsely_integrations->integrate();
116
117 return $parsely_integrations;
118 }
119