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

132 lines 4.3 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: http://www.datafeedr.com
5 Description: Connect to the Datafeedr API and configure your API settings.
6 Author: datafeedr.com
7 Author URI: http://www.datafeedr.com
8 License: GPL v3
9 Requires at least: 3.8
10 Tested up to: 4.9.1
11 Version: 1.0.76
12
13 Datafeedr API Plugin
14 Copyright (C) 2018, Datafeedr - help@datafeedr.com
15
16 This program is free software: you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>.
28 */
29
30 // Exit if accessed directly
31 if ( ! defined( 'ABSPATH' ) ) {
32 exit;
33 }
34
35 /**
36 * Define constants.
37 */
38 define( 'DFRAPI_VERSION', '1.0.76' );
39 define( 'DFRAPI_URL', plugin_dir_url( __FILE__ ) );
40 define( 'DFRAPI_PATH', plugin_dir_path( __FILE__ ) );
41 define( 'DFRAPI_BASENAME', plugin_basename( __FILE__ ) );
42 define( 'DFRAPI_DOMAIN', 'datafeedr-api' );
43 define( 'DFRAPI_HOME_URL', 'http://www.datafeedr.com' );
44 define( 'DFRAPI_KEYS_URL', 'https://members.datafeedr.com/api' );
45 define( 'DFRAPI_USER_URL', 'https://members.datafeedr.com/' );
46 define( 'DFRAPI_HELP_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
47 define( 'DFRAPI_BUG_REPORTS_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
48 define( 'DFRAPI_QNA_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
49 define( 'DFRAPI_DOCS_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
50 define( 'DFRAPI_REPORT_BUG_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
51 define( 'DFRAPI_ASK_QUESTION_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
52 define( 'DFRAPI_EMAIL_US_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
53
54 /**
55 * Require WP 3.8+
56 */
57 add_action( 'admin_init', 'dfrapi_wp_version_check' );
58 function dfrapi_wp_version_check() {
59 $version = get_bloginfo( 'version' );
60 if ( version_compare( $version, '3.8', '<' ) ) {
61 deactivate_plugins( DFRAPI_BASENAME );
62 }
63 }
64
65 /**
66 * Notify user that this plugin is deactivated.
67 */
68 add_action( 'admin_notices', 'dfrapi_wp_version_notice' );
69 function dfrapi_wp_version_notice() {
70 $version = get_bloginfo( 'version' );
71 if ( version_compare( $version, '3.8', '<' ) ) {
72 echo '<div class="error"><p>' . __( 'The ', DFRAPI_DOMAIN ) . '<strong><em>';
73 _e( 'Datafeedr API', DFRAPI_DOMAIN );
74 echo '</em></strong>';
75 _e( ' plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.',
76 DFRAPI_DOMAIN );
77 echo '</p></div>';
78 if ( isset( $_GET['activate'] ) ) {
79 unset( $_GET['activate'] );
80 }
81 }
82 }
83
84 /**
85 * Load files for all pages.
86 */
87 require_once( DFRAPI_PATH . 'classes/class-datafeedr-plugin-dependency.php' );
88 require_once( DFRAPI_PATH . 'classes/class-datafeedr-timer.php' );
89 require_once( DFRAPI_PATH . 'classes/class-datafeedr-image-importer.php' );
90 require_once( DFRAPI_PATH . 'functions/functions.php' );
91 require_once( DFRAPI_PATH . 'functions/upgrade.php' );
92 require_once( DFRAPI_PATH . 'libraries/datafeedr.php' );
93 require_once( DFRAPI_PATH . 'libraries/zanox_client.php' );
94 require_once( DFRAPI_PATH . 'classes/class-dfrapi-searchform.php' );
95 require_once( DFRAPI_PATH . 'functions/api.php' );
96
97 /**
98 * Display admin notices for each required plugin that needs to be
99 * installed, activated and/or updated.
100 *
101 * @since 1.0.75
102 */
103 function dfrapi_admin_notice_plugin_dependencies() {
104
105 /**
106 * @var Dfrapi_Plugin_Dependency[] $dependencies
107 */
108 $dependencies = array();
109
110 foreach ( $dependencies as $dependency ) {
111
112 $action = $dependency->action_required();
113
114 if ( ! $action ) {
115 continue;
116 }
117
118 echo '<div class="notice notice-error"><p>';
119 echo $dependency->msg( 'Datafeedr API' );
120 echo $dependency->link();
121 echo '</p></div>';
122 }
123 }
124
125 add_action( 'admin_notices', 'dfrapi_admin_notice_plugin_dependencies' );
126
127 /**
128 * Load files only if we're in the admin section of the site.
129 */
130 if ( is_admin() ) {
131 require_once( DFRAPI_PATH . 'classes/class-dfrapi-initialize.php' );
132 }