Custom Post Template

Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.

v1.5Simon WheatleyUpdated Added 10k+ installs96% rating
37
Score
48
Errors
30
Warnings
+0
Change

Category Scores

Security0
Repo83
Performance100
Maintainability73

Issues to Review

Prioritized issue groups from the latest Plugin Check scan

78 findings

Security

44

7 issue groups

Maintainability

22

11 issue groups

I18n

9

4 issue groups

Repo Compliance

3

3 issue groups

ERRORSecurityOutput Not EscapedAll output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '"<p>Rendering of admin template {$this->plugin_base}/view/admin/$ug_name.php failed</p>"'.21
Category
Security
Occurrences
21
Severity
error

Sample message

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '"<p>Rendering of admin template {$this->plugin_base}/view/admin/$ug_name.php failed</p>"'.

WARNINGSecurityMissingProcessing form data without nonce verification.6
Category
Security
Occurrences
6
Severity
warning

Sample message

Processing form data without nonce verification.

WARNINGSecurityInput Not ValidatedDetected usage of a possibly undefined superglobal array index: $_POST[$this-&gt;id ()]. Check that the array index exists before using it.5
Category
Security
Occurrences
5
Severity
warning

Sample message

Detected usage of a possibly undefined superglobal array index: $_POST[$this-&gt;id ()]. Check that the array index exists before using it.

WARNINGMaintainabilityNon Prefixed Function FoundFunctions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: &quot;is_post_template&quot;.4
Category
Maintainability
Occurrences
4
Severity
warning

Sample message

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

WARNINGSecurityInput Not SanitizedDetected usage of a non-sanitized input variable: $_POST[$this-&gt;id ()]4
Category
Security
Occurrences
4
Severity
warning

Sample message

Detected usage of a non-sanitized input variable: $_POST[$this-&gt;id ()]

WARNINGSecurityMissing Unslash$_POST[$this-&gt;id ()] not unslashed before sanitization. Use wp_unslash() or similar4
Category
Security
Occurrences
4
Severity
warning

Sample message

$_POST[$this-&gt;id ()] not unslashed before sanitization. Use wp_unslash() or similar

ERRORMaintainabilityTEMPLATEPATHUsage FoundFound usage of constant "TEMPLATEPATH". Use get_template_directory() instead.4
Category
Maintainability
Occurrences
4
Severity
error

Sample message

Found usage of constant "TEMPLATEPATH". Use get_template_directory() instead.

ERRORI18nText Domain MismatchMismatched text domain. Expected 'custom-post-template' but got 'custom-post-templates'.4
Category
I18n
Occurrences
4
Severity
error

Sample message

Mismatched text domain. Expected 'custom-post-template' but got 'custom-post-templates'.

WARNINGMaintainabilityNon Prefixed Variable FoundGlobal variables defined by a theme/plugin should start with the theme/plugin prefix. Found: &quot;$filename&quot;.3
Category
Maintainability
Occurrences
3
Severity
warning

Sample message

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

ERRORSecurityUnsafe Printing FunctionAll output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.3
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'.

Show 15 more
ERRORMaintainabilitymissing direct file access protection3
Category
Maintainability
Occurrences
3
Severity
error

Sample message

PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;

ERRORMaintainabilitySTYLESHEETPATHUsage Found2
Category
Maintainability
Occurrences
2
Severity
error

Sample message

Found usage of constant "STYLESHEETPATH". Use get_stylesheet_directory() instead.

ERRORI18nMissing Translators Comment2
Category
I18n
Occurrences
2
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.

ERRORI18nNon Singular String Literal Domain2
Category
I18n
Occurrences
2
Severity
error

Sample message

The $domain parameter must be a single text string literal. Found: $this->id

WARNINGMaintainabilityNon Prefixed Class Found1
Category
Maintainability
Occurrences
1
Severity
warning

Sample message

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

WARNINGMaintainabilityNon Prefixed Hookname Found1
Category
Maintainability
Occurrences
1
Severity
warning

Sample message

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

WARNINGMaintainabilityerror log print r1
Category
Maintainability
Occurrences
1
Severity
warning

Sample message

print_r() found. Debug code should not normally be used in production.

ERRORSecurityattribute escape Found1
Category
Security
Occurrences
1
Severity
error

Sample message

attribute_escape() has been deprecated since WordPress version 2.8.0. Use esc_attr() instead.

ERRORMaintainabilityregister sidebar widget Found1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

register_sidebar_widget() has been deprecated since WordPress version 2.8.0. Use wp_register_sidebar_widget() instead.

ERRORMaintainabilityregister widget control Found1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

register_widget_control() has been deprecated since WordPress version 2.8.0. Use wp_register_widget_control() instead.

ERRORI18nMissing Arg Domain1
Category
I18n
Occurrences
1
Severity
error

Sample message

Missing $domain parameter in function call to _e().

WARNINGMaintainabilitymismatched plugin name1
Category
Maintainability
Occurrences
1
Severity
warning

Sample message

Plugin name "Custom Post Template" is different from the name declared in plugin header "Custom Post Templates".

ERRORRepo Complianceno license1
Category
Repo Compliance
Occurrences
1
Severity
error

Sample message

Missing "License". Please update your readme with a valid GPLv2 (or later) compatible license.

ERRORRepo Complianceoutdated tested upto header1
Category
Repo Compliance
Occurrences
1
Severity
error

Sample message

Tested up to: 3.4 < 7.0. The "Tested up to" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.

ERRORRepo Complianceplugin header no license1
Category
Repo Compliance
Occurrences
1
Severity
error

Sample message

Missing "License" in Plugin Header. Please update your Plugin Header with a valid GPLv2 (or later) compatible license.

Score History

First score snapshot

v1.5

37

Latest

Findings
78
Errors
48
Warnings
30
Check
2.0.0

Related Plugins

Gantry 5 Framework

7k+ active installs

100
Generate Child Theme

9k+ active installs

100
Custom Post Exporter

3k+ active installs

99
Header and Footer Scripts

200k+ active installs

99
Solace Extra

10k+ active installs

99