Passed
Push — master ( 2c1b34...eeeeb5 )
by Paul
04:03
created
plugin/Actions.php 3 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -21,111 +21,111 @@
 block discarded – undo
21 21
 
22 22
 class Actions implements HooksContract
23 23
 {
24
-    protected $about;
25
-    protected $admin;
26
-    protected $app;
27
-    protected $blocks;
28
-    protected $console;
29
-    protected $editor;
30
-    protected $listtable;
31
-    protected $menu;
32
-    protected $main;
33
-    protected $notices;
34
-    protected $public;
35
-    protected $review;
36
-    protected $router;
37
-    protected $settings;
38
-    protected $taxonomy;
39
-    protected $translator;
40
-    protected $trustalyze;
41
-    protected $welcome;
24
+	protected $about;
25
+	protected $admin;
26
+	protected $app;
27
+	protected $blocks;
28
+	protected $console;
29
+	protected $editor;
30
+	protected $listtable;
31
+	protected $menu;
32
+	protected $main;
33
+	protected $notices;
34
+	protected $public;
35
+	protected $review;
36
+	protected $router;
37
+	protected $settings;
38
+	protected $taxonomy;
39
+	protected $translator;
40
+	protected $trustalyze;
41
+	protected $welcome;
42 42
 
43
-    public function __construct(Application $app ) {
44
-        $this->app = $app;
45
-        $this->admin = $app->make(AdminController::class);
46
-        $this->blocks = $app->make(BlocksController::class);
47
-        $this->console = $app->make(Console::class);
48
-        $this->editor = $app->make(EditorController::class);
49
-        $this->listtable = $app->make(ListTableController::class);
50
-        $this->main = $app->make(MainController::class);
51
-        $this->menu = $app->make(MenuController::class);
52
-        $this->notices = $app->make(NoticeController::class);
53
-        $this->public = $app->make(PublicController::class);
54
-        $this->review = $app->make(ReviewController::class);
55
-        $this->router = $app->make(Router::class);
56
-        $this->settings = $app->make(SettingsController::class);
57
-        $this->taxonomy = $app->make(TaxonomyController::class);
58
-        $this->translator = $app->make(TranslationController::class);
59
-        $this->trustalyze = $app->make(TrustalyzeController::class);
60
-        $this->welcome = $app->make(WelcomeController::class);
61
-    }
43
+	public function __construct(Application $app ) {
44
+		$this->app = $app;
45
+		$this->admin = $app->make(AdminController::class);
46
+		$this->blocks = $app->make(BlocksController::class);
47
+		$this->console = $app->make(Console::class);
48
+		$this->editor = $app->make(EditorController::class);
49
+		$this->listtable = $app->make(ListTableController::class);
50
+		$this->main = $app->make(MainController::class);
51
+		$this->menu = $app->make(MenuController::class);
52
+		$this->notices = $app->make(NoticeController::class);
53
+		$this->public = $app->make(PublicController::class);
54
+		$this->review = $app->make(ReviewController::class);
55
+		$this->router = $app->make(Router::class);
56
+		$this->settings = $app->make(SettingsController::class);
57
+		$this->taxonomy = $app->make(TaxonomyController::class);
58
+		$this->translator = $app->make(TranslationController::class);
59
+		$this->trustalyze = $app->make(TrustalyzeController::class);
60
+		$this->welcome = $app->make(WelcomeController::class);
61
+	}
62 62
 
63
-    /**
64
-     * @return void
65
-     */
66
-    public function run()
67
-    {
68
-        add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
69
-        add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
70
-        add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
71
-        add_action('admin_init',                                            [$this->admin, 'runMigrations']);
72
-        add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
73
-        add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
74
-        add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
75
-        add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
76
-        add_action('admin_init',                                            [$this->app, 'setDefaults']);
77
-        add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
78
-        add_action('init',                                                  [$this->blocks, 'registerBlocks']);
79
-        add_action('admin_footer',                                          [$this->console, 'logOnce']);
80
-        add_action('wp_footer',                                             [$this->console, 'logOnce']);
81
-        add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
82
-        add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
83
-        add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
84
-        add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
85
-        add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
86
-        add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
87
-        add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
88
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
89
-        add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
90
-        add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
91
-        add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
92
-        add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
93
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
94
-        add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
95
-        add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
96
-        add_action('init',                                                  [$this->main, 'registerPostType'], 8);
97
-        add_action('init',                                                  [$this->main, 'registerShortcodes']);
98
-        add_action('init',                                                  [$this->main, 'registerTaxonomy']);
99
-        add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
100
-        add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
101
-        add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
102
-        add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
103
-        add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
104
-        add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
105
-        add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
106
-        add_action('wp_footer',                                             [$this->public, 'renderSchema']);
107
-        add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
108
-        add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
109
-        add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
110
-        add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
111
-        add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
112
-        add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
113
-        add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
114
-        add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
115
-        add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
116
-        add_action('admin_init',                                            [$this->settings, 'registerSettings']);
117
-        add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
118
-        add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
119
-        add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
120
-        add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
121
-        add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
122
-        add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
123
-        add_action('admin_enqueue_scripts',                                 [$this->translator, 'translatePostStatusLabels']);
124
-        add_action('site-reviews/review/created',                           [$this->trustalyze, 'onCreated']);
125
-        add_action('site-reviews/review/reverted',                          [$this->trustalyze, 'onReverted']);
126
-        add_action('site-reviews/review/saved',                             [$this->trustalyze, 'onSaved']);
127
-        add_action('updated_postmeta',                                      [$this->trustalyze, 'onUpdatedMeta'], 10, 3);
128
-        add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
129
-        add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
130
-    }
63
+	/**
64
+	 * @return void
65
+	 */
66
+	public function run()
67
+	{
68
+		add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
69
+		add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
70
+		add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
71
+		add_action('admin_init',                                            [$this->admin, 'runMigrations']);
72
+		add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
73
+		add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
74
+		add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
75
+		add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
76
+		add_action('admin_init',                                            [$this->app, 'setDefaults']);
77
+		add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
78
+		add_action('init',                                                  [$this->blocks, 'registerBlocks']);
79
+		add_action('admin_footer',                                          [$this->console, 'logOnce']);
80
+		add_action('wp_footer',                                             [$this->console, 'logOnce']);
81
+		add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
82
+		add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
83
+		add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
84
+		add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
85
+		add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
86
+		add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
87
+		add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
88
+		add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
89
+		add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
90
+		add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
91
+		add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
92
+		add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
93
+		add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
94
+		add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
95
+		add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
96
+		add_action('init',                                                  [$this->main, 'registerPostType'], 8);
97
+		add_action('init',                                                  [$this->main, 'registerShortcodes']);
98
+		add_action('init',                                                  [$this->main, 'registerTaxonomy']);
99
+		add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
100
+		add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
101
+		add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
102
+		add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
103
+		add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
104
+		add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
105
+		add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
106
+		add_action('wp_footer',                                             [$this->public, 'renderSchema']);
107
+		add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
108
+		add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
109
+		add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
110
+		add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
111
+		add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
112
+		add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
113
+		add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
114
+		add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
115
+		add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
116
+		add_action('admin_init',                                            [$this->settings, 'registerSettings']);
117
+		add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
118
+		add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
119
+		add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
120
+		add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
121
+		add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
122
+		add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
123
+		add_action('admin_enqueue_scripts',                                 [$this->translator, 'translatePostStatusLabels']);
124
+		add_action('site-reviews/review/created',                           [$this->trustalyze, 'onCreated']);
125
+		add_action('site-reviews/review/reverted',                          [$this->trustalyze, 'onReverted']);
126
+		add_action('site-reviews/review/saved',                             [$this->trustalyze, 'onSaved']);
127
+		add_action('updated_postmeta',                                      [$this->trustalyze, 'onUpdatedMeta'], 10, 3);
128
+		add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
129
+		add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
130
+	}
131 131
 }
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -40,24 +40,24 @@  discard block
 block discarded – undo
40 40
     protected $trustalyze;
41 41
     protected $welcome;
42 42
 
