PluginProbe
Datafeedr API / 1.4.3
Datafeedr API v1.4.3
1.4.3 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 All 182 releases
datafeedr-api / datafeedr-api.php

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

150 lines 6.4 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: 7.1
13 Version: 1.4.3
14
15 Datafeedr API Plugin
16 Copyright (C) 2026, Datafeedr - [email protected]
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 defined( 'ABSPATH' ) || exit;
33
34 /**
35 * Define constants.
36 */
37 define( 'DFRAPI_VERSION', '1.4.3' );
38 define( 'DFRAPI_URL', plugin_dir_url( __FILE__ ) ); // https://example.com/wp-content/plugins/datafeedr-api/
39 define( 'DFRAPI_PATH', plugin_dir_path( __FILE__ ) ); // /absolute/path/to/wp-content/plugins/datafeedr-api/
40 define( 'DFRAPI_BASENAME', plugin_basename( __FILE__ ) ); // datafeedr-api/datafeedr-api.php
41 define( 'DFRAPI_PLUGIN_FILE', __FILE__ ); // /absolute/path/to/wp-content/plugins/datafeedr-api/datafeedr-api.php
42 define( 'DFRAPI_DOMAIN', 'datafeedr-api' ); // Deprecated as of 2022-02-10 14:18:51
43 define( 'DFRAPI_HOME_URL', 'https://www.datafeedr.com' );
44 define( 'DFRAPI_KEYS_URL', 'https://datafeedr.me/api' );
45 define( 'DFRAPI_USER_URL', 'https://datafeedr.me/dashboard' );
46 define( 'DFRAPI_HELP_URL', 'https://datafeedr.me/contact' );
47 define( 'DFRAPI_BUG_REPORTS_URL', 'https://datafeedr.me/docs' );
48 define( 'DFRAPI_QNA_URL', 'https://datafeedr.me/docs' );
49 define( 'DFRAPI_DOCS_URL', 'https://datafeedr.me/docs' );
50 define( 'DFRAPI_DOCS_SEARCH_URL', 'https://datafeedrapi.helpscoutdocs.com/search?query=' );
51 define( 'DFRAPI_REPORT_BUG_URL', 'https://datafeedr.me/contact' );
52 define( 'DFRAPI_ASK_QUESTION_URL', 'https://datafeedr.me/contact' );
53 define( 'DFRAPI_EMAIL_US_URL', 'https://datafeedr.me/contact' );
54 define( 'DFRAPI_SUPPORT_EMAIL', '[email protected]' );
55 define( 'DFRAPI_COMPLEX_QUERY_SCORE', 10000 );
56 define( 'DFRAPI_EXCESSIVE_MERCHANT_COUNT', 1000 );
57
58 /**
59 * Compatibility Check.
60 *
61 * @param bool $network_wide
62 *
63 * @return void
64 */
65 function dfrapi_register_activation( bool $network_wide ) {
66
67 // Check that minimum WordPress requirement has been met.
68 $version = get_bloginfo( 'version' );
69 if ( version_compare( $version, '3.8', '<' ) ) {
70 deactivate_plugins( DFRAPI_BASENAME );
71 wp_die( __(
72 'The Datafeedr API Plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.',
73 'datafeedr-api'
74 ) );
75 }
76
77 // Check that plugin is not being activated at the Network level on Multisite sites.
78 if ( $network_wide && is_multisite() ) {
79 deactivate_plugins( DFRAPI_BASENAME );
80 wp_die( __(
81 'The Datafeedr API plugin cannot be activated at the Network-level. Please activate the Datafeedr API plugin at the Site-level instead.',
82 'datafeedr-api'
83 ) );
84 }
85 }
86
87 register_activation_hook( __FILE__, 'dfrapi_register_activation' );
88
89 /**
90 * Load Functions
91 */
92 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/global.php';
93 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/upgrade.php';
94
95 /**
96 * Load Libraries
97 */
98 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/libraries/datafeedr.php';
99
100 /**
101 * Load files only if we're in the WordPress Admin Area of the site.
102 */
103 if ( is_admin() ) {
104
105 // Core admin functions.
106 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/admin.php';
107
108 // Load required classes.
109 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-env.php'; // Checks environment for any problems.
110 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-configuration.php'; // Configuration page.
111 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-networks.php'; // Networks page.
112 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-merchants.php'; // Merchants page.
113 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-tools.php'; // Tools page.
114 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-export.php'; // Export page.
115 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-import.php'; // Import page.
116 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-account.php'; // Account page.
117 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-help.php'; // Help tabs.
118 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-initialize.php';
119 }
120
121 /**
122 * Load Classes
123 */
124 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-plugin-dependency.php';
125 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-cron.php';
126 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-timer.php';
127 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-currency.php';
128 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-price.php';
129 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-image-importer.php';
130 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-data.php';
131 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-uploader.php';
132 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-searchform.php'; // Search Form.
133
134 /**
135 * Global Hooks
136 */
137 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/global/emails.php';
138 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/global/affiliate-ids.php';
139
140 /**
141 * Load Admin Hooks
142 */
143 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/admin-notices.php';
144 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/ajax.php';
145 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/debug-information.php';
146 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/enqueue-scripts.php';
147 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/interface.php';
148 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/merchants.php';
149 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/hooks/admin/networks.php';
150