PluginProbe
Datafeedr API / 1.3.8
Datafeedr API v1.3.8
1.4.2 1.0.125 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 All 181 releases
datafeedr-api / datafeedr-api.php

datafeedr-api.php in Datafeedr API 1.3.8, at datafeedr-api.php

146 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Datafeedr API
4 Plugin URI: https://www.datafeedr.com
5 Description: Connect to the Datafeedr API and configure your API settings.
6 Author: datafeedr.com
7 Author URI: https://www.datafeedr.com
8 Text Domain: datafeedr-api
9 License: GPL v3
10 Requires PHP: 7.4
11 Requires at least: 3.8
12 Tested up to: 6.1.2-alpha
13 Version: 1.3.8
14
15 Datafeedr API Plugin
16 Copyright (C) 2022, Datafeedr - help@datafeedr.com
17
18 This program is free software: you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation, either version 3 of the License, or
21 (at your option) any later version.
22
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
27
28 You should have received a copy of the GNU General Public License
29 along with this program. If not, see <http://www.gnu.org/licenses/>.
30 */
31
32 /**
33 * Define constants.
34 */
35 define( 'DFRAPI_VERSION', '1.3.8' );
36 define( 'DFRAPI_URL', plugin_dir_url( __FILE__ ) ); // https://example.com/wp-content/plugins/datafeedr-api/
37 define( 'DFRAPI_PATH', plugin_dir_path( __FILE__ ) ); // /absolute/path/to/wp-content/plugins/datafeedr-api/
38 define( 'DFRAPI_BASENAME', plugin_basename( __FILE__ ) ); // datafeedr-api/datafeedr-api.php
39 define( 'DFRAPI_PLUGIN_FILE', __FILE__ ); // /absolute/path/to/wp-content/plugins/datafeedr-api/datafeedr-api.php
40 define( 'DFRAPI_DOMAIN', 'datafeedr-api' ); // Deprecated as of 2022-02-10 14:18:51
41 define( 'DFRAPI_HOME_URL', 'https://www.datafeedr.com' );
42 define( 'DFRAPI_KEYS_URL', 'https://datafeedr.me/api' );
43 define( 'DFRAPI_USER_URL', 'https://datafeedr.me/dashboard' );
44 define( 'DFRAPI_HELP_URL', 'https://datafeedr.me/contact' );
45 define( 'DFRAPI_BUG_REPORTS_URL', 'https://datafeedr.me/docs' );
46 define( 'DFRAPI_QNA_URL', 'https://datafeedr.me/docs' );
47 define( 'DFRAPI_DOCS_URL', 'https://datafeedr.me/docs' );
48 define( 'DFRAPI_DOCS_SEARCH_URL', 'https://datafeedrapi.helpscoutdocs.com/search?query=' );
49 define( 'DFRAPI_REPORT_BUG_URL', 'https://datafeedr.me/contact' );
50 define( 'DFRAPI_ASK_QUESTION_URL', 'https://datafeedr.me/contact' );
51 define( 'DFRAPI_EMAIL_US_URL', 'https://datafeedr.me/contact' );
52 define( 'DFRAPI_COMPLEX_QUERY_SCORE', 10000 );
53 define( 'DFRAPI_EXCESSIVE_MERCHANT_COUNT', 1000 );
54
55 /**
56 * Compatibility Check.
57 *
58 * @param bool $network_wide
59 *
60 * @return void
61 */
62 function dfrapi_register_activation( bool $network_wide ) {
63
64 // Check that minimum WordPress requirement has been met.
65 $version = get_bloginfo( 'version' );
66 if ( version_compare( $version, '3.8', '<' ) ) {
67 deactivate_plugins( DFRAPI_BASENAME );
68 wp_die( __(
69 'The Datafeedr API Plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.',
70 'datafeedr-api'
71 ) );
72 }
73
74 // Check that plugin is not being activated at the Network level on Multisite sites.
75 if ( $network_wide && is_multisite() ) {
76 deactivate_plugins( DFRAPI_BASENAME );
77 wp_die( __(
78 'The Datafeedr API plugin cannot be activated at the Network-level. Please activate the Datafeedr API plugin at the Site-level instead.',
79 'datafeedr-api'
80 ) );
81 }
82 }
83
84 register_activation_hook( __FILE__, 'dfrapi_register_activation' );
85
86 /**
87 * Load Functions
88 */
89 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/global.php';
90 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/upgrade.php';
91
92 /**
93 * Load Libraries
94 */
95 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/libraries/datafeedr.php';
96
97 /**
98 * Load files only if we're in the WordPress Admin Area of the site.
99 */
100 if ( is_admin() ) {
101
102 // Core admin functions.
103 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/admin.php';
104
105 // Load required classes.
106 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-env.php'; // Checks environment for any problems.
107 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-configuration.php'; // Configuration page.
108 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-networks.php'; // Networks page.
109 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-merchants.php'; // Merchants page.
110 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-tools.php'; // Tools page.
111 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-export.php'; // Export page.
112 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-import.php'; // Import page.
113 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-account.php'; // Account page.
114 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-help.php'; // Help tabs.
115 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-initialize.php';
116 }
117
118 /**
119 * Load Classes
120 */
121 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-plugin-dependency.php';
122 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-cron.php';
123 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-timer.php';
124 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-currency.php';
125 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-price.php';
126 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-image-importer.php';
127 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-data.php';
128 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-uploader.php';
129 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-searchform.php'; // Search Form.
130
131 /**
132 * Global Hooks
133 */
134 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/global/emails.php';
135 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/global/affiliate-ids.php';
136
137 /**
138 * Load Admin Hooks
139 */
140 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/admin-notices.php';
141 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/ajax.php';
142 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/debug-information.php';
143 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/enqueue-scripts.php';
144 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/interface.php';
145 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/merchants.php';
146