43
-    public function __construct(Application $app ) {
43
+    public function __construct( Application $app ) {
44 44
         $this->app = $app;
45
-        $this->admin = $app->make(AdminController::class);
46
-        $this->blocks = $app->make(BlocksController::class);
47
-        $this->console = $app->make(Console::class);
48
-        $this->editor = $app->make(EditorController::class);
49
-        $this->listtable = $app->make(ListTableController::class);
50
-        $this->main = $app->make(MainController::class);
51
-        $this->menu = $app->make(MenuController::class);
52
-        $this->notices = $app->make(NoticeController::class);
53
-        $this->public = $app->make(PublicController::class);
54
-        $this->review = $app->make(ReviewController::class);
55
-        $this->router = $app->make(Router::class);
56
-        $this->settings = $app->make(SettingsController::class);
57
-        $this->taxonomy = $app->make(TaxonomyController::class);
58
-        $this->translator = $app->make(TranslationController::class);
59
-        $this->trustalyze = $app->make(TrustalyzeController::class);
60
-        $this->welcome = $app->make(WelcomeController::class);
45
+        $this->admin = $app->make( AdminController::class );
46
+        $this->blocks = $app->make( BlocksController::class );
47
+        $this->console = $app->make( Console::class );
48
+        $this->editor = $app->make( EditorController::class );
49
+        $this->listtable = $app->make( ListTableController::class );
50
+        $this->main = $app->make( MainController::class );
51
+        $this->menu = $app->make( MenuController::class );
52
+        $this->notices = $app->make( NoticeController::class );
53
+        $this->public = $app->make( PublicController::class );
54
+        $this->review = $app->make( ReviewController::class );
55
+        $this->router = $app->make( Router::class );
56
+        $this->settings = $app->make( SettingsController::class );
57
+        $this->taxonomy = $app->make( TaxonomyController::class );
58
+        $this->translator = $app->make( TranslationController::class );
59
+        $this->trustalyze = $app->make( TrustalyzeController::class );
60
+        $this->welcome = $app->make( WelcomeController::class );
61 61
     }
62 62
 
63 63
     /**
@@ -65,67 +65,67 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function run()
67 67
     {
68
-        add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
69
-        add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
70
-        add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
71
-        add_action('admin_init',                                            [$this->admin, 'runMigrations']);
72
-        add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
73
-        add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
74
-        add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
75
-        add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
76
-        add_action('admin_init',                                            [$this->app, 'setDefaults']);
77
-        add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
78
-        add_action('init',                                                  [$this->blocks, 'registerBlocks']);
79
-        add_action('admin_footer',                                          [$this->console, 'logOnce']);
80
-        add_action('wp_footer',                                             [$this->console, 'logOnce']);
81
-        add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
82
-        add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
83
-        add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
84
-        add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
85
-        add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
86
-        add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
87
-        add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
88
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
89
-        add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
90
-        add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
91
-        add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
92
-        add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
93
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
94
-        add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
95
-        add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
96
-        add_action('init',                                                  [$this->main, 'registerPostType'], 8);
97
-        add_action('init',                                                  [$this->main, 'registerShortcodes']);
98
-        add_action('init',                                                  [$this->main, 'registerTaxonomy']);
99
-        add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
100
-        add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
101
-        add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
102
-        add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
103
-        add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
104
-        add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
105
-        add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
106
-        add_action('wp_footer',                                             [$this->public, 'renderSchema']);
107
-        add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
108
-        add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
109
-        add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
110
-        add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
111
-        add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
112
-        add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
113
-        add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
114
-        add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
115
-        add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
116
-        add_action('admin_init',                                            [$this->settings, 'registerSettings']);
117
-        add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
118
-        add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
119
-        add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
120
-        add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
121
-        add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
122
-        add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
123
-        add_action('admin_enqueue_scripts',                                 [$this->translator, 'translatePostStatusLabels']);
124
-        add_action('site-reviews/review/created',                           [$this->trustalyze, 'onCreated']);
125
-        add_action('site-reviews/review/reverted',                          [$this->trustalyze, 'onReverted']);
126
-        add_action('site-reviews/review/saved',                             [$this->trustalyze, 'onSaved']);
127
-        add_action('updated_postmeta',                                      [$this->trustalyze, 'onUpdatedMeta'], 10, 3);
128
-        add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
129
-        add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
68
+        add_action( 'admin_enqueue_scripts', [$this->admin, 'enqueueAssets'] );
69
+        add_action( 'admin_init', [$this->admin, 'registerTinymcePopups'] );
70
+        add_action( 'media_buttons', [$this->admin, 'renderTinymceButton'], 11 );
71
+        add_action( 'admin_init', [$this->admin, 'runMigrations'] );
72
+        add_action( 'plugins_loaded', [$this->app, 'getDefaults'], 11 );
73
+        add_action( 'plugins_loaded', [$this->app, 'registerAddons'] );
74
+        add_action( 'plugins_loaded', [$this->app, 'registerLanguages'] );
75
+        add_action( 'plugins_loaded', [$this->app, 'registerReviewTypes'] );
76
+        add_action( 'admin_init', [$this->app, 'setDefaults'] );
77
+        add_action( 'init', [$this->blocks, 'registerAssets'], 9 );
78
+        add_action( 'init', [$this->blocks, 'registerBlocks'] );
79
+        add_action( 'admin_footer', [$this->console, 'logOnce'] );
80
+        add_action( 'wp_footer', [$this->console, 'logOnce'] );
81
+        add_action( 'add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes'] );
82
+        add_action( 'admin_print_scripts', [$this->editor, 'removeAutosave'], 999 );
83
+        add_action( 'admin_menu', [$this->editor, 'removeMetaBoxes'] );
84
+        add_action( 'current_screen', [$this->editor, 'removePostTypeSupport'] );
85
+        add_action( 'post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox'] );
86
+        add_action( 'admin_head', [$this->editor, 'renderReviewFields'] );
87
+        add_action( 'admin_action_revert', [$this->editor, 'revertReview'] );
88
+        add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3 );
89
+        add_action( 'admin_action_approve', [$this->listtable, 'approve'] );
90
+        add_action( 'bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2 );
91
+        add_action( 'restrict_manage_posts', [$this->listtable, 'renderColumnFilters'] );
92
+        add_action( 'manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2 );
93
+        add_action( 'save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields'] );
94
+        add_action( 'pre_get_posts', [$this->listtable, 'setQueryForColumn'] );
95
+        add_action( 'admin_action_unapprove', [$this->listtable, 'unapprove'] );
96
+        add_action( 'init', [$this->main, 'registerPostType'], 8 );
97
+        add_action( 'init', [$this->main, 'registerShortcodes'] );
98
+        add_action( 'init', [$this->main, 'registerTaxonomy'] );
99
+        add_action( 'widgets_init', [$this->main, 'registerWidgets'] );
100
+        add_action( 'admin_menu', [$this->menu, 'registerMenuCount'] );
101
+        add_action( 'admin_menu', [$this->menu, 'registerSubMenus'] );
102
+        add_action( 'admin_init', [$this->menu, 'setCustomPermissions'], 999 );
103
+        add_action( 'admin_notices', [$this->notices, 'filterAdminNotices'] );
104
+        add_action( 'wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999 );
105
+        add_filter( 'site-reviews/builder', [$this->public, 'modifyBuilder'] );
106
+        add_action( 'wp_footer', [$this->public, 'renderSchema'] );
107
+        add_action( 'set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6 );
108
+        add_action( 'transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3 );
109
+        add_action( 'site-reviews/review/created', [$this->review, 'onAfterCreate'] );
110
+        add_action( 'before_delete_post', [$this->review, 'onBeforeDelete'] );
111
+        add_action( 'update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4 );
112
+        add_action( 'admin_init', [$this->router, 'routeAdminPostRequest'] );
113
+        add_action( 'wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
114
+        add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
115
+        add_action( 'init', [$this->router, 'routePublicPostRequest'] );
116
+        add_action( 'admin_init', [$this->settings, 'registerSettings'] );
117
+        add_action( Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents'] );
118
+        add_action( Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents'] );
119
+        add_action( Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents'] );
120
+        add_action( Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents'] );
121
+        add_action( 'restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9 );
122
+        add_action( 'set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6 );
123
+        add_action( 'admin_enqueue_scripts', [$this->translator, 'translatePostStatusLabels'] );
124
+        add_action( 'site-reviews/review/created', [$this->trustalyze, 'onCreated'] );
125
+        add_action( 'site-reviews/review/reverted', [$this->trustalyze, 'onReverted'] );
126
+        add_action( 'site-reviews/review/saved', [$this->trustalyze, 'onSaved'] );
127
+        add_action( 'updated_postmeta', [$this->trustalyze, 'onUpdatedMeta'], 10, 3 );
128
+        add_action( 'activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2 );
129
+        add_action( 'admin_menu', [$this->welcome, 'registerPage'] );
130 130
     }
131 131
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
     protected $trustalyze;
41 41
     protected $welcome;
42 42
 
43
-    public function __construct(Application $app ) {
43
+    public function __construct(Application $app )
44
+    {
44 45
         $this->app = $app;
45 46
         $this->admin = $app->make(AdminController::class);
46 47
         $this->blocks = $app->make(BlocksController::class);
Please login to merge, or discard this patch.
plugin/Filters.php 2 patches
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -15,72 +15,72 @@
 block discarded – undo
15 15
 
16 16
 class Filters implements HooksContract
17 17
 {
18
-    protected $admin;
19
-    protected $app;
20
-    protected $basename;
21
-    protected $blocks;
22
-    protected $editor;
23
-    protected $listtable;
24
-    protected $public;
25
-    protected $translator;
26
-    protected $trustalyze;
27
-    protected $welcome;
18
+	protected $admin;
19
+	protected $app;
20
+	protected $basename;
21
+	protected $blocks;
22
+	protected $editor;
23
+	protected $listtable;
24
+	protected $public;
25
+	protected $translator;
26
+	protected $trustalyze;
27
+	protected $welcome;
28 28
 
29
-    public function __construct(Application $app)
30
-    {
31
-        $this->app = $app;
32
-        $this->admin = $app->make(AdminController::class);
33
-        $this->basename = plugin_basename($app->file);
34
-        $this->blocks = $app->make(BlocksController::class);
35
-        $this->editor = $app->make(EditorController::class);
36
-        $this->listtable = $app->make(ListTableController::class);
37
-        $this->public = $app->make(PublicController::class);
38
-        $this->translator = $app->make(TranslationController::class);
39
-        $this->trustalyze = $app->make(TrustalyzeController::class);
40
-        $this->welcome = $app->make(WelcomeController::class);
41
-    }
29
+	public function __construct(Application $app)
30
+	{
31
+		$this->app = $app;
32
+		$this->admin = $app->make(AdminController::class);
33
+		$this->basename = plugin_basename($app->file);
34
+		$this->blocks = $app->make(BlocksController::class);
35
+		$this->editor = $app->make(EditorController::class);
36
+		$this->listtable = $app->make(ListTableController::class);
37
+		$this->public = $app->make(PublicController::class);
38
+		$this->translator = $app->make(TranslationController::class);
39
+		$this->trustalyze = $app->make(TrustalyzeController::class);
40
+		$this->welcome = $app->make(WelcomeController::class);
41
+	}
42 42
 
43
-    /**
44
-     * @return void
45
-     */
46
-    public function run()
47
-    {
48
-        add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
49
-        add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
50
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
51
-        add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
52
-        add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
53
-        add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
54
-        add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
55
-        add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
56
-        add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
57
-        add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
58
-        add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
59
-        add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
60
-        add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
61
-        add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
62
-        add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
63
-        add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
64
-        add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
65
-        add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
66
-        add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
67
-        add_filter('bulk_post_updated_messages',                                [$this->translator, 'filterBulkUpdateMessages'], 10, 2);
68
-        add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 9, 3);
69
-        add_filter('site-reviews/gettext/site-reviews',                         [$this->translator, 'filterGettextSiteReviews'], 10, 2);
70
-        add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 9, 4);
71
-        add_filter('site-reviews/gettext_with_context/site-reviews',            [$this->translator, 'filterGettextWithContextSiteReviews'], 10, 3);
72
-        add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 9, 5);
73
-        add_filter('site-reviews/ngettext/site-reviews',                        [$this->translator, 'filterNgettextSiteReviews'], 10, 4);
74
-        add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 9, 6);
75
-        add_filter('site-reviews/ngettext_with_context/site-reviews',           [$this->translator, 'filterNgettextWithContextSiteReviews'], 10, 5);
76
-        add_filter('display_post_states',                                       [$this->translator, 'filterPostStates'], 10, 2);
77
-        add_filter('site-reviews/gettext/default',                              [$this->translator, 'filterPostStatusLabels'], 10, 2);
78
-        add_filter('site-reviews/gettext_with_context/default',                 [$this->translator, 'filterPostStatusLabels'], 10, 2);
79
-        add_filter('site-reviews/ngettext/default',                             [$this->translator, 'filterPostStatusText'], 10, 4);
80
-        add_filter('site-reviews/settings/callback',                            [$this->trustalyze, 'filterSettingsCallback']);
81
-        add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->trustalyze, 'filterSettingsTableRow'], 10, 3);
82
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
83
-        add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
84
-        add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
85
-    }
43
+	/**
44
+	 * @return void
45
+	 */
46
+	public function run()
47
+	{
48
+		add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
49
+		add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
50
+		add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
51
+		add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
52
+		add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
53
+		add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
54
+		add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
55
+		add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
56
+		add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
57
+		add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
58
+		add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
59
+		add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
60
+		add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
61
+		add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
62
+		add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
63
+		add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
64
+		add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
65
+		add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
66
+		add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
67
+		add_filter('bulk_post_updated_messages',                                [$this->translator, 'filterBulkUpdateMessages'], 10, 2);
68
+		add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 9, 3);
69
+		add_filter('site-reviews/gettext/site-reviews',                         [$this->translator, 'filterGettextSiteReviews'], 10, 2);
70
+		add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 9, 4);
71
+		add_filter('site-reviews/gettext_with_context/site-reviews',            [$this->translator, 'filterGettextWithContextSiteReviews'], 10, 3);
72
+		add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 9, 5);
73
+		add_filter('site-reviews/ngettext/site-reviews',                        [$this->translator, 'filterNgettextSiteReviews'], 10, 4);
74
+		add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 9, 6);
75
+		add_filter('site-reviews/ngettext_with_context/site-reviews',           [$this->translator, 'filterNgettextWithContextSiteReviews'], 10, 5);
76
+		add_filter('display_post_states',                                       [$this->translator, 'filterPostStates'], 10, 2);
77
+		add_filter('site-reviews/gettext/default',                              [$this->translator, 'filterPostStatusLabels'], 10, 2);
78
+		add_filter('site-reviews/gettext_with_context/default',                 [$this->translator, 'filterPostStatusLabels'], 10, 2);
79
+		add_filter('site-reviews/ngettext/default',                             [$this->translator, 'filterPostStatusText'], 10, 4);
80
+		add_filter('site-reviews/settings/callback',                            [$this->trustalyze, 'filterSettingsCallback']);
81
+		add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->trustalyze, 'filterSettingsTableRow'], 10, 3);
82
+		add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
83
+		add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
84
+		add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
85
+	}
86 86
 }
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
     protected $trustalyze;
