Changeset 3421992
- Timestamp:
- 12/17/2025 02:13:40 PM (4 months ago)
- Location:
- billy
- Files:
-
- 2 edited
-
tags/2.1.0/billy.php (modified) (2 diffs)
-
trunk/billy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
billy/tags/2.1.0/billy.php
r3421987 r3421992 133 133 134 134 /** 135 * On load: Initialize classes. 135 * On load: 136 * 1. Test compatibility. 137 * 2. Initialize plugin. 136 138 * 137 139 * @return void 138 140 */ 139 141 function billy_plugins_loaded(): void { 142 // TODO: Temporary workaround to fix a potential "Declaration of Billy_Pro::init() must be compatible with Billy::init(): void" fatal error on plugin activation! 143 if ( defined( 'BILLY_PRO_PLUGIN_FILE' ) && version_compare( get_plugin_data( BILLY_PRO_PLUGIN_FILE )['Version'], '2.1.0', '<' ) ) { 144 deactivate_plugins( plugin_basename( BILLY_PRO_PLUGIN_FILE ) ); 145 146 add_action( 'admin_notices', 'billy_pro_incompatible_admin_notice' ); 147 return; 148 } 149 150 if ( billy_is_plugin_active( 'classic-editor/classic-editor.php' ) || billy_is_plugin_active( 'disable-gutenberg/disable-gutenberg.php' ) ) { 151 add_action( 'admin_notices', 'billy_classic_editor_admin_notice' ); 152 add_action( 'admin_init', 'billy_deactivate' ); 153 154 return; 155 } 156 157 if ( version_compare( PHP_VERSION, REQUIRED_PHP, '<=' ) ) { 158 add_action( 'admin_notices', 'billy_php_incompatible_admin_notice' ); 159 // add_action( 'admin_init', 'billy_deactivate' ); 160 161 return; 162 } 163 164 if ( version_compare( wp_get_wp_version(), REQUIRED_WP, '<=' ) ) { 165 add_action( 'admin_notices', 'billy_wp_incompatible_admin_notice' ); 166 // add_action( 'admin_init', 'billy_deactivate' ); 167 168 return; 169 } 170 171 if ( isset( $_REQUEST['post_type'] ) && str_starts_with( (string) wp_unslash( $_REQUEST['post_type'] ), 'billy-' ) && ! wp_is_writable( __DIR__ . '/mpdf/tmp' ) ) { 172 add_action( 'admin_notices', 'billy_temp_pdfdirectory_not_writable_admin_notice' ); 173 } 174 140 175 // Initialize Classes. 141 176 include_once __DIR__ . '/inc/class-billy.php'; … … 168 203 169 204 /** 170 * On init: Test compatibility.171 *172 * @return void173 */174 function billy_plugins_init(): void {175 // TODO: Temporary workaround to fix a potential "Declaration of Billy_Pro::init() must be compatible with Billy::init(): void" fatal error on plugin activation!176 if ( defined( 'BILLY_PRO_PLUGIN_FILE' ) && version_compare( get_plugin_data( BILLY_PRO_PLUGIN_FILE )['Version'], '2.1.0', '<' ) ) {177 deactivate_plugins( plugin_basename( BILLY_PRO_PLUGIN_FILE ) );178 179 add_action( 'admin_notices', 'billy_pro_incompatible_admin_notice' );180 return;181 }182 183 if ( billy_is_plugin_active( 'classic-editor/classic-editor.php' ) || billy_is_plugin_active( 'disable-gutenberg/disable-gutenberg.php' ) ) {184 add_action( 'admin_notices', 'billy_classic_editor_admin_notice' );185 add_action( 'admin_init', 'billy_deactivate' );186 187 return;188 }189 190 if ( version_compare( PHP_VERSION, REQUIRED_PHP, '<=' ) ) {191 add_action( 'admin_notices', 'billy_php_incompatible_admin_notice' );192 // add_action( 'admin_init', 'billy_deactivate' );193 194 return;195 }196 197 if ( version_compare( wp_get_wp_version(), REQUIRED_WP, '<=' ) ) {198 add_action( 'admin_notices', 'billy_wp_incompatible_admin_notice' );199 // add_action( 'admin_init', 'billy_deactivate' );200 201 return;202 }203 204 if ( isset( $_REQUEST['post_type'] ) && str_starts_with( (string) wp_unslash( $_REQUEST['post_type'] ), 'billy-' ) && ! wp_is_writable( __DIR__ . '/mpdf/tmp' ) ) {205 add_action( 'admin_notices', 'billy_temp_pdfdirectory_not_writable_admin_notice' );206 }207 }208 add_action( 'init', 'billy_plugins_init', 998 );209 210 /**211 205 * Yoast Duplicate Post: Enable the plugin for the WooCommerce "product" post type, which is unavailable by default. 212 206 * -
billy/trunk/billy.php
r3421987 r3421992 133 133 134 134 /** 135 * On load: Initialize classes. 135 * On load: 136 * 1. Test compatibility. 137 * 2. Initialize plugin. 136 138 * 137 139 * @return void 138 140 */ 139 141 function billy_plugins_loaded(): void { 142 // TODO: Temporary workaround to fix a potential "Declaration of Billy_Pro::init() must be compatible with Billy::init(): void" fatal error on plugin activation! 143 if ( defined( 'BILLY_PRO_PLUGIN_FILE' ) && version_compare( get_plugin_data( BILLY_PRO_PLUGIN_FILE )['Version'], '2.1.0', '<' ) ) { 144 deactivate_plugins( plugin_basename( BILLY_PRO_PLUGIN_FILE ) ); 145 146 add_action( 'admin_notices', 'billy_pro_incompatible_admin_notice' ); 147 return; 148 } 149 150 if ( billy_is_plugin_active( 'classic-editor/classic-editor.php' ) || billy_is_plugin_active( 'disable-gutenberg/disable-gutenberg.php' ) ) { 151 add_action( 'admin_notices', 'billy_classic_editor_admin_notice' ); 152 add_action( 'admin_init', 'billy_deactivate' ); 153 154 return; 155 } 156 157 if ( version_compare( PHP_VERSION, REQUIRED_PHP, '<=' ) ) { 158 add_action( 'admin_notices', 'billy_php_incompatible_admin_notice' ); 159 // add_action( 'admin_init', 'billy_deactivate' ); 160 161 return; 162 } 163 164 if ( version_compare( wp_get_wp_version(), REQUIRED_WP, '<=' ) ) { 165 add_action( 'admin_notices', 'billy_wp_incompatible_admin_notice' ); 166 // add_action( 'admin_init', 'billy_deactivate' ); 167 168 return; 169 } 170 171 if ( isset( $_REQUEST['post_type'] ) && str_starts_with( (string) wp_unslash( $_REQUEST['post_type'] ), 'billy-' ) && ! wp_is_writable( __DIR__ . '/mpdf/tmp' ) ) { 172 add_action( 'admin_notices', 'billy_temp_pdfdirectory_not_writable_admin_notice' ); 173 } 174 140 175 // Initialize Classes. 141 176 include_once __DIR__ . '/inc/class-billy.php'; … … 168 203 169 204 /** 170 * On init: Test compatibility.171 *172 * @return void173 */174 function billy_plugins_init(): void {175 // TODO: Temporary workaround to fix a potential "Declaration of Billy_Pro::init() must be compatible with Billy::init(): void" fatal error on plugin activation!176 if ( defined( 'BILLY_PRO_PLUGIN_FILE' ) && version_compare( get_plugin_data( BILLY_PRO_PLUGIN_FILE )['Version'], '2.1.0', '<' ) ) {177 deactivate_plugins( plugin_basename( BILLY_PRO_PLUGIN_FILE ) );178 179 add_action( 'admin_notices', 'billy_pro_incompatible_admin_notice' );180 return;181 }182 183 if ( billy_is_plugin_active( 'classic-editor/classic-editor.php' ) || billy_is_plugin_active( 'disable-gutenberg/disable-gutenberg.php' ) ) {184 add_action( 'admin_notices', 'billy_classic_editor_admin_notice' );185 add_action( 'admin_init', 'billy_deactivate' );186 187 return;188 }189 190 if ( version_compare( PHP_VERSION, REQUIRED_PHP, '<=' ) ) {191 add_action( 'admin_notices', 'billy_php_incompatible_admin_notice' );192 // add_action( 'admin_init', 'billy_deactivate' );193 194 return;195 }196 197 if ( version_compare( wp_get_wp_version(), REQUIRED_WP, '<=' ) ) {198 add_action( 'admin_notices', 'billy_wp_incompatible_admin_notice' );199 // add_action( 'admin_init', 'billy_deactivate' );200 201 return;202 }203 204 if ( isset( $_REQUEST['post_type'] ) && str_starts_with( (string) wp_unslash( $_REQUEST['post_type'] ), 'billy-' ) && ! wp_is_writable( __DIR__ . '/mpdf/tmp' ) ) {205 add_action( 'admin_notices', 'billy_temp_pdfdirectory_not_writable_admin_notice' );206 }207 }208 add_action( 'init', 'billy_plugins_init', 998 );209 210 /**211 205 * Yoast Duplicate Post: Enable the plugin for the WooCommerce "product" post type, which is unavailable by default. 212 206 *
Note: See TracChangeset
for help on using the changeset viewer.