WP-PostRatings

Adds an AJAX rating system for your WordPress site's content.

v1.91.2Lester ChanUpdated Added 30k+ installs86% rating
29
Score
425
Errors
384
Warnings
+0
Change

Category Scores

Security0
Repo80
Performance100
Maintainability33

Issues to Review

Prioritized issue groups from the latest Plugin Check scan

809 findings

Security

472

9 issue groups

Maintainability

283

13 issue groups

I18n

46

3 issue groups

ERRORSecurityOutput is not escapedAll output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '"<$start_tag $attributes data-nonce=\""'.320
Category
Security
Occurrences
320
Severity
error

Sample message

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '"<$start_tag $attributes data-nonce=\""'.

WARNINGMaintainabilityNon-prefixed global variableGlobal variables defined by a theme/plugin should start with the theme/plugin prefix. Found: &quot;$base_name&quot;.135
Category
Maintainability
Occurrences
135
Severity
warning

Sample message

Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: &quot;$base_name&quot;.

WARNINGSecurityInterpolated SQL is not preparedUse placeholders and $wpdb-&gt;prepare(); found interpolated variable $category_sql at &quot;SELECT COUNT($wpdb-&gt;ratings.rating_postid) AS ratings_users, SUM($wpdb-&gt;ratings.rating_rating) AS ratings_score, ROUND(((SUM($wpdb-&gt;ratings.rating_rating)/COUNT($wpdb-&gt;ratings.rating_postid))), 2) AS ratings_average, $wpdb-&gt;posts.ID FROM $wpdb-&gt;posts LEFT JOIN $wpdb-&gt;ratings ON $wpdb-&gt;ratings.rating_postid = $wpdb-&gt;posts.ID INNER JOIN $wpdb-&gt;term_relationships ON ($wpdb-&gt;posts.ID = $wpdb-&gt;term_relationships.object_id) INNER JOIN $wpdb-&gt;term_taxonomy ON ($wpdb-&gt;term_relationships.term_taxonomy_id = $wpdb-&gt;term_taxonomy.term_taxonomy_id) WHERE rating_timestamp &gt;= $min_time AND $wpdb-&gt;posts.post_password = &#039;&#039; AND $wpdb-&gt;posts.post_date &lt; NOW() AND $wpdb-&gt;posts.post_status = &#039;publish&#039; AND $wpdb-&gt;term_taxonomy.taxonomy = &#039;category&#039; AND $category_sql AND $where GROUP BY $wpdb-&gt;ratings.rating_postid ORDER BY $order_by DESC, ratings_users DESC LIMIT %d&quot;52
Category
Security
Occurrences
52
Severity
warning

Sample message

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable $category_sql at &quot;SELECT COUNT($wpdb-&gt;ratings.rating_postid) AS ratings_users, SUM($wpdb-&gt;ratings.rating_rating) AS ratings_score, ROUND(((SUM($wpdb-&gt;ratings.rating_rating)/COUNT($wpdb-&gt;ratings.rating_postid))), 2) AS ratings_average, $wpdb-&gt;posts.ID FROM $wpdb-&gt;posts LEFT JOIN $wpdb-&gt;ratings ON $wpdb-&gt;ratings.rating_postid = $wpdb-&gt;posts.ID INNER JOIN $wpdb-&gt;term_relationships ON ($wpdb-&gt;posts.ID = $wpdb-&gt;term_relationships.object_id) INNER JOIN $wpdb-&gt;term_taxonomy ON ($wpdb-&gt;term_relationships.term_taxonomy_id = $wpdb-&gt;term_taxonomy.term_taxonomy_id) WHERE rating_timestamp &gt;= $min_time AND $wpdb-&gt;posts.post_password = &#039;&#039; AND $wpdb-&gt;posts.post_date &lt; NOW() AND $wpdb-&gt;posts.post_status = &#039;publish&#039; AND $wpdb-&gt;term_taxonomy.taxonomy = &#039;category&#039; AND $category_sql AND $where GROUP BY $wpdb-&gt;ratings.rating_postid ORDER BY $order_by DESC, ratings_users DESC LIMIT %d&quot;

WARNINGMaintainabilityNon-prefixed functionFunctions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: &quot;add_ratings_fields&quot;.42
Category
Maintainability
Occurrences
42
Severity
warning

Sample message

Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: &quot;add_ratings_fields&quot;.

ERRORI18nMissing Translators CommentA function call to __() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.40
Category
I18n
Occurrences
40
Severity
error

Sample message

A function call to __() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.

WARNINGMaintainabilityDirect QueryUse of a direct database call is discouraged.39
Category
Maintainability
Occurrences
39
Severity
warning

Sample message

Use of a direct database call is discouraged.

