Changeset 3245319
- Timestamp:
- 02/23/2025 09:49:42 PM (14 months ago)
- File:
-
- 1 edited
-
convoworks-wp/trunk/convo-plugin.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
convoworks-wp/trunk/convo-plugin.php
r3204408 r3245319 9 9 * Plugin URI: https://convoworks.com 10 10 * Author: ZEF Development 11 * Version: 0.22.4 111 * Version: 0.22.42 12 12 * Author URI: https://zef.dev 13 13 * Text Domain: convo-wp … … 15 15 */ 16 16 17 if ( ! defined( 'ABSPATH' )) {18 die( 'You are not allowed to call this page directly.');17 if (! defined('ABSPATH')) { 18 die('You are not allowed to call this page directly.'); 19 19 } 20 20 21 if ( ! defined( 'CONVOWP_LOCAL' )) {21 if (! defined('CONVOWP_LOCAL')) { 22 22 define('CONVOWP_LOCAL', false); 23 23 } … … 25 25 use Convo\Providers\ConvoWPPlugin; 26 26 27 define('CONVOWP_VERSION', '0.22.4 1');27 define('CONVOWP_VERSION', '0.22.42'); 28 28 define('CONVOWP_PLUGIN_SLUG', plugin_basename(__FILE__)); 29 29 define('CONVOWP_FILE', __FILE__); 30 30 define('CONVOWP_PATH', __DIR__); 31 define('CONVOWP_URL' , plugin_dir_url(__FILE__));32 define('CONVOWP_ASSETS_PATH' , CONVOWP_PATH . '/public/assets/');31 define('CONVOWP_URL', plugin_dir_url(__FILE__)); 32 define('CONVOWP_ASSETS_PATH', CONVOWP_PATH . '/public/assets/'); 33 33 define('CONVOWP_ASSETS_URL', CONVOWP_URL . 'public/assets/'); 34 34 define('CONVOWP_RESOURCES_URL', CONVOWP_URL . 'resources/'); … … 43 43 44 44 // 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 debuging45 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 50 50 51 51 // Initialize the plugin 52 52 if (version_compare(PHP_VERSION, '7.2', ">=")) { 53 54 error_log('ConvoWPPlugin INCLUDE after ['.timer_stop(0,6).'ms]'); 53 55 54 // Add autoloader 56 if ( CONVOWP_LOCAL) {57 require_once __DIR__ .'/vendor/autoload.php';55 if (CONVOWP_LOCAL) { 56 require_once __DIR__ . '/vendor/autoload.php'; 58 57 } else { 59 require_once __DIR__ .'/vendor/scoper-autoload.php';58 require_once __DIR__ . '/vendor/scoper-autoload.php'; 60 59 } 61 60 62 61 $plugin = new ConvoWPPlugin(); 63 62 $plugin->init(); 64 65 error_log('ConvoWPPlugin INIT DONE after ['.timer_stop(0,6).'ms]');66 67 63 } else { 68 64 if (is_admin()) { 69 add_action('all_admin_notices', function () {65 add_action('all_admin_notices', function () { 70 66 echo esc_html('<div class="error"><p>You need PHP v7.2+ to use the ConvoWp plugin. You currently have ' . PHP_VERSION . '</p></div>'); 71 67 }); … … 75 71 // Plugin activation and deactivation 76 72 if (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']); 81 77 } 82
Note: See TracChangeset
for help on using the changeset viewer.