PluginProbe
Datafeedr API / 1.2.16
Datafeedr API v1.2.16
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.2.16, at datafeedr-api.php

122 lines 4.7 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.0-alpha
13 Version: 1.2.16
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.2.16' );
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_HOME_URL', 'https://www.datafeedr.com' );
41 define( 'DFRAPI_KEYS_URL', 'https://members.datafeedr.com/api' );
42 define( 'DFRAPI_USER_URL', 'https://members.datafeedr.com/' );
43 define( 'DFRAPI_HELP_URL', 'https://datafeedr.me/contact' );
44 define( 'DFRAPI_BUG_REPORTS_URL', 'https://datafeedr.me/docs' );
45 define( 'DFRAPI_QNA_URL', 'https://datafeedr.me/docs' );
46 define( 'DFRAPI_DOCS_URL', 'https://datafeedr.me/docs' );
47 define( 'DFRAPI_REPORT_BUG_URL', 'https://datafeedr.me/contact' );
48 define( 'DFRAPI_ASK_QUESTION_URL', 'https://datafeedr.me/contact' );
49 define( 'DFRAPI_EMAIL_US_URL', 'https://datafeedr.me/contact' );
50 define( 'DFRAPI_COMPLEX_QUERY_SCORE', 10000 );
51 define( 'DFRAPI_EXCESSIVE_MERCHANT_COUNT', 1000 );
52
53 /**
54 * Compatibility Check.
55 *
56 * @param bool $network_wide
57 *
58 * @return void
59 */
60 function dfrapi_register_activation( bool $network_wide ) {
61
62 // Check that minimum WordPress requirement has been met.
63 $version = get_bloginfo( 'version' );
64 if ( version_compare( $version, '3.8', '<' ) ) {
65 deactivate_plugins( DFRAPI_BASENAME );
66 wp_die( __(
67 'The Datafeedr API Plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.',
68 'datafeedr-api'
69 ) );
70 }
71
72 // Check that plugin is not being activated at the Network level on Multisite sites.
73 if ( $network_wide && is_multisite() ) {
74 deactivate_plugins( DFRAPI_BASENAME );
75 wp_die( __(
76 'The Datafeedr API plugin cannot be activated at the Network-level. Please activate the Datafeedr API plugin at the Site-level instead.',
77 'datafeedr-api'
78 ) );
79 }
80 }
81
82 register_activation_hook( __FILE__, 'dfrapi_register_activation' );
83
84 /**
85 * Load files only if we're in the WordPress Admin Area of the site.
86 */
87 if ( is_admin() ) {
88 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-initialize.php';
89 }
90
91 /**
92 * Load Classes
93 */
94 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-plugin-dependency.php';
95 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-plugin-dependency.php';
96 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-cron.php';
97 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-timer.php';
98 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-currency.php';
99 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-price.php';
100 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-datafeedr-image-importer.php';
101 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-data.php';
102 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-image-uploader.php';
103 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/classes/class-dfrapi-searchform.php';
104
105 /**
106 * Load Libraries
107 */
108 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/libraries/datafeedr.php';
109
110 /**
111 * Load Functions
112 */
113 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/functions.php';
114 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/upgrade.php';
115 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/api.php';
116
117 /**
118 * Load Hooks
119 */
120 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/filters.php';
121 require_once dirname( DFRAPI_PLUGIN_FILE ) . '/functions/actions.php';
122