Completed
Branch BUG/invalid-field-count (62be81)
by
unknown
78:11 queued 64:42
created
core/libraries/plugin_api/EE_Register_Personal_Data_Exporter.lib.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -13,55 +13,55 @@
 block discarded – undo
13 13
 class EE_Register_Personal_Data_Exporter implements EEI_Plugin_API
14 14
 {
15 15
 
16
-    /**
17
-     * FQCN for all privacy policy generators
18
-     *
19
-     * @var array keys are plugin_ids, and values are an array of FQCNs or FQCNs
20
-     */
21
-    protected static $exporters = array();
16
+	/**
17
+	 * FQCN for all privacy policy generators
18
+	 *
19
+	 * @var array keys are plugin_ids, and values are an array of FQCNs or FQCNs
20
+	 */
21
+	protected static $exporters = array();
22 22
 
23 23
 
24
-    /*
24
+	/*
25 25
      * @param string $plugin_id
26 26
      * @param array $FQNSs can be the fully qualified namespaces each containing only privacy policies,
27 27
      *              OR fully qualified class names of privacy policies
28 28
      */
29
-    public static function register($plugin_id = null, $FQCNs = array())
30
-    {
31
-        self::$exporters[ $plugin_id ] = $FQCNs;
32
-        // add to list of modules to be registered
33
-        add_filter(
34
-            'FHEE__EventEspresso_core_services_privacy_export_PersonalDataExporterManager__exporters',
35
-            array('EE_Register_Personal_Data_Exporter', 'addExporters')
36
-        );
37
-    }
29
+	public static function register($plugin_id = null, $FQCNs = array())
30
+	{
31
+		self::$exporters[ $plugin_id ] = $FQCNs;
32
+		// add to list of modules to be registered
33
+		add_filter(
34
+			'FHEE__EventEspresso_core_services_privacy_export_PersonalDataExporterManager__exporters',
35
+			array('EE_Register_Personal_Data_Exporter', 'addExporters')
36
+		);
37
+	}
38 38
 
39 39
 
40
-    /**
41
-     * @param null $ID
42
-     */
43
-    public static function deregister($ID = null)
44
-    {
45
-        unset(self::$exporters[ $ID ]);
46
-    }
40
+	/**
41
+	 * @param null $ID
42
+	 */
43
+	public static function deregister($ID = null)
44
+	{
45
+		unset(self::$exporters[ $ID ]);
46
+	}
47 47
 
48 48
 
49
-    /**
50
-     * Adds our personal data exporters registered by add-ons
51
-     *
52
-     * @param string[] $exporters
53
-     * @return string[]
54
-     */
55
-    public static function addExporters(array $exporters)
56
-    {
57
-        foreach (self::$exporters as $exporters_per_addon) {
58
-            $exporters = array_merge(
59
-                $exporters,
60
-                $exporters_per_addon
61
-            );
62
-        }
63
-        return $exporters;
64
-    }
49
+	/**
50
+	 * Adds our personal data exporters registered by add-ons
51
+	 *
52
+	 * @param string[] $exporters
53
+	 * @return string[]
54
+	 */
55
+	public static function addExporters(array $exporters)
56
+	{
57
+		foreach (self::$exporters as $exporters_per_addon) {
58
+			$exporters = array_merge(
59
+				$exporters,
60
+				$exporters_per_addon
61
+			);
62
+		}
63
+		return $exporters;
64
+	}
65 65
 }
66 66
 // End of file EE_Register_Personal_Data_Exporter.lib.php
