PluginProbe
Media Cloud Sync / 1.1.1
Media Cloud Sync v1.1.1
1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 All 34 releases
media-cloud-sync / media-cloud-sync.php

media-cloud-sync.php in Media Cloud Sync 1.1.1, at media-cloud-sync.php

95 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Media Cloud Sync
4 * Version: 1.1.1
5 * Description: Media Cloud Sync helps to sync your wordpress media to the cloud based services.
6 * Author: Dudlewebs
7 * Author URI: http://dudlewebs.com
8 * License: GPLv2 or later
9 * Requires at least: 5.2
10 * Tested up to: 6.8
11 * Requires PHP: 7.4
12 * Text Domain: media-cloud-sync
13 */
14
15 defined('ABSPATH') || exit;
16
17 if (!defined('WPMCS_FILE')) {
18 define('WPMCS_FILE', __FILE__);
19 }
20
21 define('WPMCS_VERSION', '1.1.1');
22 define('WPMCS_PLUGIN_NAME', 'Media Cloud Sync');
23
24 define('WPMCS_TOKEN', 'wpmcs');
25 define('WPMCS_PATH', plugin_dir_path(WPMCS_FILE));
26 define('WPMCS_URL', plugins_url('/', WPMCS_FILE));
27
28 define('WPMCS_ASSETS_PATH', WPMCS_PATH . 'assets/');
29 define('WPMCS_ASSETS_URL', WPMCS_URL . 'assets/');
30 define('WPMCS_INCLUDES_PATH', WPMCS_PATH . 'includes/');
31 define('WPMCS_SDK_PATH', WPMCS_INCLUDES_PATH . 'sdk/');
32
33 global $wpdb;
34 define('WPMCS_ITEM_TABLE', $wpdb->prefix.WPMCS_TOKEN.'_items');
35 define('WPMCS_DB_VERSION', '1.0.0');
36
37 add_action('plugins_loaded', 'wpmcs_load_plugin_textdomain');
38
39 if (!version_compare(PHP_VERSION, '7.4', '>=')) {
40 add_action('admin_notices', 'wpmcs_php_version_check_fail');
41 } elseif (!version_compare(get_bloginfo('version'), '5.2', '>=')) {
42 add_action('admin_notices', 'wpmcs_wp_version_check_fail');
43 } else {
44 //include services
45 require_once WPMCS_SDK_PATH . 's3/aws-autoloader.php';
46 require_once WPMCS_SDK_PATH . 'google/autoload.php';
47
48 require WPMCS_INCLUDES_PATH . 'main.php';
49 }
50
51
52 /**
53 * Load Plugin textdomain.
54 *
55 * Load gettext translate for Plugin text domain.
56 *
57 * @return void
58 * @since 1.0.0
59 *
60 */
61 function wpmcs_load_plugin_textdomain(){
62 load_plugin_textdomain('media-cloud-sync');
63 }
64
65 /**
66 * Plugin admin notice for minimum PHP version.
67 *
68 * Warning when the site doesn't have the minimum required PHP version.
69 *
70 * @return void
71 * @since 1.0.0
72 *
73 */
74 function wpmcs_php_version_check_fail(){
75 /* translators: %s: PHP version. */
76 $message = sprintf(esc_html__('%1$s requires PHP version %2$s+, plugin is currently not running.', 'media-cloud-sync'), WPMCS_PLUGIN_NAME, '7.4');
77 $html_message = sprintf('<div class="error">%s</div>', wpautop($message));
78 echo wp_kses_post($html_message);
79 }
80
81 /**
82 * Plugin admin notice for minimum WordPress version.
83 *
84 * Warning when the site doesn't have the minimum required WordPress version.
85 *
86 * @return void
87 * @since 1.0.0
88 *
89 */
90 function wpmcs_wp_version_check_fail(){
91 /* translators: %s: WordPress version. */
92 $message = sprintf(esc_html__('%1$s requires WordPress version %2$s+. Because you are using an earlier version, the plugin is currently not running.', 'media-cloud-sync'), WPMCS_PLUGIN_NAME, '5.2');
93 $html_message = sprintf('<div class="error">%s</div>', wpautop($message));
94 echo wp_kses_post($html_message);
95 }