27 27
     protected $welcome;
28 28
 
29
-    public function __construct(Application $app)
29
+    public function __construct( Application $app )
30 30
     {
31 31
         $this->app = $app;
32
-        $this->admin = $app->make(AdminController::class);
33
-        $this->basename = plugin_basename($app->file);
34
-        $this->blocks = $app->make(BlocksController::class);
35
-        $this->editor = $app->make(EditorController::class);
36
-        $this->listtable = $app->make(ListTableController::class);
37
-        $this->public = $app->make(PublicController::class);
38
-        $this->translator = $app->make(TranslationController::class);
39
-        $this->trustalyze = $app->make(TrustalyzeController::class);
40
-        $this->welcome = $app->make(WelcomeController::class);
32
+        $this->admin = $app->make( AdminController::class );
33
+        $this->basename = plugin_basename( $app->file );
34
+        $this->blocks = $app->make( BlocksController::class );
35
+        $this->editor = $app->make( EditorController::class );
36
+        $this->listtable = $app->make( ListTableController::class );
37
+        $this->public = $app->make( PublicController::class );
38
+        $this->translator = $app->make( TranslationController::class );
39
+        $this->trustalyze = $app->make( TrustalyzeController::class );
40
+        $this->welcome = $app->make( WelcomeController::class );
41 41
     }
42 42
 
