@@ -1,7 +1,7 @@ |
||
1 | -<?php defined('WPINC') || die; ?> |
|
1 | +<?php defined( 'WPINC' ) || die; ?> |
|
2 | 2 | |
3 | -<p><?= __('The JSON-LD schema is disabled by default. To use it, please enable the option in your blocks or shortcodes. The schema appears in Google\'s search results and shows the star rating and other information about your reviews. If the schema has been enabled, you can use Google\'s <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test your pages for valid schema data.', 'site-reviews'); ?></p> |
|
4 | -<p><?= __('You may override any of these options on a per-post/page basis by using its Custom Field name and adding a custom value using the <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a> metabox.', 'site-reviews'); ?></p> |
|
3 | +<p><?= __( 'The JSON-LD schema is disabled by default. To use it, please enable the option in your blocks or shortcodes. The schema appears in Google\'s search results and shows the star rating and other information about your reviews. If the schema has been enabled, you can use Google\'s <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test your pages for valid schema data.', 'site-reviews' ); ?></p> |
|
4 | +<p><?= __( 'You may override any of these options on a per-post/page basis by using its Custom Field name and adding a custom value using the <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a> metabox.', 'site-reviews' ); ?></p> |
|
5 | 5 | <table class="form-table"> |
6 | 6 | <tbody> |
7 | 7 | {{ rows }} |
@@ -10,94 +10,94 @@ |
||
10 | 10 | |
11 | 11 | class MainController extends Controller |
12 | 12 | { |
13 | - /** |
|
14 | - * @return void |
|
15 | - * @action init |
|
16 | - */ |
|
17 | - public function registerPostType() |
|
18 | - { |
|
19 | - if (!glsr()->hasPermission()) { |
|
20 | - return; |
|
21 | - } |
|
22 | - $command = new RegisterPostType([ |
|
23 | - 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
|
24 | - 'columns' => [ |
|
25 | - 'title' => '', |
|
26 | - 'category' => '', |
|
27 | - 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | - 'reviewer' => __('Author', 'site-reviews'), |
|
29 | - 'review_type' => __('Type', 'site-reviews'), |
|
30 | - 'rating' => __('Rating', 'site-reviews'), |
|
31 | - 'pinned' => __('Pinned', 'site-reviews'), |
|
32 | - 'date' => '', |
|
33 | - ], |
|
34 | - 'menu_icon' => 'dashicons-star-half', |
|
35 | - 'menu_name' => glsr()->name, |
|
36 | - 'map_meta_cap' => true, |
|
37 | - 'plural' => __('Reviews', 'site-reviews'), |
|
38 | - 'post_type' => Application::POST_TYPE, |
|
39 | - 'rest_controller_class' => RestReviewController::class, |
|
40 | - 'show_in_rest' => true, |
|
41 | - 'single' => __('Review', 'site-reviews'), |
|
42 | - ]); |
|
43 | - $this->execute($command); |
|
44 | - } |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + * @action init |
|
16 | + */ |
|
17 | + public function registerPostType() |
|
18 | + { |
|
19 | + if (!glsr()->hasPermission()) { |
|
20 | + return; |
|
21 | + } |
|
22 | + $command = new RegisterPostType([ |
|
23 | + 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
|
24 | + 'columns' => [ |
|
25 | + 'title' => '', |
|
26 | + 'category' => '', |
|
27 | + 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | + 'reviewer' => __('Author', 'site-reviews'), |
|
29 | + 'review_type' => __('Type', 'site-reviews'), |
|
30 | + 'rating' => __('Rating', 'site-reviews'), |
|
31 | + 'pinned' => __('Pinned', 'site-reviews'), |
|
32 | + 'date' => '', |
|
33 | + ], |
|
34 | + 'menu_icon' => 'dashicons-star-half', |
|
35 | + 'menu_name' => glsr()->name, |
|
36 | + 'map_meta_cap' => true, |
|
37 | + 'plural' => __('Reviews', 'site-reviews'), |
|
38 | + 'post_type' => Application::POST_TYPE, |
|
39 | + 'rest_controller_class' => RestReviewController::class, |
|
40 | + 'show_in_rest' => true, |
|
41 | + 'single' => __('Review', 'site-reviews'), |
|
42 | + ]); |
|
43 | + $this->execute($command); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * @return void |
|
48 | - * @action init |
|
49 | - */ |
|
50 | - public function registerShortcodes() |
|
51 | - { |
|
52 | - $command = new RegisterShortcodes([ |
|
53 | - 'site_reviews', |
|
54 | - 'site_reviews_form', |
|
55 | - 'site_reviews_summary', |
|
56 | - ]); |
|
57 | - $this->execute($command); |
|
58 | - } |
|
46 | + /** |
|
47 | + * @return void |
|
48 | + * @action init |
|
49 | + */ |
|
50 | + public function registerShortcodes() |
|
51 | + { |
|
52 | + $command = new RegisterShortcodes([ |
|
53 | + 'site_reviews', |
|
54 | + 'site_reviews_form', |
|
55 | + 'site_reviews_summary', |
|
56 | + ]); |
|
57 | + $this->execute($command); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return void |
|
62 | - * @action init |
|
63 | - */ |
|
64 | - public function registerTaxonomy() |
|
65 | - { |
|
66 | - $command = new RegisterTaxonomy([ |
|
67 | - 'hierarchical' => true, |
|
68 | - 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
69 | - 'public' => false, |
|
70 | - 'rest_controller_class' => RestCategoryController::class, |
|
71 | - 'show_admin_column' => true, |
|
72 | - 'show_in_rest' => true, |
|
73 | - 'show_ui' => true, |
|
74 | - ]); |
|
75 | - $this->execute($command); |
|
76 | - } |
|
60 | + /** |
|
61 | + * @return void |
|
62 | + * @action init |
|
63 | + */ |
|
64 | + public function registerTaxonomy() |
|
65 | + { |
|
66 | + $command = new RegisterTaxonomy([ |
|
67 | + 'hierarchical' => true, |
|
68 | + 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
69 | + 'public' => false, |
|
70 | + 'rest_controller_class' => RestCategoryController::class, |
|
71 | + 'show_admin_column' => true, |
|
72 | + 'show_in_rest' => true, |
|
73 | + 'show_ui' => true, |
|
74 | + ]); |
|
75 | + $this->execute($command); |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * @return void |
|
80 | - * @action widgets_init |
|
81 | - */ |
|
82 | - public function registerWidgets() |
|
83 | - { |
|
84 | - $command = new RegisterWidgets([ |
|
85 | - 'site-reviews' => [ |
|
86 | - 'class' => 'glsr-widget glsr-widget-site-reviews', |
|
87 | - 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
88 | - 'title' => __('Recent Reviews', 'site-reviews'), |
|
89 | - ], |
|
90 | - 'site-reviews-form' => [ |
|
91 | - 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
|
92 | - 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
93 | - 'title' => __('Submit a Review', 'site-reviews'), |
|
94 | - ], |
|
95 | - 'site-reviews-summary' => [ |
|
96 | - 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
|
97 | - 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
98 | - 'title' => __('Summary of Reviews', 'site-reviews'), |
|
99 | - ], |
|
100 | - ]); |
|
101 | - $this->execute($command); |
|
102 | - } |
|
78 | + /** |
|
79 | + * @return void |
|
80 | + * @action widgets_init |
|
81 | + */ |
|
82 | + public function registerWidgets() |
|
83 | + { |
|
84 | + $command = new RegisterWidgets([ |
|
85 | + 'site-reviews' => [ |
|
86 | + 'class' => 'glsr-widget glsr-widget-site-reviews', |
|
87 | + 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
88 | + 'title' => __('Recent Reviews', 'site-reviews'), |
|
89 | + ], |
|
90 | + 'site-reviews-form' => [ |
|
91 | + 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
|
92 | + 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
93 | + 'title' => __('Submit a Review', 'site-reviews'), |
|
94 | + ], |
|
95 | + 'site-reviews-summary' => [ |
|
96 | + 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
|
97 | + 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
98 | + 'title' => __('Summary of Reviews', 'site-reviews'), |
|
99 | + ], |
|
100 | + ]); |
|
101 | + $this->execute($command); |
|
102 | + } |
|
103 | 103 | } |
@@ -16,31 +16,31 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function registerPostType() |
18 | 18 | { |
19 | - if (!glsr()->hasPermission()) { |
|
19 | + if( !glsr()->hasPermission() ) { |
|
20 | 20 | return; |
21 | 21 | } |
22 | - $command = new RegisterPostType([ |
|
22 | + $command = new RegisterPostType( [ |
|
23 | 23 | 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
24 | 24 | 'columns' => [ |
25 | 25 | 'title' => '', |
26 | 26 | 'category' => '', |
27 | - 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | - 'reviewer' => __('Author', 'site-reviews'), |
|
29 | - 'review_type' => __('Type', 'site-reviews'), |
|
30 | - 'rating' => __('Rating', 'site-reviews'), |
|
31 | - 'pinned' => __('Pinned', 'site-reviews'), |
|
27 | + 'assigned_to' => __( 'Assigned To', 'site-reviews' ), |
|
28 | + 'reviewer' => __( 'Author', 'site-reviews' ), |
|
29 | + 'review_type' => __( 'Type', 'site-reviews' ), |
|
30 | + 'rating' => __( 'Rating', 'site-reviews' ), |
|
31 | + 'pinned' => __( 'Pinned', 'site-reviews' ), |
|
32 | 32 | 'date' => '', |
33 | 33 | ], |
34 | 34 | 'menu_icon' => 'dashicons-star-half', |
35 | 35 | 'menu_name' => glsr()->name, |
36 | 36 | 'map_meta_cap' => true, |
37 | - 'plural' => __('Reviews', 'site-reviews'), |
|
37 | + 'plural' => __( 'Reviews', 'site-reviews' ), |
|
38 | 38 | 'post_type' => Application::POST_TYPE, |
39 | 39 | 'rest_controller_class' => RestReviewController::class, |
40 | 40 | 'show_in_rest' => true, |
41 | - 'single' => __('Review', 'site-reviews'), |
|
42 | - ]); |
|
43 | - $this->execute($command); |
|
41 | + 'single' => __( 'Review', 'site-reviews' ), |
|
42 | + ] ); |
|
43 | + $this->execute( $command ); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function registerShortcodes() |
51 | 51 | { |
52 | - $command = new RegisterShortcodes([ |
|
52 | + $command = new RegisterShortcodes( [ |
|
53 | 53 | 'site_reviews', |
54 | 54 | 'site_reviews_form', |
55 | 55 | 'site_reviews_summary', |
56 | - ]); |
|
57 | - $this->execute($command); |
|
56 | + ] ); |
|
57 | + $this->execute( $command ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -63,16 +63,16 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function registerTaxonomy() |
65 | 65 | { |
66 | - $command = new RegisterTaxonomy([ |
|
66 | + $command = new RegisterTaxonomy( [ |
|
67 | 67 | 'hierarchical' => true, |
68 | - 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
68 | + 'meta_box_cb' => [glsr( EditorController::class ), 'renderTaxonomyMetabox'], |
|
69 | 69 | 'public' => false, |
70 | 70 | 'rest_controller_class' => RestCategoryController::class, |
71 | 71 | 'show_admin_column' => true, |
72 | 72 | 'show_in_rest' => true, |
73 | 73 | 'show_ui' => true, |
74 | - ]); |
|
75 | - $this->execute($command); |
|
74 | + ] ); |
|
75 | + $this->execute( $command ); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -81,23 +81,23 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function registerWidgets() |
83 | 83 | { |
84 | - $command = new RegisterWidgets([ |
|
84 | + $command = new RegisterWidgets( [ |
|
85 | 85 | 'site-reviews' => [ |
86 | 86 | 'class' => 'glsr-widget glsr-widget-site-reviews', |
87 | - 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
88 | - 'title' => __('Recent Reviews', 'site-reviews'), |
|
87 | + 'description' => __( 'Site Reviews: Display your recent reviews.', 'site-reviews' ), |
|
88 | + 'title' => __( 'Recent Reviews', 'site-reviews' ), |
|
89 | 89 | ], |
90 | 90 | 'site-reviews-form' => [ |
91 | 91 | 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
92 | - 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
93 | - 'title' => __('Submit a Review', 'site-reviews'), |
|
92 | + 'description' => __( 'Site Reviews: Display a form to submit reviews.', 'site-reviews' ), |
|
93 | + 'title' => __( 'Submit a Review', 'site-reviews' ), |
|
94 | 94 | ], |
95 | 95 | 'site-reviews-summary' => [ |
96 | 96 | 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
97 | - 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
98 | - 'title' => __('Summary of Reviews', 'site-reviews'), |
|
97 | + 'description' => __( 'Site Reviews: Display a summary of your reviews.', 'site-reviews' ), |
|
98 | + 'title' => __( 'Summary of Reviews', 'site-reviews' ), |
|
99 | 99 | ], |
100 | - ]); |
|
101 | - $this->execute($command); |
|
100 | + ] ); |
|
101 | + $this->execute( $command ); |
|
102 | 102 | } |
103 | 103 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | protected $taxonomy; |
34 | 34 | protected $welcome; |
35 | 35 | |
36 | - public function __construct(Application $app ) { |
|
36 | + public function __construct(Application $app ) |
|
37 | + { |
|
37 | 38 | $this->app = $app; |
38 | 39 | $this->admin = $app->make(AdminController::class); |
39 | 40 | $this->blocks = $app->make(BlocksController::class); |
@@ -20,108 +20,108 @@ |
||
20 | 20 | |
21 | 21 | class Actions implements HooksContract |
22 | 22 | { |
23 | - protected $about; |
|
24 | - protected $admin; |
|
25 | - protected $app; |
|
26 | - protected $blocks; |
|
27 | - protected $console; |
|
28 | - protected $editor; |
|
29 | - protected $listtable; |
|
30 | - protected $menu; |
|
31 | - protected $main; |
|
32 | - protected $notices; |
|
33 | - protected $public; |
|
34 | - protected $rebusify; |
|
35 | - protected $review; |
|
36 | - protected $router; |
|
37 | - protected $settings; |
|
38 | - protected $taxonomy; |
|
39 | - protected $welcome; |
|
23 | + protected $about; |
|
24 | + protected $admin; |
|
25 | + protected $app; |
|
26 | + protected $blocks; |
|
27 | + protected $console; |
|
28 | + protected $editor; |
|
29 | + protected $listtable; |
|
30 | + protected $menu; |
|
31 | + protected $main; |
|
32 | + protected $notices; |
|
33 | + protected $public; |
|
34 | + protected $rebusify; |
|
35 | + protected $review; |
|
36 | + protected $router; |
|
37 | + protected $settings; |
|
38 | + protected $taxonomy; |
|
39 | + protected $welcome; |
|
40 | 40 | |
41 | - public function __construct(Application $app ) { |
|
42 | - $this->app = $app; |
|
43 | - $this->admin = $app->make(AdminController::class); |
|
44 | - $this->blocks = $app->make(BlocksController::class); |
|
45 | - $this->console = $app->make(Console::class); |
|
46 | - $this->editor = $app->make(EditorController::class); |
|
47 | - $this->listtable = $app->make(ListTableController::class); |
|
48 | - $this->main = $app->make(MainController::class); |
|
49 | - $this->menu = $app->make(MenuController::class); |
|
50 | - $this->notices = $app->make(NoticeController::class); |
|
51 | - $this->public = $app->make(PublicController::class); |
|
52 | - $this->rebusify = $app->make(RebusifyController::class); |
|
53 | - $this->review = $app->make(ReviewController::class); |
|
54 | - $this->router = $app->make(Router::class); |
|
55 | - $this->settings = $app->make(SettingsController::class); |
|
56 | - $this->taxonomy = $app->make(TaxonomyController::class); |
|
57 | - $this->welcome = $app->make(WelcomeController::class); |
|
58 | - } |
|
41 | + public function __construct(Application $app ) { |
|
42 | + $this->app = $app; |
|
43 | + $this->admin = $app->make(AdminController::class); |
|
44 | + $this->blocks = $app->make(BlocksController::class); |
|
45 | + $this->console = $app->make(Console::class); |
|
46 | + $this->editor = $app->make(EditorController::class); |
|
47 | + $this->listtable = $app->make(ListTableController::class); |
|
48 | + $this->main = $app->make(MainController::class); |
|
49 | + $this->menu = $app->make(MenuController::class); |
|
50 | + $this->notices = $app->make(NoticeController::class); |
|
51 | + $this->public = $app->make(PublicController::class); |
|
52 | + $this->rebusify = $app->make(RebusifyController::class); |
|
53 | + $this->review = $app->make(ReviewController::class); |
|
54 | + $this->router = $app->make(Router::class); |
|
55 | + $this->settings = $app->make(SettingsController::class); |
|
56 | + $this->taxonomy = $app->make(TaxonomyController::class); |
|
57 | + $this->welcome = $app->make(WelcomeController::class); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return void |
|
62 | - */ |
|
63 | - public function run() |
|
64 | - { |
|
65 | - add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
66 | - add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
67 | - add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
68 | - add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
69 | - add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
70 | - add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
71 | - add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
72 | - add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
73 | - add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
74 | - add_action('init', [$this->blocks, 'registerBlocks']); |
|
75 | - add_action('admin_footer', [$this->console, 'logOnce']); |
|
76 | - add_action('wp_footer', [$this->console, 'logOnce']); |
|
77 | - add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
78 | - add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
79 | - add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
80 | - add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
81 | - add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
82 | - add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
83 | - add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
84 | - add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
85 | - add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3); |
|
86 | - add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
87 | - add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
88 | - add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
89 | - add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
90 | - add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
91 | - add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
92 | - add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
93 | - add_action('init', [$this->main, 'registerPostType'], 8); |
|
94 | - add_action('init', [$this->main, 'registerShortcodes']); |
|
95 | - add_action('init', [$this->main, 'registerTaxonomy']); |
|
96 | - add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
97 | - add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
98 | - add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
99 | - add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
100 | - add_action('admin_notices', [$this->notices, 'filterAdminNotices']); |
|
101 | - add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
102 | - add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
103 | - add_action('wp_footer', [$this->public, 'renderSchema']); |
|
104 | - add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
105 | - add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
106 | - add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
107 | - add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 3); |
|
108 | - add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
109 | - add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
110 | - add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
111 | - add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
112 | - add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
113 | - add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
114 | - add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
115 | - add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
116 | - add_action('init', [$this->router, 'routePublicPostRequest']); |
|
117 | - add_action('admin_init', [$this->settings, 'registerSettings']); |
|
118 | - add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
119 | - add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
120 | - add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
121 | - add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
122 | - add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
123 | - add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
124 | - add_action('activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2); |
|
125 | - add_action('admin_menu', [$this->welcome, 'registerPage']); |
|
126 | - } |
|
60 | + /** |
|
61 | + * @return void |
|
62 | + */ |
|
63 | + public function run() |
|
64 | + { |
|
65 | + add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
66 | + add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
67 | + add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
68 | + add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
69 | + add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
70 | + add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
71 | + add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
72 | + add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
73 | + add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
74 | + add_action('init', [$this->blocks, 'registerBlocks']); |
|
75 | + add_action('admin_footer', [$this->console, 'logOnce']); |
|
76 | + add_action('wp_footer', [$this->console, 'logOnce']); |
|
77 | + add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
78 | + add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
79 | + add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
80 | + add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
81 | + add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
82 | + add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
83 | + add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
84 | + add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
85 | + add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3); |
|
86 | + add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
87 | + add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
88 | + add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
89 | + add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
90 | + add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
91 | + add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
92 | + add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
93 | + add_action('init', [$this->main, 'registerPostType'], 8); |
|
94 | + add_action('init', [$this->main, 'registerShortcodes']); |
|
95 | + add_action('init', [$this->main, 'registerTaxonomy']); |
|
96 | + add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
97 | + add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
98 | + add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
99 | + add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
100 | + add_action('admin_notices', [$this->notices, 'filterAdminNotices']); |
|
101 | + add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
102 | + add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
103 | + add_action('wp_footer', [$this->public, 'renderSchema']); |
|
104 | + add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
105 | + add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
106 | + add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
107 | + add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 3); |
|
108 | + add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
109 | + add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
110 | + add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
111 | + add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
112 | + add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
113 | + add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
114 | + add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
115 | + add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
116 | + add_action('init', [$this->router, 'routePublicPostRequest']); |
|
117 | + add_action('admin_init', [$this->settings, 'registerSettings']); |
|
118 | + add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
119 | + add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
120 | + add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
121 | + add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
122 | + add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
123 | + add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
124 | + add_action('activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2); |
|
125 | + add_action('admin_menu', [$this->welcome, 'registerPage']); |
|
126 | + } |
|
127 | 127 | } |
@@ -38,23 +38,23 @@ discard block |
||
38 | 38 | protected $taxonomy; |
39 | 39 | protected $welcome; |
40 | 40 | |
41 | - public function __construct(Application $app ) { |
|
41 | + public function __construct( Application $app ) { |
|
42 | 42 | $this->app = $app; |
43 | - $this->admin = $app->make(AdminController::class); |
|
44 | - $this->blocks = $app->make(BlocksController::class); |
|
45 | - $this->console = $app->make(Console::class); |
|
46 | - $this->editor = $app->make(EditorController::class); |
|
47 | - $this->listtable = $app->make(ListTableController::class); |
|
48 | - $this->main = $app->make(MainController::class); |
|
49 | - $this->menu = $app->make(MenuController::class); |
|
50 | - $this->notices = $app->make(NoticeController::class); |
|
51 | - $this->public = $app->make(PublicController::class); |
|
52 | - $this->rebusify = $app->make(RebusifyController::class); |
|
53 | - $this->review = $app->make(ReviewController::class); |
|
54 | - $this->router = $app->make(Router::class); |
|
55 | - $this->settings = $app->make(SettingsController::class); |
|
56 | - $this->taxonomy = $app->make(TaxonomyController::class); |
|
57 | - $this->welcome = $app->make(WelcomeController::class); |
|
43 | + $this->admin = $app->make( AdminController::class ); |
|
44 | + $this->blocks = $app->make( BlocksController::class ); |
|
45 | + $this->console = $app->make( Console::class ); |
|
46 | + $this->editor = $app->make( EditorController::class ); |
|
47 | + $this->listtable = $app->make( ListTableController::class ); |
|
48 | + $this->main = $app->make( MainController::class ); |
|
49 | + $this->menu = $app->make( MenuController::class ); |
|
50 | + $this->notices = $app->make( NoticeController::class ); |
|
51 | + $this->public = $app->make( PublicController::class ); |
|
52 | + $this->rebusify = $app->make( RebusifyController::class ); |
|
53 | + $this->review = $app->make( ReviewController::class ); |
|
54 | + $this->router = $app->make( Router::class ); |
|
55 | + $this->settings = $app->make( SettingsController::class ); |
|
56 | + $this->taxonomy = $app->make( TaxonomyController::class ); |
|
57 | + $this->welcome = $app->make( WelcomeController::class ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,66 +62,66 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function run() |
64 | 64 | { |
65 | - add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
66 | - add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
67 | - add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
68 | - add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
69 | - add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
70 | - add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
71 | - add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
72 | - add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
73 | - add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
74 | - add_action('init', [$this->blocks, 'registerBlocks']); |
|
75 | - add_action('admin_footer', [$this->console, 'logOnce']); |
|
76 | - add_action('wp_footer', [$this->console, 'logOnce']); |
|
77 | - add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
78 | - add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
79 | - add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
80 | - add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
81 | - add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
82 | - add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
83 | - add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
84 | - add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
85 | - add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3); |
|
86 | - add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
87 | - add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
88 | - add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
89 | - add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
90 | - add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
91 | - add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
92 | - add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
93 | - add_action('init', [$this->main, 'registerPostType'], 8); |
|
94 | - add_action('init', [$this->main, 'registerShortcodes']); |
|
95 | - add_action('init', [$this->main, 'registerTaxonomy']); |
|
96 | - add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
97 | - add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
98 | - add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
99 | - add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
100 | - add_action('admin_notices', [$this->notices, 'filterAdminNotices']); |
|
101 | - add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
102 | - add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
103 | - add_action('wp_footer', [$this->public, 'renderSchema']); |
|
104 | - add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
105 | - add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
106 | - add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
107 | - add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 3); |
|
108 | - add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
109 | - add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
110 | - add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
111 | - add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
112 | - add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
113 | - add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
114 | - add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
115 | - add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
116 | - add_action('init', [$this->router, 'routePublicPostRequest']); |
|
117 | - add_action('admin_init', [$this->settings, 'registerSettings']); |
|
118 | - add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
119 | - add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
120 | - add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
121 | - add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
122 | - add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
123 | - add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
124 | - add_action('activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2); |
|
125 | - add_action('admin_menu', [$this->welcome, 'registerPage']); |
|
65 | + add_action( 'admin_enqueue_scripts', [$this->admin, 'enqueueAssets'] ); |
|
66 | + add_action( 'admin_init', [$this->admin, 'registerTinymcePopups'] ); |
|
67 | + add_action( 'media_buttons', [$this->admin, 'renderTinymceButton'], 11 ); |
|
68 | + add_action( 'plugins_loaded', [$this->app, 'getDefaults'], 11 ); |
|
69 | + add_action( 'plugins_loaded', [$this->app, 'registerAddons'] ); |
|
70 | + add_action( 'plugins_loaded', [$this->app, 'registerLanguages'] ); |
|
71 | + add_action( 'plugins_loaded', [$this->app, 'registerReviewTypes'] ); |
|
72 | + add_action( 'upgrader_process_complete', [$this->app, 'upgraded'], 10, 2 ); |
|
73 | + add_action( 'init', [$this->blocks, 'registerAssets'], 9 ); |
|
74 | + add_action( 'init', [$this->blocks, 'registerBlocks'] ); |
|
75 | + add_action( 'admin_footer', [$this->console, 'logOnce'] ); |
|
76 | + add_action( 'wp_footer', [$this->console, 'logOnce'] ); |
|
77 | + add_action( 'admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels'] ); |
|
78 | + add_action( 'add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes'] ); |
|
79 | + add_action( 'admin_print_scripts', [$this->editor, 'removeAutosave'], 999 ); |
|
80 | + add_action( 'admin_menu', [$this->editor, 'removeMetaBoxes'] ); |
|
81 | + add_action( 'current_screen', [$this->editor, 'removePostTypeSupport'] ); |
|
82 | + add_action( 'post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox'] ); |
|
83 | + add_action( 'admin_head', [$this->editor, 'renderReviewFields'] ); |
|
84 | + add_action( 'admin_action_revert', [$this->editor, 'revertReview'] ); |
|
85 | + add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3 ); |
|
86 | + add_action( 'admin_action_approve', [$this->listtable, 'approve'] ); |
|
87 | + add_action( 'bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2 ); |
|
88 | + add_action( 'restrict_manage_posts', [$this->listtable, 'renderColumnFilters'] ); |
|
89 | + add_action( 'manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2 ); |
|
90 | + add_action( 'save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields'] ); |
|
91 | + add_action( 'pre_get_posts', [$this->listtable, 'setQueryForColumn'] ); |
|
92 | + add_action( 'admin_action_unapprove', [$this->listtable, 'unapprove'] ); |
|
93 | + add_action( 'init', [$this->main, 'registerPostType'], 8 ); |
|
94 | + add_action( 'init', [$this->main, 'registerShortcodes'] ); |
|
95 | + add_action( 'init', [$this->main, 'registerTaxonomy'] ); |
|
96 | + add_action( 'widgets_init', [$this->main, 'registerWidgets'] ); |
|
97 | + add_action( 'admin_menu', [$this->menu, 'registerMenuCount'] ); |
|
98 | + add_action( 'admin_menu', [$this->menu, 'registerSubMenus'] ); |
|
99 | + add_action( 'admin_init', [$this->menu, 'setCustomPermissions'], 999 ); |
|
100 | + add_action( 'admin_notices', [$this->notices, 'filterAdminNotices'] ); |
|
101 | + add_action( 'wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999 ); |
|
102 | + add_filter( 'site-reviews/builder', [$this->public, 'modifyBuilder'] ); |
|
103 | + add_action( 'wp_footer', [$this->public, 'renderSchema'] ); |
|
104 | + add_action( 'site-reviews/review/created', [$this->rebusify, 'onCreated'] ); |
|
105 | + add_action( 'site-reviews/review/reverted', [$this->rebusify, 'onReverted'] ); |
|
106 | + add_action( 'site-reviews/review/saved', [$this->rebusify, 'onSaved'] ); |
|
107 | + add_action( 'updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 3 ); |
|
108 | + add_action( 'set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6 ); |
|
109 | + add_action( 'transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3 ); |
|
110 | + add_action( 'site-reviews/review/created', [$this->review, 'onAfterCreate'] ); |
|
111 | + add_action( 'before_delete_post', [$this->review, 'onBeforeDelete'] ); |
|
112 | + add_action( 'update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4 ); |
|
113 | + add_action( 'admin_init', [$this->router, 'routeAdminPostRequest'] ); |
|
114 | + add_action( 'wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] ); |
|
115 | + add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] ); |
|
116 | + add_action( 'init', [$this->router, 'routePublicPostRequest'] ); |
|
117 | + add_action( 'admin_init', [$this->settings, 'registerSettings'] ); |
|
118 | + add_action( Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents'] ); |
|
119 | + add_action( Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents'] ); |
|
120 | + add_action( Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents'] ); |
|
121 | + add_action( Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents'] ); |
|
122 | + add_action( 'restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9 ); |
|
123 | + add_action( 'set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6 ); |
|
124 | + add_action( 'activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2 ); |
|
125 | + add_action( 'admin_menu', [$this->welcome, 'registerPage'] ); |
|
126 | 126 | } |
127 | 127 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | defined('WPINC') || die; |
19 | 19 | |
20 | 20 | if (!class_exists('GL_Plugin_Check_v3')) { |
21 | - require_once __DIR__.'/activate.php'; |
|
21 | + require_once __DIR__.'/activate.php'; |
|
22 | 22 | } |
23 | 23 | $check = new GL_Plugin_Check_v3(__FILE__); |
24 | 24 | if (!$check->canProceed()) { |
25 | - return; |
|
25 | + return; |
|
26 | 26 | } |
27 | 27 | require_once __DIR__.'/autoload.php'; |
28 | 28 | require_once __DIR__.'/compatibility.php'; |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | * Text Domain: site-reviews |
16 | 16 | * Domain Path: languages |
17 | 17 | */ |
18 | -defined('WPINC') || die; |
|
18 | +defined( 'WPINC' ) || die; |
|
19 | 19 | |
20 | -if (!class_exists('GL_Plugin_Check_v3')) { |
|
20 | +if( !class_exists( 'GL_Plugin_Check_v3' ) ) { |
|
21 | 21 | require_once __DIR__.'/activate.php'; |
22 | 22 | } |
23 | -$check = new GL_Plugin_Check_v3(__FILE__); |
|
24 | -if (!$check->canProceed()) { |
|
23 | +$check = new GL_Plugin_Check_v3( __FILE__ ); |
|
24 | +if( !$check->canProceed() ) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | require_once __DIR__.'/autoload.php'; |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | require_once __DIR__.'/helpers.php'; |
31 | 31 | |
32 | 32 | $app = new GeminiLabs\SiteReviews\Application(); |
33 | -$app->make('Provider')->register($app); |
|
34 | -register_activation_hook(__FILE__, array($app, 'activate')); |
|
35 | -register_deactivation_hook(__FILE__, array($app, 'deactivate')); |
|
36 | -register_shutdown_function(array($app, 'catchFatalError')); |
|
33 | +$app->make( 'Provider' )->register( $app ); |
|
34 | +register_activation_hook( __FILE__, array( $app, 'activate' ) ); |
|
35 | +register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) ); |
|
36 | +register_shutdown_function( array( $app, 'catchFatalError' ) ); |
|
37 | 37 | $app->init(); |
@@ -8,112 +8,112 @@ |
||
8 | 8 | |
9 | 9 | class Notice |
10 | 10 | { |
11 | - /** |
|
12 | - * @param string $type |
|
13 | - * @param string|array|WP_Error $message |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function add($type, $message, array $args = []) |
|
17 | - { |
|
18 | - if (empty(array_filter([$message, $type]))) { |
|
19 | - return; |
|
20 | - } |
|
21 | - $args['message'] = $message; |
|
22 | - $args['type'] = $type; |
|
23 | - add_settings_error(Application::ID, '', json_encode($this->normalize($args))); |
|
24 | - } |
|
11 | + /** |
|
12 | + * @param string $type |
|
13 | + * @param string|array|WP_Error $message |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function add($type, $message, array $args = []) |
|
17 | + { |
|
18 | + if (empty(array_filter([$message, $type]))) { |
|
19 | + return; |
|
20 | + } |
|
21 | + $args['message'] = $message; |
|
22 | + $args['type'] = $type; |
|
23 | + add_settings_error(Application::ID, '', json_encode($this->normalize($args))); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * @param string|array|WP_Error $message |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - public function addError($message, array $args = []) |
|
31 | - { |
|
32 | - $this->add('error', $message, $args); |
|
33 | - } |
|
26 | + /** |
|
27 | + * @param string|array|WP_Error $message |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + public function addError($message, array $args = []) |
|
31 | + { |
|
32 | + $this->add('error', $message, $args); |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * @param string|array|WP_Error $message |
|
37 | - * @return void |
|
38 | - */ |
|
39 | - public function addSuccess($message, array $args = []) |
|
40 | - { |
|
41 | - $this->add('success', $message, $args); |
|
42 | - } |
|
35 | + /** |
|
36 | + * @param string|array|WP_Error $message |
|
37 | + * @return void |
|
38 | + */ |
|
39 | + public function addSuccess($message, array $args = []) |
|
40 | + { |
|
41 | + $this->add('success', $message, $args); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @param string|array|WP_Error $message |
|
46 | - * @return void |
|
47 | - */ |
|
48 | - public function addWarning($message, array $args = []) |
|
49 | - { |
|
50 | - $this->add('warning', $message, $args); |
|
51 | - } |
|
44 | + /** |
|
45 | + * @param string|array|WP_Error $message |
|
46 | + * @return void |
|
47 | + */ |
|
48 | + public function addWarning($message, array $args = []) |
|
49 | + { |
|
50 | + $this->add('warning', $message, $args); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @return static |
|
55 | - */ |
|
56 | - public function clear() |
|
57 | - { |
|
58 | - global $wp_settings_errors; |
|
59 | - $wp_settings_errors = []; |
|
60 | - delete_transient('settings_errors'); |
|
61 | - return $this; |
|
62 | - } |
|
53 | + /** |
|
54 | + * @return static |
|
55 | + */ |
|
56 | + public function clear() |
|
57 | + { |
|
58 | + global $wp_settings_errors; |
|
59 | + $wp_settings_errors = []; |
|
60 | + delete_transient('settings_errors'); |
|
61 | + return $this; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return string |
|
66 | - */ |
|
67 | - public function get() |
|
68 | - { |
|
69 | - $notices = array_map('unserialize', |
|
70 | - array_unique(array_map('serialize', get_settings_errors(Application::ID))) |
|
71 | - ); |
|
72 | - $notices = array_reduce($notices, function ($carry, $notice) { |
|
73 | - return $carry.$this->buildNotice(json_decode($notice['message'], true)); |
|
74 | - }); |
|
75 | - return apply_filters('site-reviews/notices', $notices); |
|
76 | - } |
|
64 | + /** |
|
65 | + * @return string |
|
66 | + */ |
|
67 | + public function get() |
|
68 | + { |
|
69 | + $notices = array_map('unserialize', |
|
70 | + array_unique(array_map('serialize', get_settings_errors(Application::ID))) |
|
71 | + ); |
|
72 | + $notices = array_reduce($notices, function ($carry, $notice) { |
|
73 | + return $carry.$this->buildNotice(json_decode($notice['message'], true)); |
|
74 | + }); |
|
75 | + return apply_filters('site-reviews/notices', $notices); |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * @return string |
|
80 | - */ |
|
81 | - protected function buildNotice(array $args) |
|
82 | - { |
|
83 | - $messages = array_reduce($args['messages'], function ($carry, $message) { |
|
84 | - return $carry.glsr(Builder::class)->p($message); |
|
85 | - }); |
|
86 | - $class = 'notice notice-'.$args['type']; |
|
87 | - if ($args['inline']) { |
|
88 | - $class.= ' inline'; |
|
89 | - } |
|
90 | - if ($args['dismissible']) { |
|
91 | - $class.= ' is-dismissible'; |
|
92 | - } |
|
93 | - return glsr(Builder::class)->div($messages, [ |
|
94 | - 'class' => $class, |
|
95 | - ]); |
|
96 | - } |
|
78 | + /** |
|
79 | + * @return string |
|
80 | + */ |
|
81 | + protected function buildNotice(array $args) |
|
82 | + { |
|
83 | + $messages = array_reduce($args['messages'], function ($carry, $message) { |
|
84 | + return $carry.glsr(Builder::class)->p($message); |
|
85 | + }); |
|
86 | + $class = 'notice notice-'.$args['type']; |
|
87 | + if ($args['inline']) { |
|
88 | + $class.= ' inline'; |
|
89 | + } |
|
90 | + if ($args['dismissible']) { |
|
91 | + $class.= ' is-dismissible'; |
|
92 | + } |
|
93 | + return glsr(Builder::class)->div($messages, [ |
|
94 | + 'class' => $class, |
|
95 | + ]); |
|
96 | + } |
|
97 | 97 | |
98 | - /** |
|
99 | - * @return array |
|
100 | - */ |
|
101 | - protected function normalize(array $args) |
|
102 | - { |
|
103 | - $defaults = [ |
|
104 | - 'dismissible' => true, |
|
105 | - 'inline' => true, |
|
106 | - 'message' => '', |
|
107 | - 'type' => '', |
|
108 | - ]; |
|
109 | - $args = shortcode_atts($defaults, $args); |
|
110 | - if (!in_array($args['type'], ['error', 'warning', 'success'])) { |
|
111 | - $args['type'] = 'success'; |
|
112 | - } |
|
113 | - $args['messages'] = is_wp_error($args['message']) |
|
114 | - ? (array) $args['message']->get_error_message() |
|
115 | - : (array) $args['message']; |
|
116 | - unset($args['message']); |
|
117 | - return $args; |
|
118 | - } |
|
98 | + /** |
|
99 | + * @return array |
|
100 | + */ |
|
101 | + protected function normalize(array $args) |
|
102 | + { |
|
103 | + $defaults = [ |
|
104 | + 'dismissible' => true, |
|
105 | + 'inline' => true, |
|
106 | + 'message' => '', |
|
107 | + 'type' => '', |
|
108 | + ]; |
|
109 | + $args = shortcode_atts($defaults, $args); |
|
110 | + if (!in_array($args['type'], ['error', 'warning', 'success'])) { |
|
111 | + $args['type'] = 'success'; |
|
112 | + } |
|
113 | + $args['messages'] = is_wp_error($args['message']) |
|
114 | + ? (array) $args['message']->get_error_message() |
|
115 | + : (array) $args['message']; |
|
116 | + unset($args['message']); |
|
117 | + return $args; |
|
118 | + } |
|
119 | 119 | } |
@@ -13,41 +13,41 @@ discard block |
||
13 | 13 | * @param string|array|WP_Error $message |
14 | 14 | * @return void |
15 | 15 | */ |
16 | - public function add($type, $message, array $args = []) |
|
16 | + public function add( $type, $message, array $args = [] ) |
|
17 | 17 | { |
18 | - if (empty(array_filter([$message, $type]))) { |
|
18 | + if( empty(array_filter( [$message, $type] )) ) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 | $args['message'] = $message; |
22 | 22 | $args['type'] = $type; |
23 | - add_settings_error(Application::ID, '', json_encode($this->normalize($args))); |
|
23 | + add_settings_error( Application::ID, '', json_encode( $this->normalize( $args ) ) ); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param string|array|WP_Error $message |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function addError($message, array $args = []) |
|
30 | + public function addError( $message, array $args = [] ) |
|
31 | 31 | { |
32 | - $this->add('error', $message, $args); |
|
32 | + $this->add( 'error', $message, $args ); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param string|array|WP_Error $message |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function addSuccess($message, array $args = []) |
|
39 | + public function addSuccess( $message, array $args = [] ) |
|
40 | 40 | { |
41 | - $this->add('success', $message, $args); |
|
41 | + $this->add( 'success', $message, $args ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @param string|array|WP_Error $message |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - public function addWarning($message, array $args = []) |
|
48 | + public function addWarning( $message, array $args = [] ) |
|
49 | 49 | { |
50 | - $this->add('warning', $message, $args); |
|
50 | + $this->add( 'warning', $message, $args ); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | global $wp_settings_errors; |
59 | 59 | $wp_settings_errors = []; |
60 | - delete_transient('settings_errors'); |
|
60 | + delete_transient( 'settings_errors' ); |
|
61 | 61 | return $this; |
62 | 62 | } |
63 | 63 | |
@@ -66,39 +66,39 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function get() |
68 | 68 | { |
69 | - $notices = array_map('unserialize', |
|
70 | - array_unique(array_map('serialize', get_settings_errors(Application::ID))) |
|
69 | + $notices = array_map( 'unserialize', |
|
70 | + array_unique( array_map( 'serialize', get_settings_errors( Application::ID ) ) ) |
|
71 | 71 | ); |
72 | - $notices = array_reduce($notices, function ($carry, $notice) { |
|
73 | - return $carry.$this->buildNotice(json_decode($notice['message'], true)); |
|
72 | + $notices = array_reduce( $notices, function( $carry, $notice ) { |
|
73 | + return $carry.$this->buildNotice( json_decode( $notice['message'], true ) ); |
|
74 | 74 | }); |
75 | - return apply_filters('site-reviews/notices', $notices); |
|
75 | + return apply_filters( 'site-reviews/notices', $notices ); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @return string |
80 | 80 | */ |
81 | - protected function buildNotice(array $args) |
|
81 | + protected function buildNotice( array $args ) |
|
82 | 82 | { |
83 | - $messages = array_reduce($args['messages'], function ($carry, $message) { |
|
84 | - return $carry.glsr(Builder::class)->p($message); |
|
83 | + $messages = array_reduce( $args['messages'], function( $carry, $message ) { |
|
84 | + return $carry.glsr( Builder::class )->p( $message ); |
|
85 | 85 | }); |
86 | 86 | $class = 'notice notice-'.$args['type']; |
87 | - if ($args['inline']) { |
|
88 | - $class.= ' inline'; |
|
87 | + if( $args['inline'] ) { |
|
88 | + $class .= ' inline'; |
|
89 | 89 | } |
90 | - if ($args['dismissible']) { |
|
91 | - $class.= ' is-dismissible'; |
|
90 | + if( $args['dismissible'] ) { |
|
91 | + $class .= ' is-dismissible'; |
|
92 | 92 | } |
93 | - return glsr(Builder::class)->div($messages, [ |
|
93 | + return glsr( Builder::class )->div( $messages, [ |
|
94 | 94 | 'class' => $class, |
95 | - ]); |
|
95 | + ] ); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * @return array |
100 | 100 | */ |
101 | - protected function normalize(array $args) |
|
101 | + protected function normalize( array $args ) |
|
102 | 102 | { |
103 | 103 | $defaults = [ |
104 | 104 | 'dismissible' => true, |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | 'message' => '', |
107 | 107 | 'type' => '', |
108 | 108 | ]; |
109 | - $args = shortcode_atts($defaults, $args); |
|
110 | - if (!in_array($args['type'], ['error', 'warning', 'success'])) { |
|
109 | + $args = shortcode_atts( $defaults, $args ); |
|
110 | + if( !in_array( $args['type'], ['error', 'warning', 'success'] ) ) { |
|
111 | 111 | $args['type'] = 'success'; |
112 | 112 | } |
113 | - $args['messages'] = is_wp_error($args['message']) |
|
114 | - ? (array) $args['message']->get_error_message() |
|
115 | - : (array) $args['message']; |
|
113 | + $args['messages'] = is_wp_error( $args['message'] ) |
|
114 | + ? (array)$args['message']->get_error_message() |
|
115 | + : (array)$args['message']; |
|
116 | 116 | unset($args['message']); |
117 | 117 | return $args; |
118 | 118 | } |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class Password extends Field |
6 | 6 | { |
7 | - /** |
|
8 | - * @return array |
|
9 | - */ |
|
10 | - public static function defaults() |
|
11 | - { |
|
12 | - return [ |
|
13 | - 'class' => 'regular-text', |
|
14 | - ]; |
|
15 | - } |
|
7 | + /** |
|
8 | + * @return array |
|
9 | + */ |
|
10 | + public static function defaults() |
|
11 | + { |
|
12 | + return [ |
|
13 | + 'class' => 'regular-text', |
|
14 | + ]; |
|
15 | + } |
|
16 | 16 | } |
@@ -6,33 +6,33 @@ |
||
6 | 6 | |
7 | 7 | class SiteReviewsDefaults extends Defaults |
8 | 8 | { |
9 | - /** |
|
10 | - * @var array |
|
11 | - */ |
|
12 | - protected $guarded = [ |
|
13 | - 'fallback', |
|
14 | - 'title', |
|
15 | - ]; |
|
9 | + /** |
|
10 | + * @var array |
|
11 | + */ |
|
12 | + protected $guarded = [ |
|
13 | + 'fallback', |
|
14 | + 'title', |
|
15 | + ]; |
|
16 | 16 | |
17 | - /** |
|
18 | - * @return array |
|
19 | - */ |
|
20 | - protected function defaults() |
|
21 | - { |
|
22 | - return [ |
|
23 | - 'assigned_to' => '', |
|
24 | - 'category' => '', |
|
25 | - 'class' => '', |
|
26 | - 'count' => 5, |
|
27 | - 'fallback' => '', |
|
28 | - 'hide' => [], |
|
29 | - 'id' => '', |
|
30 | - 'offset' => '', |
|
31 | - 'pagination' => false, |
|
32 | - 'rating' => 0, |
|
33 | - 'schema' => false, |
|
34 | - 'title' => '', |
|
35 | - 'type' => 'local', |
|
36 | - ]; |
|
37 | - } |
|
17 | + /** |
|
18 | + * @return array |
|
19 | + */ |
|
20 | + protected function defaults() |
|
21 | + { |
|
22 | + return [ |
|
23 | + 'assigned_to' => '', |
|
24 | + 'category' => '', |
|
25 | + 'class' => '', |
|
26 | + 'count' => 5, |
|
27 | + 'fallback' => '', |
|
28 | + 'hide' => [], |
|
29 | + 'id' => '', |
|
30 | + 'offset' => '', |
|
31 | + 'pagination' => false, |
|
32 | + 'rating' => 0, |
|
33 | + 'schema' => false, |
|
34 | + 'title' => '', |
|
35 | + 'type' => 'local', |
|
36 | + ]; |
|
37 | + } |
|
38 | 38 | } |
@@ -101,7 +101,8 @@ |
||
101 | 101 | { |
102 | 102 | if (is_wp_error($response)) { |
103 | 103 | $this->message = $response->get_error_message(); |
104 | - } else { |
|
104 | + } |
|
105 | + else { |
|
105 | 106 | $responseBody = wp_remote_retrieve_body($response); |
106 | 107 | $responseCode = wp_remote_retrieve_response_code($response); |
107 | 108 | $responseData = (array) json_decode($responseBody, true); |
@@ -10,143 +10,143 @@ |
||
10 | 10 | |
11 | 11 | class Rebusify |
12 | 12 | { |
13 | - const API_URL = 'https://www.rebusify.com/api/rbs/'; |
|
14 | - const WEB_URL = 'https://rebusify.com/plans?ref=105'; |
|
13 | + const API_URL = 'https://www.rebusify.com/api/rbs/'; |
|
14 | + const WEB_URL = 'https://rebusify.com/plans?ref=105'; |
|
15 | 15 | |
16 | - public $message; |
|
17 | - public $response; |
|
18 | - public $success; |
|
16 | + public $message; |
|
17 | + public $response; |
|
18 | + public $success; |
|
19 | 19 | |
20 | - /** |
|
21 | - * @return mixed |
|
22 | - */ |
|
23 | - public function __get($key) |
|
24 | - { |
|
25 | - return property_exists($this, $key) |
|
26 | - ? $this->$key |
|
27 | - : Arr::get($this->response, $key, null); |
|
28 | - } |
|
20 | + /** |
|
21 | + * @return mixed |
|
22 | + */ |
|
23 | + public function __get($key) |
|
24 | + { |
|
25 | + return property_exists($this, $key) |
|
26 | + ? $this->$key |
|
27 | + : Arr::get($this->response, $key, null); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return self |
|
32 | - */ |
|
33 | - public function activateKey($apiKey = '', $email = '') |
|
34 | - { |
|
35 | - $this->send('api_key_activation.php', [ |
|
36 | - 'body' => [ |
|
37 | - 'apikey' => $apiKey ?: 0, |
|
38 | - 'domain' => get_home_url(), |
|
39 | - 'email' => $email ?: 0, |
|
40 | - ], |
|
41 | - ]); |
|
42 | - return $this; |
|
43 | - } |
|
30 | + /** |
|
31 | + * @return self |
|
32 | + */ |
|
33 | + public function activateKey($apiKey = '', $email = '') |
|
34 | + { |
|
35 | + $this->send('api_key_activation.php', [ |
|
36 | + 'body' => [ |
|
37 | + 'apikey' => $apiKey ?: 0, |
|
38 | + 'domain' => get_home_url(), |
|
39 | + 'email' => $email ?: 0, |
|
40 | + ], |
|
41 | + ]); |
|
42 | + return $this; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @return self |
|
47 | - */ |
|
48 | - public function reset() |
|
49 | - { |
|
50 | - $this->message = ''; |
|
51 | - $this->response = []; |
|
52 | - $this->success = false; |
|
53 | - return $this; |
|
54 | - } |
|
45 | + /** |
|
46 | + * @return self |
|
47 | + */ |
|
48 | + public function reset() |
|
49 | + { |
|
50 | + $this->message = ''; |
|
51 | + $this->response = []; |
|
52 | + $this->success = false; |
|
53 | + return $this; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * @return self |
|
58 | - */ |
|
59 | - public function sendReview(Review $review) |
|
60 | - { |
|
61 | - $this->send('index.php', [ |
|
62 | - 'body' => $this->getBodyForReview($review), |
|
63 | - 'timeout' => 120, |
|
64 | - ]); |
|
65 | - return $this; |
|
66 | - } |
|
56 | + /** |
|
57 | + * @return self |
|
58 | + */ |
|
59 | + public function sendReview(Review $review) |
|
60 | + { |
|
61 | + $this->send('index.php', [ |
|
62 | + 'body' => $this->getBodyForReview($review), |
|
63 | + 'timeout' => 120, |
|
64 | + ]); |
|
65 | + return $this; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @return self |
|
70 | - */ |
|
71 | - public function sendReviewResponse(Review $review) |
|
72 | - { |
|
73 | - $this->send('fetch_customer_reply.php', [ |
|
74 | - 'body' => $this->getBodyForResponse($review), |
|
75 | - ]); |
|
76 | - return $this; |
|
77 | - } |
|
68 | + /** |
|
69 | + * @return self |
|
70 | + */ |
|
71 | + public function sendReviewResponse(Review $review) |
|
72 | + { |
|
73 | + $this->send('fetch_customer_reply.php', [ |
|
74 | + 'body' => $this->getBodyForResponse($review), |
|
75 | + ]); |
|
76 | + return $this; |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * @return array |
|
81 | - */ |
|
82 | - protected function getBodyForResponse(Review $review) |
|
83 | - { |
|
84 | - $rebusifyResponse = [ |
|
85 | - 'reply' => Str::truncate($review->response, 300), |
|
86 | - 'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID |
|
87 | - 'review_transaction_id' => $review->review_id, |
|
88 | - 'type' => 'M', |
|
89 | - ]; |
|
90 | - return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review); |
|
91 | - } |
|
79 | + /** |
|
80 | + * @return array |
|
81 | + */ |
|
82 | + protected function getBodyForResponse(Review $review) |
|
83 | + { |
|
84 | + $rebusifyResponse = [ |
|
85 | + 'reply' => Str::truncate($review->response, 300), |
|
86 | + 'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID |
|
87 | + 'review_transaction_id' => $review->review_id, |
|
88 | + 'type' => 'M', |
|
89 | + ]; |
|
90 | + return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return array |
|
95 | - */ |
|
96 | - protected function getBodyForReview(Review $review) |
|
97 | - { |
|
98 | - $rebusifyReview = [ |
|
99 | - 'domain' => get_home_url(), |
|
100 | - 'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25), |
|
101 | - 'rate' => $review->rating, |
|
102 | - 'review_transaction_id' => $review->review_id, |
|
103 | - 'reviews' => Str::truncate($review->content, 280), |
|
104 | - 'title' => Str::truncate($review->title, 35), |
|
105 | - 'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews |
|
106 | - ]; |
|
107 | - return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review); |
|
108 | - } |
|
93 | + /** |
|
94 | + * @return array |
|
95 | + */ |
|
96 | + protected function getBodyForReview(Review $review) |
|
97 | + { |
|
98 | + $rebusifyReview = [ |
|
99 | + 'domain' => get_home_url(), |
|
100 | + 'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25), |
|
101 | + 'rate' => $review->rating, |
|
102 | + 'review_transaction_id' => $review->review_id, |
|
103 | + 'reviews' => Str::truncate($review->content, 280), |
|
104 | + 'title' => Str::truncate($review->title, 35), |
|
105 | + 'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews |
|
106 | + ]; |
|
107 | + return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review); |
|
108 | + } |
|
109 | 109 | |
110 | - /** |
|
111 | - * @param \WP_Error|array $response |
|
112 | - * @return void |
|
113 | - */ |
|
114 | - protected function handleResponse($response) |
|
115 | - { |
|
116 | - if (is_wp_error($response)) { |
|
117 | - $this->message = $response->get_error_message(); |
|
118 | - } else { |
|
119 | - $responseBody = wp_remote_retrieve_body($response); |
|
120 | - $responseCode = wp_remote_retrieve_response_code($response); |
|
121 | - $responseData = (array) json_decode($responseBody, true); |
|
122 | - $this->response = array_shift($responseData); |
|
123 | - $this->message = Arr::get($this->response, 'msg'); |
|
124 | - $this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack! |
|
125 | - if (200 !== $responseCode) { |
|
126 | - glsr_log()->error('Bad response code ['.$responseCode.']'); |
|
127 | - } |
|
128 | - if (!$this->success) { |
|
129 | - glsr_log()->error($this->message); |
|
130 | - } |
|
131 | - } |
|
132 | - } |
|
110 | + /** |
|
111 | + * @param \WP_Error|array $response |
|
112 | + * @return void |
|
113 | + */ |
|
114 | + protected function handleResponse($response) |
|
115 | + { |
|
116 | + if (is_wp_error($response)) { |
|
117 | + $this->message = $response->get_error_message(); |
|
118 | + } else { |
|
119 | + $responseBody = wp_remote_retrieve_body($response); |
|
120 | + $responseCode = wp_remote_retrieve_response_code($response); |
|
121 | + $responseData = (array) json_decode($responseBody, true); |
|
122 | + $this->response = array_shift($responseData); |
|
123 | + $this->message = Arr::get($this->response, 'msg'); |
|
124 | + $this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack! |
|
125 | + if (200 !== $responseCode) { |
|
126 | + glsr_log()->error('Bad response code ['.$responseCode.']'); |
|
127 | + } |
|
128 | + if (!$this->success) { |
|
129 | + glsr_log()->error($this->message); |
|
130 | + } |
|
131 | + } |
|
132 | + } |
|
133 | 133 | |
134 | - /** |
|
135 | - * @param string $endpoint |
|
136 | - * @return void |
|
137 | - */ |
|
138 | - protected function send($endpoint, array $args = []) |
|
139 | - { |
|
140 | - $args = wp_parse_args($args, [ |
|
141 | - 'body' => null, |
|
142 | - 'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'], |
|
143 | - 'redirection' => 5, |
|
144 | - 'sslverify' => false, |
|
145 | - 'timeout' => 5, |
|
146 | - ]); |
|
147 | - $this->reset(); |
|
148 | - $this->handleResponse( |
|
149 | - wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args) |
|
150 | - ); |
|
151 | - } |
|
134 | + /** |
|
135 | + * @param string $endpoint |
|
136 | + * @return void |
|
137 | + */ |
|
138 | + protected function send($endpoint, array $args = []) |
|
139 | + { |
|
140 | + $args = wp_parse_args($args, [ |
|
141 | + 'body' => null, |
|
142 | + 'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'], |
|
143 | + 'redirection' => 5, |
|
144 | + 'sslverify' => false, |
|
145 | + 'timeout' => 5, |
|
146 | + ]); |
|
147 | + $this->reset(); |
|
148 | + $this->handleResponse( |
|
149 | + wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args) |
|
150 | + ); |
|
151 | + } |
|
152 | 152 | } |
@@ -20,25 +20,25 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * @return mixed |
22 | 22 | */ |
23 | - public function __get($key) |
|
23 | + public function __get( $key ) |
|
24 | 24 | { |
25 | - return property_exists($this, $key) |
|
25 | + return property_exists( $this, $key ) |
|
26 | 26 | ? $this->$key |
27 | - : Arr::get($this->response, $key, null); |
|
27 | + : Arr::get( $this->response, $key, null ); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @return self |
32 | 32 | */ |
33 | - public function activateKey($apiKey = '', $email = '') |
|
33 | + public function activateKey( $apiKey = '', $email = '' ) |
|
34 | 34 | { |
35 | - $this->send('api_key_activation.php', [ |
|
35 | + $this->send( 'api_key_activation.php', [ |
|
36 | 36 | 'body' => [ |
37 | 37 | 'apikey' => $apiKey ?: 0, |
38 | 38 | 'domain' => get_home_url(), |
39 | 39 | 'email' => $email ?: 0, |
40 | 40 | ], |
41 | - ]); |
|
41 | + ] ); |
|
42 | 42 | return $this; |
43 | 43 | } |
44 | 44 | |
@@ -56,77 +56,77 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * @return self |
58 | 58 | */ |
59 | - public function sendReview(Review $review) |
|
59 | + public function sendReview( Review $review ) |
|
60 | 60 | { |
61 | - $this->send('index.php', [ |
|
62 | - 'body' => $this->getBodyForReview($review), |
|
61 | + $this->send( 'index.php', [ |
|
62 | + 'body' => $this->getBodyForReview( $review ), |
|
63 | 63 | 'timeout' => 120, |
64 | - ]); |
|
64 | + ] ); |
|
65 | 65 | return $this; |
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @return self |
70 | 70 | */ |
71 | - public function sendReviewResponse(Review $review) |
|
71 | + public function sendReviewResponse( Review $review ) |
|
72 | 72 | { |
73 | - $this->send('fetch_customer_reply.php', [ |
|
74 | - 'body' => $this->getBodyForResponse($review), |
|
75 | - ]); |
|
73 | + $this->send( 'fetch_customer_reply.php', [ |
|
74 | + 'body' => $this->getBodyForResponse( $review ), |
|
75 | + ] ); |
|
76 | 76 | return $this; |
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @return array |
81 | 81 | */ |
82 | - protected function getBodyForResponse(Review $review) |
|
82 | + protected function getBodyForResponse( Review $review ) |
|
83 | 83 | { |
84 | 84 | $rebusifyResponse = [ |
85 | - 'reply' => Str::truncate($review->response, 300), |
|
86 | - 'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID |
|
85 | + 'reply' => Str::truncate( $review->response, 300 ), |
|
86 | + 'review_id' => glsr( Database::class )->get( $review->ID, 'rebusify' ), // this is the rebusify review ID |
|
87 | 87 | 'review_transaction_id' => $review->review_id, |
88 | 88 | 'type' => 'M', |
89 | 89 | ]; |
90 | - return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review); |
|
90 | + return apply_filters( 'site-reviews/rebusify/response', $rebusifyResponse, $review ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * @return array |
95 | 95 | */ |
96 | - protected function getBodyForReview(Review $review) |
|
96 | + protected function getBodyForReview( Review $review ) |
|
97 | 97 | { |
98 | 98 | $rebusifyReview = [ |
99 | 99 | 'domain' => get_home_url(), |
100 | - 'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25), |
|
100 | + 'firstname' => Str::truncate( Str::convertName( $review->author, 'first' ), 25 ), |
|
101 | 101 | 'rate' => $review->rating, |
102 | 102 | 'review_transaction_id' => $review->review_id, |
103 | - 'reviews' => Str::truncate($review->content, 280), |
|
104 | - 'title' => Str::truncate($review->title, 35), |
|
103 | + 'reviews' => Str::truncate( $review->content, 280 ), |
|
104 | + 'title' => Str::truncate( $review->title, 35 ), |
|
105 | 105 | 'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews |
106 | 106 | ]; |
107 | - return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review); |
|
107 | + return apply_filters( 'site-reviews/rebusify/review', $rebusifyReview, $review ); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | 111 | * @param \WP_Error|array $response |
112 | 112 | * @return void |
113 | 113 | */ |
114 | - protected function handleResponse($response) |
|
114 | + protected function handleResponse( $response ) |
|
115 | 115 | { |
116 | - if (is_wp_error($response)) { |
|
116 | + if( is_wp_error( $response ) ) { |
|
117 | 117 | $this->message = $response->get_error_message(); |
118 | 118 | } else { |
119 | - $responseBody = wp_remote_retrieve_body($response); |
|
120 | - $responseCode = wp_remote_retrieve_response_code($response); |
|
121 | - $responseData = (array) json_decode($responseBody, true); |
|
122 | - $this->response = array_shift($responseData); |
|
123 | - $this->message = Arr::get($this->response, 'msg'); |
|
124 | - $this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack! |
|
125 | - if (200 !== $responseCode) { |
|
126 | - glsr_log()->error('Bad response code ['.$responseCode.']'); |
|
119 | + $responseBody = wp_remote_retrieve_body( $response ); |
|
120 | + $responseCode = wp_remote_retrieve_response_code( $response ); |
|
121 | + $responseData = (array)json_decode( $responseBody, true ); |
|
122 | + $this->response = array_shift( $responseData ); |
|
123 | + $this->message = Arr::get( $this->response, 'msg' ); |
|
124 | + $this->success = 'success' === Arr::get( $this->response, 'result' ) || 'yes' === Arr::get( $this->response, 'success' ); // @todo remove this ugly hack! |
|
125 | + if( 200 !== $responseCode ) { |
|
126 | + glsr_log()->error( 'Bad response code ['.$responseCode.']' ); |
|
127 | 127 | } |
128 | - if (!$this->success) { |
|
129 | - glsr_log()->error($this->message); |
|
128 | + if( !$this->success ) { |
|
129 | + glsr_log()->error( $this->message ); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | * @param string $endpoint |
136 | 136 | * @return void |
137 | 137 | */ |
138 | - protected function send($endpoint, array $args = []) |
|
138 | + protected function send( $endpoint, array $args = [] ) |
|
139 | 139 | { |
140 | - $args = wp_parse_args($args, [ |
|
140 | + $args = wp_parse_args( $args, [ |
|
141 | 141 | 'body' => null, |
142 | 142 | 'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'], |
143 | 143 | 'redirection' => 5, |
144 | 144 | 'sslverify' => false, |
145 | 145 | 'timeout' => 5, |
146 | - ]); |
|
146 | + ] ); |
|
147 | 147 | $this->reset(); |
148 | 148 | $this->handleResponse( |
149 | - wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args) |
|
149 | + wp_remote_post( trailingslashit( static::API_URL ).$endpoint, $args ) |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 | } |
@@ -14,69 +14,69 @@ |
||
14 | 14 | |
15 | 15 | class Filters implements HooksContract |
16 | 16 | { |
17 | - protected $admin; |
|
18 | - protected $app; |
|
19 | - protected $basename; |
|
20 | - protected $blocks; |
|
21 | - protected $editor; |
|
22 | - protected $listtable; |
|
23 | - protected $public; |
|
24 | - protected $rebusify; |
|
25 | - protected $translator; |
|
26 | - protected $welcome; |
|
17 | + protected $admin; |
|
18 | + protected $app; |
|
19 | + protected $basename; |
|
20 | + protected $blocks; |
|
21 | + protected $editor; |
|
22 | + protected $listtable; |
|
23 | + protected $public; |
|
24 | + protected $rebusify; |
|
25 | + protected $translator; |
|
26 | + protected $welcome; |
|
27 | 27 | |
28 | - public function __construct(Application $app) |
|
29 | - { |
|
30 | - $this->app = $app; |
|
31 | - $this->admin = $app->make(AdminController::class); |
|
32 | - $this->basename = plugin_basename($app->file); |
|
33 | - $this->blocks = $app->make(BlocksController::class); |
|
34 | - $this->editor = $app->make(EditorController::class); |
|
35 | - $this->listtable = $app->make(ListTableController::class); |
|
36 | - $this->public = $app->make(PublicController::class); |
|
37 | - $this->rebusify = $app->make(RebusifyController::class); |
|
38 | - $this->translator = $app->make(Translator::class); |
|
39 | - $this->welcome = $app->make(WelcomeController::class); |
|
40 | - } |
|
28 | + public function __construct(Application $app) |
|
29 | + { |
|
30 | + $this->app = $app; |
|
31 | + $this->admin = $app->make(AdminController::class); |
|
32 | + $this->basename = plugin_basename($app->file); |
|
33 | + $this->blocks = $app->make(BlocksController::class); |
|
34 | + $this->editor = $app->make(EditorController::class); |
|
35 | + $this->listtable = $app->make(ListTableController::class); |
|
36 | + $this->public = $app->make(PublicController::class); |
|
37 | + $this->rebusify = $app->make(RebusifyController::class); |
|
38 | + $this->translator = $app->make(Translator::class); |
|
39 | + $this->welcome = $app->make(WelcomeController::class); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - public function run() |
|
46 | - { |
|
47 | - add_filter('map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2); |
|
48 | - add_filter('mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15); |
|
49 | - add_filter('plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks']); |
|
50 | - add_filter('dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems']); |
|
51 | - add_filter('block_categories', [$this->blocks, 'filterBlockCategories']); |
|
52 | - add_filter('classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2); |
|
53 | - add_filter('use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2); |
|
54 | - add_filter('wp_editor_settings', [$this->editor, 'filterEditorSettings']); |
|
55 | - add_filter('the_editor', [$this->editor, 'filterEditorTextarea']); |
|
56 | - add_filter('is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3); |
|
57 | - add_filter('gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3); |
|
58 | - add_filter('gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4); |
|
59 | - add_filter('post_updated_messages', [$this->editor, 'filterUpdateMessages']); |
|
60 | - add_filter('bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2); |
|
61 | - add_filter('manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType']); |
|
62 | - add_filter('post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2); |
|
63 | - add_filter('default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2); |
|
64 | - add_filter('display_post_states', [$this->listtable, 'filterPostStates'], 10, 2); |
|
65 | - add_filter('post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2); |
|
66 | - add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns']); |
|
67 | - add_filter('ngettext', [$this->listtable, 'filterStatusText'], 10, 5); |
|
68 | - add_filter('script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2); |
|
69 | - add_filter('site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11); |
|
70 | - add_filter('query_vars', [$this->public, 'filterQueryVars']); |
|
71 | - add_filter('site-reviews/render/view', [$this->public, 'filterRenderView']); |
|
72 | - add_filter('site-reviews/settings/callback', [$this->rebusify, 'filterSettingsCallback']); |
|
73 | - add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3); |
|
74 | - add_filter('gettext', [$this->translator, 'filterGettext'], 10, 3); |
|
75 | - add_filter('gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4); |
|
76 | - add_filter('ngettext', [$this->translator, 'filterNgettext'], 10, 5); |
|
77 | - add_filter('ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6); |
|
78 | - add_filter('plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9); |
|
79 | - add_filter('admin_title', [$this->welcome, 'filterAdminTitle']); |
|
80 | - add_filter('admin_footer_text', [$this->welcome, 'filterFooterText']); |
|
81 | - } |
|
42 | + /** |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + public function run() |
|
46 | + { |
|
47 | + add_filter('map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2); |
|
48 | + add_filter('mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15); |
|
49 | + add_filter('plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks']); |
|
50 | + add_filter('dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems']); |
|
51 | + add_filter('block_categories', [$this->blocks, 'filterBlockCategories']); |
|
52 | + add_filter('classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2); |
|
53 | + add_filter('use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2); |
|
54 | + add_filter('wp_editor_settings', [$this->editor, 'filterEditorSettings']); |
|
55 | + add_filter('the_editor', [$this->editor, 'filterEditorTextarea']); |
|
56 | + add_filter('is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3); |
|
57 | + add_filter('gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3); |
|
58 | + add_filter('gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4); |
|
59 | + add_filter('post_updated_messages', [$this->editor, 'filterUpdateMessages']); |
|
60 | + add_filter('bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2); |
|
61 | + add_filter('manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType']); |
|
62 | + add_filter('post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2); |
|
63 | + add_filter('default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2); |
|
64 | + add_filter('display_post_states', [$this->listtable, 'filterPostStates'], 10, 2); |
|
65 | + add_filter('post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2); |
|
66 | + add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns']); |
|
67 | + add_filter('ngettext', [$this->listtable, 'filterStatusText'], 10, 5); |
|
68 | + add_filter('script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2); |
|
69 | + add_filter('site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11); |
|
70 | + add_filter('query_vars', [$this->public, 'filterQueryVars']); |
|
71 | + add_filter('site-reviews/render/view', [$this->public, 'filterRenderView']); |
|
72 | + add_filter('site-reviews/settings/callback', [$this->rebusify, 'filterSettingsCallback']); |
|
73 | + add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3); |
|
74 | + add_filter('gettext', [$this->translator, 'filterGettext'], 10, 3); |
|
75 | + add_filter('gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4); |
|
76 | + add_filter('ngettext', [$this->translator, 'filterNgettext'], 10, 5); |
|
77 | + add_filter('ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6); |
|
78 | + add_filter('plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9); |
|
79 | + add_filter('admin_title', [$this->welcome, 'filterAdminTitle']); |
|
80 | + add_filter('admin_footer_text', [$this->welcome, 'filterFooterText']); |
|
81 | + } |
|
82 | 82 | } |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | protected $translator; |
26 | 26 | protected $welcome; |
27 | 27 | |
28 | - public function __construct(Application $app) |
|
28 | + public function __construct( Application $app ) |
|
29 | 29 | { |
30 | 30 | $this->app = $app; |
31 | - $this->admin = $app->make(AdminController::class); |
|
32 | - $this->basename = plugin_basename($app->file); |
|
33 | - $this->blocks = $app->make(BlocksController::class); |
|
34 | - $this->editor = $app->make(EditorController::class); |
|
35 | - $this->listtable = $app->make(ListTableController::class); |
|
36 | - $this->public = $app->make(PublicController::class); |
|
37 | - $this->rebusify = $app->make(RebusifyController::class); |
|
38 | - $this->translator = $app->make(Translator::class); |
|
39 | - $this->welcome = $app->make(WelcomeController::class); |
|
31 | + $this->admin = $app->make( AdminController::class ); |
|
32 | + $this->basename = plugin_basename( $app->file ); |
|
33 | + $this->blocks = $app->make( BlocksController::class ); |
|
34 | + $this->editor = $app->make( EditorController::class ); |
|
35 | + $this->listtable = $app->make( ListTableController::class ); |
|
36 | + $this->public = $app->make( PublicController::class ); |
|
37 | + $this->rebusify = $app->make( RebusifyController::class ); |
|
38 | + $this->translator = $app->make( Translator::class ); |
|
39 | + $this->welcome = $app->make( WelcomeController::class ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -44,39 +44,39 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function run() |
46 | 46 | { |
47 | - add_filter('map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2); |
|
48 | - add_filter('mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15); |
|
49 | - add_filter('plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks']); |
|
50 | - add_filter('dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems']); |
|
51 | - add_filter('block_categories', [$this->blocks, 'filterBlockCategories']); |
|
52 | - add_filter('classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2); |
|
53 | - add_filter('use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2); |
|
54 | - add_filter('wp_editor_settings', [$this->editor, 'filterEditorSettings']); |
|
55 | - add_filter('the_editor', [$this->editor, 'filterEditorTextarea']); |
|
56 | - add_filter('is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3); |
|
57 | - add_filter('gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3); |
|
58 | - add_filter('gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4); |
|
59 | - add_filter('post_updated_messages', [$this->editor, 'filterUpdateMessages']); |
|
60 | - add_filter('bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2); |
|
61 | - add_filter('manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType']); |
|
62 | - add_filter('post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2); |
|
63 | - add_filter('default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2); |
|
64 | - add_filter('display_post_states', [$this->listtable, 'filterPostStates'], 10, 2); |
|
65 | - add_filter('post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2); |
|
66 | - add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns']); |
|
67 | - add_filter('ngettext', [$this->listtable, 'filterStatusText'], 10, 5); |
|
68 | - add_filter('script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2); |
|
69 | - add_filter('site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11); |
|
70 | - add_filter('query_vars', [$this->public, 'filterQueryVars']); |
|
71 | - add_filter('site-reviews/render/view', [$this->public, 'filterRenderView']); |
|
72 | - add_filter('site-reviews/settings/callback', [$this->rebusify, 'filterSettingsCallback']); |
|
73 | - add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3); |
|
74 | - add_filter('gettext', [$this->translator, 'filterGettext'], 10, 3); |
|
75 | - add_filter('gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4); |
|
76 | - add_filter('ngettext', [$this->translator, 'filterNgettext'], 10, 5); |
|
77 | - add_filter('ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6); |
|
78 | - add_filter('plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9); |
|
79 | - add_filter('admin_title', [$this->welcome, 'filterAdminTitle']); |
|
80 | - add_filter('admin_footer_text', [$this->welcome, 'filterFooterText']); |
|
47 | + add_filter( 'map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2 ); |
|
48 | + add_filter( 'mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15 ); |
|
49 | + add_filter( 'plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks'] ); |
|
50 | + add_filter( 'dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems'] ); |
|
51 | + add_filter( 'block_categories', [$this->blocks, 'filterBlockCategories'] ); |
|
52 | + add_filter( 'classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2 ); |
|
53 | + add_filter( 'use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2 ); |
|
54 | + add_filter( 'wp_editor_settings', [$this->editor, 'filterEditorSettings'] ); |
|
55 | + add_filter( 'the_editor', [$this->editor, 'filterEditorTextarea'] ); |
|
56 | + add_filter( 'is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3 ); |
|
57 | + add_filter( 'gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3 ); |
|
58 | + add_filter( 'gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 ); |
|
59 | + add_filter( 'post_updated_messages', [$this->editor, 'filterUpdateMessages'] ); |
|
60 | + add_filter( 'bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 ); |
|
61 | + add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType'] ); |
|
62 | + add_filter( 'post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2 ); |
|
63 | + add_filter( 'default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 ); |
|
64 | + add_filter( 'display_post_states', [$this->listtable, 'filterPostStates'], 10, 2 ); |
|
65 | + add_filter( 'post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2 ); |
|
66 | + add_filter( 'manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns'] ); |
|
67 | + add_filter( 'ngettext', [$this->listtable, 'filterStatusText'], 10, 5 ); |
|
68 | + add_filter( 'script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2 ); |
|
69 | + add_filter( 'site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11 ); |
|
70 | + add_filter( 'query_vars', [$this->public, 'filterQueryVars'] ); |
|
71 | + add_filter( 'site-reviews/render/view', [$this->public, 'filterRenderView'] ); |
|
72 | + add_filter( 'site-reviews/settings/callback', [$this->rebusify, 'filterSettingsCallback'] ); |
|
73 | + add_filter( 'site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3 ); |
|
74 | + add_filter( 'gettext', [$this->translator, 'filterGettext'], 10, 3 ); |
|
75 | + add_filter( 'gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4 ); |
|
76 | + add_filter( 'ngettext', [$this->translator, 'filterNgettext'], 10, 5 ); |
|
77 | + add_filter( 'ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6 ); |
|
78 | + add_filter( 'plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9 ); |
|
79 | + add_filter( 'admin_title', [$this->welcome, 'filterAdminTitle'] ); |
|
80 | + add_filter( 'admin_footer_text', [$this->welcome, 'filterFooterText'] ); |
|
81 | 81 | } |
82 | 82 | } |