PluginProbe
Social Slider Feed – Social Media Feed & Gallery Widgets / trunk
Social Slider Feed – Social Media Feed & Gallery Widgets vtrunk
2.3.5 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.3 1.7.13 All 44 releases
instagram-slider-widget / instagram-slider-widget.php

instagram-slider-widget.php in Social Slider Feed – Social Media Feed & Gallery Widgets trunk, at instagram-slider-widget.php

158 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Social Slider Feed
4 * Plugin URI: https://cm-wp.com/instagram-slider-widget
5 * Version: 2.3.5
6 * Description: Shows Instagram, Facebook and YouTube responsive feeds in widgets, posts, pages, or anywhere else using shortcodes
7 * Author: Themeisle
8 * Author URI: https://themeisle.com
9 * Requires PHP: 7.4
10 * Text Domain: instagram-slider-widget
11 * Domain Path: /languages
12 * License: GPL2
13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
14 * WordPress Available: yes
15 * Requires License: no
16 */
17
18 // Exit if accessed directly
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit;
21 }
22
23 // Подключаем класс проверки совместимости
24 require_once dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php';
25
26 $plugin_info = [
27 'prefix' => 'wis_',
28 'plugin_name' => 'wisw',
29 'plugin_title' => 'Social Slider Feed',
30 'plugin_text_domain' => 'instagram-slider-widget',
31
32 // Служба поддержки
33 'support_details' => [
34 'url' => 'https://wordpress.org/support/plugin/instagram-slider-widget/', // Ссылка на сайт плагина
35 'pages_map' => [
36 'features' => 'premium-features', // {site}/premium-features "страница возможности"
37 'pricing' => 'pricing', // {site}/prices страница "цены"
38 'support' => 'support', // {site}/support страница "служба поддержки"
39 'docs' => 'docs', // {site}/docs страница "документация"
40 ],
41 ],
42
43 // Настройка обновлений плагина
44 'has_updates' => true,
45 'updates_settings' => [
46 'repository' => 'wordpress',
47 'slug' => 'instagram-slider-widget',
48 'maybe_rollback' => true,
49 'rollback_settings' => [
50 'prev_stable_version' => '0.0.0',
51 ],
52 ],
53
54 // PLUGIN SUBSCRIBE FORM
55 'subscribe_widget' => false,
56
57 'load_factory_modules' => [
58 [ 'libs/factory/bootstrap', 'factory_bootstrap_483', 'admin' ],
59 [ 'libs/factory/forms', 'factory_forms_481', 'admin' ],
60 [ 'libs/factory/pages', 'factory_pages_481', 'admin' ],
61 [ 'libs/factory/templates', 'factory_templates_135', 'admin' ],
62 [ 'libs/factory/logger', 'factory_logger_150', 'all' ],
63 ],
64 ];
65
66 global $wis_compatibility;
67
68 $wis_compatibility = new Wbcr_Factory481_Requirements( __FILE__, array_merge( $plugin_info, [
69 'plugin_already_activate' => defined( 'WIS_PLUGIN_ACTIVE' ),
70 'required_php_version' => '7.4',
71 'required_wp_version' => '6.0.0',
72 'required_clearfy_check_component' => false,
73 ] ) );
74
75 /**
76 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
77 * and the user will throw a warning.
78 */
79 if ( ! $wis_compatibility->check() ) {
80 return;
81 }
82 /********************************************/
83 define( 'WIS_PLUGIN_ACTIVE', true );
84 define( 'WIS_PLUGIN_VERSION', $wis_compatibility->get_plugin_version() );
85 define( 'WIS_PLUGIN_FILE', __FILE__ );
86 define( 'WIS_ABSPATH', dirname( __FILE__ ) );
87 define( 'WIS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
88 define( 'WIS_PLUGIN_SLUG', dirname( plugin_basename( __FILE__ ) ) );
89 define( 'WIS_PLUGIN_URL', plugins_url( '', __FILE__ ) );
90 define( 'WIS_PLUGIN_DIR', dirname( __FILE__ ) );
91 define( 'WIS_PRODUCT_SLUG', basename( dirname( __FILE__ ) ) );
92
93 define( 'WIS_COMPONENTS_URL', WIS_PLUGIN_URL . '/components' );
94 define( 'WIS_COMPONENTS_DIR', WIS_PLUGIN_DIR . '/components' );
95
96 define( 'WIS_FEEDS_OPTION', 'feeds' );
97
98 /********************************************/
99
100
101
102 /**
103 * -----------------------------------------------------------------------------
104 * PLUGIN INIT
105 * -----------------------------------------------------------------------------
106 */
107 require_once WIS_PLUGIN_DIR . '/libs/factory/core/boot.php';
108 require_once WIS_PLUGIN_DIR . '/includes/class-helper.php';
109 require_once WIS_PLUGIN_DIR . '/includes/class-feed.php';
110 require_once WIS_PLUGIN_DIR . '/includes/class-feeds.php';
111 require_once WIS_PLUGIN_DIR . '/includes/class-profiles.php';
112 require_once WIS_PLUGIN_DIR . '/includes/class-plugin.php';
113 require_once WIS_PLUGIN_DIR . '/includes/class-wis-plugin-temp.php';
114
115 /**
116 * Deactivate PRO plugin.
117 *
118 * @param WIS_Plugin $disable_admin_notice_obj
119 */
120 function wisw_deactivate_pro_plugin( $disable_admin_notice_obj ) {
121 $pro_slug = 'instagram-slider-widget-premium/instagram-slider-widget-premium.php';
122
123 // If plugin isn't active, we stop immediately.
124 if ( ! is_plugin_active( $pro_slug ) ) {
125 return;
126 }
127
128 // Delete premium option
129 $disable_admin_notice_obj->deletePopulateOption( 'premium_package' );
130
131 remove_action( 'plugins_loaded', 'wisw_premium_load', 20 );
132
133 // As register_deactivation_hook called, deactivate the pro plugin silently.
134 deactivate_plugins( $pro_slug, true );
135
136 }
137
138 try {
139
140 require_once WIS_PLUGIN_DIR . '/vendor/autoload.php';
141 $instagram_slider_widget = new WIS_Plugin( __FILE__, array_merge( $plugin_info, [
142 'plugin_version' => WIS_PLUGIN_VERSION,
143 ] ) );
144
145 wisw_deactivate_pro_plugin( $instagram_slider_widget );
146 } catch ( Exception $e ) {
147 // Plugin wasn't initialized due to an error
148 define( 'WIS_PLUGIN_THROW_ERROR', true );
149
150 $wis_plugin_error_func = function () use ( $e ) {
151 $error = sprintf( 'The %s plugin has stopped. <b>Error:</b> %s Code: %s', 'Social Slider Feed', $e->getMessage(), $e->getCode() );
152 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
153 };
154
155 add_action( 'admin_notices', $wis_plugin_error_func );
156 add_action( 'network_admin_notices', $wis_plugin_error_func );
157 }
158