| @@ -1,49 +1,78 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | /** |
| 3 | 4 | * Plugin Name: Passster |
| 4 | - * Plugin URI: https://patrickposner.dev | |
| 5 | + * Plugin URI: https://passster.com/ | |
| 5 | 6 | * Description: A simple plugin to password-protect your complete website, some pages/posts or just parts of your content. |
| 6 | - * Version: 3.5.4 | |
| 7 | - * Author: Patrick Posner | |
| 8 | - * Author URI: https://patrickposner.dev | |
| 7 | + * Version: 4.3.15 | |
| 8 | + * Author: WPChill | |
| 9 | + * Author URI: https://wpchill.com | |
| 9 | 10 | * License: GPL-2.0+ |
| 10 | 11 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 11 | 12 | * Text Domain: content-protector |
| 12 | 13 | * Domain Path: /languages |
| 13 | 14 | * |
| 14 | - */ | |
| 15 | - | |
| 15 | + * | |
| 16 | + * | |
| 17 | + * NOTE: | |
| 18 | + * Patrick Posner transferred ownership rights on: 6th of December, 2024 when ownership was handed over to WPChill | |
| 19 | + */ | |
| 16 | 20 | define( 'PASSSTER_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
| 17 | -define( 'PASSSTER_ABSPATH', dirname( __FILE__ ) . DIRECTORY_SEPARATOR ); | |
| 18 | 21 | define( 'PASSSTER_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); |
| 19 | - | |
| 20 | -// load setup. | |
| 21 | -require_once( PASSSTER_ABSPATH . 'inc' . DIRECTORY_SEPARATOR . 'setup.php' ); | |
| 22 | - | |
| 23 | -// localize. | |
| 24 | -$textdomain_dir = plugin_basename( dirname( __FILE__ ) ) . '/languages'; | |
| 25 | -load_plugin_textdomain( 'content-protector', false, $textdomain_dir ); | |
| 26 | - | |
| 22 | +define( 'PASSSTER_VERSION', '4.3.15' ); | |
| 27 | 23 | // run plugin. |
| 28 | -if ( ! function_exists( 'passster_run_plugin' ) ) { | |
| 24 | +if ( !function_exists( 'passster_run_plugin' ) ) { | |
| 25 | + add_action( 'plugins_loaded', 'passster_run_plugin' ); | |
| 26 | + /** | |
| 27 | + * Run plugin | |
| 28 | + * | |
| 29 | + * @return void | |
| 30 | + * @throws Exception | |
| 31 | + */ | |
| 32 | + function passster_run_plugin() { | |
| 33 | + // Include files. | |
| 34 | + require_once PASSSTER_PATH . '/inc/class-ps-conditional.php'; | |
| 35 | + require_once PASSSTER_PATH . '/inc/class-ps-helper.php'; | |
| 36 | + require_once PASSSTER_PATH . '/inc/class-ps-form.php'; | |
| 37 | + require_once PASSSTER_PATH . '/inc/class-ps-public.php'; | |
| 38 | + require_once PASSSTER_PATH . '/inc/class-ps-migrator.php'; | |
| 39 | + require_once PASSSTER_PATH . '/inc/class-ps-block-editor.php'; | |
| 40 | + require_once PASSSTER_PATH . '/inc/class-ps-rest-handler.php'; | |
| 41 | + require_once PASSSTER_PATH . '/inc/class-ps-protected-areas-rest-controller.php'; | |
| 42 | + require_once PASSSTER_PATH . '/inc/class-ps-rest-api.php'; | |
| 43 | + require_once PASSSTER_PATH . '/inc/class-ps-protected-posts.php'; | |
| 44 | + require_once PASSSTER_PATH . '/inc/class-ps-category-lock.php'; | |
| 45 | + // admin. | |
| 46 | + require_once PASSSTER_PATH . '/inc/admin/inc/class-ps-admin-settings.php'; | |
| 47 | + require_once PASSSTER_PATH . '/inc/admin/inc/class-ps-upsells.php'; | |
| 48 | + require_once PASSSTER_PATH . '/inc/admin/inc/class-ps-admin.php'; | |
| 49 | + require_once PASSSTER_PATH . '/inc/admin/inc/class-ps-meta.php'; | |
| 50 | + require_once PASSSTER_PATH . '/inc/admin/inc/class-ps-dynamic-styles.php'; | |
| 51 | + // load Freemius. | |
| 52 | + require_once PASSSTER_PATH . '/inc/freemius-setup.php'; | |
| 53 | + // localize. | |
| 54 | + $textdomain_dir = plugin_basename( __DIR__ ) . '/languages'; | |
| 55 | + load_plugin_textdomain( 'content-protector', false, $textdomain_dir ); | |
| 56 | + if ( !get_option( 'passster_secure_key' ) ) { | |
| 57 | + add_option( 'passster_secure_key', bin2hex( random_bytes( 32 ) ) ); | |
| 58 | + } | |
| 59 | + passster\PS_Admin::get_instance(); | |
| 60 | + passster\PS_Admin_Settings::get_instance(); | |
| 61 | + passster\PS_Meta::get_instance(); | |
| 62 | + passster\PS_Dynamic_Styles::get_instance(); | |
| 63 | + passster\PS_Form::get_instance(); | |
| 64 | + passster\PS_Public::get_instance(); | |
| 65 | + passster\PS_Block_Editor::get_instance(); | |
| 66 | + passster\PS_Rest_Handler::get_instance(); | |
| 67 | + passster\PS_Rest_API::get_instance(); | |
| 68 | + passster\PS_Upsells::get_instance(); | |
| 69 | + // Maybe migrate settings. | |
| 70 | + $options = get_option( 'passster' ); | |
| 71 | + if ( empty( $options ) ) { | |
| 72 | + passster\PS_Migrator::migrate(); | |
| 73 | + } | |
| 74 | + passster\PS_Protected_Posts::get_instance(); | |
| 75 | + passster\PS_Category_Lock::get_instance(); | |
| 76 | + } | |
| 29 | 77 | |
| 30 | - // boot autoloader. | |
| 31 | - if ( file_exists( __DIR__ . '/vendor/autoload.php' ) && ! class_exists( 'passster\PS_Admin' ) ) { | |
| 32 | - require __DIR__ . '/vendor/autoload.php'; | |
| 33 | - } | |
| 34 | - | |
| 35 | - add_action( 'plugins_loaded', 'passster_run_plugin' ); | |
| 36 | - | |
| 37 | - /** | |
| 38 | - * Run plugin | |
| 39 | - * | |
| 40 | - * @return void | |
| 41 | - */ | |
| 42 | - function passster_run_plugin() { | |
| 43 | - passster\PS_Admin::get_instance(); | |
| 44 | - passster\PS_Customizer::get_instance(); | |
| 45 | - passster\PS_Meta::get_instance(); | |
| 46 | - passster\PS_Form::get_instance(); | |
| 47 | - passster\PS_Public::get_instance(); | |
| 48 | - } | |
| 49 | -} | |
| 78 | +} | |