43 43
     /**
@@ -45,42 +45,42 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function run()
47 47
     {
48
-        add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
49
-        add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
50
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
51
-        add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
52
-        add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
53
-        add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
54
-        add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
55
-        add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
56
-        add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
57
-        add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
58
-        add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
59
-        add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
60
-        add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
61
-        add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
62
-        add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
63
-        add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
64
-        add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
65
-        add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
66
-        add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
67
-        add_filter('bulk_post_updated_messages',                                [$this->translator, 'filterBulkUpdateMessages'], 10, 2);
68
-        add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 9, 3);
69
-        add_filter('site-reviews/gettext/site-reviews',                         [$this->translator, 'filterGettextSiteReviews'], 10, 2);
70
-        add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 9, 4);
71
-        add_filter('site-reviews/gettext_with_context/site-reviews',            [$this->translator, 'filterGettextWithContextSiteReviews'], 10, 3);
72
-        add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 9, 5);
73
-        add_filter('site-reviews/ngettext/site-reviews',                        [$this->translator, 'filterNgettextSiteReviews'], 10, 4);
74
-        add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 9, 6);
75
-        add_filter('site-reviews/ngettext_with_context/site-reviews',           [$this->translator, 'filterNgettextWithContextSiteReviews'], 10, 5);
76
-        add_filter('display_post_states',                                       [$this->translator, 'filterPostStates'], 10, 2);
77
-        add_filter('site-reviews/gettext/default',                              [$this->translator, 'filterPostStatusLabels'], 10, 2);
78
-        add_filter('site-reviews/gettext_with_context/default',                 [$this->translator, 'filterPostStatusLabels'], 10, 2);
79
-        add_filter('site-reviews/ngettext/default',                             [$this->translator, 'filterPostStatusText'], 10, 4);
80
-        add_filter('site-reviews/settings/callback',                            [$this->trustalyze, 'filterSettingsCallback']);
81
-        add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->trustalyze, 'filterSettingsTableRow'], 10, 3);
82
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
83
-        add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
84
-        add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
48
+        add_filter( 'map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2 );
49
+        add_filter( 'mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15 );
50
+        add_filter( 'plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks'] );
51
+        add_filter( 'dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems'] );
52
+        add_filter( 'block_categories', [$this->blocks, 'filterBlockCategories'] );
53
+        add_filter( 'classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2 );
54
+        add_filter( 'use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2 );
55
+        add_filter( 'wp_editor_settings', [$this->editor, 'filterEditorSettings'] );
56
+        add_filter( 'the_editor', [$this->editor, 'filterEditorTextarea'] );
57
+        add_filter( 'is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3 );
58
+        add_filter( 'post_updated_messages', [$this->editor, 'filterUpdateMessages'] );
59
+        add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType'] );
60
+        add_filter( 'post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2 );
61
+        add_filter( 'default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
62
+        add_filter( 'post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2 );
63
+        add_filter( 'manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns'] );
64
+        add_filter( 'script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2 );
65
+        add_filter( 'site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11 );
66
+        add_filter( 'site-reviews/render/view', [$this->public, 'filterRenderView'] );
67
+        add_filter( 'bulk_post_updated_messages', [$this->translator, 'filterBulkUpdateMessages'], 10, 2 );
68
+        add_filter( 'gettext', [$this->translator, 'filterGettext'], 9, 3 );
69
+        add_filter( 'site-reviews/gettext/site-reviews', [$this->translator, 'filterGettextSiteReviews'], 10, 2 );
70
+        add_filter( 'gettext_with_context', [$this->translator, 'filterGettextWithContext'], 9, 4 );
71
+        add_filter( 'site-reviews/gettext_with_context/site-reviews', [$this->translator, 'filterGettextWithContextSiteReviews'], 10, 3 );
72
+        add_filter( 'ngettext', [$this->translator, 'filterNgettext'], 9, 5 );
73
+        add_filter( 'site-reviews/ngettext/site-reviews', [$this->translator, 'filterNgettextSiteReviews'], 10, 4 );
74
+        add_filter( 'ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 9, 6 );
75
+        add_filter( 'site-reviews/ngettext_with_context/site-reviews', [$this->translator, 'filterNgettextWithContextSiteReviews'], 10, 5 );
76
+        add_filter( 'display_post_states', [$this->translator, 'filterPostStates'], 10, 2 );
77
+        add_filter( 'site-reviews/gettext/default', [$this->translator, 'filterPostStatusLabels'], 10, 2 );
78
+        add_filter( 'site-reviews/gettext_with_context/default', [$this->translator, 'filterPostStatusLabels'], 10, 2 );
79
+        add_filter( 'site-reviews/ngettext/default', [$this->translator, 'filterPostStatusText'], 10, 4 );
80
+        add_filter( 'site-reviews/settings/callback', [$this->trustalyze, 'filterSettingsCallback'] );
81
+        add_filter( 'site-reviews/interpolate/partials/form/table-row-multiple', [$this->trustalyze, 'filterSettingsTableRow'], 10, 3 );
82
+        add_filter( 'plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9 );
83
+        add_filter( 'admin_title', [$this->welcome, 'filterAdminTitle'] );
84
+        add_filter( 'admin_footer_text', [$this->welcome, 'filterFooterText'] );
85 85
     }
86 86
 }
Please login to merge, or discard this patch.
plugin/Controllers/NoticeController.php 2 patches
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -10,114 +10,114 @@
 block discarded – undo
10 10
 
11 11
 class NoticeController extends Controller
12 12
 {
13
-    const USER_META_KEY = '_glsr_notices';
13
+	const USER_META_KEY = '_glsr_notices';
14 14
 
15
-    /**
16
-     * @var array
17
-     */
18
-    protected $dismissValuesMap;
15
+	/**
16
+	 * @var array
17
+	 */
18
+	protected $dismissValuesMap;
19 19
 
20
-    public function __construct()
21
-    {
22
-        $this->dismissValuesMap = [
23
-            'trustalyze' => glsr()->version('major'),
24
-            'welcome' => glsr()->version('minor'),
25
-        ];
26
-    }
20
+	public function __construct()
21
+	{
22
+		$this->dismissValuesMap = [
23
+			'trustalyze' => glsr()->version('major'),
24
+			'welcome' => glsr()->version('minor'),
25
+		];
26
+	}
27 27
 
28
-    /**
29
-     * @return void
30
-     * @action admin_notices
31
-     */
32
-    public function filterAdminNotices()
33
-    {
34
-        $screen = glsr_current_screen();
35
-        $this->renderWelcomeNotice($screen->post_type);
36
-        $this->renderTrustalyzeNotice($screen->post_type);
37
-    }
28
+	/**
29
+	 * @return void
30
+	 * @action admin_notices
31
+	 */
32
+	public function filterAdminNotices()
33
+	{
34
+		$screen = glsr_current_screen();
35
+		$this->renderWelcomeNotice($screen->post_type);
36
+		$this->renderTrustalyzeNotice($screen->post_type);
37
+	}
38 38
 
39
-    /**
40
-     * @return void
41
-     */
42
-    public function routerDismissNotice(array $request)
43
-    {
44
-        if ($key = Arr::get($request, 'notice')) {
45
-            $this->dismissNotice($key);
46
-        }
47
-    }
39
+	/**
40
+	 * @return void
41
+	 */
42
+	public function routerDismissNotice(array $request)
43
+	{
44
+		if ($key = Arr::get($request, 'notice')) {
45
+			$this->dismissNotice($key);
46
+		}
47
+	}
48 48
 
49
-    /**
50
-     * @param string $key
51
-     * @return void
52
-     */
53
-    protected function dismissNotice($key)
54
-    {
55
-        $this->setUserMeta($key, $this->getVersionFor($key));
56
-    }
49
+	/**
50
+	 * @param string $key
51
+	 * @return void
52
+	 */
53
+	protected function dismissNotice($key)
54
+	{
55
+		$this->setUserMeta($key, $this->getVersionFor($key));
56
+	}
57 57
 
58
-    /**
59
-     * @param string $key
60
-     * @param mixed $fallback
61
-     * @return mixed
62
-     */
63
-    protected function getUserMeta($key, $fallback)
64
-    {
65
-        $meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
66
-        return Arr::get($meta, $key, $fallback);
67
-    }
58
+	/**
59
+	 * @param string $key
60
+	 * @param mixed $fallback
61
+	 * @return mixed
62
+	 */
63
+	protected function getUserMeta($key, $fallback)
64
+	{
65
+		$meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
66
+		return Arr::get($meta, $key, $fallback);
67
+	}
68 68
 
69
-    /**
70
-     * @param string $noticeKey
71
-     * @return string
72
-     */
73
-    protected function getVersionFor($noticeKey)
74
-    {
75
-        return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
76
-    }
69
+	/**
70
+	 * @param string $noticeKey
71
+	 * @return string
72
+	 */
73
+	protected function getVersionFor($noticeKey)
74
+	{
75
+		return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
76
+	}
77 77
 
78
-    /**
79
-     * @param string $screenPostType
80
-     * @return void
81
-     */
82
-    protected function renderTrustalyzeNotice($screenPostType)
83
-    {
84
-        if (Application::POST_TYPE == $screenPostType
85
-            && Helper::isGreaterThan($this->getVersionFor('trustalyze'), $this->getUserMeta('trustalyze', 0))
86
-            && !glsr(OptionManager::class)->getBool('settings.general.trustalyze')
87
-            && glsr()->can('manage_options')) {
88
-            glsr()->render('partials/notices/trustalyze');
89
-        }
90
-    }
78
+	/**
79
+	 * @param string $screenPostType
80
+	 * @return void
81
+	 */
82
+	protected function renderTrustalyzeNotice($screenPostType)
83
+	{
84
+		if (Application::POST_TYPE == $screenPostType
85
+			&& Helper::isGreaterThan($this->getVersionFor('trustalyze'), $this->getUserMeta('trustalyze', 0))
86
+			&& !glsr(OptionManager::class)->getBool('settings.general.trustalyze')
87
+			&& glsr()->can('manage_options')) {
88
+			glsr()->render('partials/notices/trustalyze');
89
+		}
90
+	}
91 91
 
