PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Tracking / TrackingData / WebsiteData.php
WebsiteData.php
53 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Give\Tracking\TrackingData;
3
4 use Give\Tracking\Contracts\TrackData;
5
6 /**
7 * Class WebsiteData
8 *
9 * Represents the website data.
10 *
11 * @since 2.10.0
12 * @package Give\Tracking\TrackingData
13 */
14 class WebsiteData implements TrackData {
15
16 /**
17 * Returns the collection data.
18 *
19 * @since 2.10.0
20 *
21 * @return array The collection data.
22 */
23 public function get() {
24 global $wp_version;
25
26 $data = [
27 'site_title' => get_option( 'blogname' ),
28 'wp_version' => $wp_version,
29 'givewp_version' => GIVE_VERSION,
30 'home_url' => untrailingslashit( home_url() ),
31 'admin_url' => untrailingslashit( admin_url() ),
32 'is_multisite' => absint( is_multisite() ),
33 'site_language' => get_bloginfo( 'language' ),
34 'install_date' => $this->getPluginInstallDate(),
35 ];
36
37 return array_merge( $data, ( new ServerData() )->get() );
38 }
39
40 /**
41 * Returns plugin install date
42 *
43 * @since 2.10.0
44 * @return int
45 */
46 private function getPluginInstallDate() {
47 $confirmationPageID = give_get_option( 'success_page' );
48
49 return strtotime( get_post_field( 'post_date', $confirmationPageID, 'db' ) );
50 }
51 }
52
53