PluginProbe
Datafeedr API / 1.0.124
Datafeedr API v1.0.124
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-v1.php

datafeedr-api-v1.php in Datafeedr API 1.0.124, at datafeedr-api-v1.php

105 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Define constants.
10 */
11 define( 'DFRAPI_VERSION', '1.0.124' );
12 define( 'DFRAPI_URL', plugin_dir_url( __FILE__ ) );
13 define( 'DFRAPI_PATH', plugin_dir_path( __FILE__ ) );
14 define( 'DFRAPI_BASENAME', plugin_basename( __FILE__ ) );
15 define( 'DFRAPI_DOMAIN', 'datafeedr-api' );
16 define( 'DFRAPI_HOME_URL', 'https://www.datafeedr.com' );
17 define( 'DFRAPI_KEYS_URL', 'https://members.datafeedr.com/api' );
18 define( 'DFRAPI_USER_URL', 'https://members.datafeedr.com/' );
19 define( 'DFRAPI_HELP_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
20 define( 'DFRAPI_BUG_REPORTS_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
21 define( 'DFRAPI_QNA_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
22 define( 'DFRAPI_DOCS_URL', 'https://datafeedrapi.helpscoutdocs.com/' );
23 define( 'DFRAPI_REPORT_BUG_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
24 define( 'DFRAPI_ASK_QUESTION_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
25 define( 'DFRAPI_EMAIL_US_URL', 'https://datafeedrapi.helpscoutdocs.com/contact' );
26
27 /**
28 * Require WP 3.8+
29 */
30 add_action( 'admin_init', 'dfrapi_wp_version_check' );
31 function dfrapi_wp_version_check() {
32 $version = get_bloginfo( 'version' );
33 if ( version_compare( $version, '3.8', '<' ) ) {
34 deactivate_plugins( DFRAPI_BASENAME );
35 }
36 }
37
38 /**
39 * Notify user that this plugin is deactivated.
40 */
41 add_action( 'admin_notices', 'dfrapi_wp_version_notice' );
42 function dfrapi_wp_version_notice() {
43 $version = get_bloginfo( 'version' );
44 if ( version_compare( $version, '3.8', '<' ) ) {
45 echo '<div class="error"><p>' . __( 'The ', DFRAPI_DOMAIN ) . '<strong><em>';
46 _e( 'Datafeedr API', DFRAPI_DOMAIN );
47 echo '</em></strong>';
48 _e( ' plugin could not be activated because it requires WordPress version 3.8 or greater. Please upgrade your installation of WordPress.',
49 DFRAPI_DOMAIN );
50 echo '</p></div>';
51 if ( isset( $_GET['activate'] ) ) {
52 unset( $_GET['activate'] );
53 }
54 }
55 }
56
57 /**
58 * Load files for all pages.
59 */
60 require_once( DFRAPI_PATH . 'classes/class-datafeedr-plugin-dependency.php' );
61 require_once( DFRAPI_PATH . 'classes/class-datafeedr-timer.php' );
62 require_once( DFRAPI_PATH . 'classes/class-datafeedr-image-importer.php' );
63 require_once( DFRAPI_PATH . 'functions/functions.php' );
64 require_once( DFRAPI_PATH . 'functions/upgrade.php' );
65 require_once( DFRAPI_PATH . 'libraries/datafeedr.php' );
66 require_once( DFRAPI_PATH . 'libraries/zanox_client.php' );
67 require_once( DFRAPI_PATH . 'classes/class-dfrapi-searchform.php' );
68 require_once( DFRAPI_PATH . 'functions/api.php' );
69
70 /**
71 * Display admin notices for each required plugin that needs to be
72 * installed, activated and/or updated.
73 *
74 * @since 1.0.75
75 */
76 function dfrapi_admin_notice_plugin_dependencies() {
77
78 /**
79 * @var Dfrapi_Plugin_Dependency[] $dependencies
80 */
81 $dependencies = array();
82
83 foreach ( $dependencies as $dependency ) {
84
85 $action = $dependency->action_required();
86
87 if ( ! $action ) {
88 continue;
89 }
90
91 echo '<div class="notice notice-error"><p>';
92 echo $dependency->msg( 'Datafeedr API' );
93 echo $dependency->link();
94 echo '</p></div>';
95 }
96 }
97
98 add_action( 'admin_notices', 'dfrapi_admin_notice_plugin_dependencies' );
99
100 /**
101 * Load files only if we're in the admin section of the site.
102 */
103 if ( is_admin() ) {
104 require_once( DFRAPI_PATH . 'classes/class-dfrapi-initialize.php' );
105 }