92
-    /**
93
-     * @param string $screenPostType
94
-     * @return void
95
-     */
96
-    protected function renderWelcomeNotice($screenPostType)
97
-    {
98
-        if (Application::POST_TYPE == $screenPostType
99
-            && Helper::isGreaterThan($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0))
100
-            && glsr()->can('edit_others_posts')) {
101
-            $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
102
-                ? __('Thanks for installing Site Reviews v%s, we hope you love it!', 'site-reviews')
103
-                : __('Thanks for updating to Site Reviews v%s, we hope you love the changes!', 'site-reviews');
104
-            glsr()->render('partials/notices/welcome', [
105
-                'text' => sprintf($welcomeText, glsr()->version),
106
-            ]);
107
-        }
108
-    }
92
+	/**
93
+	 * @param string $screenPostType
94
+	 * @return void
95
+	 */
96
+	protected function renderWelcomeNotice($screenPostType)
97
+	{
98
+		if (Application::POST_TYPE == $screenPostType
99
+			&& Helper::isGreaterThan($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0))
100
+			&& glsr()->can('edit_others_posts')) {
101
+			$welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
102
+				? __('Thanks for installing Site Reviews v%s, we hope you love it!', 'site-reviews')
103
+				: __('Thanks for updating to Site Reviews v%s, we hope you love the changes!', 'site-reviews');
104
+			glsr()->render('partials/notices/welcome', [
105
+				'text' => sprintf($welcomeText, glsr()->version),
106
+			]);
107
+		}
108
+	}
109 109
 
110
-    /**
111
-     * @param string $key
112
-     * @param mixed $fallback
113
-     * @return mixed
114
-     */
115
-    protected function setUserMeta($key, $value)
116
-    {
117
-        $userId = get_current_user_id();
118
-        $meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
119
-        $meta = array_filter(wp_parse_args($meta, []));
120
-        $meta[$key] = $value;
121
-        update_user_meta($userId, static::USER_META_KEY, $meta);
122
-    }
110
+	/**
111
+	 * @param string $key
112
+	 * @param mixed $fallback
113
+	 * @return mixed
114
+	 */
115
+	protected function setUserMeta($key, $value)
116
+	{
117
+		$userId = get_current_user_id();
118
+		$meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
119
+		$meta = array_filter(wp_parse_args($meta, []));
120
+		$meta[$key] = $value;
121
+		update_user_meta($userId, static::USER_META_KEY, $meta);
122
+	}
123 123
 }
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
     public function __construct()
21 21
     {
22 22
         $this->dismissValuesMap = [
23
-            'trustalyze' => glsr()->version('major'),
24
-            'welcome' => glsr()->version('minor'),
23
+            'trustalyze' => glsr()->version( 'major' ),
24
+            'welcome' => glsr()->version( 'minor' ),
25 25
         ];
26 26
     }
27 27
 
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
     public function filterAdminNotices()
33 33
     {
34 34
         $screen = glsr_current_screen();
35
-        $this->renderWelcomeNotice($screen->post_type);
36
-        $this->renderTrustalyzeNotice($screen->post_type);
35
+        $this->renderWelcomeNotice( $screen->post_type );
36
+        $this->renderTrustalyzeNotice( $screen->post_type );
37 37
     }
38 38
 
39 39
     /**
40 40
      * @return void
41 41
      */