WARNINGMaintainabilityNon-prefixed hook nameHook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: &quot;rate_post&quot;.26
Category
Maintainability
Occurrences
26
Severity
warning

Sample message

Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: &quot;rate_post&quot;.

WARNINGSecurityRequest data is not unslashed$_COOKIE[&#039;comment_author_&#039;.COOKIEHASH] not unslashed before sanitization. Use wp_unslash() or similar25
Category
Security
Occurrences
25
Severity
warning

Sample message

$_COOKIE[&#039;comment_author_&#039;.COOKIEHASH] not unslashed before sanitization. Use wp_unslash() or similar

WARNINGSecurityInput is not sanitizedDetected usage of a non-sanitized input variable: $_COOKIE[&#039;comment_author_&#039;.COOKIEHASH]22
Category
Security
Occurrences
22
Severity
warning

Sample message

Detected usage of a non-sanitized input variable: $_COOKIE[&#039;comment_author_&#039;.COOKIEHASH]

ERRORSecurityDatabase parameter is not escapedUnescaped parameter $post_ids used in $wpdb->query()\n$post_ids assigned unsafely at line 71.21
Category
Security
Occurrences
21
Severity
error

Sample message

Unescaped parameter $post_ids used in $wpdb->query()\n$post_ids assigned unsafely at line 71.

Show 15 more
WARNINGMaintainabilityNo Caching21
Category
Maintainability
Occurrences
21
Severity
warning

Sample message

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().

ERRORSecuritySQL query is not prepared19
Category
Security
Occurrences
19
Severity
error

Sample message

Use placeholders and $wpdb->prepare(); found $post_ids

WARNINGSecurityInput is not validated8
Category
Security
Occurrences
8
Severity
warning

Sample message

Detected usage of a possibly undefined superglobal array index: $_POST[&#039;postratings_template_highestrated&#039;]. Check that the array index exists before using it.

ERRORMaintainabilitystrip tags strip tags6
Category
Maintainability
Occurrences
6
Severity
error

Sample message

strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead.

ERRORI18nUnordered Placeholders Text5
Category
I18n
Occurrences
5
Severity
error

Sample message

Multiple placeholders in translatable strings should be ordered. Expected "%1$s, %2$s", but got "%s, %s" in '%s @ %s'.

WARNINGMaintainabilitySchema Change3
Category
Maintainability
Occurrences
3
Severity
warning

Sample message

Attempting a database schema change is discouraged.

WARNINGMaintainabilityNon-prefixed class3
Category
Maintainability
Occurrences
3
Severity
warning

Sample message

Classes declared by a theme/plugin should start with the theme/plugin prefix. Found: &quot;WPPostRatingsAdmin&quot;.

ERRORSecurityUnsafe printing function3
Category
Security
Occurrences
3
Severity
error

Sample message

All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.

WARNINGMaintainabilitytrademarked term3
Category
Maintainability
Occurrences
3
Severity
warning

Sample message

The plugin name includes a restricted term. Your chosen plugin name - "WP-PostRatings" - contains the restricted term "wp" which cannot be used at all in your plugin name.

WARNINGSecurityNonce verification recommended2
Category
Security
Occurrences
2
Severity
warning

Sample message

Processing form data without nonce verification.

ERRORMaintainabilityDeprecated function: wp_get_sites2
Category
Maintainability
Occurrences
2
Severity
error

Sample message

wp_get_sites() has been deprecated since WordPress version 4.6.0. Use get_sites() instead.

WARNINGI18nDiscouraged text-domain loading1
Category
I18n
Occurrences
1
Severity
warning

Sample message

load_plugin_textdomain() has been discouraged since WordPress version 4.6. When your plugin is hosted on WordPress.org, you no longer need to manually include this function call for translations under your plugin slug. WordPress will automatically load the translations for you as needed.

WARNINGMaintainabilityNon-prefixed constant1
Category
Maintainability
Occurrences
1
Severity
warning

Sample message

Global constants defined by a theme/plugin should start with the theme/plugin prefix. Found: &quot;WP_POSTRATINGS_VERSION&quot;.

ERRORMaintainabilityfile system operations fclose1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fclose().

ERRORMaintainabilityfile system operations fopen1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fopen().

External Connections

Not analyzed yet.

Score History

First score snapshot

v1.91.2

29

Latest

Findings
809
Errors
425
Warnings
384
Check
2.0.0

Relationship Map

Author, categories, issues, domains, and nearby plugins.

29 nodes

Related Plugins

Absolute Reviews

6k+ active installs

99
Gutena Star Ratings

1k+ active installs

97
Widget for Google Reviews

1k+ active installs

97
Widgets for Amazon Reviews

2k+ active installs

96
Widgets for Ebay Reviews

500 active installs

96