Passed
Push — master ( ccb079...7906b4 )
by Paul
04:39
created
plugin/Database/PostCountsManager.php 2 patches
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -7,85 +7,85 @@
 block discarded – undo
7 7
 
8 8
 class PostCountsManager
9 9
 {
10
-    /**
11
-     * @var CountsManager
12
-     */
13
-    protected $manager;
10
+	/**
11
+	 * @var CountsManager
12
+	 */
13
+	protected $manager;
14 14
 
15
-    public function __construct()
16
-    {
17
-        $this->manager = glsr(CountsManager::class);
18
-    }
15
+	public function __construct()
16
+	{
17
+		$this->manager = glsr(CountsManager::class);
18
+	}
19 19
 
20
-    /**
21
-     * @param int $postId
22
-     * @return array
23
-     */
24
-    public function build($postId)
25
-    {
26
-        return $this->manager->buildCounts([
27
-            'post_ids' => [$postId],
28
-        ]);
29
-    }
20
+	/**
21
+	 * @param int $postId
22
+	 * @return array
23
+	 */
24
+	public function build($postId)
25
+	{
26
+		return $this->manager->buildCounts([
27
+			'post_ids' => [$postId],
28
+		]);
29
+	}
30 30
 
31
-    /**
32
-     * @return void
33
-     */
34
-    public function decrease(Review $review)
35
-    {
36
-        if (empty($counts = $this->get($review->assigned_to))) {
37
-            return;
38
-        }
39
-        $this->update($review->assigned_to,
40
-            $this->manager->decreaseRating($counts, $review->review_type, $review->rating)
41
-        );
42
-    }
31
+	/**
32
+	 * @return void
33
+	 */
34
+	public function decrease(Review $review)
35
+	{
36
+		if (empty($counts = $this->get($review->assigned_to))) {
37
+			return;
38
+		}
39
+		$this->update($review->assigned_to,
40
+			$this->manager->decreaseRating($counts, $review->review_type, $review->rating)
41
+		);
42
+	}
43 43
 
44
-    /**
45
-     * @param int $postId
46
-     * @return array
47
-     */
48
-    public function get($postId)
49
-    {
50
-        return array_filter((array) get_post_meta($postId, CountsManager::META_COUNT, true));
51
-    }
44
+	/**
45
+	 * @param int $postId
46
+	 * @return array
47
+	 */
48
+	public function get($postId)
49
+	{
50
+		return array_filter((array) get_post_meta($postId, CountsManager::META_COUNT, true));
51
+	}
52 52
 
53
-    /**
54
-     * @return void
55
-     */
56
-    public function increase(Review $review)
57
-    {
58
-        if (!(get_post($review->assigned_to) instanceof \WP_Post)) {
59
-            return;
60
-        }
61
-        $counts = $this->get($review->assigned_to);
62
-        $counts = empty($counts)
63
-            ? $this->build($review->assigned_to)
64
-            : $this->manager->increaseRating($counts, $review->review_type, $review->rating);
65
-        $this->update($review->assigned_to, $counts);
66
-    }
53
+	/**
54
+	 * @return void
55
+	 */
56
+	public function increase(Review $review)
57
+	{
58
+		if (!(get_post($review->assigned_to) instanceof \WP_Post)) {
59
+			return;
60
+		}
61
+		$counts = $this->get($review->assigned_to);
62
+		$counts = empty($counts)
63
+			? $this->build($review->assigned_to)
64
+			: $this->manager->increaseRating($counts, $review->review_type, $review->rating);
65
+		$this->update($review->assigned_to, $counts);
66
+	}
67 67
 
68
-    /**
69
-     * @param int $postId
70
-     * @return void
71
-     */
72
-    public function update($postId, array $reviewCounts)
73
-    {
74
-        $ratingCounts = $this->manager->flatten($reviewCounts);
75
-        update_post_meta($postId, CountsManager::META_COUNT, $reviewCounts);
76
-        update_post_meta($postId, CountsManager::META_AVERAGE, glsr(Rating::class)->getAverage($ratingCounts));
77
-        update_post_meta($postId, CountsManager::META_RANKING, glsr(Rating::class)->getRanking($ratingCounts));
78
-    }
68
+	/**
69
+	 * @param int $postId
70
+	 * @return void
71
+	 */
72
+	public function update($postId, array $reviewCounts)
73
+	{
74
+		$ratingCounts = $this->manager->flatten($reviewCounts);
75
+		update_post_meta($postId, CountsManager::META_COUNT, $reviewCounts);
76
+		update_post_meta($postId, CountsManager::META_AVERAGE, glsr(Rating::class)->getAverage($ratingCounts));
77
+		update_post_meta($postId, CountsManager::META_RANKING, glsr(Rating::class)->getRanking($ratingCounts));
78
+	}
79 79
 
80
-    /**
81
-     * @return void
82
-     */
83
-    public function updateAll()
84
-    {
85
-        glsr(SqlQueries::class)->deletePostCountMetaKeys();
86
-        $postIds = glsr(SqlQueries::class)->getReviewsMeta('assigned_to');
87
-        foreach ($postIds as $postId) {
88
-            $this->update($postId, $this->build($postId));
89
-        }
90
-    }
80
+	/**
81
+	 * @return void
82
+	 */
83
+	public function updateAll()
84
+	{
85
+		glsr(SqlQueries::class)->deletePostCountMetaKeys();
86
+		$postIds = glsr(SqlQueries::class)->getReviewsMeta('assigned_to');
87
+		foreach ($postIds as $postId) {
88
+			$this->update($postId, $this->build($postId));
89
+		}
90
+	}
91 91
 }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -14,30 +14,30 @@  discard block
 block discarded – undo
14 14
 
15 15
     public function __construct()
16 16
     {
17
-        $this->manager = glsr(CountsManager::class);
17
+        $this->manager = glsr( CountsManager::class );
18 18
     }
19 19
 
20 20
     /**
21 21
      * @param int $postId
22 22
      * @return array
23 23
      */
24
-    public function build($postId)
24
+    public function build( $postId )
25 25
     {
26
-        return $this->manager->buildCounts([
26
+        return $this->manager->buildCounts( [
27 27
             'post_ids' => [$postId],
28
-        ]);
28
+        ] );
29 29
     }
30 30
 
31 31
     /**
32 32
      * @return void
33 33
      */