42
-    public function routerDismissNotice(array $request)
42
+    public function routerDismissNotice( array $request )
43 43
     {
44
-        if ($key = Arr::get($request, 'notice')) {
45
-            $this->dismissNotice($key);
44
+        if( $key = Arr::get( $request, 'notice' ) ) {
45
+            $this->dismissNotice( $key );
46 46
         }
47 47
     }
48 48
 
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
      * @param string $key
51 51
      * @return void
52 52
      */
53
-    protected function dismissNotice($key)
53
+    protected function dismissNotice( $key )
54 54
     {
55
-        $this->setUserMeta($key, $this->getVersionFor($key));
55
+        $this->setUserMeta( $key, $this->getVersionFor( $key ) );
56 56
     }
57 57
 
58 58
     /**
@@ -60,32 +60,32 @@  discard block
 block discarded – undo
60 60
      * @param mixed $fallback
61 61
      * @return mixed
62 62
      */
63
-    protected function getUserMeta($key, $fallback)
63
+    protected function getUserMeta( $key, $fallback )
64 64
     {
65
-        $meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
66
-        return Arr::get($meta, $key, $fallback);
65
+        $meta = get_user_meta( get_current_user_id(), static::USER_META_KEY, true );
66
+        return Arr::get( $meta, $key, $fallback );
67 67
     }
68 68
 
69 69
     /**
70 70
      * @param string $noticeKey
71 71
      * @return string
72 72
      */
73
-    protected function getVersionFor($noticeKey)
73
+    protected function getVersionFor( $noticeKey )
74 74
     {
75
-        return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
75
+        return Arr::get( $this->dismissValuesMap, $noticeKey, glsr()->version( 'major' ) );
76 76
     }
77 77
 
78 78
     /**
79 79
      * @param string $screenPostType
80 80
      * @return void
81 81
      */
82
-    protected function renderTrustalyzeNotice($screenPostType)
82
+    protected function renderTrustalyzeNotice( $screenPostType )
83 83
     {
84
-        if (Application::POST_TYPE == $screenPostType
85
-            && Helper::isGreaterThan($this->getVersionFor('trustalyze'), $this->getUserMeta('trustalyze', 0))
86
-            && !glsr(OptionManager::class)->getBool('settings.general.trustalyze')
87
-            && glsr()->can('manage_options')) {
88
-            glsr()->render('partials/notices/trustalyze');
84
+        if( Application::POST_TYPE == $screenPostType
85
+            && Helper::isGreaterThan( $this->getVersionFor( 'trustalyze' ), $this->getUserMeta( 'trustalyze', 0 ) )
86
+            && !glsr( OptionManager::class )->getBool( 'settings.general.trustalyze' )
87
+            && glsr()->can( 'manage_options' ) ) {
88
+            glsr()->render( 'partials/notices/trustalyze' );
89 89
         }
90 90
     }
91 91
 
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
      * @param string $screenPostType
94 94
      * @return void
95 95
      */
96
-    protected function renderWelcomeNotice($screenPostType)
96
+    protected function renderWelcomeNotice( $screenPostType )
97 97
     {
98
-        if (Application::POST_TYPE == $screenPostType
99
-            && Helper::isGreaterThan($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0))
100
-            && glsr()->can('edit_others_posts')) {
101
-            $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
102
-                ? __('Thanks for installing Site Reviews v%s, we hope you love it!', 'site-reviews')
103
-                : __('Thanks for updating to Site Reviews v%s, we hope you love the changes!', 'site-reviews');
104
-            glsr()->render('partials/notices/welcome', [
105
-                'text' => sprintf($welcomeText, glsr()->version),
106
-            ]);
98
+        if( Application::POST_TYPE == $screenPostType
99
+            && Helper::isGreaterThan( $this->getVersionFor( 'welcome' ), $this->getUserMeta( 'welcome', 0 ) )
100
+            && glsr()->can( 'edit_others_posts' ) ) {
101
+            $welcomeText = '0.0.0' == glsr( OptionManager::class )->get( 'version_upgraded_from' )
102
+                ? __( 'Thanks for installing Site Reviews v%s, we hope you love it!', 'site-reviews' )
103
+                : __( 'Thanks for updating to Site Reviews v%s, we hope you love the changes!', 'site-reviews' );
104
+            glsr()->render( 'partials/notices/welcome', [
105
+                'text' => sprintf( $welcomeText, glsr()->version ),
106
+            ] );
107 107
         }
108 108
     }
109 109
 
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
      * @param mixed $fallback
113 113
      * @return mixed
114 114
      */
115
-    protected function setUserMeta($key, $value)
115
+    protected function setUserMeta( $key, $value )
116 116
     {
117 117
         $userId = get_current_user_id();
118
-        $meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
119
-        $meta = array_filter(wp_parse_args($meta, []));
118
+        $meta = (array)get_user_meta( $userId, static::USER_META_KEY, true );
119
+        $meta = array_filter( wp_parse_args( $meta, [] ) );
120 120
         $meta[$key] = $value;
121
-        update_user_meta($userId, static::USER_META_KEY, $meta);
121
+        update_user_meta( $userId, static::USER_META_KEY, $meta );
122 122
     }
123 123
 }
Please login to merge, or discard this patch.
plugin/Modules/Trustalyze.php 3 patches
Indentation   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -10,143 +10,143 @@
 block discarded – undo
10 10
 
11 11
 class Trustalyze
12 12
 {
13
-    const API_URL = 'https://www.trustalyze.com/api/rbs/';
14
-    const WEB_URL = 'https://trustalyze.com/plans?ref=105';
13
+	const API_URL = 'https://www.trustalyze.com/api/rbs/';
14
+	const WEB_URL = 'https://trustalyze.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
-        $trustalyzeResponse = [
85
-            'reply' => Str::truncate($review->response, 300),
86
-            'review_id' => glsr(Database::class)->get($review->ID, 'trustalyze'), // this is the trustalyze review ID
87
-            'review_transaction_id' => $review->review_id,
88
-            'type' => 'M',
89
-        ];
90
-        return apply_filters('site-reviews/trustalyze/response', $trustalyzeResponse, $review);
91
-    }
79
+	/**
80
+	 * @return array
81
+	 */
82
+	protected function getBodyForResponse(Review $review)
83
+	{
84
+		$trustalyzeResponse = [
85
+			'reply' => Str::truncate($review->response, 300),
86
+			'review_id' => glsr(Database::class)->get($review->ID, 'trustalyze'), // this is the trustalyze review ID
87
+			'review_transaction_id' => $review->review_id,
88
+			'type' => 'M',
89
+		];
90
+		return apply_filters('site-reviews/trustalyze/response', $trustalyzeResponse, $review);
91
+	}
92 92
 
93
-    /**
94
-     * @return array
95
-     */
96
-    protected function getBodyForReview(Review $review)
97
-    {
98
-        $trustalyzeReview = [
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/trustalyze/review', $trustalyzeReview, $review);
108
-    }
93
+	/**
94
+	 * @return array
95
+	 */
96
+	protected function getBodyForReview(Review $review)
97
+	{
98
+		$trustalyzeReview = [
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/trustalyze/review', $trustalyzeReview, $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
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,25 +20,25 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         $trustalyzeResponse = [
85
-            'reply' => Str::truncate($review->response, 300),
86
-            'review_id' => glsr(Database::class)->get($review->ID, 'trustalyze'), // this is the trustalyze review ID
85
+            'reply' => Str::truncate( $review->response, 300 ),
86
+            'review_id' => glsr( Database::class )->get( $review->ID, 'trustalyze' ), // this is the trustalyze review ID
87 87
             'review_transaction_id' => $review->review_id,
88 88
             'type' => 'M',
89 89
         ];
90
-        return apply_filters('site-reviews/trustalyze/response', $trustalyzeResponse, $review);
90
+        return apply_filters( 'site-reviews/trustalyze/response', $trustalyzeResponse, $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
         $trustalyzeReview = [
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/trustalyze/review', $trustalyzeReview, $review);
107
+        return apply_filters( 'site-reviews/trustalyze/review', $trustalyzeReview, $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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,8 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
views/pages/welcome/support.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <p class="about-description">
4
-    Still need help with <?= glsr()->name; ?>? We offer excellent support, but don't forget to check our <a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">documentation</a> first.
4
+    Still need help with <?= glsr()->name; ?>? We offer excellent support, but don't forget to check our <a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">documentation</a> first.
5 5
 </p>
6 6
 <div class="is-fullwidth">
7 7
     <div class="glsr-flex-row glsr-has-2-columns">
Please login to merge, or discard this patch.
views/pages/welcome/getting-started.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="is-fullwidth">
4 4
     <div class="glsr-flex-row glsr-has-2-columns">
5 5
         <div class="glsr-column">
6 6
             <h3>Editor Blocks</h3>
7 7
             <p>The fastest way to getting started with Site Reviews is to use the three provided blocks in the WordPress Block Editor. Each block comes with multiple settings which let you configure the block exactly as needed. To add a block to your page, click the "Add Block" button and search for "Site Reviews".</p>
8
-            <img class="screenshot" src="<?= glsr()->url('assets/images/blocks.png'); ?>" alt="Editor Blocks" />
8
+            <img class="screenshot" src="<?= glsr()->url( 'assets/images/blocks.png' ); ?>" alt="Editor Blocks" />
9 9
         </div>
10 10
         <div class="glsr-column">
11 11
             <h3>Shortcodes and Widgets</h3>
12 12
             <p>You can also use the shortcodes or widgets on your page. Keep in mind, however, that widgets are limited in options compared to the shortcodes (for example, the "Latest Reviews" widget does not allow pagination). If you are using the Classic Editor in WordPress, you can click on the Site Reviews shortcode button above the editor (next to the media button) to add a shortcode via a friendly popup.</p>
13 13
             <p>To learn more about the shortcodes and the available shortcode options, please see the Shortcode Documentation page of the plugin.</p>
14
-            <a class="button" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">View Shortcode Documentation</a>
14
+            <a class="button" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">View Shortcode Documentation</a>
15 15
         </div>
16 16
     </div>
17 17
 </div>
@@ -20,31 +20,31 @@  discard block
 block discarded – undo
20 20
     <h2>Features</h2>
21 21
     <ul class="glsr-flex-row glsr-has-3-columns">
22 22
         <li class="glsr-column">
23
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=addons'); ?>">Add-ons</a></h3>
23
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=addons' ); ?>">Add-ons</a></h3>
24 24
             <p>Extend Site Reviews with add-ons that provide additional features.</p>
25 25
         </li>
26 26
         <li class="glsr-column">
27
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-reviews'); ?>">Avatars</a></h3>
27
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-reviews' ); ?>">Avatars</a></h3>
28 28
             <p>Enable avatars to generate images using the WordPress Gravatar service.</p>
29 29
         </li>
30 30
         <li class="glsr-column">
31
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-general'); ?>">Backup/Restore</a></h3>
31
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=tools#tab-general' ); ?>">Backup/Restore</a></h3>
32 32
             <p>Backup and restore your plugin settings as needed.</p>
33 33
         </li>
34 34
         <li class="glsr-column">
35
-            <h3><a data-expand="#faq-14" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">Bayesian Ranking</a></h3>
35
+            <h3><a data-expand="#faq-14" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">Bayesian Ranking</a></h3>
36 36
             <p>Easily rank pages with assigned reviews using the bayesian algorithm.</p>
37 37
         </li>
38 38
         <li class="glsr-column">
39
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions'); ?>">Blacklist</a></h3>
39
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions' ); ?>">Blacklist</a></h3>
40 40
             <p>Blacklist words, phrases, IP addresses, names, and emails.</p>
41 41
         </li>
42 42
         <li class="glsr-column">
43
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Blockchain Validation</a></h3>
43
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Blockchain Validation</a></h3>
44 44
             <p>Verify your reviews on the Blockchain with <a href="https://trustalyze.com?ref=105">Trustalyze</a>.</p>
45 45
         </li>
46 46
         <li class="glsr-column">
47
-            <h3><a href="<?= admin_url('edit-tags.php?taxonomy=site-review-category&post_type=site-review'); ?>">Categories</a></h3>
47
+            <h3><a href="<?= admin_url( 'edit-tags.php?taxonomy=site-review-category&post_type=site-review' ); ?>">Categories</a></h3>
48 48
             <p>Add your own categories and assign reviews to them.</p>
49 49
         </li>
50 50
         <li class="glsr-column">
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             <p>Designed for WordPress developers with over 100 filter hooks and convenient functions.</p>
53 53
         </li>
54 54
         <li class="glsr-column">
55
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">Documentation</a></h3>
55
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">Documentation</a></h3>
56 56
             <p>Provides FAQ and documenation for hooks and all shortcodes and functions.</p>
57 57
         </li>
58 58
         <li class="glsr-column">
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
             <p>Use configurable editor blocks in the new WordPress 5.0 editor.</p>
61 61
         </li>
62 62
         <li class="glsr-column">
63
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-schema'); ?>">JSON-LD Schema</a></h3>
63
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-schema' ); ?>">JSON-LD Schema</a></h3>
64 64
             <p>Enable JSON-LD schema to display your reviews and ratings in search results.</p>
65 65
         </li>
66 66
         <li class="glsr-column">
67
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Multilingual</a></h3>
67
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Multilingual</a></h3>
68 68
             <p>Integrates with Polylang and WPML and provides easy search/replace translation.</p>
69 69
         </li>
70 70
         <li class="glsr-column">
@@ -72,47 +72,47 @@  discard block
 block discarded – undo
72 72
             <p>Provides full support for the WordPress multisite feature.</p>
73 73
         </li>
74 74
         <li class="glsr-column">
75
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Notifications</a></h3>
75
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Notifications</a></h3>
76 76
             <p>Send notifications to one or more emails when a review is submitted.</p>
77 77
         </li>
78 78
         <li class="glsr-column">
79
-            <h3><a data-expand="#faq-03" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">Page Assignment</a></h3>
79
+            <h3><a data-expand="#faq-03" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">Page Assignment</a></h3>
80 80
             <p>Assign reviews to Posts, Pages, and Custom Post Types.</p>
81 81
         </li>
82 82
         <li class="glsr-column">
83
-            <h3><a data-expand="#faq-02" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">Pagination</a></h3>
83
+            <h3><a data-expand="#faq-02" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">Pagination</a></h3>
84 84
             <p>Enable AJAX pagination to display a custom number of reviews per-page.</p>
85 85
         </li>
86 86
         <li class="glsr-column">
87
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.''); ?>">Responses</a></h3>
87
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'' ); ?>">Responses</a></h3>
88 88
             <p>Write a response to reviews that require a response.</p>
89 89
         </li>
90 90
         <li class="glsr-column">
91
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Restrictions</a></h3>
91
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Restrictions</a></h3>
92 92
             <p>Require approval before publishing reviews and limit to registered users.</p>
93 93
         </li>
94 94
         <li class="glsr-column">
95
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions'); ?>">Review Limits</a></h3>
95
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions' ); ?>">Review Limits</a></h3>
96 96
             <p>Limit review submissions by email address, IP address, or username.</p>
97 97
         </li>
98 98
         <li class="glsr-column">
99
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">Review Summaries</a></h3>
99
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">Review Summaries</a></h3>
100 100
             <p>Display a summary of your review ratings from high to low.</p>
101 101
         </li>
102 102
         <li class="glsr-column">
103
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">Shortcodes</a></h3>
103
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">Shortcodes</a></h3>
104 104
             <p>Use the configurable shortcodes complete with documentation.</p>
105 105
         </li>
106 106
         <li class="glsr-column">
107
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Slack</a></h3>
107
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Slack</a></h3>
108 108
             <p>Receive notifications in Slack when a review is submitted.</p>
109 109
         </li>
110 110
         <li class="glsr-column">
111
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions'); ?>">SPAM Protection</a></h3>
111
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions' ); ?>">SPAM Protection</a></h3>
112 112
             <p>Uses a Honeypot and integrates with Invisible reCAPTCHA and Akismet.</p>
113 113
         </li>
114 114
         <li class="glsr-column">
115
-            <h3><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">Styles</a></h3>
115
+            <h3><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general' ); ?>">Styles</a></h3>
116 116
             <p>Change the submission form style to match popular themes and form plugins.</p>
117 117
         </li>
118 118
         <li class="glsr-column">
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
             <p>Free premium-level support included on the WordPress support forum.</p>
121 121
         </li>
122 122
         <li class="glsr-column">
123
-            <h3><a data-expand="#faq-18" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">Templates</a></h3>
123
+            <h3><a data-expand="#faq-18" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">Templates</a></h3>
124 124
             <p>Use the Site Reviews templates in your theme for full control over the HTML.</p>
125 125
         </li>
126 126
         <li class="glsr-column">
127
-            <h3><a href="<?= admin_url('widgets.php'); ?>">Widgets</a></h3>
127
+            <h3><a href="<?= admin_url( 'widgets.php' ); ?>">Widgets</a></h3>
128 128
             <p>Use the configurable widgets in your sidebars.</p>
129 129
         </li>
130 130
     </ul>
Please login to merge, or discard this patch.
views/pages/documentation/hooks.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <p>Hooks (also known as <a href="https://developer.wordpress.org/plugins/hooks/index.html">Actions and Filters</a>) are used in your theme's <code>functions.php</code> file to make changes to the plugin.</p>
4 4
 
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
     <div class="glsr-card-header">
7 7
         <h3>Customise the order of the fields in the review submission form</h3>
8 8
         <button type="button" class="handlediv" aria-expanded="true">
9
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
9
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
10 10
             <span class="toggle-indicator" aria-hidden="true"></span>
11 11
         </button>
12 12
     </div>
13 13
     <div class="inside">
14 14
         <p>Use this hook to customise the order of the fields in the review submission form used by Site Reviews.</p>
15
-        <p>See the <code><a data-expand="#faq-07" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
15
+        <p>See the <code><a data-expand="#faq-07" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
16 16
         <pre><code class="php">/**
17 17
  * Customises the order of the fields used in the Site Reviews submission form.
18 18
  * Paste this in your active theme's functions.php file.
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
     <div class="glsr-card-header">
31 31
         <h3>Customise the star images</h3>
32 32
         <button type="button" class="handlediv" aria-expanded="true">
33
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
33
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
34 34
             <span class="toggle-indicator" aria-hidden="true"></span>
35 35
         </button>
36 36
     </div>
37 37
     <div class="inside">
38 38
         <p>Use this hook to customise the star images used by Site Reviews.</p>
39
-        <p>See the <code><a data-expand="#faq-11" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
39
+        <p>See the <code><a data-expand="#faq-11" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
40 40
         <pre><code class="php">/**
41 41
  * Customises the stars used by Site Reviews.
42 42
  * Paste this in your active theme's functions.php file.
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     <div class="glsr-card-header">
55 55
         <h3>Disable the plugin javascript</h3>
56 56
         <button type="button" class="handlediv" aria-expanded="true">
57
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
57
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
58 58
             <span class="toggle-indicator" aria-hidden="true"></span>
59 59
         </button>
60 60
     </div>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     <div class="glsr-card-header">
74 74
         <h3>Disable the plugin stylesheet</h3>
75 75
         <button type="button" class="handlediv" aria-expanded="true">
76
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
76
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
77 77
             <span class="toggle-indicator" aria-hidden="true"></span>
78 78
         </button>
79 79
     </div>
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     <div class="glsr-card-header">
93 93
         <h3>Disable the polyfill.io script</h3>
94 94
         <button type="button" class="handlediv" aria-expanded="true">
95
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
95
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
96 96
             <span class="toggle-indicator" aria-hidden="true"></span>
97 97
         </button>
98 98
     </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     <div class="glsr-card-header">
113 113
         <h3>Do something immediately after a review has been submitted</h3>
114 114
         <button type="button" class="handlediv" aria-expanded="true">
115
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
115
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
116 116
             <span class="toggle-indicator" aria-hidden="true"></span>
117 117
         </button>
118 118
     </div>
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
     <div class="glsr-card-header">
137 137
         <h3>Modify the schema</h3>
138 138
         <button type="button" class="handlediv" aria-expanded="true">
139
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
139
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
140 140
             <span class="toggle-indicator" aria-hidden="true"></span>
141 141
         </button>
142 142
     </div>
143 143
     <div class="inside">
144 144
         <p>Use this hook if you would like to modify the schema type properties.</p>
145 145
         <p>This hook is specific to the schema type. For example, to modify the schema properties for the LocalBusiness schema type you would use the <code>site-reviews/schema/LocalBusiness</code> hook, but to modify the schema properties for the Product schema type you would use the <code>site-reviews/schema/Product</code> hook.</p>
146
-        <p>See the <code><a data-expand="#faq-01" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
146
+        <p>See the <code><a data-expand="#faq-01" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
147 147
         <p>Make sure to use Google's <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test the schema after any custom modifications have been made.</p>
148 148
         <pre><code class="php">/**
149 149
  * Modifies the properties of the schema created by Site Reviews.
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     <div class="glsr-card-header">
164 164
         <h3>Modify the submitted review before it is saved</h3>
165 165
         <button type="button" class="handlediv" aria-expanded="true">
166
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
166
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
167 167
             <span class="toggle-indicator" aria-hidden="true"></span>
168 168
         </button>
169 169
     </div>
Please login to merge, or discard this patch.
views/pages/documentation/functions.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div id="functions-01" class="glsr-card postbox">
4 4
     <div class="glsr-card-header">
5 5
         <h3>Read me first!</h3>
6 6
         <button type="button" class="handlediv" aria-expanded="true">
7
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
7
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
8 8
             <span class="toggle-indicator" aria-hidden="true"></span>
9 9
         </button>
10 10
     </div>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     <div class="glsr-card-header">
39 39
         <h3>Helper function to create a review</h3>
40 40
         <button type="button" class="handlediv" aria-expanded="true">
41
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
41
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
42 42
             <span class="toggle-indicator" aria-hidden="true"></span>
43 43
         </button>
44 44
     </div>
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 ]);
88 88
 </code></pre>
89 89
         <p><strong>Helpful Tip:</strong></p>
90
-        <p>You can use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to view the review object that is returned.</p>
90
+        <p>You can use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to view the review object that is returned.</p>
91 91
         <pre><code class="php">glsr_debug($review);</code></pre>
92 92
     </div>
93 93
 </div>
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     <div class="glsr-card-header">
97 97
         <h3>Helper function to debug variables</h3>
98 98
         <button type="button" class="handlediv" aria-expanded="true">
99
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
99
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
100 100
             <span class="toggle-indicator" aria-hidden="true"></span>
101 101
         </button>
102 102
     </div>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     <div class="glsr-card-header">
122 122
         <h3>Helper function to get a plugin setting</h3>
123 123
         <button type="button" class="handlediv" aria-expanded="true">
124
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
124
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
125 125
             <span class="toggle-indicator" aria-hidden="true"></span>
126 126
         </button>
127 127
     </div>
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 $requireApproval = apply_filters('glsr_get_option', 'no', 'general.require.approval', 'no');</code></pre>
143 143
         <p><strong>Helpful Tip:</strong></p>
144
-        <p>You can use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to view the whole plugin settings array, this will help you figure out which dot-notation path to use.</p>
144
+        <p>You can use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to view the whole plugin settings array, this will help you figure out which dot-notation path to use.</p>
145 145
         <pre><code class="php">glsr_debug(glsr_get_options());</code></pre>
146 146
     </div>
147 147
 </div>
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     <div class="glsr-card-header">
151 151
         <h3>Helper function to get all plugin settings</h3>
152 152
         <button type="button" class="handlediv" aria-expanded="true">
153
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
153
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
154 154
             <span class="toggle-indicator" aria-hidden="true"></span>
155 155
         </button>
156 156
     </div>
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 $pluginSettings = apply_filters('glsr_get_options', []);</code></pre>
169 169
         <p><strong>Helpful Tip:</strong></p>
170
-        <p>You can use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print the settings array to the screen:</p>
170
+        <p>You can use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print the settings array to the screen:</p>
171 171
         <pre><code class="php">glsr_debug($pluginSettings);</code></pre>
172 172
     </div>
173 173
 </div>
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     <div class="glsr-card-header">
177 177
         <h3>Helper function to get a single review</h3>
178 178
         <button type="button" class="handlediv" aria-expanded="true">
179
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
179
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
180 180
             <span class="toggle-indicator" aria-hidden="true"></span>
181 181
         </button>
182 182
     </div>
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 <pre><code class="php">echo $reviewHtml; // This is identical to: $review->render();</code></pre>
218 218
             </li>
219 219
             <li>
220
-                <p>You can also use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print both arrayable objects to the screen:</p>
220
+                <p>You can also use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print both arrayable objects to the screen:</p>
221 221
                 <pre><code class="php">glsr_debug($review, $reviewHtml);</code></pre>
222 222
             </li>
223 223
         </ol>
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     <div class="glsr-card-header">
229 229
         <h3>Helper function to get multiple reviews</h3>
230 230
         <button type="button" class="handlediv" aria-expanded="true">
231
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
231
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
232 232
             <span class="toggle-indicator" aria-hidden="true"></span>
233 233
         </button>
234 234
     </div>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                 <pre><code class="php">echo $reviews; // This is identical to: $reviews->render();</code></pre>
273 273
             </li>
274 274
             <li>
275
-                <p>Loop through all reviews and handle each review as needed. Each <code>$review</code> is identical to what the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-06">glsr_get_review</a></code> helper function returns, so make sure to read the "Helpful Tips" from that section above for more information.</p>
275
+                <p>Loop through all reviews and handle each review as needed. Each <code>$review</code> is identical to what the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-06">glsr_get_review</a></code> helper function returns, so make sure to read the "Helpful Tips" from that section above for more information.</p>
276 276
                 <pre><code class="php">foreach ($reviews as $review) {
277 277
     echo $review;
278 278
 };</code></pre>
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 echo $reviewsHtml->navigation;</code></pre>
291 291
             </li>
292 292
             <li>
293
-                <p>You can also use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print both arrayable objects to the screen:</p>
293
+                <p>You can also use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-03">glsr_debug</a></code> helper function to print both arrayable objects to the screen:</p>
294 294
                 <pre><code class="php">glsr_debug($reviews, $reviewsHtml);</code></pre>
295 295
             </li>
296 296
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     <div class="glsr-card-header">
303 303
         <h3>Helper function to generate HTML stars for a rating</h3>
304 304
         <button type="button" class="handlediv" aria-expanded="true">
305
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
305
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
306 306
             <span class="toggle-indicator" aria-hidden="true"></span>
307 307
         </button>
308 308
     </div>
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     <div class="glsr-card-header">
327 327
         <h3>Helper function to log variables to the plugin console</h3>
328 328
         <button type="button" class="handlediv" aria-expanded="true">
329
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
329
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
330 330
             <span class="toggle-indicator" aria-hidden="true"></span>
331 331
         </button>
332 332
     </div>
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 // OR:
347 347
 
348 348
 apply_filters('glsr_log', null, $var1);</code></pre>
349
-    <p>Logged entries will be found in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console'); ?>">Tools &rarr; Console</a></code>.</p>
349
+    <p>Logged entries will be found in the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console' ); ?>">Tools &rarr; Console</a></code>.</p>
350 350
     </div>
351 351
 </div>
352 352
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     <div class="glsr-card-header">
355 355
         <h3>Helper function to recalculate the rating counts</h3>
356 356
         <button type="button" class="handlediv" aria-expanded="true">
357
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
357
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
358 358
             <span class="toggle-indicator" aria-hidden="true"></span>
359 359
         </button>
360 360
     </div>
@@ -370,6 +370,6 @@  discard block
 block discarded – undo
370 370
 // OR:
371 371
 
372 372
 apply_filters('glsr_calculate_ratings', null);</code></pre>
373
-    <p>You can verify that it runs by checking the log entries in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console'); ?>">Tools &rarr; Console</a></code>.</p>
373
+    <p>You can verify that it runs by checking the log entries in the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console' ); ?>">Tools &rarr; Console</a></code>.</p>
374 374
     </div>
375 375
 </div>
Please login to merge, or discard this patch.
views/pages/documentation/shortcodes.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <p>This page shows all of the available shortcode options with examples of how to use them. You can use multiple options in the same shortcode.</p>
4 4
 
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     <div class="glsr-card-header">
7 7
         <h3>[site_reviews]</h3>
8 8
         <button type="button" class="handlediv" aria-expanded="true">
9
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
9
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
10 10
             <span class="toggle-indicator" aria-hidden="true"></span>
11 11
         </button>
12 12
     </div>
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     <div class="glsr-card-header">
81 81
         <h3>[site_reviews_form]</h3>
82 82
         <button type="button" class="handlediv" aria-expanded="true">
83
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
83
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
84 84
             <span class="toggle-indicator" aria-hidden="true"></span>
85 85
         </button>
86 86
     </div>
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     <div class="glsr-card-header">
129 129
         <h3>[site_reviews_summary]</h3>
130 130
         <button type="button" class="handlediv" aria-expanded="true">
131
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
131
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
132 132
             <span class="toggle-indicator" aria-hidden="true"></span>
133 133
         </button>
134 134
     </div>
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         <pre><code>[site_reviews_summary hide="bars,if_empty,rating,stars,summary"]</code></pre>
159 159
 
160 160
         <p class="glsr-heading">labels</p>
161
-        <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations'); ?>">Settings &rarr; Translations</a></code> page.</p>
161
+        <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations' ); ?>">Settings &rarr; Translations</a></code> page.</p>
162 162
         <p>The default labels value is: <code>"Excellent,Very good,Average,Poor,Terrible"</code></p>
163 163
         <pre><code>[site_reviews_summary labels="5 star,4 star,3 star,2 star,1 star"]</code></pre>
164 164
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         <pre><code>[site_reviews_summary schema="true"]</code></pre>
176 176
 
177 177
         <p class="glsr-heading">text</p>
178
-        <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations'); ?>">Settings &rarr; Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p>
178
+        <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations' ); ?>">Settings &rarr; Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p>
179 179
         <p>The default text value is: <code>"{rating} out of {max} stars (based on {num} reviews)"</code></p>
180 180
         <pre><code>[site_reviews_summary text="{num} customer reviews"]</code></pre>
181 181
 
Please login to merge, or discard this patch.