Plugin Directory

Changeset 3245319


Ignore:
Timestamp:
02/23/2025 09:49:42 PM (14 months ago)
Author:
zefdev
Message:

Add the plugin file changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • convoworks-wp/trunk/convo-plugin.php

    r3204408 r3245319  
    99 * Plugin URI: https://convoworks.com
    1010 * Author: ZEF Development
    11  * Version: 0.22.41
     11 * Version: 0.22.42
    1212 * Author URI: https://zef.dev
    1313 * Text Domain: convo-wp
     
    1515 */
    1616
    17 if ( ! defined( 'ABSPATH' ) ) {
    18     die( 'You are not allowed to call this page directly.' );
     17if (! defined('ABSPATH')) {
     18    die('You are not allowed to call this page directly.');
    1919}
    2020
    21 if ( ! defined( 'CONVOWP_LOCAL' ) ) {
     21if (! defined('CONVOWP_LOCAL')) {
    2222    define('CONVOWP_LOCAL', false);
    2323}
     
    2525use Convo\Providers\ConvoWPPlugin;
    2626
    27 define('CONVOWP_VERSION', '0.22.41');
     27define('CONVOWP_VERSION', '0.22.42');
    2828define('CONVOWP_PLUGIN_SLUG', plugin_basename(__FILE__));
    2929define('CONVOWP_FILE', __FILE__);
    3030define('CONVOWP_PATH', __DIR__);
    31 define('CONVOWP_URL' , plugin_dir_url(__FILE__));
    32 define('CONVOWP_ASSETS_PATH' , CONVOWP_PATH . '/public/assets/');
     31define('CONVOWP_URL', plugin_dir_url(__FILE__));
     32define('CONVOWP_ASSETS_PATH', CONVOWP_PATH . '/public/assets/');
    3333define('CONVOWP_ASSETS_URL', CONVOWP_URL . 'public/assets/');
    3434define('CONVOWP_RESOURCES_URL', CONVOWP_URL . 'resources/');
     
    4343
    4444// CONVO RELATED
    45 define( 'CONVO_DATA_PATH', wp_upload_dir()['basedir'] . '/convoworks');
    46 define( 'CONVO_MEDIA_BASE_URL', wp_upload_dir()['baseurl'] . '/convoworks');
    47 define( 'CONVO_BASE_URL', site_url());
    48 define( 'CONVO_PUBLIC_REST_BASE_URL', CONVO_BASE_URL . '/wp-json/convo/v1/public');
    49 define( 'CONVO_UTIL_DISABLE_GZIP_ENCODING', false); // faster Rest responses, but can cause problemss in development and debuging
     45define('CONVO_DATA_PATH', wp_upload_dir()['basedir'] . '/convoworks');
     46define('CONVO_MEDIA_BASE_URL', wp_upload_dir()['baseurl'] . '/convoworks');
     47define('CONVO_BASE_URL', site_url());
     48define('CONVO_PUBLIC_REST_BASE_URL', CONVO_BASE_URL . '/wp-json/convo/v1/public');
     49define('CONVO_UTIL_DISABLE_GZIP_ENCODING', false); // faster Rest responses, but can cause problemss in development and debuging
    5050
    5151// Initialize the plugin
    5252if (version_compare(PHP_VERSION, '7.2', ">=")) {
    53    
    54     error_log('ConvoWPPlugin INCLUDE after ['.timer_stop(0,6).'ms]');
     53
    5554    // Add autoloader
    56     if ( CONVOWP_LOCAL) {
    57         require_once __DIR__.'/vendor/autoload.php';
     55    if (CONVOWP_LOCAL) {
     56        require_once __DIR__ . '/vendor/autoload.php';
    5857    } else {
    59         require_once __DIR__.'/vendor/scoper-autoload.php';
     58        require_once __DIR__ . '/vendor/scoper-autoload.php';
    6059    }
    6160
    6261    $plugin = new ConvoWPPlugin();
    6362    $plugin->init();
    64 
    65     error_log('ConvoWPPlugin INIT DONE after ['.timer_stop(0,6).'ms]');
    66 
    6763} else {
    6864    if (is_admin()) {
    69         add_action('all_admin_notices', function() {
     65        add_action('all_admin_notices', function () {
    7066            echo esc_html('<div class="error"><p>You need PHP v7.2+ to use the ConvoWp plugin. You currently have ' . PHP_VERSION . '</p></div>');
    7167        });
     
    7571// Plugin activation and deactivation
    7672if (version_compare(PHP_VERSION, '7.2', ">=")) {
    77     register_activation_hook( __FILE__, [ \Convo\Providers\PluginActivator::class, 'activate' ] );
    78     register_deactivation_hook( __FILE__, [ \Convo\Providers\PluginActivator::class, 'deactivate' ] );
    79     add_action( 'activated_plugin', [ \Convo\Providers\PluginActivator::class, 'afterActivate' ] );
    80     add_action( 'deactivated_plugin', [ \Convo\Providers\PluginActivator::class, 'afterDeactivate' ] );
     73    register_activation_hook(__FILE__, [\Convo\Providers\PluginActivator::class, 'activate']);
     74    register_deactivation_hook(__FILE__, [\Convo\Providers\PluginActivator::class, 'deactivate']);
     75    add_action('activated_plugin', [\Convo\Providers\PluginActivator::class, 'afterActivate']);
     76    add_action('deactivated_plugin', [\Convo\Providers\PluginActivator::class, 'afterDeactivate']);
    8177}
    82 
Note: See TracChangeset for help on using the changeset viewer.