67 67
 // Location: ${NAMESPACE}/EE_Register_Personal_Data_Exporter.lib.php
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public static function register($plugin_id = null, $FQCNs = array())
30 30
     {
31
-        self::$exporters[ $plugin_id ] = $FQCNs;
31
+        self::$exporters[$plugin_id] = $FQCNs;
32 32
         // add to list of modules to be registered
33 33
         add_filter(
34 34
             'FHEE__EventEspresso_core_services_privacy_export_PersonalDataExporterManager__exporters',
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public static function deregister($ID = null)
44 44
     {
45
-        unset(self::$exporters[ $ID ]);
45
+        unset(self::$exporters[$ID]);
46 46
     }
47 47
 
48 48
 
Please login to merge, or discard this patch.
core/services/privacy/export/PersonalDataExporterInterface.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -14,35 +14,35 @@
 block discarded – undo
14 14
  */
15 15
 interface PersonalDataExporterInterface
16 16
 {
17
-    /**
18
-     * Gets the Translated name of this exporter
19
-     *
20
-     * @return string
21
-     */
22
-    public function name();
17
+	/**
18
+	 * Gets the Translated name of this exporter
19
+	 *
20
+	 * @return string
21
+	 */
22
+	public function name();
23 23
 
24
-    /**
25
-     * Returns data for export.
26
-     *
27
-     * @param string    $email_address ,
28
-     * @param int       $page          starts at 1, not 0
29
-     * @return array {
30
-     * @type array      $data          {
31
-     * @type array {
32
-     * @type string     $group_id      (not translated, same for all exports)
33
-     * @type string     $group_label   (translated string)
34
-     * @type string|int $item_id
35
-     * @type array      $data          {
36
-     * @type array {
37
-     * @type string     $name          what's shown in the left-column of the export row
38
-     * @type string     $value         what's showin the right-column of the export row
39
-     *                                 }
40
-     *                                 }
41
-     *                                 }
42
-     *                                 }
43
-     *                                 }
44
-     */
45
-    public function export($email_address, $page = 1);
24
+	/**
25
+	 * Returns data for export.
26
+	 *
27
+	 * @param string    $email_address ,
28
+	 * @param int       $page          starts at 1, not 0
29
+	 * @return array {
30
+	 * @type array      $data          {
31
+	 * @type array {
32
+	 * @type string     $group_id      (not translated, same for all exports)
33
+	 * @type string     $group_label   (translated string)
34
+	 * @type string|int $item_id
35
+	 * @type array      $data          {
36
+	 * @type array {
37
+	 * @type string     $name          what's shown in the left-column of the export row
38
+	 * @type string     $value         what's showin the right-column of the export row
39
+	 *                                 }
40
+	 *                                 }
41
+	 *                                 }
42
+	 *                                 }
43
+	 *                                 }
44
+	 */
45
+	public function export($email_address, $page = 1);
46 46
 }
47 47
 // End of file PersonalDataExporterInterface.php
48 48
 // Location: EventEspresso\core\domain\services\admin/PersonalDataExporterInterface.php
Please login to merge, or discard this patch.
core/domain/services/admin/privacy/erasure/EraseAttendeeData.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -16,73 +16,73 @@
 block discarded – undo
16 16
 class EraseAttendeeData implements PersonalDataEraserInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @var EEM_Attendee
21
-     */
22
-    protected $attendee_model;
19
+	/**
20
+	 * @var EEM_Attendee
21
+	 */
22
+	protected $attendee_model;
23 23
 
24 24
 
25
-    /**
26
-     * EraseAttendeeData constructor.
27
-     *
28
-     * @param EEM_Attendee $attendee_model
29
-     */
30
-    public function __construct(EEM_Attendee $attendee_model)
31
-    {
32
-        $this->attendee_model = $attendee_model;
33
-    }
25
+	/**
26
+	 * EraseAttendeeData constructor.
27
+	 *
28
+	 * @param EEM_Attendee $attendee_model
29
+	 */
30
+	public function __construct(EEM_Attendee $attendee_model)
31
+	{
32
+		$this->attendee_model = $attendee_model;
33
+	}
34 34
 
35 35
 
36
-    /**
37
-     * Gets a translated string name for the data eraser
38
-     *
39
-     * @return string
40
-     */
41
-    public function name()
42
-    {
43
-        return esc_html__('Event Espresso Attendee Data', 'event_espresso');
44
-    }
36
+	/**
37
+	 * Gets a translated string name for the data eraser
38
+	 *
39
+	 * @return string
40
+	 */
41
+	public function name()
42
+	{
43
+		return esc_html__('Event Espresso Attendee Data', 'event_espresso');
44
+	}
45 45
 
46 46
 
47
-    /**
48
-     * Erases a "page" of personal user data
49
-     *
50
-     * @return array {
51
-     * @type boolean $items_removed  whether items were removed successfully or not
52
-     * @type boolean $items_retained whether any items were skipped or not
53
-     * @type array   $messages       values are messages to show
54
-     * @type boolean $done           whether this eraser is done or has more pages
55
-     *               }
56
-     * @throws \EE_Error
57
-     */
58
-    public function erase($email_address, $page = 1)
59
-    {
60
-        $rows_updated = $this->attendee_model->update(
61
-            array(
62
-                'ATT_fname'    => esc_html__('Anonymous', 'event_espresso'),
63
-                'ATT_lname'    => '',
64
-                'ATT_email'    => '',
65
-                'ATT_address'  => '',
66
-                'ATT_address2' => '',
67
-                'ATT_city'     => '',
68
-                'STA_ID'       => 0,
69
-                'CNT_ISO'      => '',
70
-                'ATT_zip'      => '',
71
-            ),
72
-            array(
73
-                array(
74
-                    'ATT_email' => $email_address,
75
-                ),
76
-            )
77
-        );
47
+	/**
48
+	 * Erases a "page" of personal user data
49
+	 *
50
+	 * @return array {
51
+	 * @type boolean $items_removed  whether items were removed successfully or not
52
+	 * @type boolean $items_retained whether any items were skipped or not
53
+	 * @type array   $messages       values are messages to show
54
+	 * @type boolean $done           whether this eraser is done or has more pages
55
+	 *               }
56
+	 * @throws \EE_Error
57
+	 */
58
+	public function erase($email_address, $page = 1)
59
+	{
60
+		$rows_updated = $this->attendee_model->update(
61
+			array(
62
+				'ATT_fname'    => esc_html__('Anonymous', 'event_espresso'),
63
+				'ATT_lname'    => '',
64
+				'ATT_email'    => '',
65
+				'ATT_address'  => '',
66
+				'ATT_address2' => '',
67
+				'ATT_city'     => '',
68
+				'STA_ID'       => 0,
69
+				'CNT_ISO'      => '',
70
+				'ATT_zip'      => '',
71
+			),
72
+			array(
73
+				array(
74
+					'ATT_email' => $email_address,
75
+				),
76
+			)
77
+		);
78 78
 
79
-        return array(
80
-            'items_removed'  => (bool) $rows_updated,
81
-            'items_retained' => false, // always false in this example
82
-            'messages'       => array(),
83
-            'done'           => true,
84
-        );
85
-    }
79
+		return array(
80
+			'items_removed'  => (bool) $rows_updated,
81
+			'items_retained' => false, // always false in this example
82
+			'messages'       => array(),
83
+			'done'           => true,
84
+		);
85
+	}
86 86
 }
87 87
 // End of file EraseAttendeeData.php
88 88
 // Location: EventEspresso\core\domain\services\privacy\erasure/EraseAttendeeData.php
Please login to merge, or discard this patch.
core/services/privacy/erasure/PersonalDataEraserInterface.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,25 +15,25 @@
 block discarded – undo
15 15
 interface PersonalDataEraserInterface
16 16
 {
17 17
 
18
-    /**
19
-     * Gets a translated string name for the data eraser
20
-     *
21
-     * @return string
22
-     */
23
-    public function name();
18
+	/**
19
+	 * Gets a translated string name for the data eraser
20
+	 *
21
+	 * @return string
22
+	 */
23
+	public function name();
24 24
 
25 25
 
26
-    /**
27
-     * Erases a "page" of personal user data
28
-     *
29
-     * @return array {
30
-     * @type boolean $items_removed  whether items were removed successfully or not
31
-     * @type boolean $items_retained whether any items were skipped or not
32
-     * @type array   $messages       values are messages to show
33
-     * @type boolean $done           whether this eraser is done or has more pages
34
-     *               }
35
-     */
36
-    public function erase($email_address, $page = 1);
26
+	/**
27
+	 * Erases a "page" of personal user data
28
+	 *
29
+	 * @return array {
30
+	 * @type boolean $items_removed  whether items were removed successfully or not
31
+	 * @type boolean $items_retained whether any items were skipped or not
32
+	 * @type array   $messages       values are messages to show
33
+	 * @type boolean $done           whether this eraser is done or has more pages
34
+	 *               }
35
+	 */
36
+	public function erase($email_address, $page = 1);
37 37
 }
38 38
 // End of file PersonalDataEraserInterface.php
39 39
 // Location: EventEspresso\core\domain\services\admin/PersonalDataEraserInterface.php
Please login to merge, or discard this patch.
core/domain/services/admin/privacy/policy/privacy_policy.template.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 ?>
8 8
 <h2><?php esc_html_e('Event Registration Data', 'event_espresso'); ?></h2>
9 9
 <p><?php
10
-    esc_html_e(
11
-        'We collect information about you during event registration. This information may include but is not limited to:',
12
-        'event_espresso'
13
-    ); ?></p>
10
+	esc_html_e(
11
+		'We collect information about you during event registration. This information may include but is not limited to:',
12
+		'event_espresso'
13
+	); ?></p>
14 14
 <ul>
15 15
     <li><?php esc_html_e('Your names', 'event_espresso'); ?></li>
16 16
     <li><?php esc_html_e('Billing address', 'event_espresso'); ?></li>
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
     <li><?php esc_html_e('Phone number', 'event_espresso'); ?></li>
20 20
     <li><?php esc_html_e('Location and traffic data (including IP address and browser type)', 'event_espresso'); ?></li>
21 21
     <li><?php
22
-        esc_html_e(
23
-            'Any other details that might be requested from you for the purpose of processing your registration or ticket purchase',
24
-            'event_espresso'
25
-        ); ?></li>
22
+		esc_html_e(
23
+			'Any other details that might be requested from you for the purpose of processing your registration or ticket purchase',
24
+			'event_espresso'
25
+		); ?></li>
26 26
 </ul>
27 27
 
28 28
 <p><?php esc_html_e('Handling this data also allows us to:', 'event_espresso'); ?></p>
@@ -30,103 +30,103 @@  discard block
 block discarded – undo
30 30
     <li><?php esc_html_e('Send you important account/purchase/service information.', 'event_espresso'); ?></li>
31 31
     <li><?php esc_html_e('Respond to your queries, refund requests, or complaints.', 'event_espresso'); ?></li>
32 32
     <li><?php
33
-        esc_html_e(
34
-            'Process payments and prevent fraudulent transactions. We do this on the basis of our legitimate business interests.',
35
-            'event_espresso'
36
-        ); ?></li>
33
+		esc_html_e(
34
+			'Process payments and prevent fraudulent transactions. We do this on the basis of our legitimate business interests.',
35
+			'event_espresso'
36
+		); ?></li>
37 37
     <li><?php
38
-        esc_html_e(
39
-            'Set up and administer your account, provide technical and customer support, and to verify your identity.',
40
-            'event_espresso'
41
-        ); ?></li>
38
+		esc_html_e(
39
+			'Set up and administer your account, provide technical and customer support, and to verify your identity.',
40
+			'event_espresso'
41
+		); ?></li>
42 42
 </ul>
43 43
 
44 44
 <?php if (! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
45 45
     <h2><?php esc_html_e('Billing Information', 'event_espresso'); ?> </h2>
46 46
     <?php
47 47
 // if onsite or offsite payment methods are active
48
-    if (! empty($active_onsite_payment_methods)) { ?>
48
+	if (! empty($active_onsite_payment_methods)) { ?>
49 49
         <p><?php
50
-            esc_html_e(
51
-                'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
52
-                'event_espresso'
53
-            ); ?></p>
50
+			esc_html_e(
51
+				'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
52
+				'event_espresso'
53
+			); ?></p>
54 54
         <p><?php
55
-            printf(
56
-                esc_html_x(
57
-                    'Please see the privacy policy of %1$s.',
58
-                    'Please see the privacy policy of PayPal Pro',
59
-                    'event_espresso'
60
-                ),
61
-                implode(
62
-                    ', ',
63
-                    array_merge(
64
-                        $active_onsite_payment_methods,
65
-                        $active_offsite_payment_methods
66
-                    )
67
-                )
68
-            ); ?></p>
55
+			printf(
56
+				esc_html_x(
57
+					'Please see the privacy policy of %1$s.',
58
+					'Please see the privacy policy of PayPal Pro',
59
+					'event_espresso'
60
+				),
61
+				implode(
62
+					', ',
63
+					array_merge(
64
+						$active_onsite_payment_methods,
65
+						$active_offsite_payment_methods
66
+					)
67
+				)
68
+			); ?></p>
69 69
         <p><?php
70
-            esc_html_e(
71
-                'Masked billing information may be stored on our servers (eg only the last 4 digits of credit card numbers are stored: **** **** **** 1234).',
72
-                'event_espresso'
73
-            ); ?></p>
70
+			esc_html_e(
71
+				'Masked billing information may be stored on our servers (eg only the last 4 digits of credit card numbers are stored: **** **** **** 1234).',
72
+				'event_espresso'
73
+			); ?></p>
74 74
     <?php } // IF OFFSITE PAYMENT METHOD ACTIVE
75
-    elseif (! empty($active_onsite_payment_methods)) { ?>
75
+	elseif (! empty($active_onsite_payment_methods)) { ?>
76 76
         <p><?php
77
-            printf(
78
-                esc_html_x(
79
-                    'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of %1$s.',
80
-                    'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of PayPal Pro.',
81
-                    'event_espresso'
82
-                ),
83
-                implode(', ', $active_offsite_payment_methods)
84
-            ); ?></p>
77
+			printf(
78
+				esc_html_x(
79
+					'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of %1$s.',
80
+					'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of PayPal Pro.',
81
+					'event_espresso'
82
+				),
83
+				implode(', ', $active_offsite_payment_methods)
84
+			); ?></p>
85 85
     <?php } ?>
86 86
     <h2><?php esc_html_e('Payment Logging', 'event_espresso'); ?></h2>
87 87
     <p><?php
88
-        esc_html_e(
89
-            'Site administrators may keep a log of communications with the payment processors in order to verify payments are being processed correctly. These logs are automatically deleted after a week.',
90
-            'event_espresso'
91
-        ); ?></p>
88
+		esc_html_e(
89
+			'Site administrators may keep a log of communications with the payment processors in order to verify payments are being processed correctly. These logs are automatically deleted after a week.',
90
+			'event_espresso'
91
+		); ?></p>
92 92
 <?php } ?>
93 93
 
94 94
 <h2><?php esc_html_e('Event Registration Cookies', 'event_espresso'); ?></h2>
95 95
 <p><?php
96
-    printf(
97
-        esc_html_x(
98
-            'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts %1$s.',
99
-            'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts 2 hours.',
100
-            'event_espresso'
101
-        ),
102
-        $session_lifespan
103
-    ); ?></p>
96
+	printf(
97
+		esc_html_x(
98
+			'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts %1$s.',
99
+			'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts 2 hours.',
100
+			'event_espresso'
101
+		),
102
+		$session_lifespan
103
+	); ?></p>
104 104
 
105 105
 <h2><?php esc_html_e('Email History Data', 'event_espresso'); ?></h2>
106 106
 <p><?php
107
-    esc_html_e(
108
-        'We keep a record of the emails sent to you. This is to ensure communication is successfully sent and its information is accurate.',
109
-        'event_espresso'
110
-    ); ?></p>
107
+	esc_html_e(
108
+		'We keep a record of the emails sent to you. This is to ensure communication is successfully sent and its information is accurate.',
109
+		'event_espresso'
110
+	); ?></p>
111 111
 
112 112
 <h2><?php esc_html_e('Event Check-In Record', 'event_espresso'); ?></h2>
113 113
 <p><?php
114
-    esc_html_e(
115
-        'When you attend an event, an event manager may record the time you check in or out of the event.',
116
-        'event_espresso'
117
-    ); ?></p>
114
+	esc_html_e(
115
+		'When you attend an event, an event manager may record the time you check in or out of the event.',
116
+		'event_espresso'
117
+	); ?></p>
118 118
 
119 119
 <h2><?php esc_html_e('Event Registration Data Retention', 'event_espresso'); ?></h2>
120 120
 <p><?php
121
-    esc_html_e(
122
-        'Personal data is stored at least until the date of the event, and may be kept indefinitely in case of future registrations.',
123
-        'event_espresso'
124
-    ); ?></p>
121
+	esc_html_e(
122
+		'Personal data is stored at least until the date of the event, and may be kept indefinitely in case of future registrations.',
123
+		'event_espresso'
124
+	); ?></p>
125 125
 
126 126
 <h2><?php esc_html_e('Event Registration Data Erasure and Export', 'event_espresso'); ?></h2>
127 127
 <p><?php
128
-    esc_html_e(
129
-        'You have the right to request your personal data be sent to you electronically, and the right to request your registration data be erased after the event. To do so, please contact the event manager or site administrator.',
130
-        'event_espresso'
131
-    ); ?></p>
128
+	esc_html_e(
129
+		'You have the right to request your personal data be sent to you electronically, and the right to request your registration data be erased after the event. To do so, please contact the event manager or site administrator.',
130
+		'event_espresso'
131
+	); ?></p>
132 132
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
         ); ?></li>
42 42
 </ul>
43 43
 
44
-<?php if (! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
44
+<?php if ( ! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
45 45
     <h2><?php esc_html_e('Billing Information', 'event_espresso'); ?> </h2>
46 46
     <?php
47 47
 // if onsite or offsite payment methods are active
48
-    if (! empty($active_onsite_payment_methods)) { ?>
48
+    if ( ! empty($active_onsite_payment_methods)) { ?>
49 49
         <p><?php
50 50
             esc_html_e(
51 51
                 'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 'event_espresso'
73 73
             ); ?></p>
74 74
     <?php } // IF OFFSITE PAYMENT METHOD ACTIVE
75
-    elseif (! empty($active_onsite_payment_methods)) { ?>
75
+    elseif ( ! empty($active_onsite_payment_methods)) { ?>
76 76
         <p><?php
77 77
             printf(
78 78
                 esc_html_x(
Please login to merge, or discard this patch.
core/services/privacy/export/PersonalDataExporterManager.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -23,68 +23,68 @@
 block discarded – undo
23 23
 class PersonalDataExporterManager
24 24
 {
25 25
 
26
-    public function __construct()
27
-    {
28
-        add_filter(
29
-            'wp_privacy_personal_data_exporters',
30
-            array($this, 'hookInExporters')
31
-        );
32
-    }
26
+	public function __construct()
27
+	{
28
+		add_filter(
29
+			'wp_privacy_personal_data_exporters',
30
+			array($this, 'hookInExporters')
31
+		);
32
+	}
33 33
 
34 34
 
35
-    /**
36
-     * Adds EE's exporters to the list of WP exporters
37
-     *
38
-     * @param array $exporters
39
-     * @return array
40
-     */
41
-    public function hookInExporters($exporters)
42
-    {
43
-        // load all the privacy policy stuff
44
-        // add post policy text
45
-        foreach ($this->loadPrivateDataExporterCollection() as $exporter) {
46
-            $exporters[ get_class($exporter) ] = array(
47
-                'exporter_friendly_name' => $exporter->name(),
48
-                'callback'               => array($exporter, 'export'),
49
-            );
50
-        }
51
-        return $exporters;
52
-    }
35
+	/**
36
+	 * Adds EE's exporters to the list of WP exporters
37
+	 *
38
+	 * @param array $exporters
39
+	 * @return array
40
+	 */
41
+	public function hookInExporters($exporters)
42
+	{
43
+		// load all the privacy policy stuff
44
+		// add post policy text
45
+		foreach ($this->loadPrivateDataExporterCollection() as $exporter) {
46
+			$exporters[ get_class($exporter) ] = array(
47
+				'exporter_friendly_name' => $exporter->name(),
48
+				'callback'               => array($exporter, 'export'),
49
+			);
50
+		}
51
+		return $exporters;
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * @return CollectionInterface|PersonalDataExporterInterface[]
57
-     * @throws InvalidIdentifierException
58
-     * @throws InvalidInterfaceException
59
-     * @throws InvalidFilePathException
60
-     * @throws InvalidEntityException
61
-     * @throws InvalidDataTypeException
62
-     * @throws InvalidClassException
63
-     */
64
-    protected function loadPrivateDataExporterCollection()
65
-    {
66
-        $loader = new CollectionLoader(
67
-            new CollectionDetails(
68
-                // collection name
69
-                'personal_data_exporters',
70
-                // collection interface
71
-                'EventEspresso\core\services\privacy\export\PersonalDataExporterInterface',
72
-                // FQCNs for classes to add (all classes within that namespace will be loaded)
73
-                apply_filters(
74
-                    'FHEE__EventEspresso_core_services_privacy_export_PersonalDataExporterManager__exporters',
75
-                    array('EventEspresso\core\domain\services\admin\privacy\export')
76
-                ),
77
-                // filepaths to classes to add
78
-                array(),
79
-                // file mask to use if parsing folder for files to add
80
-                '',
81
-                // what to use as identifier for collection entities
82
-                // using CLASS NAME prevents duplicates (works like a singleton)
83
-                CollectionDetails::ID_CLASS_NAME
84
-            )
85
-        );
86
-        return $loader->getCollection();
87
-    }
55
+	/**
56
+	 * @return CollectionInterface|PersonalDataExporterInterface[]
57
+	 * @throws InvalidIdentifierException
58
+	 * @throws InvalidInterfaceException
59
+	 * @throws InvalidFilePathException
60
+	 * @throws InvalidEntityException
61
+	 * @throws InvalidDataTypeException
62
+	 * @throws InvalidClassException
63
+	 */
64
+	protected function loadPrivateDataExporterCollection()
65
+	{
66
+		$loader = new CollectionLoader(
67
+			new CollectionDetails(
68
+				// collection name
69
+				'personal_data_exporters',
70
+				// collection interface
71
+				'EventEspresso\core\services\privacy\export\PersonalDataExporterInterface',
72
+				// FQCNs for classes to add (all classes within that namespace will be loaded)
73
+				apply_filters(
74
+					'FHEE__EventEspresso_core_services_privacy_export_PersonalDataExporterManager__exporters',
75
+					array('EventEspresso\core\domain\services\admin\privacy\export')
76
+				),
77
+				// filepaths to classes to add
78
+				array(),
79
+				// file mask to use if parsing folder for files to add
80
+				'',
81
+				// what to use as identifier for collection entities
82
+				// using CLASS NAME prevents duplicates (works like a singleton)
83
+				CollectionDetails::ID_CLASS_NAME
84
+			)
85
+		);
86
+		return $loader->getCollection();
87
+	}
88 88
 }
89 89
 
90 90
 // End of file PersonalDataExporterManager.php
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         // load all the privacy policy stuff
44 44
         // add post policy text
45 45
         foreach ($this->loadPrivateDataExporterCollection() as $exporter) {
46
-            $exporters[ get_class($exporter) ] = array(
46
+            $exporters[get_class($exporter)] = array(
47 47
                 'exporter_friendly_name' => $exporter->name(),
48 48
                 'callback'               => array($exporter, 'export'),
49 49
             );
Please login to merge, or discard this patch.
core/services/privacy/erasure/PersonalDataEraserManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         // load all the privacy policy stuff
41 41
         // add post policy text
42 42
         foreach ($this->loadPrivateDataEraserCollection() as $eraser) {
43
-            $erasers[ get_class($eraser) ] = array(
43
+            $erasers[get_class($eraser)] = array(
44 44
                 'eraser_friendly_name' => $eraser->name(),
45 45
                 'callback'             => array($eraser, 'erase'),
46 46
             );
Please login to merge, or discard this patch.
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -23,65 +23,65 @@
 block discarded – undo
23 23
 class PersonalDataEraserManager
24 24
 {
25 25
 
26
-    public function __construct()
27
-    {
28
-        add_filter(
29
-            'wp_privacy_personal_data_erasers',
30
-            array($this, 'hookInErasers')
31
-        );
32
-    }
26
+	public function __construct()
27
+	{
28
+		add_filter(
29
+			'wp_privacy_personal_data_erasers',
30
+			array($this, 'hookInErasers')
31
+		);
32
+	}
33 33
 
34 34
 
35
-    /**
36
-     * For all the registered `PrivateDataEraserInterface`s, add them as erasers
37
-     */
38
-    public function hookInErasers($erasers)
39
-    {
40
-        // load all the privacy policy stuff
41
-        // add post policy text
42
-        foreach ($this->loadPrivateDataEraserCollection() as $eraser) {
43
-            $erasers[ get_class($eraser) ] = array(
44
-                'eraser_friendly_name' => $eraser->name(),
45
-                'callback'             => array($eraser, 'erase'),
46
-            );
47
-        }
48
-        return $erasers;
49
-    }
35
+	/**
36
+	 * For all the registered `PrivateDataEraserInterface`s, add them as erasers
37
+	 */
38
+	public function hookInErasers($erasers)
39
+	{
40
+		// load all the privacy policy stuff
41
+		// add post policy text
42
+		foreach ($this->loadPrivateDataEraserCollection() as $eraser) {
43
+			$erasers[ get_class($eraser) ] = array(
44
+				'eraser_friendly_name' => $eraser->name(),
45
+				'callback'             => array($eraser, 'erase'),
46
+			);
47
+		}
48
+		return $erasers;
49
+	}
50 50
 
51 51
 
52
-    /**
53
-     * @return CollectionInterface|PersonalDataEraserInterface[]
54
-     * @throws InvalidIdentifierException
55
-     * @throws InvalidInterfaceException
56
-     * @throws InvalidFilePathException
57
-     * @throws InvalidEntityException
58
-     * @throws InvalidDataTypeException
59
-     * @throws InvalidClassException
60
-     */
61
-    protected function loadPrivateDataEraserCollection()
62
-    {
63
-        $loader = new CollectionLoader(
64
-            new CollectionDetails(
65
-                // collection name
66
-                'privacy_erasers',
67
-                // collection interface
68
-                'EventEspresso\core\services\privacy\erasure\PersonalDataEraserInterface',
69
-                // FQCNs for classes to add (all classes within that namespace will be loaded)
70
-                apply_filters(
71
-                    'FHEE__EventEspresso_core_services_privacy_erasure_PersonalDataEraserManager__erasers',
72
-                    array('EventEspresso\core\domain\services\admin\privacy\erasure')
73
-                ),
74
-                // filepaths to classes to add
75
-                array(),
76
-                // file mask to use if parsing folder for files to add
77
-                '',
78
-                // what to use as identifier for collection entities
79
-                // using CLASS NAME prevents duplicates (works like a singleton)
80
-                CollectionDetails::ID_CLASS_NAME
81
-            )
82
-        );
83
-        return $loader->getCollection();
84
-    }
52
+	/**
53
+	 * @return CollectionInterface|PersonalDataEraserInterface[]
54
+	 * @throws InvalidIdentifierException
55
+	 * @throws InvalidInterfaceException
56
+	 * @throws InvalidFilePathException
57
+	 * @throws InvalidEntityException
58
+	 * @throws InvalidDataTypeException
59
+	 * @throws InvalidClassException
60
+	 */
61
+	protected function loadPrivateDataEraserCollection()
62
+	{
63
+		$loader = new CollectionLoader(
64
+			new CollectionDetails(
65
+				// collection name
66
+				'privacy_erasers',
67
+				// collection interface
68
+				'EventEspresso\core\services\privacy\erasure\PersonalDataEraserInterface',
69
+				// FQCNs for classes to add (all classes within that namespace will be loaded)
70
+				apply_filters(
71
+					'FHEE__EventEspresso_core_services_privacy_erasure_PersonalDataEraserManager__erasers',
72
+					array('EventEspresso\core\domain\services\admin\privacy\erasure')
73
+				),
74
+				// filepaths to classes to add
75
+				array(),
76
+				// file mask to use if parsing folder for files to add
77
+				'',
78
+				// what to use as identifier for collection entities
79
+				// using CLASS NAME prevents duplicates (works like a singleton)
80
+				CollectionDetails::ID_CLASS_NAME
81
+			)
82
+		);
83
+		return $loader->getCollection();
84
+	}
85 85
 }
86 86
 // End of file PersonalDataEraserManager.php
87 87
 // Location: EventEspresso\core\domain\services\admin/PersonalDataEraserManager.php
Please login to merge, or discard this patch.
core/services/privacy/policy/PrivacyPolicyManager.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,6 @@
 block discarded – undo
33 33
     /**
34 34
      * For all the registered `PrivacyPolicyInterface`s, add their privacy policy content
35 35
      *
36
-     * @param WP_Post $post
37 36
      */
38 37
     public function addPrivacyPolicy()
39 38
     {
Please login to merge, or discard this patch.
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -24,64 +24,64 @@
 block discarded – undo
24 24
 class PrivacyPolicyManager
25 25
 {
26 26
 
27
-    public function __construct()
28
-    {
29
-        add_action('admin_init', array($this, 'addPrivacyPolicy'), 9);
30
-    }
27
+	public function __construct()
28
+	{
29
+		add_action('admin_init', array($this, 'addPrivacyPolicy'), 9);
30
+	}
31 31
 
32 32
 
33
-    /**
34
-     * For all the registered `PrivacyPolicyInterface`s, add their privacy policy content
35
-     *
36
-     * @param WP_Post $post
37
-     */
38
-    public function addPrivacyPolicy()
39
-    {
40
-        $policy_page_id = (int) get_option('wp_page_for_privacy_policy');
41
-        if (! $policy_page_id) {
42
-            return;
43
-        }
44
-        // load all the privacy policy stuff
45
-        // add post policy text
46
-        foreach ($this->loadPrivacyPolicyCollection() as $privacy_policy) {
47
-            wp_add_privacy_policy_content($privacy_policy->getName(), $privacy_policy->getContent());
48
-        }
49
-    }
33
+	/**
34
+	 * For all the registered `PrivacyPolicyInterface`s, add their privacy policy content
35
+	 *
36
+	 * @param WP_Post $post
37
+	 */
38
+	public function addPrivacyPolicy()
39
+	{
40
+		$policy_page_id = (int) get_option('wp_page_for_privacy_policy');
41
+		if (! $policy_page_id) {
42
+			return;
43
+		}
44
+		// load all the privacy policy stuff
45
+		// add post policy text
46
+		foreach ($this->loadPrivacyPolicyCollection() as $privacy_policy) {
47
+			wp_add_privacy_policy_content($privacy_policy->getName(), $privacy_policy->getContent());
48
+		}
49
+	}
50 50
 
51 51
 
52
-    /**
53
-     * @return CollectionInterface|PrivacyPolicyInterface[]
54
-     * @throws InvalidIdentifierException
55
-     * @throws InvalidInterfaceException
56
-     * @throws InvalidFilePathException
57
-     * @throws InvalidEntityException
58
-     * @throws InvalidDataTypeException
59
-     * @throws InvalidClassException
60
-     */
61
-    protected function loadPrivacyPolicyCollection()
62
-    {
63
-        $loader = new CollectionLoader(
64
-            new CollectionDetails(
65
-                // collection name
66
-                'privacy_policies',
67
-                // collection interface
68
-                'EventEspresso\core\services\privacy\policy\PrivacyPolicyInterface',
69
-                // FQCNs for classes to add (all classes within that namespace will be loaded)
70
-                apply_filters(
71
-                    'FHEE__EventEspresso_core_services_privacy_policy_PrivacyPolicyManager__privacy_policies',
72
-                    array('EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy')
73
-                ),
74
-                // filepaths to classes to add
75
-                array(),
76
-                // file mask to use if parsing folder for files to add
77
-                '',
78
-                // what to use as identifier for collection entities
79
-                // using CLASS NAME prevents duplicates (works like a singleton)
80
-                CollectionDetails::ID_CLASS_NAME
81
-            )
82
-        );
83
-        return $loader->getCollection();
84
-    }
52
+	/**
53
+	 * @return CollectionInterface|PrivacyPolicyInterface[]
54
+	 * @throws InvalidIdentifierException
55
+	 * @throws InvalidInterfaceException
56
+	 * @throws InvalidFilePathException
57
+	 * @throws InvalidEntityException
58
+	 * @throws InvalidDataTypeException
59
+	 * @throws InvalidClassException
60
+	 */
61
+	protected function loadPrivacyPolicyCollection()
62
+	{
63
+		$loader = new CollectionLoader(
64
+			new CollectionDetails(
65
+				// collection name
66
+				'privacy_policies',
67
+				// collection interface
68
+				'EventEspresso\core\services\privacy\policy\PrivacyPolicyInterface',
69
+				// FQCNs for classes to add (all classes within that namespace will be loaded)
70
+				apply_filters(
71
+					'FHEE__EventEspresso_core_services_privacy_policy_PrivacyPolicyManager__privacy_policies',
72
+					array('EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy')
73
+				),
74
+				// filepaths to classes to add
75
+				array(),
76
+				// file mask to use if parsing folder for files to add
77
+				'',
78
+				// what to use as identifier for collection entities
79
+				// using CLASS NAME prevents duplicates (works like a singleton)
80
+				CollectionDetails::ID_CLASS_NAME
81
+			)
82
+		);
83
+		return $loader->getCollection();
84
+	}
85 85
 }
86 86
 // End of file PrivacyPolicyManager.php
87 87
 // Location: EventEspresso\core\domain\services\admin/PrivacyPolicyManager.php
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     public function addPrivacyPolicy()
39 39
     {
40 40
         $policy_page_id = (int) get_option('wp_page_for_privacy_policy');
41
-        if (! $policy_page_id) {
41
+        if ( ! $policy_page_id) {
42 42
             return;
43 43
         }
44 44
         // load all the privacy policy stuff
Please login to merge, or discard this patch.
core/EE_Front_Controller.core.php 1 patch
Indentation   +470 added lines, -470 removed lines patch added patch discarded remove patch
@@ -26,474 +26,474 @@
 block discarded – undo
26 26
 final class EE_Front_Controller
27 27
 {
28 28
 
29
-    /**
30
-     * @var string $_template_path
31
-     */
32
-    private $_template_path;
33
-
34
-    /**
35
-     * @var string $_template
36
-     */
37
-    private $_template;
38
-
39
-    /**
40
-     * @type EE_Registry $Registry
41
-     */
42
-    protected $Registry;
43
-
44
-    /**
45
-     * @type EE_Request_Handler $Request_Handler
46
-     */
47
-    protected $Request_Handler;
48
-
49
-    /**
50
-     * @type EE_Module_Request_Router $Module_Request_Router
51
-     */
52
-    protected $Module_Request_Router;
53
-
54
-
55
-    /**
56
-     *    class constructor
57
-     *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
-     *
59
-     * @access    public
60
-     * @param \EE_Registry              $Registry
61
-     * @param \EE_Request_Handler       $Request_Handler
62
-     * @param \EE_Module_Request_Router $Module_Request_Router
63
-     */
64
-    public function __construct(
65
-        EE_Registry $Registry,
66
-        EE_Request_Handler $Request_Handler,
67
-        EE_Module_Request_Router $Module_Request_Router
68
-    ) {
69
-        $this->Registry = $Registry;
70
-        $this->Request_Handler = $Request_Handler;
71
-        $this->Module_Request_Router = $Module_Request_Router;
72
-        // determine how to integrate WP_Query with the EE models
73
-        add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
74
-        // load other resources and begin to actually run shortcodes and modules
75
-        add_action('wp_loaded', array($this, 'wp_loaded'), 5);
76
-        // analyse the incoming WP request
77
-        add_action('parse_request', array($this, 'get_request'), 1, 1);
78
-        // process request with module factory
79
-        add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
80
-        // before headers sent
81
-        add_action('wp', array($this, 'wp'), 5);
82
-        // primarily used to process any content shortcodes
83
-        add_action('template_redirect', array($this, 'templateRedirect'), 999);
84
-        // header
85
-        add_action('wp_head', array($this, 'header_meta_tag'), 5);
86
-        add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
87
-        add_filter('template_include', array($this, 'template_include'), 1);
88
-        // display errors
89
-        add_action('loop_start', array($this, 'display_errors'), 2);
90
-        // the content
91
-        // add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
92
-        // exclude our private cpt comments
93
-        add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
94
-        // make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
95
-        add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
96
-        // action hook EE
97
-        do_action('AHEE__EE_Front_Controller__construct__done', $this);
98
-    }
99
-
100
-
101
-    /**
102
-     * @return EE_Request_Handler
103
-     */
104
-    public function Request_Handler()
105
-    {
106
-        return $this->Request_Handler;
107
-    }
108
-
109
-
110
-    /**
111
-     * @return EE_Module_Request_Router
112
-     */
113
-    public function Module_Request_Router()
114
-    {
115
-        return $this->Module_Request_Router;
116
-    }
117
-
118
-
119
-    /**
120
-     * @return LegacyShortcodesManager
121
-     */
122
-    public function getLegacyShortcodesManager()
123
-    {
124
-        return EE_Config::getLegacyShortcodesManager();
125
-    }
126
-
127
-
128
-
129
-
130
-
131
-    /***********************************************        INIT ACTION HOOK         ***********************************************/
132
-    /**
133
-     * filter_wp_comments
134
-     * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
135
-     * widgets/queries done on frontend
136
-     *
137
-     * @param  array $clauses array of comment clauses setup by WP_Comment_Query
138
-     * @return array array of comment clauses with modifications.
139
-     * @throws InvalidArgumentException
140
-     * @throws InvalidDataTypeException
141
-     * @throws InvalidInterfaceException
142
-     */
143
-    public function filter_wp_comments($clauses)
144
-    {
145
-        global $wpdb;
146
-        if (strpos($clauses['join'], $wpdb->posts) !== false) {
147
-            /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
148
-            $custom_post_types = LoaderFactory::getLoader()->getShared(
149
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
150
-            );
151
-            $cpts = $custom_post_types->getPrivateCustomPostTypes();
152
-            foreach ($cpts as $cpt => $details) {
153
-                $clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
154
-            }
155
-        }
156
-        return $clauses;
157
-    }
158
-
159
-
160
-    /**
161
-     * @return void
162
-     * @throws InvalidArgumentException
163
-     * @throws InvalidDataTypeException
164
-     * @throws InvalidInterfaceException
165
-     */
166
-    public function employ_CPT_Strategy()
167
-    {
168
-        if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
169
-            LoaderFactory::getLoader()->getShared('EE_CPT_Strategy');
170
-        }
171
-    }
172
-
173
-
174
-    /**
175
-     * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
176
-     *
177
-     * @param  string $url incoming url
178
-     * @return string         final assembled url
179
-     */
180
-    public function maybe_force_admin_ajax_ssl($url)
181
-    {
182
-        if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
183
-            $url = str_replace('http://', 'https://', $url);
184
-        }
185
-        return $url;
186
-    }
187
-
188
-
189
-
190
-
191
-
192
-
193
-    /***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
194
-
195
-
196
-    /**
197
-     *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
198
-     *    default priority init phases have run
199
-     *
200
-     * @access    public
201
-     * @return    void
202
-     */
203
-    public function wp_loaded()
204
-    {
205
-    }
206
-
207
-
208
-
209
-
210
-
211
-    /***********************************************        PARSE_REQUEST HOOK         ***********************************************/
212
-    /**
213
-     *    _get_request
214
-     *
215
-     * @access public
216
-     * @param WP $WP
217
-     * @return void
218
-     */
219
-    public function get_request(WP $WP)
220
-    {
221
-        do_action('AHEE__EE_Front_Controller__get_request__start');
222
-        $this->Request_Handler->parse_request($WP);
223
-        do_action('AHEE__EE_Front_Controller__get_request__complete');
224
-    }
225
-
226
-
227
-    /**
228
-     *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
229
-     *
230
-     * @access    public
231
-     * @param   WP_Query $WP_Query
232
-     * @return    void
233
-     */
234
-    public function pre_get_posts($WP_Query)
235
-    {
236
-        // only load Module_Request_Router if this is the main query
237
-        if ($this->Module_Request_Router instanceof EE_Module_Request_Router
238
-            && $WP_Query->is_main_query()
239
-        ) {
240
-            // cycle thru module routes
241
-            while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
242
-                // determine module and method for route
243
-                $module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
244
-                if ($module instanceof EED_Module) {
245
-                    // get registered view for route
246
-                    $this->_template_path = $this->Module_Request_Router->get_view($route);
247
-                    // grab module name
248
-                    $module_name = $module->module_name();
249
-                    // map the module to the module objects
250
-                    $this->Registry->modules->{$module_name} = $module;
251
-                }
252
-            }
253
-        }
254
-    }
255
-
256
-
257
-
258
-
259
-
260
-    /***********************************************        WP HOOK         ***********************************************/
261
-
262
-
263
-    /**
264
-     *    wp - basically last chance to do stuff before headers sent
265
-     *
266
-     * @access    public
267
-     * @return    void
268
-     */
269
-    public function wp()
270
-    {
271
-    }
272
-
273
-
274
-
275
-    /***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
276
-
277
-
278
-    /**
279
-     * callback for the "template_redirect" hook point
280
-     * checks sidebars for EE widgets
281
-     * loads resources and assets accordingly
282
-     *
283
-     * @return void
284
-     */
285
-    public function templateRedirect()
286
-    {
287
-        global $wp_query;
288
-        if (empty($wp_query->posts)) {
289
-            return;
290
-        }
291
-        // if we already know this is an espresso page, then load assets
292
-        $load_assets = $this->Request_Handler->is_espresso_page();
293
-        // if we are already loading assets then just move along, otherwise check for widgets
294
-        $load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
295
-        if ($load_assets) {
296
-            add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
297
-            add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
298
-        }
299
-    }
300
-
301
-
302
-    /**
303
-     * builds list of active widgets then scans active sidebars looking for them
304
-     * returns true is an EE widget is found in an active sidebar
305
-     * Please Note: this does NOT mean that the sidebar or widget
306
-     * is actually in use in a given template, as that is unfortunately not known
307
-     * until a sidebar and it's widgets are actually loaded
308
-     *
309
-     * @return boolean
310
-     */
311
-    private function espresso_widgets_in_active_sidebars()
312
-    {
313
-        $espresso_widgets = array();
314
-        foreach ($this->Registry->widgets as $widget_class => $widget) {
315
-            $id_base = EspressoWidget::getIdBase($widget_class);
316
-            if (is_active_widget(false, false, $id_base)) {
317
-                $espresso_widgets[] = $id_base;
318
-            }
319
-        }
320
-        $all_sidebar_widgets = wp_get_sidebars_widgets();
321
-        foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
322
-            if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
323
-                foreach ($sidebar_widgets as $sidebar_widget) {
324
-                    foreach ($espresso_widgets as $espresso_widget) {
325
-                        if (strpos($sidebar_widget, $espresso_widget) !== false) {
326
-                            return true;
327
-                        }
328
-                    }
329
-                }
330
-            }
331
-        }
332
-        return false;
333
-    }
334
-
335
-
336
-    /**
337
-     *    header_meta_tag
338
-     *
339
-     * @access    public
340
-     * @return    void
341
-     */
342
-    public function header_meta_tag()
343
-    {
344
-        print(
345
-        apply_filters(
346
-            'FHEE__EE_Front_Controller__header_meta_tag',
347
-            '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
348
-        )
349
-        );
350
-
351
-        // let's exclude all event type taxonomy term archive pages from search engine indexing
352
-        // @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
353
-        // also exclude all critical pages from indexing
354
-        if ((
355
-                is_tax('espresso_event_type')
356
-                && get_option('blog_public') !== '0'
357
-            )
358
-            || is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
359
-        ) {
360
-            print(
361
-            apply_filters(
362
-                'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
363
-                '<meta name="robots" content="noindex,follow" />' . "\n"
364
-            )
365
-            );
366
-        }
367
-    }
368
-
369
-
370
-    /**
371
-     * wp_print_scripts
372
-     *
373
-     * @return void
374
-     */
375
-    public function wp_print_scripts()
376
-    {
377
-        global $post;
378
-        if (isset($post->EE_Event)
379
-            && $post->EE_Event instanceof EE_Event
380
-            && get_post_type() === 'espresso_events'
381
-            && is_singular()
382
-        ) {
383
-            \EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
384
-        }
385
-    }
386
-
387
-
388
-    public function enqueueStyle()
389
-    {
390
-        wp_enqueue_style('espresso_default');
391
-        wp_enqueue_style('espresso_custom_css');
392
-    }
393
-
394
-
395
-
396
-    /***********************************************        WP_FOOTER         ***********************************************/
397
-
398
-
399
-    public function enqueueScripts()
400
-    {
401
-        wp_enqueue_script('espresso_core');
402
-    }
403
-
404
-
405
-    /**
406
-     * display_errors
407
-     *
408
-     * @access public
409
-     * @return void
410
-     * @throws DomainException
411
-     */
412
-    public function display_errors()
413
-    {
414
-        static $shown_already = false;
415
-        do_action('AHEE__EE_Front_Controller__display_errors__begin');
416
-        if (! $shown_already
417
-            && apply_filters('FHEE__EE_Front_Controller__display_errors', true)
418
-            && is_main_query()
419
-            && ! is_feed()
420
-            && in_the_loop()
421
-            && did_action('wp_head')
422
-            && $this->Request_Handler->is_espresso_page()
423
-        ) {
424
-            echo EE_Error::get_notices();
425
-            $shown_already = true;
426
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
427
-        }
428
-        do_action('AHEE__EE_Front_Controller__display_errors__end');
429
-    }
430
-
431
-
432
-
433
-
434
-
435
-    /***********************************************        UTILITIES         ***********************************************/
436
-    /**
437
-     *    template_include
438
-     *
439
-     * @access    public
440
-     * @param   string $template_include_path
441
-     * @return    string
442
-     */
443
-    public function template_include($template_include_path = null)
444
-    {
445
-        if ($this->Request_Handler->is_espresso_page()) {
446
-            $this->_template_path = ! empty($this->_template_path)
447
-                ? basename($this->_template_path)
448
-                : basename(
449
-                    $template_include_path
450
-                );
451
-            $template_path = EEH_Template::locate_template($this->_template_path, array(), false);
452
-            $this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
453
-            $this->_template = basename($this->_template_path);
454
-            return $this->_template_path;
455
-        }
456
-        return $template_include_path;
457
-    }
458
-
459
-
460
-    /**
461
-     *    get_selected_template
462
-     *
463
-     * @access    public
464
-     * @param bool $with_path
465
-     * @return    string
466
-     */
467
-    public function get_selected_template($with_path = false)
468
-    {
469
-        return $with_path ? $this->_template_path : $this->_template;
470
-    }
471
-
472
-
473
-    /**
474
-     * @deprecated 4.9.26
475
-     * @param string $shortcode_class
476
-     * @param \WP    $wp
477
-     */
478
-    public function initialize_shortcode($shortcode_class = '', WP $wp = null)
479
-    {
480
-        \EE_Error::doing_it_wrong(
481
-            __METHOD__,
482
-            __(
483
-                'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
484
-                'event_espresso'
485
-            ),
486
-            '4.9.26'
487
-        );
488
-        $this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
489
-    }
490
-
491
-
492
-    /**
493
-     * @return void
494
-     * @deprecated 4.9.57.p
495
-     */
496
-    public function loadPersistentAdminNoticeManager()
497
-    {
498
-    }
29
+	/**
30
+	 * @var string $_template_path
31
+	 */
32
+	private $_template_path;
33
+
34
+	/**
35
+	 * @var string $_template
36
+	 */
37
+	private $_template;
38
+
39
+	/**
40
+	 * @type EE_Registry $Registry
41
+	 */
42
+	protected $Registry;
43
+
44
+	/**
45
+	 * @type EE_Request_Handler $Request_Handler
46
+	 */
47
+	protected $Request_Handler;
48
+
49
+	/**
50
+	 * @type EE_Module_Request_Router $Module_Request_Router
51
+	 */
52
+	protected $Module_Request_Router;
53
+
54
+
55
+	/**
56
+	 *    class constructor
57
+	 *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
+	 *
59
+	 * @access    public
60
+	 * @param \EE_Registry              $Registry
61
+	 * @param \EE_Request_Handler       $Request_Handler
62
+	 * @param \EE_Module_Request_Router $Module_Request_Router
63
+	 */
64
+	public function __construct(
65
+		EE_Registry $Registry,
66
+		EE_Request_Handler $Request_Handler,
67
+		EE_Module_Request_Router $Module_Request_Router
68
+	) {
69
+		$this->Registry = $Registry;
70
+		$this->Request_Handler = $Request_Handler;
71
+		$this->Module_Request_Router = $Module_Request_Router;
72
+		// determine how to integrate WP_Query with the EE models
73
+		add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
74
+		// load other resources and begin to actually run shortcodes and modules
75
+		add_action('wp_loaded', array($this, 'wp_loaded'), 5);
76
+		// analyse the incoming WP request
77
+		add_action('parse_request', array($this, 'get_request'), 1, 1);
78
+		// process request with module factory
79
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
80
+		// before headers sent
81
+		add_action('wp', array($this, 'wp'), 5);
82
+		// primarily used to process any content shortcodes
83
+		add_action('template_redirect', array($this, 'templateRedirect'), 999);
84
+		// header
85
+		add_action('wp_head', array($this, 'header_meta_tag'), 5);
86
+		add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
87
+		add_filter('template_include', array($this, 'template_include'), 1);
88
+		// display errors
89
+		add_action('loop_start', array($this, 'display_errors'), 2);
90
+		// the content
91
+		// add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
92
+		// exclude our private cpt comments
93
+		add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
94
+		// make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
95
+		add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
96
+		// action hook EE
97
+		do_action('AHEE__EE_Front_Controller__construct__done', $this);
98
+	}
99
+
100
+
101
+	/**
102
+	 * @return EE_Request_Handler
103
+	 */
104
+	public function Request_Handler()
105
+	{
106
+		return $this->Request_Handler;
107
+	}
108
+
109
+
110
+	/**
111
+	 * @return EE_Module_Request_Router
112
+	 */
113
+	public function Module_Request_Router()
114
+	{
115
+		return $this->Module_Request_Router;
116
+	}
117
+
118
+
119
+	/**
120
+	 * @return LegacyShortcodesManager
121
+	 */
122
+	public function getLegacyShortcodesManager()
123
+	{
124
+		return EE_Config::getLegacyShortcodesManager();
125
+	}
126
+
127
+
128
+
129
+
130
+
131
+	/***********************************************        INIT ACTION HOOK         ***********************************************/
132
+	/**
133
+	 * filter_wp_comments
134
+	 * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
135
+	 * widgets/queries done on frontend
136
+	 *
137
+	 * @param  array $clauses array of comment clauses setup by WP_Comment_Query
138
+	 * @return array array of comment clauses with modifications.
139
+	 * @throws InvalidArgumentException
140
+	 * @throws InvalidDataTypeException
141
+	 * @throws InvalidInterfaceException
142
+	 */
143
+	public function filter_wp_comments($clauses)
144
+	{
145
+		global $wpdb;
146
+		if (strpos($clauses['join'], $wpdb->posts) !== false) {
147
+			/** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
148
+			$custom_post_types = LoaderFactory::getLoader()->getShared(
149
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
150
+			);
151
+			$cpts = $custom_post_types->getPrivateCustomPostTypes();
152
+			foreach ($cpts as $cpt => $details) {
153
+				$clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
154
+			}
155
+		}
156
+		return $clauses;
157
+	}
158
+
159
+
160
+	/**
161
+	 * @return void
162
+	 * @throws InvalidArgumentException
163
+	 * @throws InvalidDataTypeException
164
+	 * @throws InvalidInterfaceException
165
+	 */
166
+	public function employ_CPT_Strategy()
167
+	{
168
+		if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
169
+			LoaderFactory::getLoader()->getShared('EE_CPT_Strategy');
170
+		}
171
+	}
172
+
173
+
174
+	/**
175
+	 * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
176
+	 *
177
+	 * @param  string $url incoming url
178
+	 * @return string         final assembled url
179
+	 */
180
+	public function maybe_force_admin_ajax_ssl($url)
181
+	{
182
+		if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
183
+			$url = str_replace('http://', 'https://', $url);
184
+		}
185
+		return $url;
186
+	}
187
+
188
+
189
+
190
+
191
+
192
+
193
+	/***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
194
+
195
+
196
+	/**
197
+	 *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
198
+	 *    default priority init phases have run
199
+	 *
200
+	 * @access    public
201
+	 * @return    void
202
+	 */
203
+	public function wp_loaded()
204
+	{
205
+	}
206
+
207
+
208
+
209
+
210
+
211
+	/***********************************************        PARSE_REQUEST HOOK         ***********************************************/
212
+	/**
213
+	 *    _get_request
214
+	 *
215
+	 * @access public
216
+	 * @param WP $WP
217
+	 * @return void
218
+	 */
219
+	public function get_request(WP $WP)
220
+	{
221
+		do_action('AHEE__EE_Front_Controller__get_request__start');
222
+		$this->Request_Handler->parse_request($WP);
223
+		do_action('AHEE__EE_Front_Controller__get_request__complete');
224
+	}
225
+
226
+
227
+	/**
228
+	 *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
229
+	 *
230
+	 * @access    public
231
+	 * @param   WP_Query $WP_Query
232
+	 * @return    void
233
+	 */
234
+	public function pre_get_posts($WP_Query)
235
+	{
236
+		// only load Module_Request_Router if this is the main query
237
+		if ($this->Module_Request_Router instanceof EE_Module_Request_Router
238
+			&& $WP_Query->is_main_query()
239
+		) {
240
+			// cycle thru module routes
241
+			while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
242
+				// determine module and method for route
243
+				$module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
244
+				if ($module instanceof EED_Module) {
245
+					// get registered view for route
246
+					$this->_template_path = $this->Module_Request_Router->get_view($route);
247
+					// grab module name
248
+					$module_name = $module->module_name();
249
+					// map the module to the module objects
250
+					$this->Registry->modules->{$module_name} = $module;
251
+				}
252
+			}
253
+		}
254
+	}
255
+
256
+
257
+
258
+
259
+
260
+	/***********************************************        WP HOOK         ***********************************************/
261
+
262
+
263
+	/**
264
+	 *    wp - basically last chance to do stuff before headers sent
265
+	 *
266
+	 * @access    public
267
+	 * @return    void
268
+	 */
269
+	public function wp()
270
+	{
271
+	}
272
+
273
+
274
+
275
+	/***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
276
+
277
+
278
+	/**
279
+	 * callback for the "template_redirect" hook point
280
+	 * checks sidebars for EE widgets
281
+	 * loads resources and assets accordingly
282
+	 *
283
+	 * @return void
284
+	 */
285
+	public function templateRedirect()
286
+	{
287
+		global $wp_query;
288
+		if (empty($wp_query->posts)) {
289
+			return;
290
+		}
291
+		// if we already know this is an espresso page, then load assets
292
+		$load_assets = $this->Request_Handler->is_espresso_page();
293
+		// if we are already loading assets then just move along, otherwise check for widgets
294
+		$load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
295
+		if ($load_assets) {
296
+			add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
297
+			add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
298
+		}
299
+	}
300
+
301
+
302
+	/**
303
+	 * builds list of active widgets then scans active sidebars looking for them
304
+	 * returns true is an EE widget is found in an active sidebar
305
+	 * Please Note: this does NOT mean that the sidebar or widget
306
+	 * is actually in use in a given template, as that is unfortunately not known
307
+	 * until a sidebar and it's widgets are actually loaded
308
+	 *
309
+	 * @return boolean
310
+	 */
311
+	private function espresso_widgets_in_active_sidebars()
312
+	{
313
+		$espresso_widgets = array();
314
+		foreach ($this->Registry->widgets as $widget_class => $widget) {
315
+			$id_base = EspressoWidget::getIdBase($widget_class);
316
+			if (is_active_widget(false, false, $id_base)) {
317
+				$espresso_widgets[] = $id_base;
318
+			}
319
+		}
320
+		$all_sidebar_widgets = wp_get_sidebars_widgets();
321
+		foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
322
+			if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
323
+				foreach ($sidebar_widgets as $sidebar_widget) {
324
+					foreach ($espresso_widgets as $espresso_widget) {
325
+						if (strpos($sidebar_widget, $espresso_widget) !== false) {
326
+							return true;
327
+						}
328
+					}
329
+				}
330
+			}
331
+		}
332
+		return false;
333
+	}
334
+
335
+
336
+	/**
337
+	 *    header_meta_tag
338
+	 *
339
+	 * @access    public
340
+	 * @return    void
341
+	 */
342
+	public function header_meta_tag()
343
+	{
344
+		print(
345
+		apply_filters(
346
+			'FHEE__EE_Front_Controller__header_meta_tag',
347
+			'<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
348
+		)
349
+		);
350
+
351
+		// let's exclude all event type taxonomy term archive pages from search engine indexing
352
+		// @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
353
+		// also exclude all critical pages from indexing
354
+		if ((
355
+				is_tax('espresso_event_type')
356
+				&& get_option('blog_public') !== '0'
357
+			)
358
+			|| is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
359
+		) {
360
+			print(
361
+			apply_filters(
362
+				'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
363
+				'<meta name="robots" content="noindex,follow" />' . "\n"
364
+			)
365
+			);
366
+		}
367
+	}
368
+
369
+
370
+	/**
371
+	 * wp_print_scripts
372
+	 *
373
+	 * @return void
374
+	 */
375
+	public function wp_print_scripts()
376
+	{
377
+		global $post;
378
+		if (isset($post->EE_Event)
379
+			&& $post->EE_Event instanceof EE_Event
380
+			&& get_post_type() === 'espresso_events'
381
+			&& is_singular()
382
+		) {
383
+			\EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
384
+		}
385
+	}
386
+
387
+
388
+	public function enqueueStyle()
389
+	{
390
+		wp_enqueue_style('espresso_default');
391
+		wp_enqueue_style('espresso_custom_css');
392
+	}
393
+
394
+
395
+
396
+	/***********************************************        WP_FOOTER         ***********************************************/
397
+
398
+
399
+	public function enqueueScripts()
400
+	{
401
+		wp_enqueue_script('espresso_core');
402
+	}
403
+
404
+
405
+	/**
406
+	 * display_errors
407
+	 *
408
+	 * @access public
409
+	 * @return void
410
+	 * @throws DomainException
411
+	 */
412
+	public function display_errors()
413
+	{
414
+		static $shown_already = false;
415
+		do_action('AHEE__EE_Front_Controller__display_errors__begin');
416
+		if (! $shown_already
417
+			&& apply_filters('FHEE__EE_Front_Controller__display_errors', true)
418
+			&& is_main_query()
419
+			&& ! is_feed()
420
+			&& in_the_loop()
421
+			&& did_action('wp_head')
422
+			&& $this->Request_Handler->is_espresso_page()
423
+		) {
424
+			echo EE_Error::get_notices();
425
+			$shown_already = true;
426
+			EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
427
+		}
428
+		do_action('AHEE__EE_Front_Controller__display_errors__end');
429
+	}
430
+
431
+
432
+
433
+
434
+
435
+	/***********************************************        UTILITIES         ***********************************************/
436
+	/**
437
+	 *    template_include
438
+	 *
439
+	 * @access    public
440
+	 * @param   string $template_include_path
441
+	 * @return    string
442
+	 */
443
+	public function template_include($template_include_path = null)
444
+	{
445
+		if ($this->Request_Handler->is_espresso_page()) {
446
+			$this->_template_path = ! empty($this->_template_path)
447
+				? basename($this->_template_path)
448
+				: basename(
449
+					$template_include_path
450
+				);
451
+			$template_path = EEH_Template::locate_template($this->_template_path, array(), false);
452
+			$this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
453
+			$this->_template = basename($this->_template_path);
454
+			return $this->_template_path;
455
+		}
456
+		return $template_include_path;
457
+	}
458
+
459
+
460
+	/**
461
+	 *    get_selected_template
462
+	 *
463
+	 * @access    public
464
+	 * @param bool $with_path
465
+	 * @return    string
466
+	 */
467
+	public function get_selected_template($with_path = false)
468
+	{
469
+		return $with_path ? $this->_template_path : $this->_template;
470
+	}
471
+
472
+
473
+	/**
474
+	 * @deprecated 4.9.26
475
+	 * @param string $shortcode_class
476
+	 * @param \WP    $wp
477
+	 */
478
+	public function initialize_shortcode($shortcode_class = '', WP $wp = null)
479
+	{
480
+		\EE_Error::doing_it_wrong(
481
+			__METHOD__,
482
+			__(
483
+				'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
484
+				'event_espresso'
485
+			),
486
+			'4.9.26'
487
+		);
488
+		$this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
489
+	}
490
+
491
+
492
+	/**
493
+	 * @return void
494
+	 * @deprecated 4.9.57.p
495
+	 */
496
+	public function loadPersistentAdminNoticeManager()
497
+	{
498
+	}
499 499
 }
Please login to merge, or discard this patch.