| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 3.1.13 Free | |
| 4 | + * @version 2.1.37 Free | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <info@fireplugins.com> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | - * @copyright Copyright © 2026 FirePlugins All Rights Reserved | |
| 8 | + * @copyright Copyright © 2025 FirePlugins All Rights Reserved | |
| 9 | 9 | * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | namespace FireBox\Core |
| @@ -16,12 +16,14 @@ | ||
| 16 | 16 | exit; // Exit if accessed directly. |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | use FPFramework\Framework; |
| 20 | + use FPFramework\Admin\Includes\MetaboxManager; | |
| 20 | 21 | use FPFramework\Base\Renderer; |
| 21 | 22 | |
| 22 | 23 | use FireBox\Core\Admin\Admin; |
| 23 | 24 | use FireBox\Core\Admin\Includes\Library; |
| 25 | + use FireBox\Core\Admin\Includes\Metaboxes as PluginMetaboxes; | |
| 24 | 26 | use FireBox\Core\Admin\Includes\Cpts\Cpts; |
| 25 | 27 | use FireBox\Core\Admin\Menu\PluginMenu; |
| 26 | 28 | use FireBox\Core\FB\Box; |
| 27 | 29 | use FireBox\Core\FB\Boxes; |
| @@ -72,8 +74,22 @@ | ||
| 72 | 74 | */ |
| 73 | 75 | public $renderer; |
| 74 | 76 | |
| 75 | 77 | /** |
| 78 | + * Plugin Metaboxes | |
| 79 | + * | |
| 80 | + * @var Metaboxes | |
| 81 | + */ | |
| 82 | + public $plugin_metaboxes; | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Metaboxes Manager | |
| 86 | + * | |
| 87 | + * @var MetaboxManager | |
| 88 | + */ | |
| 89 | + public $metaboxes_manager; | |
| 90 | + | |
| 91 | + /** | |
| 76 | 92 | * Box |
| 77 | 93 | * |
| 78 | 94 | * @var Box |
| 79 | 95 | */ |
| @@ -127,9 +143,15 @@ | ||
| 127 | 143 | * @var Log |
| 128 | 144 | */ |
| 129 | 145 | public $log; |
| 130 | 146 | |
| 131 | - | |
| 147 | + /** | |
| 148 | + * PHP Scripts | |
| 149 | + * | |
| 150 | + * @var PHPScripts | |
| 151 | + */ | |
| 152 | + public $phpscripts; | |
| 153 | + #PRO-END | |
| 132 | 154 | |
| 133 | 155 | /** |
| 134 | 156 | * Translations cache |
| 135 | 157 | * |
| @@ -200,13 +222,11 @@ | ||
| 200 | 222 | * @return void |
| 201 | 223 | */ |
| 202 | 224 | public function admin_init() |
| 203 | 225 | { |
| 226 | + | |
| 204 | 227 | new \FPFramework\Admin\Includes\UpgradeProModal($this->plugin_slug, $this->plugin_name); |
| 205 | - | |
| 206 | 228 | |
| 207 | - new \FireBox\Core\Admin\Includes\UpgradeToPlanModal(); | |
| 208 | - | |
| 209 | 229 | |
| 210 | 230 | // Admin |
| 211 | 231 | $this->admin = new Admin(); |
| 212 | 232 | |
| @@ -211,8 +231,13 @@ | ||
| 211 | 231 | $this->admin = new Admin(); |
| 212 | 232 | |
| 213 | 233 | // Library |
| 214 | 234 | $this->library = new Library(); |
| 235 | + | |
| 236 | + // Metaboxes | |
| 237 | + $this->metaboxes_manager = new MetaboxManager(); | |
| 238 | + $this->plugin_metaboxes = new PluginMetaboxes(); | |
| 239 | + $this->metaboxes_manager->init(); | |
| 215 | 240 | } |
| 216 | 241 | |
| 217 | 242 | /** |
| 218 | 243 | * Runs at the start of the Plugin |
| @@ -222,10 +247,8 @@ | ||
| 222 | 247 | public function preFlight() |
| 223 | 248 | { |
| 224 | 249 | // loads text domain |
| 225 | 250 | add_action('plugins_loaded', [$this, 'loadTextdomain'], 10); |
| 226 | - | |
| 227 | - | |
| 228 | 251 | } |
| 229 | 252 | |
| 230 | 253 | /** |
| 231 | 254 | * Ensures only one instance of the plugin class is loaded or can be loaded |
| @@ -269,18 +292,16 @@ | ||
| 269 | 292 | |
| 270 | 293 | // Log |
| 271 | 294 | $this->log = new Log(); |
| 272 | 295 | |
| 273 | - new API\API(); | |
| 296 | + // REST API | |
| 297 | + new RESTAPI(); | |
| 274 | 298 | |
| 275 | 299 | |
| 276 | 300 | |
| 277 | - // Register Custom Post Type | |
| 278 | - new \FireBox\Core\Admin\Includes\Cpts\Firebox(); | |
| 279 | - | |
| 280 | - // Keep the campaign-derived caches (box list, "session conditions in use" | |
| 281 | - // flag) in sync with campaign writes | |
| 282 | - \FireBox\Core\Helpers\BoxHelper::registerCacheInvalidation(); | |
| 301 | + // Custom Post Types | |
| 302 | + $this->cpts = new Cpts(); | |
| 303 | + $this->cpts->init(); | |
| 283 | 304 | |
| 284 | 305 | // Renderer |
| 285 | 306 | $this->renderer = new Renderer(FBOX_LAYOUTS_DIR); |
| 286 | 307 | |
| @@ -304,15 +325,11 @@ | ||
| 304 | 325 | |
| 305 | 326 | // Track |
| 306 | 327 | $this->track = new Track(); |
| 307 | 328 | |
| 308 | - | |
| 309 | - | |
| 310 | 329 | // Usage Tracking |
| 311 | 330 | $usageTracking = new \FireBox\Core\UsageTracking\SendUsage(); |
| 312 | 331 | $usageTracking->maybeStart(); |
| 313 | - | |
| 314 | - new FB\Meta(); | |
| 315 | 332 | } |
| 316 | 333 | |
| 317 | 334 | /** |
| 318 | 335 | * Initializes FireBox Plugin with the required components |
| @@ -328,8 +345,29 @@ | ||
| 328 | 345 | $this->initCommons(); |
| 329 | 346 | |
| 330 | 347 | // Load front-end |
| 331 | 348 | new Frontend(); |
| 349 | + } | |
| 350 | + | |
| 351 | + /** | |
| 352 | + * Append our Plugin translation class to the set of translation classes of the Framework | |
| 353 | + * | |
| 354 | + * @param array | |
| 355 | + * | |
| 356 | + * @return array | |
| 357 | + */ | |
| 358 | + public function setTranslationsPaths($paths) | |
| 359 | + { | |
| 360 | + if (isset($paths['firebox'])) | |
| 361 | + { | |
| 362 | + return $paths; | |
| 363 | + } | |
| 364 | + | |
| 365 | + $paths['firebox'] = [ | |
| 366 | + 'prefix' => 'FB_' | |
| 367 | + ]; | |
| 368 | + | |
| 369 | + return $paths; | |
| 332 | 370 | } |
| 333 | 371 | |
| 334 | 372 | /** |
| 335 | 373 | * Retrieves the translation of $text |