Plugin Directory

Changeset 3421987


Ignore:
Timestamp:
12/17/2025 02:09:44 PM (4 months ago)
Author:
them.es
Message:

updated trunk

Location:
billy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • billy/tags/2.1.0/billy.php

    r3421884 r3421987  
    133133
    134134/**
    135  * On load:
    136  * 1. Test compatibility.
    137  * 2. Initialize plugin.
     135 * On load: Initialize classes.
    138136 *
    139137 * @return void
    140138 */
    141139function 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 
    175140    // Initialize Classes.
    176141    include_once __DIR__ . '/inc/class-billy.php';
     
    203168
    204169/**
     170 * On init: Test compatibility.
     171 *
     172 * @return void
     173 */
     174function 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}
     208add_action( 'init', 'billy_plugins_init', 998 );
     209
     210/**
    205211 * Yoast Duplicate Post: Enable the plugin for the WooCommerce "product" post type, which is unavailable by default.
    206212 *
  • billy/trunk/billy.php

    r3421884 r3421987  
    133133
    134134/**
    135  * On load:
    136  * 1. Test compatibility.
    137  * 2. Initialize plugin.
     135 * On load: Initialize classes.
    138136 *
    139137 * @return void
    140138 */
    141139function 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 
    175140    // Initialize Classes.
    176141    include_once __DIR__ . '/inc/class-billy.php';
     
    203168
    204169/**
     170 * On init: Test compatibility.
     171 *
     172 * @return void
     173 */
     174function 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}
     208add_action( 'init', 'billy_plugins_init', 998 );
     209
     210/**
    205211 * Yoast Duplicate Post: Enable the plugin for the WooCommerce "product" post type, which is unavailable by default.
    206212 *
Note: See TracChangeset for help on using the changeset viewer.