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
← All changes | datafeedr-api.php +103 -49 1.0.20 → 1.4.3 View file →
@@ -1,18 +1,20 @@
1 1 <?php
2 2 /*
3 3 Plugin Name: Datafeedr API
4 -Plugin URI: https://v4.datafeedr.com
4 +Plugin URI: https://www.datafeedr.com
5 5 Description: Connect to the Datafeedr API and configure your API settings.
6 6 Author: datafeedr.com
7 -Author URI: https://v4.datafeedr.com
7 +Author URI: https://www.datafeedr.com
8 +Text Domain: datafeedr-api
8 9 License: GPL v3
10 +Requires PHP: 7.4
9 11 Requires at least: 3.8
10 -Tested up to: 4.1-beta1
11 -Version: 1.0.20
12 +Tested up to: 7.1
13 +Version: 1.4.3
12 14
13 15 Datafeedr API Plugin
14 -Copyright (C) 2014, Datafeedr - [email protected]
16 +Copyright (C) 2026, Datafeedr - [email protected]
15 17
16 18 This program is free software: you can redistribute it and/or modify
17 19 it under the terms of the GNU General Public License as published by
18 20 the Free Software Foundation, either version 3 of the License, or
@@ -26,70 +28,122 @@
26 28 You should have received a copy of the GNU General Public License
27 29 along with this program. If not, see <http://www.gnu.org/licenses/>.
28 30 */
29 31
30 -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
32 +defined( 'ABSPATH' ) || exit;
31 33
32 34 /**
33 35 * Define constants.
34 36 */
35 -define( 'DFRAPI_VERSION', '1.0.20' );
36 -define( 'DFRAPI_URL', plugin_dir_url( __FILE__ ) );
37 -define( 'DFRAPI_PATH', plugin_dir_path( __FILE__ ) );
38 -define( 'DFRAPI_BASENAME', plugin_basename( __FILE__ ) );
39 -define( 'DFRAPI_DOMAIN', 'datafeedr-api' );
40 -define( 'DFRAPI_HOME_URL', 'https://v4.datafeedr.com' );
41 -define( 'DFRAPI_KEYS_URL', 'https://v4.datafeedr.com/keys' );
42 -define( 'DFRAPI_USER_URL', 'https://v4.datafeedr.com/user' );
43 -define( 'DFRAPI_HELP_URL', 'https://v4.datafeedr.com/support' );
44 -define( 'DFRAPI_BUG_REPORTS_URL', 'https://v4.datafeedr.com/bug-reports' );
45 -define( 'DFRAPI_QNA_URL', 'https://v4.datafeedr.com/topics' );
46 -define( 'DFRAPI_DOCS_URL', 'https://v4.datafeedr.com/support' );
47 -define( 'DFRAPI_REPORT_BUG_URL', 'https://v4.datafeedr.com/node/add/bug-report' );
48 -define( 'DFRAPI_ASK_QUESTION_URL', 'https://v4.datafeedr.com/node/add/topic' );
49 -define( 'DFRAPI_EMAIL_US_URL', 'https://v4.datafeedr.com/node/add/ticket' );
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 );
50 57
51 58 /**
52 - * Require WP 3.8+
59 + * Compatibility Check.
60 + *
61 + * @param bool $network_wide
62 + *
63 + * @return void
53 64 */
54 -add_action( 'admin_init', 'dfrapi_wp_version_check' );
55 -function dfrapi_wp_version_check() {
65 +function dfrapi_register_activation( bool $network_wide ) {
66 +
67 + // Check that minimum WordPress requirement has been met.
56 68 $version = get_bloginfo( 'version' );
57 69 if ( version_compare( $version, '3.8', '<' ) ) {
58 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 + ) );
59 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 + }
60 85 }
61 86
87 +register_activation_hook( __FILE__, 'dfrapi_register_activation' );
88 +
62 89 /**
63 - * Notify user that this plugin is deactivated.
90 + * Load Functions
64 91 */
65 -add_action( 'admin_notices', 'dfrapi_wp_version_notice' );
66 -function dfrapi_wp_version_notice() {
67 - $version = get_bloginfo( 'version' );
68 - if ( version_compare( $version, '3.8', '<' ) ) {
69 - echo '<div class="error"><p>' . __( 'The ', DFRAPI_DOMAIN ) . '<strong><em>';
70 - _e( 'Datafeedr API', DFRAPI_DOMAIN );
71 - echo '</em></strong>';
72 - _e( ' plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.', DFRAPI_DOMAIN );
73 - echo '</p></div>';
74 - if ( isset( $_GET['activate'] ) ) {
75 - unset( $_GET['activate'] );
76 - }
77 - }
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';
78 119 }
79 120
80 121 /**
81 - * Load files for all pages.
122 + * Load Classes
82 123 */
83 -require_once( DFRAPI_PATH . 'functions/functions.php' ); // Core functions.
84 -require_once( DFRAPI_PATH . 'functions/upgrade.php' ); // Upgrade functions.
85 -require_once( DFRAPI_PATH . 'libraries/datafeedr.php' ); // Load the Datafeedr API Library.
86 -require_once( DFRAPI_PATH . 'libraries/zanox_client.php' ); // Load the Zanox Client Library.
87 -require_once( DFRAPI_PATH . 'classes/class-dfrapi-searchform.php' ); // Product search form.
88 -require_once( DFRAPI_PATH . 'functions/api.php' ); // API specific helper functions.
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.
89 133
90 134 /**
91 - * Load files only if we're in the admin section of the site.
135 + * Global Hooks
92 136 */
93 -if ( is_admin() ) {
94 - require_once ( DFRAPI_PATH . 'classes/class-dfrapi-initialize.php' );
95 -}
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';