| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: PublishPress Blocks |
| 5 |
* Plugin URI: https://publishpress.com/blocks/ |
| 6 |
* Description: PublishPress Blocks has everything you need to build professional websites with the Gutenberg editor. |
| 7 |
* Version: 3.7.6 |
| 8 |
* Author: PublishPress |
| 9 |
* Author URI: https://publishpress.com/ |
| 10 |
* Text Domain: advanced-gutenberg |
| 11 |
* Domain Path: /languages |
| 12 |
* Blocks: advgb/accordions, advgb/adv-tabs, advgb/button, advgb/columns, advgb/contact-form, advgb/count-up, advgb/image, advgb/images-slider, advgb/infobox, advgb/icon, advgb/list, advgb/login-form, advgb/map, advgb/newsletter, advgb/recent-posts, advgb/search-bar, advgb/social-links, advgb/summary, advgb/table, advgb/tabs, advgb/testimonial, advgb/video, advgb/woo-products, advgb/countdown, advgb/feature, advgb/feature-list, advgb/pricing-table |
| 13 |
* Requires at least: 5.5 |
| 14 |
* Requires PHP: 7.2.5 |
| 15 |
* License: GPL2 |
| 16 |
*/ |
| 17 |
|
| 18 |
/** |
| 19 |
* Copyright |
| 20 |
* |
| 21 |
* @copyright 2014-2020 Joomunited |
| 22 |
* @copyright 2020 Advanced Gutenberg. help@advancedgutenberg.com |
| 23 |
* @copyright 2020-2024 PublishPress. help@publishpress.com |
| 24 |
* |
| 25 |
* Original development of this plugin was kindly funded by Joomunited |
| 26 |
* |
| 27 |
* This program is free software; you can redistribute it and/or modify |
| 28 |
* it under the terms of the GNU General Public License as published by |
| 29 |
* the Free Software Foundation; either version 2 of the License, or |
| 30 |
* (at your option) any later version. |
| 31 |
* |
| 32 |
* This program is distributed in the hope that it will be useful, |
| 33 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 34 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 35 |
* GNU General Public License for more details. |
| 36 |
* |
| 37 |
* You should have received a copy of the GNU General Public License |
| 38 |
* along with this program; if not, write to the Free Software |
| 39 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 40 |
*/ |
| 41 |
|
| 42 |
defined('ABSPATH') || die; |
| 43 |
global $wp_version; |
| 44 |
$min_php_version = '7.2.5'; |
| 45 |
$min_wp_version = '5.5'; |
| 46 |
// If the PHP or WP version is not compatible, terminate the plugin execution. |
| 47 |
$invalid_php_version = version_compare(phpversion(), $min_php_version, '<'); |
| 48 |
$invalid_wp_version = version_compare($wp_version, $min_wp_version, '<'); |
| 49 |
if ($invalid_php_version || $invalid_wp_version) { |
| 50 |
return; |
| 51 |
} |
| 52 |
|
| 53 |
$includeFileRelativePath = '/publishpress/instance-protection/include.php'; |
| 54 |
if (file_exists(__DIR__ . '/lib/vendor' . $includeFileRelativePath)) { |
| 55 |
require_once __DIR__ . '/lib/vendor' . $includeFileRelativePath; |
| 56 |
} elseif (defined('ADVANCED_GUTENBERG_LIB_VENDOR_PATH') && file_exists(ADVANCED_GUTENBERG_LIB_VENDOR_PATH . $includeFileRelativePath)) { |
| 57 |
require_once ADVANCED_GUTENBERG_LIB_VENDOR_PATH . $includeFileRelativePath; |
| 58 |
} |
| 59 |
|
| 60 |
$bundledTranslationsPath = '/publishpress/bundled-translations/core/include.php'; |
| 61 |
if (file_exists(__DIR__ . '/lib/vendor' . $bundledTranslationsPath)) { |
| 62 |
require_once __DIR__ . '/lib/vendor' . $bundledTranslationsPath; |
| 63 |
} elseif (defined('ADVANCED_GUTENBERG_LIB_VENDOR_PATH') && file_exists(ADVANCED_GUTENBERG_LIB_VENDOR_PATH . $bundledTranslationsPath)) { |
| 64 |
require_once ADVANCED_GUTENBERG_LIB_VENDOR_PATH . $bundledTranslationsPath; |
| 65 |
} |
| 66 |
|
| 67 |
if (class_exists('PublishPressInstanceProtection\\Config')) { |
| 68 |
$pluginCheckerConfig = new PublishPressInstanceProtection\Config(); |
| 69 |
$pluginCheckerConfig->pluginSlug = 'advanced-gutenberg'; |
| 70 |
$pluginCheckerConfig->pluginName = 'PublishPress Blocks'; |
| 71 |
$pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig); |
| 72 |
} |
| 73 |
|
| 74 |
if (! defined('ADVANCED_GUTENBERG_LOADED')) { |
| 75 |
define('ADVANCED_GUTENBERG_LOADED', true); |
| 76 |
if (! defined('ADVANCED_GUTENBERG_VERSION')) { |
| 77 |
define('ADVANCED_GUTENBERG_VERSION', '3.7.6'); |
| 78 |
} |
| 79 |
|
| 80 |
if (! defined('ADVANCED_GUTENBERG_PLUGIN')) { |
| 81 |
define('ADVANCED_GUTENBERG_PLUGIN', __FILE__); |
| 82 |
} |
| 83 |
|
| 84 |
if (! defined('ADVANCED_GUTENBERG_BASE_PATH')) { |
| 85 |
define('ADVANCED_GUTENBERG_BASE_PATH', __DIR__); |
| 86 |
} |
| 87 |
|
| 88 |
if (! defined('ADVANCED_GUTENBERG_UPGRADE_LINK')) { |
| 89 |
define('ADVANCED_GUTENBERG_UPGRADE_LINK', 'https://publishpress.com/links/blocks-menu'); |
| 90 |
} |
| 91 |
|
| 92 |
/** |
| 93 |
* @since 3.2.0 |
| 94 |
*/ |
| 95 |
if (! defined('ADVANCED_GUTENBERG_LIB_VENDOR_PATH')) { |
| 96 |
define('ADVANCED_GUTENBERG_LIB_VENDOR_PATH', ADVANCED_GUTENBERG_BASE_PATH . '/lib/vendor'); |
| 97 |
} |
| 98 |
|
| 99 |
/** |
| 100 |
* @deprecated 3.2.0 Use ADVANCED_GUTENBERG_LIB_VENDOR_PATH instead. |
| 101 |
*/ |
| 102 |
if (! defined('ADVANCED_GUTENBERG_VENDOR_PATH')) { |
| 103 |
define('ADVANCED_GUTENBERG_VENDOR_PATH', ADVANCED_GUTENBERG_LIB_VENDOR_PATH); |
| 104 |
} |
| 105 |
|
| 106 |
if (! defined('ADVANCED_GUTENBERG_PLUGIN_DIR_URL')) { |
| 107 |
define('ADVANCED_GUTENBERG_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); |
| 108 |
} |
| 109 |
|
| 110 |
add_action('plugins_loaded', function () { |
| 111 |
if (class_exists('PublishPress\\BundledTranslations\\BundledTranslations')) { |
| 112 |
$bundledTranslations = new PublishPress\BundledTranslations\BundledTranslations( |
| 113 |
'advanced-gutenberg', |
| 114 |
ADVANCED_GUTENBERG_BASE_PATH . '/languages', |
| 115 |
ADVANCED_GUTENBERG_PLUGIN |
| 116 |
); |
| 117 |
|
| 118 |
$bundledTranslations->init(); |
| 119 |
} |
| 120 |
}, 10); |
| 121 |
|
| 122 |
// Internal Vendor and Ask-for-Review |
| 123 |
if (! defined('ADVANCED_GUTENBERG_PRO_LOADED_LIB_VENDOR_PATH')) { |
| 124 |
$autoloadFilePath = ADVANCED_GUTENBERG_LIB_VENDOR_PATH . '/autoload.php'; |
| 125 |
if ( |
| 126 |
! class_exists('ComposerAutoloaderInitPPBlocks') |
| 127 |
&& is_file($autoloadFilePath) |
| 128 |
&& is_readable($autoloadFilePath) |
| 129 |
) { |
| 130 |
require_once $autoloadFilePath; |
| 131 |
} |
| 132 |
} |
| 133 |
|
| 134 |
// Activation |
| 135 |
register_activation_hook(ADVANCED_GUTENBERG_PLUGIN, function () { |
| 136 |
|
| 137 |
require_once __DIR__ . '/install.php'; |
| 138 |
}); |
| 139 |
|
| 140 |
add_action('plugins_loaded', function () { |
| 141 |
|
| 142 |
if ( |
| 143 |
is_admin() |
| 144 |
&& class_exists('PublishPress\WordPressReviews\ReviewsController') |
| 145 |
&& file_exists(__DIR__ . '/review/review-request.php') |
| 146 |
) { |
| 147 |
// Ask for review |
| 148 |
require_once __DIR__ . '/review/review-request.php'; |
| 149 |
} |
| 150 |
|
| 151 |
// Code shared with Pro version |
| 152 |
require_once __DIR__ . '/init.php'; |
| 153 |
}, - 10); |
| 154 |
} |
| 155 |
|