34
-    public function decrease(Review $review)
34
+    public function decrease( Review $review )
35 35
     {
36
-        if (empty($counts = $this->get($review->assigned_to))) {
36
+        if( empty($counts = $this->get( $review->assigned_to )) ) {
37 37
             return;
38 38
         }
39
-        $this->update($review->assigned_to,
40
-            $this->manager->decreaseRating($counts, $review->review_type, $review->rating)
39
+        $this->update( $review->assigned_to,
40
+            $this->manager->decreaseRating( $counts, $review->review_type, $review->rating )
41 41
         );
42 42
     }
43 43
 
@@ -45,36 +45,36 @@  discard block
 block discarded – undo
45 45
      * @param int $postId
46 46
      * @return array
47 47
      */
48
-    public function get($postId)
48
+    public function get( $postId )
49 49
     {
50
-        return array_filter((array) get_post_meta($postId, CountsManager::META_COUNT, true));
50
+        return array_filter( (array)get_post_meta( $postId, CountsManager::META_COUNT, true ) );
51 51
     }
52 52
 
53 53
     /**
54 54
      * @return void
55 55
      */
56
-    public function increase(Review $review)
56
+    public function increase( Review $review )
57 57
     {
58
-        if (!(get_post($review->assigned_to) instanceof \WP_Post)) {
58
+        if( !(get_post( $review->assigned_to ) instanceof \WP_Post) ) {
59 59
             return;
60 60
         }
61
-        $counts = $this->get($review->assigned_to);
61
+        $counts = $this->get( $review->assigned_to );
62 62
         $counts = empty($counts)
63
-            ? $this->build($review->assigned_to)
64
-            : $this->manager->increaseRating($counts, $review->review_type, $review->rating);
65
-        $this->update($review->assigned_to, $counts);
63
+            ? $this->build( $review->assigned_to )
64
+            : $this->manager->increaseRating( $counts, $review->review_type, $review->rating );
65
+        $this->update( $review->assigned_to, $counts );
66 66
     }
67 67
 
68 68
     /**
69 69
      * @param int $postId
70 70
      * @return void
71 71
      */
72
-    public function update($postId, array $reviewCounts)
72
+    public function update( $postId, array $reviewCounts )
73 73
     {
74
-        $ratingCounts = $this->manager->flatten($reviewCounts);
75
-        update_post_meta($postId, CountsManager::META_COUNT, $reviewCounts);
76
-        update_post_meta($postId, CountsManager::META_AVERAGE, glsr(Rating::class)->getAverage($ratingCounts));
77
-        update_post_meta($postId, CountsManager::META_RANKING, glsr(Rating::class)->getRanking($ratingCounts));
74
+        $ratingCounts = $this->manager->flatten( $reviewCounts );
75
+        update_post_meta( $postId, CountsManager::META_COUNT, $reviewCounts );
76
+        update_post_meta( $postId, CountsManager::META_AVERAGE, glsr( Rating::class )->getAverage( $ratingCounts ) );
77
+        update_post_meta( $postId, CountsManager::META_RANKING, glsr( Rating::class )->getRanking( $ratingCounts ) );
78 78
     }
79 79
 
80 80
     /**
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function updateAll()
84 84
     {
85
-        glsr(SqlQueries::class)->deletePostCountMetaKeys();
86
-        $postIds = glsr(SqlQueries::class)->getReviewsMeta('assigned_to');
87
-        foreach ($postIds as $postId) {
88
-            $this->update($postId, $this->build($postId));
85
+        glsr( SqlQueries::class )->deletePostCountMetaKeys();
86
+        $postIds = glsr( SqlQueries::class )->getReviewsMeta( 'assigned_to' );
87
+        foreach( $postIds as $postId ) {
88
+            $this->update( $postId, $this->build( $postId ) );
89 89
         }
90 90
     }
91 91
 }
Please login to merge, or discard this patch.
plugin/Shortcodes/SiteReviewsFormShortcode.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,15 +4,15 @@
 block discarded – undo
4 4
 
5 5
 class SiteReviewsFormShortcode extends Shortcode
6 6
 {
7
-    protected function hideOptions()
8
-    {
9
-        return [
10
-            'rating' => __('Hide the rating field', 'site-reviews'),
11
-            'title' => __('Hide the title field', 'site-reviews'),
12
-            'content' => __('Hide the review field', 'site-reviews'),
13
-            'name' => __('Hide the name field', 'site-reviews'),
14
-            'email' => __('Hide the email field', 'site-reviews'),
15
-            'terms' => __('Hide the terms field', 'site-reviews'),
16
-        ];
17
-    }
7
+	protected function hideOptions()
8
+	{
9
+		return [
10
+			'rating' => __('Hide the rating field', 'site-reviews'),
11
+			'title' => __('Hide the title field', 'site-reviews'),
12
+			'content' => __('Hide the review field', 'site-reviews'),
13
+			'name' => __('Hide the name field', 'site-reviews'),
14
+			'email' => __('Hide the email field', 'site-reviews'),
15
+			'terms' => __('Hide the terms field', 'site-reviews'),
16
+		];
17
+	}
18 18
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
     protected function hideOptions()
8 8
     {
9 9
         return [
10
-            'rating' => __('Hide the rating field', 'site-reviews'),
11
-            'title' => __('Hide the title field', 'site-reviews'),
12
-            'content' => __('Hide the review field', 'site-reviews'),
13
-            'name' => __('Hide the name field', 'site-reviews'),
14
-            'email' => __('Hide the email field', 'site-reviews'),
15
-            'terms' => __('Hide the terms field', 'site-reviews'),
10
+            'rating' => __( 'Hide the rating field', 'site-reviews' ),
11
+            'title' => __( 'Hide the title field', 'site-reviews' ),
12
+            'content' => __( 'Hide the review field', 'site-reviews' ),
13
+            'name' => __( 'Hide the name field', 'site-reviews' ),
14
+            'email' => __( 'Hide the email field', 'site-reviews' ),
15
+            'terms' => __( 'Hide the terms field', 'site-reviews' ),
16 16
         ];
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
plugin/Modules/Html/Template.php 2 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -7,86 +7,86 @@
 block discarded – undo
7 7
 
8 8
 class Template
9 9
 {
10
-    /**
11
-     * @param string $templatePath
12
-     * @return void|string
13
-     */
14
-    public function build($templatePath, array $data = [])
15
-    {
16
-        $data = $this->normalize($data);
17
-        $path = Str::removePrefix('templates/', $templatePath);
18
-        $template = glsr()->build($templatePath, $data);
19
-        $template = apply_filters('site-reviews/build/template/'.$path, $template, $data);
20
-        $template = $this->interpolate($template, $data, $path);
21
-        $template = apply_filters('site-reviews/rendered/template', $template, $templatePath, $data);
22
-        $template = apply_filters('site-reviews/rendered/template/'.$path, $template, $data);
23
-        return $template;
24
-    }
10
+	/**
11
+	 * @param string $templatePath
12
+	 * @return void|string
13
+	 */
14
+	public function build($templatePath, array $data = [])
15
+	{
16
+		$data = $this->normalize($data);
17
+		$path = Str::removePrefix('templates/', $templatePath);
18
+		$template = glsr()->build($templatePath, $data);
19
+		$template = apply_filters('site-reviews/build/template/'.$path, $template, $data);
20
+		$template = $this->interpolate($template, $data, $path);
21
+		$template = apply_filters('site-reviews/rendered/template', $template, $templatePath, $data);
22
+		$template = apply_filters('site-reviews/rendered/template/'.$path, $template, $data);
23
+		return $template;
24
+	}
25 25
 
26
-    /**
27
-     * Interpolate context values into template placeholders.
28
-     * @param string $template
29
-     * @param string $templatePath
30
-     * @return string
31
-     */
32
-    public function interpolate($template, array $data = [], $templatePath)
33
-    {
34
-        $context = $this->normalizeContext(Arr::get($data, 'context', []));
35
-        $context = apply_filters('site-reviews/interpolate/'.$templatePath, $context, $template, $data);
36
-        return $this->interpolateContext($template, $context);
37
-    }
26
+	/**
27
+	 * Interpolate context values into template placeholders.
28
+	 * @param string $template
29
+	 * @param string $templatePath
30
+	 * @return string
31
+	 */
32
+	public function interpolate($template, array $data = [], $templatePath)
33
+	{
34
+		$context = $this->normalizeContext(Arr::get($data, 'context', []));
35
+		$context = apply_filters('site-reviews/interpolate/'.$templatePath, $context, $template, $data);
36
+		return $this->interpolateContext($template, $context);
37
+	}
38 38
 
39
-    /**
40
-     * Interpolate context values into template placeholders.
41
-     * @param string $text
42
-     * @return string
43
-     */
44
-    public function interpolateContext($text, array $context = [])
45
-    {
46
-        foreach ($context as $key => $value) {
47
-            $text = strtr(
48
-                $text,
49
-                array_fill_keys(['{'.$key.'}', '{{ '.$key.' }}'], $value)
50
-            );
51
-        }
52
-        return trim($text);
53
-    }
39
+	/**
40
+	 * Interpolate context values into template placeholders.
41
+	 * @param string $text
42
+	 * @return string
43
+	 */
44
+	public function interpolateContext($text, array $context = [])
45
+	{
46
+		foreach ($context as $key => $value) {
47
+			$text = strtr(
48
+				$text,
49
+				array_fill_keys(['{'.$key.'}', '{{ '.$key.' }}'], $value)
50
+			);
51
+		}
52
+		return trim($text);
53
+	}
54 54
 
55
-    /**
56
-     * @param string $templatePath
57
-     * @return void|string
58
-     */
59
-    public function render($templatePath, array $data = [])
60
-    {
61
-        echo $this->build($templatePath, $data);
62
-    }
55
+	/**
56
+	 * @param string $templatePath
57
+	 * @return void|string
58
+	 */
59
+	public function render($templatePath, array $data = [])
60
+	{
61
+		echo $this->build($templatePath, $data);
62
+	}
63 63
 
64
-    /**
65
-     * @return array
66
-     */
67
-    protected function normalize(array $data)
68
-    {
69
-        $arrayKeys = ['context', 'globals'];
70
-        $data = wp_parse_args($data, array_fill_keys($arrayKeys, []));
71
-        foreach ($arrayKeys as $key) {
72
-            if (is_array($data[$key])) {
73
-                continue;
74
-            }
75
-            $data[$key] = [];
76
-        }
77
-        return $data;
78
-    }
64
+	/**
65
+	 * @return array
66
+	 */
67
+	protected function normalize(array $data)
68
+	{
69
+		$arrayKeys = ['context', 'globals'];
70
+		$data = wp_parse_args($data, array_fill_keys($arrayKeys, []));
71
+		foreach ($arrayKeys as $key) {
72
+			if (is_array($data[$key])) {
73
+				continue;
74
+			}
75
+			$data[$key] = [];
76
+		}
77
+		return $data;
78
+	}
79 79
 
80
-    /**
81
-     * @return array
82
-     */
83
-    protected function normalizeContext(array $context)
84
-    {
85
-        $context = array_filter($context, function ($value) {
86
-            return !is_array($value) && !is_object($value);
87
-        });
88
-        return array_map(function ($value) {
89
-            return (string) $value;
90
-        }, $context);
91
-    }
80
+	/**
81
+	 * @return array
82
+	 */
83
+	protected function normalizeContext(array $context)
84
+	{
85
+		$context = array_filter($context, function ($value) {
86
+			return !is_array($value) && !is_object($value);
87
+		});
88
+		return array_map(function ($value) {
89
+			return (string) $value;
90
+		}, $context);
91
+	}
92 92
 }
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
      * @param string $templatePath
12 12
      * @return void|string
13 13
      */
14
-    public function build($templatePath, array $data = [])
14
+    public function build( $templatePath, array $data = [] )
15 15
     {
16
-        $data = $this->normalize($data);
17
-        $path = Str::removePrefix('templates/', $templatePath);
18
-        $template = glsr()->build($templatePath, $data);
19
-        $template = apply_filters('site-reviews/build/template/'.$path, $template, $data);
20
-        $template = $this->interpolate($template, $data, $path);
21
-        $template = apply_filters('site-reviews/rendered/template', $template, $templatePath, $data);
22
-        $template = apply_filters('site-reviews/rendered/template/'.$path, $template, $data);
16
+        $data = $this->normalize( $data );
17
+        $path = Str::removePrefix( 'templates/', $templatePath );
18
+        $template = glsr()->build( $templatePath, $data );
19
+        $template = apply_filters( 'site-reviews/build/template/'.$path, $template, $data );
20
+        $template = $this->interpolate( $template, $data, $path );
21
+        $template = apply_filters( 'site-reviews/rendered/template', $template, $templatePath, $data );
22
+        $template = apply_filters( 'site-reviews/rendered/template/'.$path, $template, $data );
23 23
         return $template;
24 24
     }
25 25
 
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
      * @param string $templatePath
30 30
      * @return string
31 31
      */
32
-    public function interpolate($template, array $data = [], $templatePath)
32
+    public function interpolate( $template, array $data = [], $templatePath )
33 33
     {
34
-        $context = $this->normalizeContext(Arr::get($data, 'context', []));
35
-        $context = apply_filters('site-reviews/interpolate/'.$templatePath, $context, $template, $data);
36
-        return $this->interpolateContext($template, $context);
34
+        $context = $this->normalizeContext( Arr::get( $data, 'context', [] ) );
35
+        $context = apply_filters( 'site-reviews/interpolate/'.$templatePath, $context, $template, $data );
36
+        return $this->interpolateContext( $template, $context );
37 37
     }
38 38
 
39 39
     /**
@@ -41,35 +41,35 @@  discard block
 block discarded – undo
41 41
      * @param string $text
42 42
      * @return string
43 43
      */
44
-    public function interpolateContext($text, array $context = [])
44
+    public function interpolateContext( $text, array $context = [] )
45 45
     {
46
-        foreach ($context as $key => $value) {
46
+        foreach( $context as $key => $value ) {
47 47
             $text = strtr(
48 48
                 $text,
49
-                array_fill_keys(['{'.$key.'}', '{{ '.$key.' }}'], $value)
49
+                array_fill_keys( ['{'.$key.'}', '{{ '.$key.' }}'], $value )
50 50
             );
51 51
         }
52
-        return trim($text);
52
+        return trim( $text );
53 53
     }
54 54
 
55 55
     /**
56 56
      * @param string $templatePath
57 57
      * @return void|string
58 58
      */
59
-    public function render($templatePath, array $data = [])
59
+    public function render( $templatePath, array $data = [] )
60 60
     {
61
-        echo $this->build($templatePath, $data);
61
+        echo $this->build( $templatePath, $data );
62 62
     }
63 63
 
64 64
     /**
65 65
      * @return array
66 66
      */
67
-    protected function normalize(array $data)
67
+    protected function normalize( array $data )
68 68
     {
69 69
         $arrayKeys = ['context', 'globals'];
70
-        $data = wp_parse_args($data, array_fill_keys($arrayKeys, []));
71
-        foreach ($arrayKeys as $key) {
72
-            if (is_array($data[$key])) {
70
+        $data = wp_parse_args( $data, array_fill_keys( $arrayKeys, [] ) );
71
+        foreach( $arrayKeys as $key ) {
72
+            if( is_array( $data[$key] ) ) {
73 73
                 continue;
74 74
             }
75 75
             $data[$key] = [];
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
     /**
81 81
      * @return array
82 82
      */
83
-    protected function normalizeContext(array $context)
83
+    protected function normalizeContext( array $context )
84 84
     {
85
-        $context = array_filter($context, function ($value) {
86
-            return !is_array($value) && !is_object($value);
85
+        $context = array_filter( $context, function( $value ) {
86
+            return !is_array( $value ) && !is_object( $value );
87 87
         });
88
-        return array_map(function ($value) {
89
-            return (string) $value;
90
-        }, $context);
88
+        return array_map( function( $value ) {
89
+            return (string)$value;
90
+        }, $context );
91 91
     }
92 92
 }
Please login to merge, or discard this patch.
views/pages/tools/general.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3
-<?php if (glsr()->hasPermission('settings')) : ?>
3
+<?php if( glsr()->hasPermission( 'settings' ) ) : ?>
4 4
 <div class="glsr-card card">
5 5
     <h3>Export Settings</h3>
6 6
     <p>Export the Site Reviews settings for this site to a <code>*.json</code> file. This allows you to easily import the plugin settings into another site.</p>
7
-    <p>To export your Site Reviews' reviews and categories, please use the WordPress <a href="<?= admin_url('export.php'); ?>">Export</a> tool.</p>
7
+    <p>To export your Site Reviews' reviews and categories, please use the WordPress <a href="<?= admin_url( 'export.php' ); ?>">Export</a> tool.</p>
8 8
     <form method="post">
9 9
         <input type="hidden" name="{{ id }}[_action]" value="export-settings">
10
-        <?php wp_nonce_field('export-settings'); ?>
11
-        <?php submit_button(__('Export Settings', 'site-reviews'), 'secondary'); ?>
10
+        <?php wp_nonce_field( 'export-settings' ); ?>
11
+        <?php submit_button( __( 'Export Settings', 'site-reviews' ), 'secondary' ); ?>
12 12
     </form>
13 13
 </div>
14 14
 <?php endif; ?>
15 15
 
16
-<?php if (glsr()->hasPermission('settings')) : ?>
16
+<?php if( glsr()->hasPermission( 'settings' ) ) : ?>
17 17
 <div class="glsr-card card">
18 18
     <h3>Import Settings</h3>
19 19
     <p>Import the Site Reviews settings from a <code>*.json</code> file. This file can be obtained by exporting the settings on another site using the export tool below.</p>
20
-    <p>To import your Site Reviews' reviews and categories from another website, please use the WordPress <a href="<?= admin_url('import.php'); ?>">Import</a> tool.</p>
20
+    <p>To import your Site Reviews' reviews and categories from another website, please use the WordPress <a href="<?= admin_url( 'import.php' ); ?>">Import</a> tool.</p>
21 21
     <form method="post" enctype="multipart/form-data">
22 22
         <input type="file" name="import-file">
23 23
         <input type="hidden" name="{{ id }}[_action]" value="import-settings">
24
-        <?php wp_nonce_field('import-settings'); ?>
25
-        <?php submit_button(__('Import Settings', 'site-reviews'), 'secondary'); ?>
24
+        <?php wp_nonce_field( 'import-settings' ); ?>
25
+        <?php submit_button( __( 'Import Settings', 'site-reviews' ), 'secondary' ); ?>
26 26
     </form>
27 27
 </div>
28 28
 <?php endif; ?>
29 29
 
30
-<?php if (glsr()->hasPermission('settings')) : ?>
30
+<?php if( glsr()->hasPermission( 'settings' ) ) : ?>
31 31
 <div class="glsr-card card">
32 32
     <h3>Migrate Plugin</h3>
33 33
     <p>Run this tool if your reviews stopped working correctly after upgrading the plugin to the latest version (i.e. read-only reviews, zero-star ratings, missing role capabilities, etc.).</p>
34 34
     <form method="post">
35 35
         <input type="hidden" name="{{ id }}[_action]" value="migrate-reviews">
36
-        <?php wp_nonce_field('migrate-reviews'); ?>
36
+        <?php wp_nonce_field( 'migrate-reviews' ); ?>
37 37
         <p class="submit">
38 38
             <button type="submit" class="glsr-button button" name="migrate-reviews" id="migrate-reviews">
39
-                <span data-loading="<?= __('Migrating Reviews, please wait...', 'site-reviews'); ?>"><?= __('Run Migration', 'site-reviews'); ?></span>
39
+                <span data-loading="<?= __( 'Migrating Reviews, please wait...', 'site-reviews' ); ?>"><?= __( 'Run Migration', 'site-reviews' ); ?></span>
40 40
             </button>
41 41
         </p>
42 42
     </form>
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
     <p>If you suspect that the rating counts are incorrect (perhaps you have cloned a page that had reviews assigned to it, or edited/deleted reviews directly from your database), you can recalculate them here.</p>
50 50
     <form method="post">
51 51
         <input type="hidden" name="{{ id }}[_action]" value="count-reviews">
52
-        <?php wp_nonce_field('count-reviews'); ?>
52
+        <?php wp_nonce_field( 'count-reviews' ); ?>
53 53
         <p class="submit">
54 54
             <button type="submit" class="glsr-button button" name="count-reviews" id="count-reviews">
55
-                <span data-loading="<?= __('Recalculating Counts, please wait...', 'site-reviews'); ?>"><?= __('Recalculate Counts', 'site-reviews'); ?></span>
55
+                <span data-loading="<?= __( 'Recalculating Counts, please wait...', 'site-reviews' ); ?>"><?= __( 'Recalculate Counts', 'site-reviews' ); ?></span>
56 56
             </button>
57 57
         </p>
58 58
     </form>
59 59
 </div>
60 60
 
61
-<?php if (glsr()->hasPermission('settings')) : ?>
61
+<?php if( glsr()->hasPermission( 'settings' ) ) : ?>
62 62
 <div class="glsr-card card">
63 63
     <h3>Reset Permissions</h3>
64 64
     <p>Site Reviews provides custom post_type capabilities that mirror the capabilities of your posts by default. For example, if a user role has permission to edit others posts, then that role will also have permission to edit other users reviews.</p>
65 65
     <p>If you have changed the capabilities of your user roles and you suspect that Site Reviews is not working correctly due to your changes, you may use this tool to reset the Site Reviews capabilities for your user roles.</p>
66 66
     <form method="post">
67 67
         <input type="hidden" name="{{ id }}[_action]" value="reset-permissions">
68
-        <?php wp_nonce_field('reset-permissions'); ?>
68
+        <?php wp_nonce_field( 'reset-permissions' ); ?>
69 69
         <p class="submit">
70 70
             <button type="submit" class="glsr-button button" name="reset-permissions" id="reset-permissions">
71
-                <span data-loading="<?= __('Resetting Permissions, please wait...', 'site-reviews'); ?>"><?= __('Reset Permissions', 'site-reviews'); ?></span>
71
+                <span data-loading="<?= __( 'Resetting Permissions, please wait...', 'site-reviews' ); ?>"><?= __( 'Reset Permissions', 'site-reviews' ); ?></span>
72 72
             </button>
73 73
         </p>
74 74
     </form>
Please login to merge, or discard this patch.
config/styles/divi.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 return [
4
-    'fields' => [
5
-        'input' => 'input',
6
-        'input_checkbox' => 'input',
7
-        'input_radio' => 'input',
8
-        'label' => 'et_pb_contact_form_label',
9
-        'select' => 'et_pb_contact_select input',
10
-        'textarea' => 'et_pb_contact_message input',
11
-    ],
12
-    'validation' => [
13
-        'field_error_class' => 'et_contact_error',
14
-        'input_error_class' => 'et_contact_error',
15
-        // 'input_valid_class' => 'glsr-is-valid',
16
-        // 'message_error_class' => 'glsr-has-errors',
17
-        // 'message_initial_class' => 'glsr-is-visible',
18
-        // 'message_success_class' => 'glsr-has-success',
19
-        // 'message_tag' => 'div',
20
-        // 'message_tag_class' => 'glsr-form-message',
21
-    ],
4
+	'fields' => [
5
+		'input' => 'input',
6
+		'input_checkbox' => 'input',
7
+		'input_radio' => 'input',
8
+		'label' => 'et_pb_contact_form_label',
9
+		'select' => 'et_pb_contact_select input',
10
+		'textarea' => 'et_pb_contact_message input',
11
+	],
12
+	'validation' => [
13
+		'field_error_class' => 'et_contact_error',
14
+		'input_error_class' => 'et_contact_error',
15
+		// 'input_valid_class' => 'glsr-is-valid',
16
+		// 'message_error_class' => 'glsr-has-errors',
17
+		// 'message_initial_class' => 'glsr-is-visible',
18
+		// 'message_success_class' => 'glsr-has-success',
19
+		// 'message_tag' => 'div',
20
+		// 'message_tag_class' => 'glsr-form-message',
21
+	],
22 22
 ];
Please login to merge, or discard this patch.
deprecated.php 2 patches
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -3,144 +3,144 @@
 block discarded – undo
3 3
 defined('WPINC') || die;
4 4
 
5 5
 if (apply_filters('site-reviews/support/deprecated/v4', true)) {
6
-    // Unprotected review meta has been deprecated
7
-    add_filter('get_post_metadata', function ($data, $postId, $metaKey, $single) {
8
-        $metaKeys = array_keys(glsr('Defaults\CreateReviewDefaults')->defaults());
9
-        if (!in_array($metaKey, $metaKeys) || glsr()->post_type != get_post_type($postId)) {
10
-            return $data;
11
-        }
12
-        glsr()->deprecated[] = sprintf(
13
-            'The "%1$s" meta_key has been deprecated for Reviews. Please use the protected "_%1$s" meta_key instead.',
14
-            $metaKey
15
-        );
16
-        return get_post_meta($postId, '_'.$metaKey, $single);
17
-    }, 10, 4);
6
+	// Unprotected review meta has been deprecated
7
+	add_filter('get_post_metadata', function ($data, $postId, $metaKey, $single) {
8
+		$metaKeys = array_keys(glsr('Defaults\CreateReviewDefaults')->defaults());
9
+		if (!in_array($metaKey, $metaKeys) || glsr()->post_type != get_post_type($postId)) {
10
+			return $data;
11
+		}
12
+		glsr()->deprecated[] = sprintf(
13
+			'The "%1$s" meta_key has been deprecated for Reviews. Please use the protected "_%1$s" meta_key instead.',
14
+			$metaKey
15
+		);
16
+		return get_post_meta($postId, '_'.$metaKey, $single);
17
+	}, 10, 4);
18 18
 
19
-    // Modules/Html/Template.php
20
-    add_filter('site-reviews/interpolate/reviews', function ($context, $template) {
21
-        $search = '{{ navigation }}';
22
-        if (false !== strpos($template, $search)) {
23
-            $context['navigation'] = $context['pagination'];
24
-            glsr()->deprecated[] = 'The {{ navigation }} template key in "YOUR_THEME/site-reviews/reviews.php" has been deprecated. Please use the {{ pagination }} template key instead.';
25
-        }
26
-        return $context;
27
-    }, 10, 2);
19
+	// Modules/Html/Template.php
20
+	add_filter('site-reviews/interpolate/reviews', function ($context, $template) {
21
+		$search = '{{ navigation }}';
22
+		if (false !== strpos($template, $search)) {
23
+			$context['navigation'] = $context['pagination'];
24
+			glsr()->deprecated[] = 'The {{ navigation }} template key in "YOUR_THEME/site-reviews/reviews.php" has been deprecated. Please use the {{ pagination }} template key instead.';
25
+		}
26
+		return $context;
27
+	}, 10, 2);
28 28
 
29
-    // Modules/Html/Template.php
30
-    add_filter('site-reviews/build/template/reviews', function ($template) {
31
-        if (has_filter('site-reviews/reviews/pagination-wrapper')) {
32
-            glsr()->deprecated[] = 'The "site-reviews/reviews/pagination-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
33
-        }
34
-        if (has_filter('site-reviews/reviews/reviews-wrapper')) {
35
-            glsr()->deprecated[] = 'The "site-reviews/reviews/reviews-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
36
-        }
37
-    });
29
+	// Modules/Html/Template.php
30
+	add_filter('site-reviews/build/template/reviews', function ($template) {
31
+		if (has_filter('site-reviews/reviews/pagination-wrapper')) {
32
+			glsr()->deprecated[] = 'The "site-reviews/reviews/pagination-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
33
+		}
34
+		if (has_filter('site-reviews/reviews/reviews-wrapper')) {
35
+			glsr()->deprecated[] = 'The "site-reviews/reviews/reviews-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
36
+		}
37
+	});
38 38
 
39
-    // Database/ReviewManager.php
40
-    add_action('site-reviews/review/created', function ($review) {
41
-        if (has_action('site-reviews/local/review/create')) {
42
-            glsr()->deprecated[] = 'The "site-reviews/local/review/create" hook has been deprecated. Please use the "site-reviews/review/created" hook instead.';
43
-            do_action('site-reviews/local/review/create', (array) get_post($review->ID), (array) $review, $review->ID);
44
-        }
45
-    }, 9);
39
+	// Database/ReviewManager.php
40
+	add_action('site-reviews/review/created', function ($review) {
41
+		if (has_action('site-reviews/local/review/create')) {
42
+			glsr()->deprecated[] = 'The "site-reviews/local/review/create" hook has been deprecated. Please use the "site-reviews/review/created" hook instead.';
43
+			do_action('site-reviews/local/review/create', (array) get_post($review->ID), (array) $review, $review->ID);
44
+		}
45
+	}, 9);
46 46
 
47
-    // Handlers/CreateReview.php
48
-    add_action('site-reviews/review/submitted', function ($review) {
49
-        if (has_action('site-reviews/local/review/submitted')) {
50
-            glsr()->deprecated[] = 'The "site-reviews/local/review/submitted" hook has been deprecated. Please use the "site-reviews/review/submitted" hook instead.';
51
-            do_action('site-reviews/local/review/submitted', null, $review);
52
-        }
53
-        if (has_filter('site-reviews/local/review/submitted/message')) {
54
-            glsr()->deprecated[] = 'The "site-reviews/local/review/submitted/message" hook has been deprecated.';
55
-        }
56
-    }, 9);
47
+	// Handlers/CreateReview.php
48
+	add_action('site-reviews/review/submitted', function ($review) {
49
+		if (has_action('site-reviews/local/review/submitted')) {
50
+			glsr()->deprecated[] = 'The "site-reviews/local/review/submitted" hook has been deprecated. Please use the "site-reviews/review/submitted" hook instead.';
51
+			do_action('site-reviews/local/review/submitted', null, $review);
52
+		}
53
+		if (has_filter('site-reviews/local/review/submitted/message')) {
54
+			glsr()->deprecated[] = 'The "site-reviews/local/review/submitted/message" hook has been deprecated.';
55
+		}
56
+	}, 9);
57 57
 
58
-    // Database/ReviewManager.php
59
-    add_filter('site-reviews/create/review-values', function ($values, $command) {
60
-        if (has_filter('site-reviews/local/review')) {
61
-            glsr()->deprecated[] = 'The "site-reviews/local/review" hook has been deprecated. Please use the "site-reviews/create/review-values" hook instead.';
62
-            return apply_filters('site-reviews/local/review', $values, $command);
63
-        }
64
-        return $values;
65
-    }, 9, 2);
58
+	// Database/ReviewManager.php
59
+	add_filter('site-reviews/create/review-values', function ($values, $command) {
60
+		if (has_filter('site-reviews/local/review')) {
61
+			glsr()->deprecated[] = 'The "site-reviews/local/review" hook has been deprecated. Please use the "site-reviews/create/review-values" hook instead.';
62
+			return apply_filters('site-reviews/local/review', $values, $command);
63
+		}
64
+		return $values;
65
+	}, 9, 2);
66 66
 
67
-    // Handlers/EnqueuePublicAssets.php
68
-    add_filter('site-reviews/enqueue/public/localize', function ($variables) {
69
-        if (has_filter('site-reviews/enqueue/localize')) {
70
-            glsr()->deprecated[] = 'The "site-reviews/enqueue/localize" hook has been deprecated. Please use the "site-reviews/enqueue/public/localize" hook instead.';
71
-            return apply_filters('site-reviews/enqueue/localize', $variables);
72
-        }
73
-        return $variables;
74
-    }, 9);
67
+	// Handlers/EnqueuePublicAssets.php
68
+	add_filter('site-reviews/enqueue/public/localize', function ($variables) {
69
+		if (has_filter('site-reviews/enqueue/localize')) {
70
+			glsr()->deprecated[] = 'The "site-reviews/enqueue/localize" hook has been deprecated. Please use the "site-reviews/enqueue/public/localize" hook instead.';
71
+			return apply_filters('site-reviews/enqueue/localize', $variables);
72
+		}
73
+		return $variables;
74
+	}, 9);
75 75
 
76
-    // Modules/Rating.php
77
-    add_filter('site-reviews/rating/average', function ($average) {
78
-        if (has_filter('site-reviews/average/rating')) {
79
-            glsr()->deprecated[] = 'The "site-reviews/average/rating" hook has been deprecated. Please use the "site-reviews/rating/average" hook instead.';
80
-        }
81
-        return $average;
82
-    }, 9);
76
+	// Modules/Rating.php
77
+	add_filter('site-reviews/rating/average', function ($average) {
78
+		if (has_filter('site-reviews/average/rating')) {
79
+			glsr()->deprecated[] = 'The "site-reviews/average/rating" hook has been deprecated. Please use the "site-reviews/rating/average" hook instead.';
80
+		}
81
+		return $average;
82
+	}, 9);
83 83
 
84
-    // Modules/Rating.php
85
-    add_filter('site-reviews/rating/ranking', function ($ranking) {
86
-        if (has_filter('site-reviews/bayesian/ranking')) {
87
-            glsr()->deprecated[] = 'The "site-reviews/bayesian/ranking" hook has been deprecated. Please use the "site-reviews/rating/ranking" hook instead.';
88
-        }
89
-        return $ranking;
90
-    }, 9);
84
+	// Modules/Rating.php
85
+	add_filter('site-reviews/rating/ranking', function ($ranking) {
86
+		if (has_filter('site-reviews/bayesian/ranking')) {
87
+			glsr()->deprecated[] = 'The "site-reviews/bayesian/ranking" hook has been deprecated. Please use the "site-reviews/rating/ranking" hook instead.';
88
+		}
89
+		return $ranking;
90
+	}, 9);
91 91
 
92
-    // Modules/Html/Partials/SiteReviews.php
93
-    add_filter('site-reviews/review/build/after', function ($renderedFields) {
94
-        if (has_filter('site-reviews/reviews/review/text')) {
95
-            glsr()->deprecated[] = 'The "site-reviews/reviews/review/text" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
96
-        }
97
-        if (has_filter('site-reviews/reviews/review/title')) {
98
-            glsr()->deprecated[] = 'The "site-reviews/reviews/review/title" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
99
-        }
100
-        return $renderedFields;
101
-    }, 9);
92
+	// Modules/Html/Partials/SiteReviews.php
93
+	add_filter('site-reviews/review/build/after', function ($renderedFields) {
94
+		if (has_filter('site-reviews/reviews/review/text')) {
95
+			glsr()->deprecated[] = 'The "site-reviews/reviews/review/text" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
96
+		}
97
+		if (has_filter('site-reviews/reviews/review/title')) {
98
+			glsr()->deprecated[] = 'The "site-reviews/reviews/review/title" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
99
+		}
100
+		return $renderedFields;
101
+	}, 9);
102 102
 
103
-    // Modules/Html/Partials/SiteReviews.php
104
-    add_filter('site-reviews/review/build/before', function ($review) {
105
-        if (has_filter('site-reviews/rendered/review')) {
106
-            glsr()->deprecated[] = 'The "site-reviews/rendered/review" hook has been deprecated. Please either use a custom "review.php" template (refer to the documentation), or use the "site-reviews/review/build/after" hook instead.';
107
-        }
108
-        if (has_filter('site-reviews/rendered/review/meta/order')) {
109
-            glsr()->deprecated[] = 'The "site-reviews/rendered/review/meta/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
110
-        }
111
-        if (has_filter('site-reviews/rendered/review/order')) {
112
-            glsr()->deprecated[] = 'The "site-reviews/rendered/review/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
113
-        }
114
-        if (has_filter('site-reviews/rendered/review-form/login-register')) {
115
-            glsr()->deprecated[] = 'The "site-reviews/rendered/review-form/login-register" hook has been deprecated. Please use a custom "login-register.php" template instead (refer to the documentation).';
116
-        }
117
-        if (has_filter('site-reviews/reviews/navigation_links')) {
118
-            glsr()->deprecated[] = 'The "site-reviews/reviews/navigation_links" hook has been deprecated. Please use a custom "pagination.php" template instead (refer to the documentation).';
119
-        }
120
-        return $review;
121
-    }, 9);
103
+	// Modules/Html/Partials/SiteReviews.php
104
+	add_filter('site-reviews/review/build/before', function ($review) {
105
+		if (has_filter('site-reviews/rendered/review')) {
106
+			glsr()->deprecated[] = 'The "site-reviews/rendered/review" hook has been deprecated. Please either use a custom "review.php" template (refer to the documentation), or use the "site-reviews/review/build/after" hook instead.';
107
+		}
108
+		if (has_filter('site-reviews/rendered/review/meta/order')) {
109
+			glsr()->deprecated[] = 'The "site-reviews/rendered/review/meta/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
110
+		}
111
+		if (has_filter('site-reviews/rendered/review/order')) {
112
+			glsr()->deprecated[] = 'The "site-reviews/rendered/review/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
113
+		}
114
+		if (has_filter('site-reviews/rendered/review-form/login-register')) {
115
+			glsr()->deprecated[] = 'The "site-reviews/rendered/review-form/login-register" hook has been deprecated. Please use a custom "login-register.php" template instead (refer to the documentation).';
116
+		}
117
+		if (has_filter('site-reviews/reviews/navigation_links')) {
118
+			glsr()->deprecated[] = 'The "site-reviews/reviews/navigation_links" hook has been deprecated. Please use a custom "pagination.php" template instead (refer to the documentation).';
119
+		}
120
+		return $review;
121
+	}, 9);
122 122
 
123
-    add_filter('site-reviews/validate/custom', function ($result, $request) {
124
-        if (has_filter('site-reviews/validate/review/submission')) {
125
-            glsr_log()->warning('The "site-reviews/validate/review/submission" hook has been deprecated. Please use the "site-reviews/validate/custom" hook instead.');
126
-            return apply_filters('site-reviews/validate/review/submission', $result, $request);
127
-        }
128
-        return $result;
129
-    }, 9, 2);
123
+	add_filter('site-reviews/validate/custom', function ($result, $request) {
124
+		if (has_filter('site-reviews/validate/review/submission')) {
125
+			glsr_log()->warning('The "site-reviews/validate/review/submission" hook has been deprecated. Please use the "site-reviews/validate/custom" hook instead.');
126
+			return apply_filters('site-reviews/validate/review/submission', $result, $request);
127
+		}
128
+		return $result;
129
+	}, 9, 2);
130 130
 
131
-    add_filter('site-reviews/views/file', function ($file, $view, $data) {
132
-        if (has_filter('site-reviews/addon/views/file')) {
133
-            glsr()->deprecated[] = 'The "site-reviews/addon/views/file" hook has been deprecated. Please use the "site-reviews/views/file" hook instead.';
134
-            $file = apply_filters('site-reviews/addon/views/file', $file, $view, $data);
135
-        }
136
-        return $file;
137
-    }, 9, 3);
131
+	add_filter('site-reviews/views/file', function ($file, $view, $data) {
132
+		if (has_filter('site-reviews/addon/views/file')) {
133
+			glsr()->deprecated[] = 'The "site-reviews/addon/views/file" hook has been deprecated. Please use the "site-reviews/views/file" hook instead.';
134
+			$file = apply_filters('site-reviews/addon/views/file', $file, $view, $data);
135
+		}
136
+		return $file;
137
+	}, 9, 3);
138 138
 }
139 139
 
140 140
 add_action('wp_footer', function () {
141
-    $notices = array_keys(array_flip(glsr()->deprecated));
142
-    natsort($notices);
143
-    foreach ($notices as $notice) {
144
-        glsr_log()->warning($notice);
145
-    }
141
+	$notices = array_keys(array_flip(glsr()->deprecated));
142
+	natsort($notices);
143
+	foreach ($notices as $notice) {
144
+		glsr_log()->warning($notice);
145
+	}
146 146
 });
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,146 +1,146 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-defined('WPINC') || die;
3
+defined( 'WPINC' ) || die;
4 4
 
5
-if (apply_filters('site-reviews/support/deprecated/v4', true)) {
5
+if( apply_filters( 'site-reviews/support/deprecated/v4', true ) ) {
6 6
     // Unprotected review meta has been deprecated
7
-    add_filter('get_post_metadata', function ($data, $postId, $metaKey, $single) {
8
-        $metaKeys = array_keys(glsr('Defaults\CreateReviewDefaults')->defaults());
9
-        if (!in_array($metaKey, $metaKeys) || glsr()->post_type != get_post_type($postId)) {
7
+    add_filter( 'get_post_metadata', function( $data, $postId, $metaKey, $single ) {
8
+        $metaKeys = array_keys( glsr( 'Defaults\CreateReviewDefaults' )->defaults() );
9
+        if( !in_array( $metaKey, $metaKeys ) || glsr()->post_type != get_post_type( $postId ) ) {
10 10
             return $data;
11 11
         }
12 12
         glsr()->deprecated[] = sprintf(
13 13
             'The "%1$s" meta_key has been deprecated for Reviews. Please use the protected "_%1$s" meta_key instead.',
14 14
             $metaKey
15 15
         );
16
-        return get_post_meta($postId, '_'.$metaKey, $single);
17
-    }, 10, 4);
16
+        return get_post_meta( $postId, '_'.$metaKey, $single );
17
+    }, 10, 4 );
18 18
 
19 19
     // Modules/Html/Template.php
20
-    add_filter('site-reviews/interpolate/reviews', function ($context, $template) {
20
+    add_filter( 'site-reviews/interpolate/reviews', function( $context, $template ) {
21 21
         $search = '{{ navigation }}';
22
-        if (false !== strpos($template, $search)) {
22
+        if( false !== strpos( $template, $search ) ) {
23 23
             $context['navigation'] = $context['pagination'];
24 24
             glsr()->deprecated[] = 'The {{ navigation }} template key in "YOUR_THEME/site-reviews/reviews.php" has been deprecated. Please use the {{ pagination }} template key instead.';
25 25
         }
26 26
         return $context;
27
-    }, 10, 2);
27
+    }, 10, 2 );
28 28
 
29 29
     // Modules/Html/Template.php
30
-    add_filter('site-reviews/build/template/reviews', function ($template) {
31
-        if (has_filter('site-reviews/reviews/pagination-wrapper')) {
30
+    add_filter( 'site-reviews/build/template/reviews', function( $template ) {
31
+        if( has_filter( 'site-reviews/reviews/pagination-wrapper' ) ) {
32 32
             glsr()->deprecated[] = 'The "site-reviews/reviews/pagination-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
33 33
         }
34
-        if (has_filter('site-reviews/reviews/reviews-wrapper')) {
34
+        if( has_filter( 'site-reviews/reviews/reviews-wrapper' ) ) {
35 35
             glsr()->deprecated[] = 'The "site-reviews/reviews/reviews-wrapper" hook has been removed. Please use the "site-reviews/builder/result" hook instead.';
36 36
         }
37 37
     });
38 38
 
39 39
     // Database/ReviewManager.php
40
-    add_action('site-reviews/review/created', function ($review) {
41
-        if (has_action('site-reviews/local/review/create')) {
40
+    add_action( 'site-reviews/review/created', function( $review ) {
41
+        if( has_action( 'site-reviews/local/review/create' ) ) {
42 42
             glsr()->deprecated[] = 'The "site-reviews/local/review/create" hook has been deprecated. Please use the "site-reviews/review/created" hook instead.';
43
-            do_action('site-reviews/local/review/create', (array) get_post($review->ID), (array) $review, $review->ID);
43
+            do_action( 'site-reviews/local/review/create', (array)get_post( $review->ID ), (array)$review, $review->ID );
44 44
         }
45
-    }, 9);
45
+    }, 9 );
46 46
 
47 47
     // Handlers/CreateReview.php
48
-    add_action('site-reviews/review/submitted', function ($review) {
49
-        if (has_action('site-reviews/local/review/submitted')) {
48
+    add_action( 'site-reviews/review/submitted', function( $review ) {
49
+        if( has_action( 'site-reviews/local/review/submitted' ) ) {
50 50
             glsr()->deprecated[] = 'The "site-reviews/local/review/submitted" hook has been deprecated. Please use the "site-reviews/review/submitted" hook instead.';
51
-            do_action('site-reviews/local/review/submitted', null, $review);
51
+            do_action( 'site-reviews/local/review/submitted', null, $review );
52 52
         }
53
-        if (has_filter('site-reviews/local/review/submitted/message')) {
53
+        if( has_filter( 'site-reviews/local/review/submitted/message' ) ) {
54 54
             glsr()->deprecated[] = 'The "site-reviews/local/review/submitted/message" hook has been deprecated.';
55 55
         }
56
-    }, 9);
56
+    }, 9 );
57 57
 
58 58
     // Database/ReviewManager.php
59
-    add_filter('site-reviews/create/review-values', function ($values, $command) {
60
-        if (has_filter('site-reviews/local/review')) {
59
+    add_filter( 'site-reviews/create/review-values', function( $values, $command ) {
60
+        if( has_filter( 'site-reviews/local/review' ) ) {
61 61
             glsr()->deprecated[] = 'The "site-reviews/local/review" hook has been deprecated. Please use the "site-reviews/create/review-values" hook instead.';
62
-            return apply_filters('site-reviews/local/review', $values, $command);
62
+            return apply_filters( 'site-reviews/local/review', $values, $command );
63 63
         }
64 64
         return $values;
65
-    }, 9, 2);
65
+    }, 9, 2 );
66 66
 
67 67
     // Handlers/EnqueuePublicAssets.php
68
-    add_filter('site-reviews/enqueue/public/localize', function ($variables) {
69
-        if (has_filter('site-reviews/enqueue/localize')) {
68
+    add_filter( 'site-reviews/enqueue/public/localize', function( $variables ) {
69
+        if( has_filter( 'site-reviews/enqueue/localize' ) ) {
70 70
             glsr()->deprecated[] = 'The "site-reviews/enqueue/localize" hook has been deprecated. Please use the "site-reviews/enqueue/public/localize" hook instead.';
71
-            return apply_filters('site-reviews/enqueue/localize', $variables);
71
+            return apply_filters( 'site-reviews/enqueue/localize', $variables );
72 72
         }
73 73
         return $variables;
74
-    }, 9);
74
+    }, 9 );
75 75
 
76 76
     // Modules/Rating.php
77
-    add_filter('site-reviews/rating/average', function ($average) {
78
-        if (has_filter('site-reviews/average/rating')) {
77
+    add_filter( 'site-reviews/rating/average', function( $average ) {
78
+        if( has_filter( 'site-reviews/average/rating' ) ) {
79 79
             glsr()->deprecated[] = 'The "site-reviews/average/rating" hook has been deprecated. Please use the "site-reviews/rating/average" hook instead.';
80 80
         }
81 81
         return $average;
82
-    }, 9);
82
+    }, 9 );
83 83
 
84 84
     // Modules/Rating.php
85
-    add_filter('site-reviews/rating/ranking', function ($ranking) {
86
-        if (has_filter('site-reviews/bayesian/ranking')) {
85
+    add_filter( 'site-reviews/rating/ranking', function( $ranking ) {
86
+        if( has_filter( 'site-reviews/bayesian/ranking' ) ) {
87 87
             glsr()->deprecated[] = 'The "site-reviews/bayesian/ranking" hook has been deprecated. Please use the "site-reviews/rating/ranking" hook instead.';
88 88
         }
89 89
         return $ranking;
90
-    }, 9);
90
+    }, 9 );
91 91
 
92 92
     // Modules/Html/Partials/SiteReviews.php
93
-    add_filter('site-reviews/review/build/after', function ($renderedFields) {
94
-        if (has_filter('site-reviews/reviews/review/text')) {
93
+    add_filter( 'site-reviews/review/build/after', function( $renderedFields ) {
94
+        if( has_filter( 'site-reviews/reviews/review/text' ) ) {
95 95
             glsr()->deprecated[] = 'The "site-reviews/reviews/review/text" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
96 96
         }
97
-        if (has_filter('site-reviews/reviews/review/title')) {
97
+        if( has_filter( 'site-reviews/reviews/review/title' ) ) {
98 98
             glsr()->deprecated[] = 'The "site-reviews/reviews/review/title" hook has been deprecated. Please use the "site-reviews/review/build/after" hook instead.';
99 99
         }
100 100
         return $renderedFields;
101
-    }, 9);
101
+    }, 9 );
102 102
 
103 103
     // Modules/Html/Partials/SiteReviews.php
104
-    add_filter('site-reviews/review/build/before', function ($review) {
105
-        if (has_filter('site-reviews/rendered/review')) {
104
+    add_filter( 'site-reviews/review/build/before', function( $review ) {
105
+        if( has_filter( 'site-reviews/rendered/review' ) ) {
106 106
             glsr()->deprecated[] = 'The "site-reviews/rendered/review" hook has been deprecated. Please either use a custom "review.php" template (refer to the documentation), or use the "site-reviews/review/build/after" hook instead.';
107 107
         }
108
-        if (has_filter('site-reviews/rendered/review/meta/order')) {
108
+        if( has_filter( 'site-reviews/rendered/review/meta/order' ) ) {
109 109
             glsr()->deprecated[] = 'The "site-reviews/rendered/review/meta/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
110 110
         }
111
-        if (has_filter('site-reviews/rendered/review/order')) {
111
+        if( has_filter( 'site-reviews/rendered/review/order' ) ) {
112 112
             glsr()->deprecated[] = 'The "site-reviews/rendered/review/order" hook has been deprecated. Please use a custom "review.php" template instead (refer to the documentation).';
113 113
         }
114
-        if (has_filter('site-reviews/rendered/review-form/login-register')) {
114
+        if( has_filter( 'site-reviews/rendered/review-form/login-register' ) ) {
115 115
             glsr()->deprecated[] = 'The "site-reviews/rendered/review-form/login-register" hook has been deprecated. Please use a custom "login-register.php" template instead (refer to the documentation).';
116 116
         }
117
-        if (has_filter('site-reviews/reviews/navigation_links')) {
117
+        if( has_filter( 'site-reviews/reviews/navigation_links' ) ) {
118 118
             glsr()->deprecated[] = 'The "site-reviews/reviews/navigation_links" hook has been deprecated. Please use a custom "pagination.php" template instead (refer to the documentation).';
119 119
         }
120 120
         return $review;
121
-    }, 9);
121
+    }, 9 );
122 122
 
123
-    add_filter('site-reviews/validate/custom', function ($result, $request) {
124
-        if (has_filter('site-reviews/validate/review/submission')) {
125
-            glsr_log()->warning('The "site-reviews/validate/review/submission" hook has been deprecated. Please use the "site-reviews/validate/custom" hook instead.');
126
-            return apply_filters('site-reviews/validate/review/submission', $result, $request);
123
+    add_filter( 'site-reviews/validate/custom', function( $result, $request ) {
124
+        if( has_filter( 'site-reviews/validate/review/submission' ) ) {
125
+            glsr_log()->warning( 'The "site-reviews/validate/review/submission" hook has been deprecated. Please use the "site-reviews/validate/custom" hook instead.' );
126
+            return apply_filters( 'site-reviews/validate/review/submission', $result, $request );
127 127
         }
128 128
         return $result;
129
-    }, 9, 2);
129
+    }, 9, 2 );
130 130
 
131
-    add_filter('site-reviews/views/file', function ($file, $view, $data) {
132
-        if (has_filter('site-reviews/addon/views/file')) {
131
+    add_filter( 'site-reviews/views/file', function( $file, $view, $data ) {
132
+        if( has_filter( 'site-reviews/addon/views/file' ) ) {
133 133
             glsr()->deprecated[] = 'The "site-reviews/addon/views/file" hook has been deprecated. Please use the "site-reviews/views/file" hook instead.';
134
-            $file = apply_filters('site-reviews/addon/views/file', $file, $view, $data);
134
+            $file = apply_filters( 'site-reviews/addon/views/file', $file, $view, $data );
135 135
         }
136 136
         return $file;
137
-    }, 9, 3);
137
+    }, 9, 3 );
138 138
 }
139 139
 
140
-add_action('wp_footer', function () {
141
-    $notices = array_keys(array_flip(glsr()->deprecated));
142
-    natsort($notices);
143
-    foreach ($notices as $notice) {
144
-        glsr_log()->warning($notice);
140
+add_action( 'wp_footer', function() {
141
+    $notices = array_keys( array_flip( glsr()->deprecated ) );
142
+    natsort( $notices );
143
+    foreach( $notices as $notice ) {
144
+        glsr_log()->warning( $notice );
145 145
     }
146 146
 });
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>
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     <div class="glsr-card-header">
76 76
         <h3>[site_reviews_form]</h3>
77 77
         <button type="button" class="handlediv" aria-expanded="true">
78
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
78
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
79 79
             <span class="toggle-indicator" aria-hidden="true"></span>
80 80
         </button>
81 81
     </div>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     <div class="glsr-card-header">
119 119
         <h3>[site_reviews_summary]</h3>
120 120
         <button type="button" class="handlediv" aria-expanded="true">
121
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
121
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
122 122
             <span class="toggle-indicator" aria-hidden="true"></span>
123 123
         </button>
124 124
     </div>
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         <pre><code>[site_reviews_summary hide="bars,if_empty,rating,stars,summary"]</code></pre>
149 149
 
150 150
         <p class="glsr-heading">labels</p>
151
-        <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>
151
+        <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>
152 152
         <p>The default labels value is: <code>"Excellent,Very good,Average,Poor,Terrible"</code></p>
153 153
         <pre><code>[site_reviews_summary labels="5 star,4 star,3 star,2 star,1 star"]</code></pre>
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         <pre><code>[site_reviews_summary schema="true"]</code></pre>
166 166
 
167 167
         <p class="glsr-heading">text</p>
168
-        <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>
168
+        <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>
169 169
         <p>The default text value is: <code>"{rating} out of {max} stars (based on {num} reviews)"</code></p>
170 170
         <pre><code>[site_reviews_summary text="{num} customer reviews"]</code></pre>
171 171
     </div>
Please login to merge, or discard this patch.
views/pages/documentation/faq.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div id="faq-01" class="glsr-card postbox">
4 4
     <div class="glsr-card-header">
5 5
         <h3>How do I add additional values to the schema?</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>
11 11
     <div class="inside">
12
-        <p>To add additional values to the generated schema, use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks'); ?>" data-expand="#hooks-07">site-reviews/schema/[SCHEMA_TYPE]</a></code> hook in your theme's functions.php file.</p>
12
+        <p>To add additional values to the generated schema, use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks' ); ?>" data-expand="#hooks-07">site-reviews/schema/[SCHEMA_TYPE]</a></code> hook in your theme's functions.php file.</p>
13 13
         <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>
14 14
         <pre><code class="php">/**
15 15
  * Modifies the schema created by Site Reviews.
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     <div class="glsr-card-header">
35 35
         <h3>How do I add pagination to my reviews?</h3>
36 36
         <button type="button" class="handlediv" aria-expanded="true">
37
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
37
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
38 38
             <span class="toggle-indicator" aria-hidden="true"></span>
39 39
         </button>
40 40
     </div>
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         <p>If you are using the shortcodes, then use the <code>pagination</code> and <code>count</code> options.</p>
44 44
         <p>For example, this will paginate reviews to 10 reviews per-page:</p>
45 45
         <pre><code class="php">[site_reviews pagination=ajax count=10]</code></pre>
46
-        <p>To lean more about the available shortcode options and how to use them, please see the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">Documentation > Shortcodes</a></code> page.</p>
46
+        <p>To lean more about the available shortcode options and how to use them, please see the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">Documentation > Shortcodes</a></code> page.</p>
47 47
     </div>
48 48
 </div>
49 49
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     <div class="glsr-card-header">
52 52
         <h3>How do I assign reviews to a page?</h3>
53 53
         <button type="button" class="handlediv" aria-expanded="true">
54
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
54
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
55 55
             <span class="toggle-indicator" aria-hidden="true"></span>
56 56
         </button>
57 57
     </div>
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         <p>If you use <code>post_id</code> as the value, then Site Reviews will know to automatically use the Page ID of the current page.</p>
70 70
         <p>If you use <code>parent_id</code> as the value, then Site Reviews will know to automatically use the Page ID of the current page's Parent.</p>
71 71
         <p>You can, of course, also directly enter the numerical WordPress Page ID of the page instead if your prefer.</p>
72
-        <p>To lean more about the available shortcode options and how to use them, please see the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes'); ?>">Documentation > Shortcodes</a></code> page.</p>
72
+        <p>To lean more about the available shortcode options and how to use them, please see the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-shortcodes' ); ?>">Documentation > Shortcodes</a></code> page.</p>
73 73
     </div>
74 74
 </div>
75 75
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     <div class="glsr-card-header">
78 78
         <h3>How do I change the font?</h3>
79 79
         <button type="button" class="handlediv" aria-expanded="true">
80
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
80
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
81 81
             <span class="toggle-indicator" aria-hidden="true"></span>
82 82
         </button>
83 83
     </div>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     <div class="glsr-card-header">
94 94
         <h3>How do I change the order of the review fields?</h3>
95 95
         <button type="button" class="handlediv" aria-expanded="true">
96
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
96
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
97 97
             <span class="toggle-indicator" aria-hidden="true"></span>
98 98
         </button>
99 99
     </div>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     <div class="glsr-card-header">
122 122
         <h3>How do I change the order of the reviews summary fields?</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>
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
     <div class="glsr-card-header">
148 148
         <h3>How do I change the order of the submission form fields?</h3>
149 149
         <button type="button" class="handlediv" aria-expanded="true">
150
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
150
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
151 151
             <span class="toggle-indicator" aria-hidden="true"></span>
152 152
         </button>
153 153
     </div>
154 154
     <div class="inside">
155
-        <p>To customise the order of the fields in the review submission form, use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks'); ?>" data-expand="#hooks-01">site-reviews/submission-form/order</a></code> filter hook in your theme's <code>functions.php</code> file.</p>
155
+        <p>To customise the order of the fields in the review submission form, use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks' ); ?>" data-expand="#hooks-01">site-reviews/submission-form/order</a></code> filter hook in your theme's <code>functions.php</code> file.</p>
156 156
         <pre><code class="php">/**
157 157
  * Customises the order of the fields used in the Site Reviews submission form.
158 158
  * Paste this in your active theme's functions.php file.
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         'terms',
172 172
     ];
173 173
 });</code></pre>
174
-        <p>If you have used the example above and the submission-form fields are not working correctly, check the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console'); ?>">Tools &rarr; Console</a></code> for errors.</p>
174
+        <p>If you have used the example above and the submission-form fields are not working correctly, check the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=tools#tab-console' ); ?>">Tools &rarr; Console</a></code> for errors.</p>
175 175
     </div>
176 176
 </div>
177 177
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     <div class="glsr-card-header">
180 180
         <h3>How do I change the pagination query string?</h3>
181 181
         <button type="button" class="handlediv" aria-expanded="true">
182
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
182
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
183 183
             <span class="toggle-indicator" aria-hidden="true"></span>
184 184
         </button>
185 185
     </div>
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
     <div class="glsr-card-header">
202 202
         <h3>How do I change the text of...?</h3>
203 203
         <button type="button" class="handlediv" aria-expanded="true">
204
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
204
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
205 205
             <span class="toggle-indicator" aria-hidden="true"></span>
206 206
         </button>
207 207
     </div>
208 208
     <div class="inside">
209
-        <p>You can change any text in the plugin on the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations'); ?>">Settings &rarr; Translations</a></code> page.</p>
209
+        <p>You can change any text in the plugin on the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-translations' ); ?>">Settings &rarr; Translations</a></code> page.</p>
210 210
     </div>
211 211
 </div>
212 212
 
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
     <div class="glsr-card-header">
215 215
         <h3>How do I create a review programmatically?</h3>
216 216
         <button type="button" class="handlediv" aria-expanded="true">
217
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
217
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
218 218
             <span class="toggle-indicator" aria-hidden="true"></span>
219 219
         </button>
220 220
     </div>
221 221
     <div class="inside">
222
-        <p>Site Reviews provides a <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions'); ?>" data-expand="#functions-02">glsr_create_review()</a></code> helper function to easily create a review.</p>
222
+        <p>Site Reviews provides a <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-functions' ); ?>" data-expand="#functions-02">glsr_create_review()</a></code> helper function to easily create a review.</p>
223 223
         <p>Here is an example:</p>
224 224
         <pre><code class="php">if (function_exists('glsr_create_review')) {
225 225
     $review = glsr_create_review([
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
     <div class="glsr-card-header">
240 240
         <h3>How do I customise the stars?</h3>
241 241
         <button type="button" class="handlediv" aria-expanded="true">
242
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
242
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
243 243
             <span class="toggle-indicator" aria-hidden="true"></span>
244 244
         </button>
245 245
     </div>
246 246
     <div class="inside">
247
-        <p>To customise the star images used by the plugin, use the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks'); ?>" data-expand="#hooks-02">site-reviews/config/inline-styles</a></code> filter hook in your theme's <code>functions.php</code> file.</p>
247
+        <p>To customise the star images used by the plugin, use the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-hooks' ); ?>" data-expand="#hooks-02">site-reviews/config/inline-styles</a></code> filter hook in your theme's <code>functions.php</code> file.</p>
248 248
         <p>Here is an example:</p>
249 249
         <pre><code class="php">/**
250 250
  * Customises the stars used by Site Reviews.
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
             <li>Open the SVG images that you copied with a text editor</li>
267 267
             <li>Change the <a target="_blank" href="https://www.hexcolortool.com">hex colour code</a> to the one you want</li>
268 268
             <li>Install and activate the <a target="_blank" href="https://wordpress.org/plugins/safe-svg/">Safe SVG</a> plugin</li>
269
-            <li>Upload the edited SVG images to your <a href="<?= admin_url('upload.php'); ?>">Media Library</a></li>
269
+            <li>Upload the edited SVG images to your <a href="<?= admin_url( 'upload.php' ); ?>">Media Library</a></li>
270 270
             <li>Copy the File URL of the uploaded SVG images and paste them into the snippet above</li>
271 271
         </ol>
272 272
     </div>
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     <div class="glsr-card-header">
277 277
         <h3>How do I hide the form after a review is submitted?</h3>
278 278
         <button type="button" class="handlediv" aria-expanded="true">
279
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
279
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
280 280
             <span class="toggle-indicator" aria-hidden="true"></span>
281 281
         </button>
282 282
     </div>
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     });";
299 299
 });</code></pre>
300 300
         <p>You can also hide the form from registered users who have already submitted a review.</p>
301
-        <p>To do this, you will need to first make sure that the "Limit Reviews" setting on the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions'); ?>">Settings &rarr; Submissions</a></code> page is set to "By Username". Once that is done, you can use the following code snippet:</p>
301
+        <p>To do this, you will need to first make sure that the "Limit Reviews" setting on the <code><a href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=settings#tab-submissions' ); ?>">Settings &rarr; Submissions</a></code> page is set to "By Username". Once that is done, you can use the following code snippet:</p>
302 302
         <pre><code class="php">/**
303 303
  * Hides the submission form from registered users who have already submitted a review
304 304
  * Paste this in your active theme's functions.php file
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     <div class="glsr-card-header">
320 320
         <h3>How do I limit the submitted review length?</h3>
321 321
         <button type="button" class="handlediv" aria-expanded="true">
322
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
322
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
323 323
             <span class="toggle-indicator" aria-hidden="true"></span>
324 324
         </button>
325 325
     </div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
     <div class="glsr-card-header">
358 358
         <h3>How do I order pages with assigned reviews by rating or ranking?</h3>
359 359
         <button type="button" class="handlediv" aria-expanded="true">
360
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
360
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
361 361
             <span class="toggle-indicator" aria-hidden="true"></span>
362 362
         </button>
363 363
     </div>
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     <div class="glsr-card-header">
414 414
         <h3>How do I prevent search engines from indexing paginated reviews?</h3>
415 415
         <button type="button" class="handlediv" aria-expanded="true">
416
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
416
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
417 417
             <span class="toggle-indicator" aria-hidden="true"></span>
418 418
         </button>
419 419
     </div>
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         <p>Here is how to prevent search engines from indexing your paginated reviews:</p>
423 423
         <ol>
424 424
             <li>Install and activate the <a href="https://wordpress.org/plugins/robots-txt-editor/">Robots.txt Editor</a> plugin.</li>
425
-            <li>Go to the <code><a href="<?= admin_url('options-reading.php'); ?>">WordPress > Settings > Reading</a></code> page.</li>
425
+            <li>Go to the <code><a href="<?= admin_url( 'options-reading.php' ); ?>">WordPress > Settings > Reading</a></code> page.</li>
426 426
             <li>Make sure that the Robots.txt starts with: <code>User-Agent: *</code></li>
427 427
             <li>Add the following lines:
428 428
                 <pre><code>Disallow: /*?reviews-page=*
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     <div class="glsr-card-header">
444 444
         <h3>How do I redirect to a custom URL after a form is submitted?</h3>
445 445
         <button type="button" class="handlediv" aria-expanded="true">
446
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
446
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
447 447
             <span class="toggle-indicator" aria-hidden="true"></span>
448 448
         </button>
449 449
     </div>
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     <div class="glsr-card-header">
457 457
         <h3>How do I remove the dash in front of the author's name?</h3>
458 458
         <button type="button" class="handlediv" aria-expanded="true">
459
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
459
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
460 460
             <span class="toggle-indicator" aria-hidden="true"></span>
461 461
         </button>
462 462
     </div>
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     <div class="glsr-card-header">
473 473
         <h3>How do I use the plugin templates in my theme?</h3>
474 474
         <button type="button" class="handlediv" aria-expanded="true">
475
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
475
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
476 476
             <span class="toggle-indicator" aria-hidden="true"></span>
477 477
         </button>
478 478
     </div>
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
     <div class="glsr-card-header">
491 491
         <h3>Why are the IP Addresses not being detected correctly?</h3>
492 492
         <button type="button" class="handlediv" aria-expanded="true">
493
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
493
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
494 494
             <span class="toggle-indicator" aria-hidden="true"></span>
495 495
         </button>
496 496
     </div>
Please login to merge, or discard this patch.
views/pages/addons/index.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
     <p><?= __('Add-ons extend the functionality of Site Reviews.', 'site-reviews'); ?></p>
7 7
     <div class="glsr-addons wp-clearfix">
8 8
     <?php
9
-        $template->render('partials/addons/addon', [
10
-            'beta' => false,
11
-            'context' => [
12
-                'description' => __('This add-on allows your site visitors to filter, search, and sort your reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
13
-                'link' => 'https://niftyplugins.com/plugins/filters/',
14
-                'slug' => 'filters',
15
-                'title' => 'Filters',
16
-            ],
17
-            'plugin' => 'site-reviews-filters/site-reviews-filters.php',
18
-        ]);
19
-        $template->render('partials/addons/addon', [
20
-            'beta' => true,
21
-            'context' => [
22
-                'description' => __('This add-on allows your site visitors to submit images with their reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
23
-                'link' => 'https://niftyplugins.com/plugins/images/',
24
-                'slug' => 'images',
25
-                'title' => 'Images',
26
-            ],
27
-            'plugin' => 'site-reviews-images/site-reviews-images.php',
28
-        ]);
29
-    ?>
9
+		$template->render('partials/addons/addon', [
10
+			'beta' => false,
11
+			'context' => [
12
+				'description' => __('This add-on allows your site visitors to filter, search, and sort your reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
13
+				'link' => 'https://niftyplugins.com/plugins/filters/',
14
+				'slug' => 'filters',
15
+				'title' => 'Filters',
16
+			],
17
+			'plugin' => 'site-reviews-filters/site-reviews-filters.php',
18
+		]);
19
+		$template->render('partials/addons/addon', [
20
+			'beta' => true,
21
+			'context' => [
22
+				'description' => __('This add-on allows your site visitors to submit images with their reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
23
+				'link' => 'https://niftyplugins.com/plugins/images/',
24
+				'slug' => 'images',
25
+				'title' => 'Images',
26
+			],
27
+			'plugin' => 'site-reviews-images/site-reviews-images.php',
28
+		]);
29
+	?>
30 30
     </div>
31 31
 </div>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,31 +1,31 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="wrap">
4
-    <h1 class="wp-heading-inline"><?= esc_html(get_admin_page_title()); ?></h1>
4
+    <h1 class="wp-heading-inline"><?= esc_html( get_admin_page_title() ); ?></h1>
5 5
     <?= $notices; ?>
6
-    <p><?= __('Add-ons extend the functionality of Site Reviews.', 'site-reviews'); ?></p>
6
+    <p><?= __( 'Add-ons extend the functionality of Site Reviews.', 'site-reviews' ); ?></p>
7 7
     <div class="glsr-addons wp-clearfix">
8 8
     <?php
9
-        $template->render('partials/addons/addon', [
9
+        $template->render( 'partials/addons/addon', [
10 10
             'beta' => false,
11 11
             'context' => [
12
-                'description' => __('This add-on allows your site visitors to filter, search, and sort your reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
12
+                'description' => __( 'This add-on allows your site visitors to filter, search, and sort your reviews. Apply now to test the unreleased beta version.', 'site-reviews' ),
13 13
                 'link' => 'https://niftyplugins.com/plugins/filters/',
14 14
                 'slug' => 'filters',
15 15
                 'title' => 'Filters',
16 16
             ],
17 17
             'plugin' => 'site-reviews-filters/site-reviews-filters.php',
18
-        ]);
19
-        $template->render('partials/addons/addon', [
18
+        ] );
19
+        $template->render( 'partials/addons/addon', [
20 20
             'beta' => true,
21 21
             'context' => [
22
-                'description' => __('This add-on allows your site visitors to submit images with their reviews. Apply now to test the unreleased beta version.', 'site-reviews'),
22
+                'description' => __( 'This add-on allows your site visitors to submit images with their reviews. Apply now to test the unreleased beta version.', 'site-reviews' ),
23 23
                 'link' => 'https://niftyplugins.com/plugins/images/',
24 24
                 'slug' => 'images',
25 25
                 'title' => 'Images',
26 26
             ],
27 27
             'plugin' => 'site-reviews-images/site-reviews-images.php',
28
-        ]);
28
+        ] );
29 29
     ?>
30 30
     </div>
31 31
 </div>
Please login to merge, or discard this patch.