Plugin Directory

Changeset 3195797


Ignore:
Timestamp:
11/24/2024 10:38:55 AM (14 months ago)
Author:
A.R.Naim
Message:

v2.0.0, service provider updated

Location:
reviewx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • reviewx/tags/2.0.0/app/Providers/PluginServiceProvider.php

    r3195734 r3195797  
    33namespace Rvx\Providers;
    44
    5 use Rvx\WPDrill\Plugin;
     5use WPDrill\Plugin;
    66use Rvx\Models\Site;
    7 use Rvx\WPDrill\ServiceProvider;
     7use WPDrill\ServiceProvider;
    88use Rvx\Handlers\UserHandler;
    99use Rvx\Handlers\ProductHandler;
     
    5050use Rvx\Handlers\WooCommerceReviewEditForm;
    5151use Rvx\Handlers\RvxInit\UpgradeReviewxDeactiveProHandler;
     52
    5253class PluginServiceProvider extends ServiceProvider
    5354{
    54     public function register() : void
    55     {
    56         $this->plugin->bind(ClientManager::class, function () {
    57             $site = Site::first();
    58             return new ClientManager($site);
    59         });
    60     }
    61     public function boot() : void
    62     {
    63         add_action('transition_post_status', new ProductHandler(), 10, 3);
    64         add_action('woocommerce_update_product', new ProductUpdateHandler());
    65         add_action('init', new PermalinkStructureHandler(), 10);
    66         add_action('init', new LoadTextDomainHandler(), 10);
    67         add_action('activated_plugin', new RedirectReviewxHandler(), 15, 1);
    68         add_action('plugins_loaded', new PageBuilderHandler(), 20);
    69         add_action('upgrader_process_complete', new UpgradeReviewxDeactiveProHandler(), 10, 2);
    70         add_action('wp_trash_post', new ProductDeleteHandler(), 10, 1);
    71         add_action('untrash_post', new ProductUntrashHandler(), 10, 1);
    72         add_action('woocommerce_thankyou', new OrderCreateHandler());
    73         add_action('woocommerce_order_status_changed', new OrderStatusChangedHandler(), 10, 4);
    74         add_action('plugins_loaded', new LoadReviewxCreateSiteTable(), 10);
    75         add_action('woocommerce_delete_order', new OrderDeleteHandler());
    76         /**
    77          * Category Hook
    78          */
    79         add_action('create_term', new CategoryHandler());
    80         add_action('delete_category', new CategoryDeleteHandler());
    81         //Post category
    82         // add_action('delete_product_cat', new CategoryProductDeleteHandler()); //Product category
    83         add_action('edited_term', new CategoryUpdateHandler());
    84         /**
    85          * Customer Hook
    86          */
    87         add_action('user_register', new UserHandler());
    88         add_action('delete_user', new UserDeleteHandler());
    89         add_action('profile_update', new UserUpdateHandler());
    90         // add_action('woocommerce_order_status_processing', (new VerifiedUserHandler()));
    91         add_action('woocommerce_update_order', new OrderUpdateHandler(), 10, 1);
    92         add_action('process_order_update', new OrderUpdateProcessHandler(), 20);
    93         /**
    94          * Importd product
    95          */
    96         add_action('woocommerce_product_import_inserted_product_object', new ProductImportHandler(), 20, 2);
    97         /**
    98          * Woocommerce review table sync with saas
    99          */
    100         add_action('transition_comment_status', new WooReviewTableHandler(), 10, 3);
    101         /**
    102          * Woocommerce review replay comments
    103          */
    104         add_action('comment_post', new ReplayCommentHandler(), 10, 3);
    105         /**
    106          * Woocommerce Comment status
    107          */
    108         add_action('wp_set_comment_status', new WoocommerceCommentStatusChangeHandler(), 10, 2);
    109         add_filter('bulk_actions-edit-comments', new CustomBulkActionsForReviewsHandler());
    110         add_filter('handle_bulk_actions', new RegisterBulkActionsForReviewsHandler(), 10, 3);
    111         add_action('trashed_comment', new WoocommerceCommentMoveToTrashHandler());
    112         add_action('untrash_comment', new WoocommerceCommentUntrashHandler());
    113         add_action('woocommerce_settings_save_products', new WoocommerceSettingsSaveHandler());
    114         /**
    115          * Woocommerce Edit Comment/Review
    116          */
    117         add_action('edit_comment', new WooCommerceReviewEditForm(), 10, 2);
    118         /**
    119          * Woocommerce Comment status
    120          */
    121         add_action('woocommerce_structured_data_product', new WoocommerceRichSchmaHandler(), 10, 2);
    122         /**
    123          * Woocommerce Template Modify
    124          */
    125         add_filter('woocommerce_locate_template', new WoocommerceLocateTemplateHandler(), 10, 3);
    126         // add_filter('comments_template', new CommentDefaultTemplateHandler(), 10);
    127         add_filter('comments_template', new CommentBoxHandle(), 99);
    128         //Woocommerce Avater
    129         add_action('woocommerce_edit_account_form', new WcEditAccountForm(), 10);
    130         add_action('woocommerce_save_account_details_errors', new WcAccountDetailsError(), 10, 1);
    131         add_action('woocommerce_save_account_details', new WcAccountDetails(), 20, 1);
    132         add_action('woocommerce_edit_account_form_tag', new WcAccountFormTag(), 20, 1);
    133         add_filter('woocommerce_checkout_fields', new WcSendEmailPermissionHandler(), 20, 1);
    134         /*
    135          * Load Appearance -> Customize - ReviewX
    136          */
    137         add_action('customize_register', new WidgetCustomizeOptionsHandler(), 10);
    138         add_action('wp_head', new WidgetCustomizeOutputCSSHandler(), 20);
    139     }
     55
     56        public function register(): void
     57        {
     58                $this->plugin->bind(ClientManager::class, function () {
     59                        $site = Site::first();
     60                        return new ClientManager($site);
     61                });
     62        }
     63
     64        public function boot(): void
     65        {
     66
     67                add_action('init', function () {
     68                    remove_action('upgrader_process_complete', ["ReviewX\Modules\VersionUpdater", 'update_plugin_v147'], 10, 2);
     69                    remove_action('plugins_loaded', ["ReviewX\Modules\VersionUpdater", 'delete_email_template']);
     70                });
     71
     72                add_action('transition_post_status', new ProductHandler(), 10, 3);
     73                add_action('woocommerce_update_product', new ProductUpdateHandler());
     74                add_action('init', new PermalinkStructureHandler(), 10);
     75                add_action('init', new LoadTextDomainHandler(), 10);
     76                add_action('activated_plugin', new RedirectReviewxHandler(), 15, 1);
     77                add_action('plugins_loaded', new PageBuilderHandler(), 20);
     78                add_action('upgrader_process_complete', new UpgradeReviewxDeactiveProHandler(), 10, 2);
     79
     80                add_action('wp_trash_post', new ProductDeleteHandler(), 10, 1);
     81                add_action('untrash_post', new ProductUntrashHandler(), 10, 1);
     82                add_action('woocommerce_thankyou', new OrderCreateHandler());
     83                add_action('woocommerce_order_status_changed', new OrderStatusChangedHandler(), 10, 4);
     84                add_action('plugins_loaded', new LoadReviewxCreateSiteTable(), 10);
     85                add_action('woocommerce_delete_order', new OrderDeleteHandler());
     86                /**
     87                 * Category Hook
     88                 */
     89                add_action('create_term', new CategoryHandler());
     90                add_action('delete_category', new CategoryDeleteHandler()); //Post category
     91                // add_action('delete_product_cat', new CategoryProductDeleteHandler()); //Product category
     92                add_action('edited_term', new CategoryUpdateHandler());
     93                /**
     94                 * Customer Hook
     95                 */
     96                add_action('user_register', new UserHandler());
     97                add_action('delete_user', new UserDeleteHandler());
     98                add_action('profile_update', new UserUpdateHandler());
     99                // add_action('woocommerce_order_status_processing', (new VerifiedUserHandler()));
     100                add_action('woocommerce_update_order', new OrderUpdateHandler(), 10, 1);
     101                add_action('process_order_update', new OrderUpdateProcessHandler(), 20);
     102                /**
     103                 * Importd product
     104                 */
     105                add_action('woocommerce_product_import_inserted_product_object', new ProductImportHandler(), 20, 2);
     106
     107                /**
     108                 * Woocommerce review table sync with saas
     109                 */
     110                add_action('transition_comment_status', new WooReviewTableHandler(), 10, 3);
     111                /**
     112                 * Woocommerce review replay comments
     113                 */
     114                add_action('comment_post', new ReplayCommentHandler(), 10, 3);
     115                /**
     116                 * Woocommerce Comment status
     117                 */
     118                add_action('wp_set_comment_status', new WoocommerceCommentStatusChangeHandler(), 10, 2);
     119                add_filter('bulk_actions-edit-comments', new CustomBulkActionsForReviewsHandler());
     120                add_filter('handle_bulk_actions', new RegisterBulkActionsForReviewsHandler(), 10, 3);
     121                add_action('trashed_comment', new WoocommerceCommentMoveToTrashHandler());
     122                add_action('untrash_comment', new WoocommerceCommentUntrashHandler());
     123                add_action('woocommerce_settings_save_products', new WoocommerceSettingsSaveHandler());
     124                /**
     125                 * Woocommerce Edit Comment/Review
     126                 */
     127                add_action('edit_comment', new WooCommerceReviewEditForm(), 10, 2);
     128               
     129                /**
     130                 * Woocommerce Comment status
     131                 */
     132                add_action('woocommerce_structured_data_product', new WoocommerceRichSchmaHandler(), 10, 2);
     133                /**
     134                 * Woocommerce Template Modify
     135                 */
     136                add_filter('woocommerce_locate_template', new WoocommerceLocateTemplateHandler(), 10, 3);
     137                // add_filter('comments_template', new CommentDefaultTemplateHandler(), 10);
     138                add_filter('comments_template', new CommentBoxHandle(), 99);
     139                //Woocommerce Avater
     140                add_action('woocommerce_edit_account_form', new WcEditAccountForm(), 10);
     141                add_action('woocommerce_save_account_details_errors', new WcAccountDetailsError(), 10, 1);
     142                add_action('woocommerce_save_account_details', new WcAccountDetails(), 20,1);
     143                add_action('woocommerce_edit_account_form_tag', new WcAccountFormTag(), 20,1);
     144                add_filter('woocommerce_checkout_fields', new WcSendEmailPermissionHandler(), 20, 1);
     145
     146                /*
     147                 * Load Appearance -> Customize - ReviewX
     148                 */
     149                add_action('customize_register', new WidgetCustomizeOptionsHandler(), 10);
     150                add_action('wp_head', new WidgetCustomizeOutputCSSHandler(), 20);
     151
     152        }
    140153}
     154
  • reviewx/trunk/app/Providers/PluginServiceProvider.php

    r3195749 r3195797  
    33namespace Rvx\Providers;
    44
    5 use Rvx\WPDrill\Plugin;
     5use WPDrill\Plugin;
    66use Rvx\Models\Site;
    7 use Rvx\WPDrill\ServiceProvider;
     7use WPDrill\ServiceProvider;
    88use Rvx\Handlers\UserHandler;
    99use Rvx\Handlers\ProductHandler;
     
    5050use Rvx\Handlers\WooCommerceReviewEditForm;
    5151use Rvx\Handlers\RvxInit\UpgradeReviewxDeactiveProHandler;
     52
    5253class PluginServiceProvider extends ServiceProvider
    5354{
    54     public function register() : void
    55     {
    56         $this->plugin->bind(ClientManager::class, function () {
    57             $site = Site::first();
    58             return new ClientManager($site);
    59         });
    60     }
    61     public function boot() : void
    62     {
    63         add_action('transition_post_status', new ProductHandler(), 10, 3);
    64         add_action('woocommerce_update_product', new ProductUpdateHandler());
    65         add_action('init', new PermalinkStructureHandler(), 10);
    66         add_action('init', new LoadTextDomainHandler(), 10);
    67         add_action('activated_plugin', new RedirectReviewxHandler(), 15, 1);
    68         add_action('plugins_loaded', new PageBuilderHandler(), 20);
    69         add_action('upgrader_process_complete', new UpgradeReviewxDeactiveProHandler(), 10, 2);
    70         add_action('wp_trash_post', new ProductDeleteHandler(), 10, 1);
    71         add_action('untrash_post', new ProductUntrashHandler(), 10, 1);
    72         add_action('woocommerce_thankyou', new OrderCreateHandler());
    73         add_action('woocommerce_order_status_changed', new OrderStatusChangedHandler(), 10, 4);
    74         add_action('plugins_loaded', new LoadReviewxCreateSiteTable(), 10);
    75         add_action('woocommerce_delete_order', new OrderDeleteHandler());
    76         /**
    77          * Category Hook
    78          */
    79         add_action('create_term', new CategoryHandler());
    80         add_action('delete_category', new CategoryDeleteHandler());
    81         //Post category
    82         // add_action('delete_product_cat', new CategoryProductDeleteHandler()); //Product category
    83         add_action('edited_term', new CategoryUpdateHandler());
    84         /**
    85          * Customer Hook
    86          */
    87         add_action('user_register', new UserHandler());
    88         add_action('delete_user', new UserDeleteHandler());
    89         add_action('profile_update', new UserUpdateHandler());
    90         // add_action('woocommerce_order_status_processing', (new VerifiedUserHandler()));
    91         add_action('woocommerce_update_order', new OrderUpdateHandler(), 10, 1);
    92         add_action('process_order_update', new OrderUpdateProcessHandler(), 20);
    93         /**
    94          * Importd product
    95          */
    96         add_action('woocommerce_product_import_inserted_product_object', new ProductImportHandler(), 20, 2);
    97         /**
    98          * Woocommerce review table sync with saas
    99          */
    100         add_action('transition_comment_status', new WooReviewTableHandler(), 10, 3);
    101         /**
    102          * Woocommerce review replay comments
    103          */
    104         add_action('comment_post', new ReplayCommentHandler(), 10, 3);
    105         /**
    106          * Woocommerce Comment status
    107          */
    108         add_action('wp_set_comment_status', new WoocommerceCommentStatusChangeHandler(), 10, 2);
    109         add_filter('bulk_actions-edit-comments', new CustomBulkActionsForReviewsHandler());
    110         add_filter('handle_bulk_actions', new RegisterBulkActionsForReviewsHandler(), 10, 3);
    111         add_action('trashed_comment', new WoocommerceCommentMoveToTrashHandler());
    112         add_action('untrash_comment', new WoocommerceCommentUntrashHandler());
    113         add_action('woocommerce_settings_save_products', new WoocommerceSettingsSaveHandler());
    114         /**
    115          * Woocommerce Edit Comment/Review
    116          */
    117         add_action('edit_comment', new WooCommerceReviewEditForm(), 10, 2);
    118         /**
    119          * Woocommerce Comment status
    120          */
    121         add_action('woocommerce_structured_data_product', new WoocommerceRichSchmaHandler(), 10, 2);
    122         /**
    123          * Woocommerce Template Modify
    124          */
    125         add_filter('woocommerce_locate_template', new WoocommerceLocateTemplateHandler(), 10, 3);
    126         // add_filter('comments_template', new CommentDefaultTemplateHandler(), 10);
    127         add_filter('comments_template', new CommentBoxHandle(), 99);
    128         //Woocommerce Avater
    129         add_action('woocommerce_edit_account_form', new WcEditAccountForm(), 10);
    130         add_action('woocommerce_save_account_details_errors', new WcAccountDetailsError(), 10, 1);
    131         add_action('woocommerce_save_account_details', new WcAccountDetails(), 20, 1);
    132         add_action('woocommerce_edit_account_form_tag', new WcAccountFormTag(), 20, 1);
    133         add_filter('woocommerce_checkout_fields', new WcSendEmailPermissionHandler(), 20, 1);
    134         /*
    135          * Load Appearance -> Customize - ReviewX
    136          */
    137         add_action('customize_register', new WidgetCustomizeOptionsHandler(), 10);
    138         add_action('wp_head', new WidgetCustomizeOutputCSSHandler(), 20);
    139     }
     55
     56        public function register(): void
     57        {
     58                $this->plugin->bind(ClientManager::class, function () {
     59                        $site = Site::first();
     60                        return new ClientManager($site);
     61                });
     62        }
     63
     64        public function boot(): void
     65        {
     66
     67                add_action('init', function () {
     68                    remove_action('upgrader_process_complete', ["ReviewX\Modules\VersionUpdater", 'update_plugin_v147'], 10, 2);
     69                    remove_action('plugins_loaded', ["ReviewX\Modules\VersionUpdater", 'delete_email_template']);
     70                });
     71
     72                add_action('transition_post_status', new ProductHandler(), 10, 3);
     73                add_action('woocommerce_update_product', new ProductUpdateHandler());
     74                add_action('init', new PermalinkStructureHandler(), 10);
     75                add_action('init', new LoadTextDomainHandler(), 10);
     76                add_action('activated_plugin', new RedirectReviewxHandler(), 15, 1);
     77                add_action('plugins_loaded', new PageBuilderHandler(), 20);
     78                add_action('upgrader_process_complete', new UpgradeReviewxDeactiveProHandler(), 10, 2);
     79
     80                add_action('wp_trash_post', new ProductDeleteHandler(), 10, 1);
     81                add_action('untrash_post', new ProductUntrashHandler(), 10, 1);
     82                add_action('woocommerce_thankyou', new OrderCreateHandler());
     83                add_action('woocommerce_order_status_changed', new OrderStatusChangedHandler(), 10, 4);
     84                add_action('plugins_loaded', new LoadReviewxCreateSiteTable(), 10);
     85                add_action('woocommerce_delete_order', new OrderDeleteHandler());
     86                /**
     87                 * Category Hook
     88                 */
     89                add_action('create_term', new CategoryHandler());
     90                add_action('delete_category', new CategoryDeleteHandler()); //Post category
     91                // add_action('delete_product_cat', new CategoryProductDeleteHandler()); //Product category
     92                add_action('edited_term', new CategoryUpdateHandler());
     93                /**
     94                 * Customer Hook
     95                 */
     96                add_action('user_register', new UserHandler());
     97                add_action('delete_user', new UserDeleteHandler());
     98                add_action('profile_update', new UserUpdateHandler());
     99                // add_action('woocommerce_order_status_processing', (new VerifiedUserHandler()));
     100                add_action('woocommerce_update_order', new OrderUpdateHandler(), 10, 1);
     101                add_action('process_order_update', new OrderUpdateProcessHandler(), 20);
     102                /**
     103                 * Importd product
     104                 */
     105                add_action('woocommerce_product_import_inserted_product_object', new ProductImportHandler(), 20, 2);
     106
     107                /**
     108                 * Woocommerce review table sync with saas
     109                 */
     110                add_action('transition_comment_status', new WooReviewTableHandler(), 10, 3);
     111                /**
     112                 * Woocommerce review replay comments
     113                 */
     114                add_action('comment_post', new ReplayCommentHandler(), 10, 3);
     115                /**
     116                 * Woocommerce Comment status
     117                 */
     118                add_action('wp_set_comment_status', new WoocommerceCommentStatusChangeHandler(), 10, 2);
     119                add_filter('bulk_actions-edit-comments', new CustomBulkActionsForReviewsHandler());
     120                add_filter('handle_bulk_actions', new RegisterBulkActionsForReviewsHandler(), 10, 3);
     121                add_action('trashed_comment', new WoocommerceCommentMoveToTrashHandler());
     122                add_action('untrash_comment', new WoocommerceCommentUntrashHandler());
     123                add_action('woocommerce_settings_save_products', new WoocommerceSettingsSaveHandler());
     124                /**
     125                 * Woocommerce Edit Comment/Review
     126                 */
     127                add_action('edit_comment', new WooCommerceReviewEditForm(), 10, 2);
     128               
     129                /**
     130                 * Woocommerce Comment status
     131                 */
     132                add_action('woocommerce_structured_data_product', new WoocommerceRichSchmaHandler(), 10, 2);
     133                /**
     134                 * Woocommerce Template Modify
     135                 */
     136                add_filter('woocommerce_locate_template', new WoocommerceLocateTemplateHandler(), 10, 3);
     137                // add_filter('comments_template', new CommentDefaultTemplateHandler(), 10);
     138                add_filter('comments_template', new CommentBoxHandle(), 99);
     139                //Woocommerce Avater
     140                add_action('woocommerce_edit_account_form', new WcEditAccountForm(), 10);
     141                add_action('woocommerce_save_account_details_errors', new WcAccountDetailsError(), 10, 1);
     142                add_action('woocommerce_save_account_details', new WcAccountDetails(), 20,1);
     143                add_action('woocommerce_edit_account_form_tag', new WcAccountFormTag(), 20,1);
     144                add_filter('woocommerce_checkout_fields', new WcSendEmailPermissionHandler(), 20, 1);
     145
     146                /*
     147                 * Load Appearance -> Customize - ReviewX
     148                 */
     149                add_action('customize_register', new WidgetCustomizeOptionsHandler(), 10);
     150                add_action('wp_head', new WidgetCustomizeOutputCSSHandler(), 20);
     151
     152        }
    140153}
     154
Note: See TracChangeset for help on using the changeset viewer.