PluginProbe
Datafeedr API / 1.0.125
Datafeedr API v1.0.125
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-v1.php

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

106 lines 3.4 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.125' );
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/price.php' );
65 require_once( DFRAPI_PATH . 'functions/upgrade.php' );
66 require_once( DFRAPI_PATH . 'libraries/datafeedr.php' );
67 require_once( DFRAPI_PATH . 'libraries/zanox_client.php' );
68 require_once( DFRAPI_PATH . 'classes/class-dfrapi-searchform.php' );
69 require_once( DFRAPI_PATH . 'functions/api.php' );
70
71 /**
72 * Display admin notices for each required plugin that needs to be
73 * installed, activated and/or updated.
74 *
75 * @since 1.0.75
76 */
77 function dfrapi_admin_notice_plugin_dependencies() {
78
79 /**
80 * @var Dfrapi_Plugin_Dependency[] $dependencies
81 */
82 $dependencies = array();
83
84 foreach ( $dependencies as $dependency ) {
85
86 $action = $dependency->action_required();
87
88 if ( ! $action ) {
89 continue;
90 }
91
92 echo '<div class="notice notice-error"><p>';
93 echo $dependency->msg( 'Datafeedr API' );
94 echo $dependency->link();
95 echo '</p></div>';
96 }
97 }
98
99 add_action( 'admin_notices', 'dfrapi_admin_notice_plugin_dependencies' );
100
101 /**
102 * Load files only if we're in the admin section of the site.
103 */
104 if ( is_admin() ) {
105 require_once( DFRAPI_PATH . 'classes/class-dfrapi-initialize.php' );
106 }